This changes the clip IDs from sequential to a huffman prefix tree, meaning that parent tiles share the same prefix with child tiles (but are shorter). This allows us to use the same checkerboard pattern to draw all tiles. TODO: - make sure we're not overflowing the 8 bit limit of the stencil buffer - draw all checkerboard fields at the same time, with one draw call - fix raster drawing (fading, clipping) refs #132
37 lines
740 B
C++
37 lines
740 B
C++
#ifndef LLMR_RENDERER_DEBUGBUCKET
|
|
#define LLMR_RENDERER_DEBUGBUCKET
|
|
|
|
#include <llmr/renderer/bucket.hpp>
|
|
#include <llmr/style/bucket_description.hpp>
|
|
#include <llmr/geometry/debug_font_buffer.hpp>
|
|
#include <llmr/geometry/vao.hpp>
|
|
|
|
#include <vector>
|
|
#include <memory>
|
|
|
|
#ifndef BUFFER_OFFSET
|
|
#define BUFFER_OFFSET(i) ((char *)nullptr + (i))
|
|
#endif
|
|
|
|
namespace llmr {
|
|
|
|
class PlainShader;
|
|
|
|
class DebugBucket : public Bucket {
|
|
public:
|
|
DebugBucket(DebugFontBuffer& fontBuffer);
|
|
|
|
virtual void render(Painter& painter, const std::string& layer_name, const Tile::ID& id);
|
|
|
|
void drawLines(PlainShader& shader);
|
|
void drawPoints(PlainShader& shader);
|
|
|
|
private:
|
|
DebugFontBuffer& fontBuffer;
|
|
VertexArrayObject array;
|
|
};
|
|
|
|
}
|
|
|
|
#endif
|