Files
MapLibreParticleLab/src/mbgl/renderer/debug_bucket.cpp
John Firebaugh d8411f26d2 Tile::ID ⇢ TileID
This allows making both Tile and TileID private.
2015-04-06 13:58:56 -07:00

32 lines
892 B
C++

#include <mbgl/renderer/debug_bucket.hpp>
#include <mbgl/renderer/painter.hpp>
#include <mbgl/platform/gl.hpp>
#include <cassert>
using namespace mbgl;
DebugBucket::DebugBucket(DebugFontBuffer& fontBuffer_)
: fontBuffer(fontBuffer_) {
}
void DebugBucket::render(Painter &painter, const StyleLayer & /*layer_desc*/,
const TileID & /*id*/, const mat4 &matrix) {
painter.renderDebugText(*this, matrix);
}
bool DebugBucket::hasData() const {
return fontBuffer.index() > 0;
}
void DebugBucket::drawLines(PlainShader& shader) {
array.bind(shader, fontBuffer, BUFFER_OFFSET(0));
MBGL_CHECK_ERROR(glDrawArrays(GL_LINES, 0, (GLsizei)(fontBuffer.index())));
}
void DebugBucket::drawPoints(PlainShader& shader) {
array.bind(shader, fontBuffer, BUFFER_OFFSET(0));
MBGL_CHECK_ERROR(glDrawArrays(GL_POINTS, 0, (GLsizei)(fontBuffer.index())));
}