Playground renderer: bind with GLState (#601)

This commit is contained in:
Gustl22
2018-12-02 23:34:37 +01:00
parent bb87c8a51b
commit 7146875c05
5 changed files with 17 additions and 10 deletions

View File

@@ -101,7 +101,9 @@ public class GdxModelRenderer extends LayerRenderer {
if (v.pos.zoomLevel < 16)
gl.clear(GL.DEPTH_BUFFER_BIT);
gl.bindBuffer(GL.ELEMENT_ARRAY_BUFFER, 0);
// Unbind via GLState to ensure no buffer is replaced by accident
GLState.bindElementBuffer(GLState.UNBIND);
GLState.bindBuffer(GL.ARRAY_BUFFER, GLState.UNBIND);
// set state that is expected after modelBatch.end();
// modelBatch keeps track of its own state
@@ -172,8 +174,8 @@ public class GdxModelRenderer extends LayerRenderer {
}
gl.depthMask(false);
gl.bindBuffer(GL.ELEMENT_ARRAY_BUFFER, 0);
gl.bindBuffer(GL.ARRAY_BUFFER, 0);
GLState.bindElementBuffer(GLState.UNBIND);
GLState.bindBuffer(GL.ARRAY_BUFFER, GLState.UNBIND);
}
// @Override