draw a checkerboard stencil clipping mask initially

This commit is contained in:
Konstantin Käfer
2014-02-26 12:24:17 +01:00
parent 70ec13e302
commit 8d68bd73e7
5 changed files with 90 additions and 78 deletions

View File

@@ -2,6 +2,7 @@
#define LLMR_MAP_TILE
#include <llmr/util/vec.hpp>
#include <llmr/util/mat4.hpp>
#include <llmr/util/noncopyable.hpp>
#include <llmr/geometry/debug_font_buffer.hpp>
#include <llmr/geometry/vao.hpp>
@@ -71,6 +72,7 @@ public:
public:
const ID id;
uint8_t clip_id;
state state;
// Holds the actual geometries in this tile.
@@ -89,6 +91,7 @@ public:
// They contain the location offsets in the buffers stored above
std::map<std::string, std::shared_ptr<Bucket>> buckets;
mat4 matrix;
private:
// Source data
std::string data;

View File

@@ -32,7 +32,7 @@ public:
void setup();
void clear();
void changeMatrix(const Tile::ID& id);
void changeMatrix();
void render(const std::shared_ptr<Tile>& tile);
void renderMatte();
void renderBackground();
@@ -40,24 +40,28 @@ public:
void renderLine(LineBucket& bucket, const std::string& layer_name, const Tile::ID& id);
void renderPoint(PointBucket& bucket, const std::string& layer_name, const Tile::ID& id);
void prepareClippingMask();
void drawClippingMask(const mat4& matrix, uint8_t clip_id);
void finishClippingMask();
private:
void setupShaders();
void drawClippingMask();
void renderLayers(const std::shared_ptr<Tile>& tile, const std::vector<LayerDescription>& layers);
void renderDebug(const std::shared_ptr<Tile>& tile);
void useProgram(uint32_t program);
void lineWidth(float lineWidth);
public:
mat4 matrix;
mat4 projMatrix;
mat4 nativeMatrix;
mat4 extrudeMatrix;
private:
Transform& transform;
Settings& settings;
Style& style;
mat4 nativeMatrix;
mat4 matrix;
mat4 exMatrix;
uint32_t gl_program = 0;
float gl_lineWidth = 0;