GLState: State DISABLED = -1 (readability).

This commit is contained in:
Gustl22
2018-08-23 22:46:40 +02:00
parent f07de4c910
commit 63cd462109
17 changed files with 41 additions and 31 deletions

View File

@@ -86,7 +86,7 @@ public class GdxSpriteBatchTest extends GdxMapApp {
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT | GL20.GL_DEPTH_BUFFER_BIT | (Gdx.graphics.getBufferFormat().coverageSampling ?
GL20.GL_COVERAGE_BUFFER_BIT_NV : 0));
GLState.enableVertexArrays(-1, -1);
GLState.enableVertexArrays(GLState.DISABLED, GLState.DISABLED);
gl.viewport(0, 0, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
gl.frontFace(GL.CW);

View File

@@ -104,9 +104,9 @@ public class GdxModelRenderer extends LayerRenderer {
// set state that is expected after modelBatch.end();
// modelBatch keeps track of its own state
GLState.enableVertexArrays(-1, -1);
GLState.bindTex2D(-1);
GLState.useProgram(-1);
GLState.enableVertexArrays(GLState.DISABLED, GLState.DISABLED);
GLState.bindTex2D(GLState.DISABLED);
GLState.useProgram(GLState.DISABLED);
GLState.test(false, false);
GLState.blend(false);

View File

@@ -105,9 +105,9 @@ public class GdxRenderer3D extends LayerRenderer {
// set state that is expected after modelBatch.end();
// modelBatch keeps track of its own state
GLState.enableVertexArrays(-1, -1);
GLState.bindTex2D(-1);
GLState.useProgram(-1);
GLState.enableVertexArrays(GLState.DISABLED, GLState.DISABLED);
GLState.bindTex2D(GLState.DISABLED);
GLState.useProgram(GLState.DISABLED);
GLState.test(false, false);
GLState.blend(false);

View File

@@ -95,9 +95,9 @@ public class GdxRenderer3D2 extends LayerRenderer {
// set state that is expected after modelBatch.end();
// modelBatch keeps track of its own state
GLState.enableVertexArrays(-1, -1);
GLState.bindTex2D(-1);
GLState.useProgram(-1);
GLState.enableVertexArrays(GLState.DISABLED, GLState.DISABLED);
GLState.bindTex2D(GLState.DISABLED);
GLState.useProgram(GLState.DISABLED);
GLState.test(false, false);
GLState.blend(false);

View File

@@ -105,7 +105,7 @@ public class CustomRenderer extends LayerRenderer {
//mVertices.position(2);
//GL.vertexAttribPointer(hVertexPosition, 2, GL20.FLOAT, false, 4, mVertices);
GLState.enableVertexArrays(hVertexPosition, -1);
GLState.enableVertexArrays(hVertexPosition, GLState.DISABLED);
/* apply view and projection matrices */
// set mvp (tmp) matrix relative to mMapPosition

View File

@@ -119,7 +119,7 @@ public class HexagonRenderTest extends GdxMapApp {
// set VBO vertex layout
gl.vertexAttribPointer(hVertexPosition, 2, GL.FLOAT, false, 0, 0);
GLState.enableVertexArrays(hVertexPosition, -1);
GLState.enableVertexArrays(hVertexPosition, GLState.DISABLED);
/* apply view and projection matrices */
// set mvp (tmp) matrix relative to mMapPosition