[core] do not paint empty debug buckets

this removes "Buffer doesn't contain elements" messages when debug painting is enabled
This commit is contained in:
Konstantin Käfer
2016-03-15 17:15:09 +01:00
parent 9a3e8ae571
commit 09684bb1dc

View File

@@ -31,11 +31,15 @@ DebugBucket::DebugBucket(const TileID id, const TileData::State state_, optional
}
void DebugBucket::drawLines(PlainShader& shader, gl::GLObjectStore& glObjectStore) {
array.bind(shader, fontBuffer, BUFFER_OFFSET_0, glObjectStore);
MBGL_CHECK_ERROR(glDrawArrays(GL_LINES, 0, (GLsizei)(fontBuffer.index())));
if (!fontBuffer.empty()) {
array.bind(shader, fontBuffer, BUFFER_OFFSET_0, glObjectStore);
MBGL_CHECK_ERROR(glDrawArrays(GL_LINES, 0, (GLsizei)(fontBuffer.index())));
}
}
void DebugBucket::drawPoints(PlainShader& shader, gl::GLObjectStore& glObjectStore) {
array.bind(shader, fontBuffer, BUFFER_OFFSET_0, glObjectStore);
MBGL_CHECK_ERROR(glDrawArrays(GL_POINTS, 0, (GLsizei)(fontBuffer.index())));
if (!fontBuffer.empty()) {
array.bind(shader, fontBuffer, BUFFER_OFFSET_0, glObjectStore);
MBGL_CHECK_ERROR(glDrawArrays(GL_POINTS, 0, (GLsizei)(fontBuffer.index())));
}
}