#pragma once #include #include "DrawData.hpp" #include class GridManager; class WorldGrid { public: void draw(GridManager& gMan, SkCanvas* canvas, const DrawData& drawData); enum class GridType : unsigned { CIRCLE_POINTS = 0, SQUARE_POINTS, SQUARE_LINES, RULED } gridType = GridType::CIRCLE_POINTS; WorldScalar size{50000000}; bool visible = true; WorldVec offset{0, 0}; private: static sk_sp get_shader(GridType gType, const SkColor4f& gridColor, float gridScale); static sk_sp compile_effect_shader_init(const char* shaderName, const char* shaderCode); static Vector2f oldWindowSize; static sk_sp circlePointEffect; static sk_sp squarePointEffect; static sk_sp squareLinesEffect; static sk_sp ruledEffect; };