port collision box debug rendering

This commit is contained in:
Ansis Brammanis
2015-04-01 13:22:16 -07:00
parent 8fd42f371f
commit dda1b770da
13 changed files with 245 additions and 1 deletions

View File

@@ -189,5 +189,20 @@ void Painter::renderSymbol(SymbolBucket &bucket, const StyleLayer &layer_desc, c
&SymbolBucket::drawGlyphs);
}
if (bucket.hasCollisionBoxData()) {
MBGL_CHECK_ERROR(glEnable(GL_STENCIL_TEST));
useProgram(collisionBoxShader->program);
collisionBoxShader->u_matrix = matrix;
collisionBoxShader->u_scale = std::pow(2, state.getNormalizedZoom() - id.z);
collisionBoxShader->u_zoom = state.getNormalizedZoom() * 10;
collisionBoxShader->u_maxzoom = (id.z + 1) * 10;
lineWidth(3.0f);
depthRange(strata, 1.0f);
bucket.drawCollisionBoxes(*collisionBoxShader);
}
MBGL_CHECK_ERROR(glEnable(GL_STENCIL_TEST));
}