Started work on grid creation menu
This commit is contained in:
parent
57392cdfdd
commit
55b15e0ec1
18 changed files with 533 additions and 181 deletions
26
src/WorldGrid.hpp
Normal file
26
src/WorldGrid.hpp
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
#pragma once
|
||||
#include <include/core/SkCanvas.h>
|
||||
#include "DrawData.hpp"
|
||||
#include <include/effects/SkRuntimeEffect.h>
|
||||
|
||||
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};
|
||||
private:
|
||||
static sk_sp<SkShader> get_shader(GridType gType, const SkColor4f& gridColor, float gridScale);
|
||||
static sk_sp<SkRuntimeEffect> compile_effect_shader_init(const char* shaderName, const char* shaderCode);
|
||||
static Vector2f oldWindowSize;
|
||||
static sk_sp<SkRuntimeEffect> circlePointEffect;
|
||||
static sk_sp<SkRuntimeEffect> squarePointEffect;
|
||||
static sk_sp<SkRuntimeEffect> squareLinesEffect;
|
||||
static sk_sp<SkRuntimeEffect> ruledEffect;
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue