diff options
Diffstat (limited to 'src/jogl')
-rw-r--r-- | src/jogl/classes/com/jogamp/graph/curve/opengl/RenderState.java | 15 | ||||
-rw-r--r-- | src/jogl/classes/jogamp/graph/curve/opengl/VBORegionSPES2.java | 3 |
2 files changed, 17 insertions, 1 deletions
diff --git a/src/jogl/classes/com/jogamp/graph/curve/opengl/RenderState.java b/src/jogl/classes/com/jogamp/graph/curve/opengl/RenderState.java index 4913d8174..c6591d5c8 100644 --- a/src/jogl/classes/com/jogamp/graph/curve/opengl/RenderState.java +++ b/src/jogl/classes/com/jogamp/graph/curve/opengl/RenderState.java @@ -88,6 +88,8 @@ public class RenderState { */ public static final int BITHINT_GLOBAL_DEPTH_TEST_ENABLED = 1 << 1 ; + public static final int DEBUG_LINESTRIP = 1 << 0 ; + public static final RenderState getRenderState(final GL2ES2 gl) { return (RenderState) gl.getContext().getAttachedObject(thisKey); } @@ -106,6 +108,7 @@ public class RenderState { private final Frustum clipFrustum; private boolean useClipFrustum; private int hintBits; + private int debugBits; private ShaderProgram sp; private static synchronized int getNextID() { @@ -210,6 +213,7 @@ public class RenderState { this.useClipFrustum = false; this.hintBits = 0; + this.debugBits = 0; this.sp = null; } @@ -307,6 +311,17 @@ public class RenderState { hintBits &= ~mask; } + public final int getDebugBits() { return this.debugBits; } + public final boolean debugBitsSet(final int mask) { + return mask == ( debugBits & mask ); + } + public final void setDebugBits(final int mask) { + debugBits |= mask; + } + public final void clearDebugBits(final int mask) { + debugBits &= ~mask; + } + /** * * @param gl diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegionSPES2.java b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegionSPES2.java index 7fcd61292..eec22973c 100644 --- a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegionSPES2.java +++ b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegionSPES2.java @@ -205,9 +205,10 @@ public final class VBORegionSPES2 extends GLRegion { gl.glDrawElements(GL.GL_TRIANGLES, indicesBuffer.getElemCount() * indicesBuffer.getCompsPerElem(), glIdxType(), 0); // gl.glDrawElements(GL.GL_LINE_STRIP, indicesBuffer.getElemCount() * indicesBuffer.getCompsPerElem(), glIdxType(), 0); tex.disable(gl); // nop on core + } else if( rs.debugBitsSet(RenderState.DEBUG_LINESTRIP) ) { + gl.glDrawElements(GL.GL_LINE_STRIP, indicesBuffer.getElemCount() * indicesBuffer.getCompsPerElem(), glIdxType(), 0); } else { gl.glDrawElements(GL.GL_TRIANGLES, indicesBuffer.getElemCount() * indicesBuffer.getCompsPerElem(), glIdxType(), 0); - // gl.glDrawElements(GL.GL_LINE_STRIP, indicesBuffer.getElemCount() * indicesBuffer.getCompsPerElem(), glIdxType(), 0); } indicesBuffer.bindBuffer(gl, false); |