diff options
Diffstat (limited to 'src/jogl/classes/jogamp/graph')
3 files changed, 25 insertions, 35 deletions
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PMSAAES2.java b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PMSAAES2.java index 3010fa5ff..798d77b8f 100644 --- a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PMSAAES2.java +++ b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PMSAAES2.java @@ -193,20 +193,16 @@ public class VBORegion2PMSAAES2 extends GLRegion { @Override protected final void clearImpl(final GL2ES2 gl) { if( null != indicesBuffer ) { - indicesBuffer.seal(gl, false); - indicesBuffer.rewind(); + indicesBuffer.clear(gl); } if( null != gca_VerticesAttr ) { - gca_VerticesAttr.seal(gl, false); - gca_VerticesAttr.rewind(); + gca_VerticesAttr.clear(gl); } if( null != gca_CurveParamsAttr ) { - gca_CurveParamsAttr.seal(gl, false); - gca_CurveParamsAttr.rewind(); + gca_CurveParamsAttr.clear(gl); } if( null != gca_ColorsAttr ) { - gca_ColorsAttr.seal(gl, false); - gca_ColorsAttr.rewind(); + gca_ColorsAttr.clear(gl); } fboDirty = true; } @@ -297,7 +293,7 @@ public class VBORegion2PMSAAES2 extends GLRegion { @Override protected void drawImpl(final GL2ES2 gl, final RegionRenderer renderer, final int[/*1*/] sampleCount) { - if( 0 >= indicesBuffer.getElementCount() ) { + if( 0 >= indicesBuffer.getElemCount() ) { if(DEBUG_INSTANCE) { System.err.printf("VBORegion2PMSAAES2.drawImpl: Empty%n"); } @@ -432,7 +428,7 @@ public class VBORegion2PMSAAES2 extends GLRegion { gca_FboTexCoordsAttr.enableBuffer(gl, true); indicesFbo.bindBuffer(gl, true); // keeps VBO binding - gl.glDrawElements(GL.GL_TRIANGLES, indicesFbo.getElementCount() * indicesFbo.getComponentCount(), GL.GL_UNSIGNED_SHORT, 0); + gl.glDrawElements(GL.GL_TRIANGLES, indicesFbo.getElemCount() * indicesFbo.getCompsPerElem(), GL.GL_UNSIGNED_SHORT, 0); indicesFbo.bindBuffer(gl, false); gca_FboTexCoordsAttr.enableBuffer(gl, false); @@ -529,10 +525,10 @@ public class VBORegion2PMSAAES2 extends GLRegion { gcu_ColorTexUnit.setData(colorTexSeq.getTextureUnit()); gl.glUniform(gcu_ColorTexUnit); // Always update, since program maybe used by multiple regions gl.glUniform(gcu_ColorTexBBox); // Always update, since program maybe used by multiple regions - gl.glDrawElements(GL.GL_TRIANGLES, indicesBuffer.getElementCount() * indicesBuffer.getComponentCount(), GL.GL_UNSIGNED_SHORT, 0); + gl.glDrawElements(GL.GL_TRIANGLES, indicesBuffer.getElemCount() * indicesBuffer.getCompsPerElem(), glIdxType(), 0); tex.disable(gl); // nop on core } else { - gl.glDrawElements(GL.GL_TRIANGLES, indicesBuffer.getElementCount() * indicesBuffer.getComponentCount(), GL.GL_UNSIGNED_SHORT, 0); + gl.glDrawElements(GL.GL_TRIANGLES, indicesBuffer.getElemCount() * indicesBuffer.getCompsPerElem(), glIdxType(), 0); } indicesBuffer.bindBuffer(gl, false); diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PVBAAES2.java b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PVBAAES2.java index 092cc55c1..a5af67e0c 100644 --- a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PVBAAES2.java +++ b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PVBAAES2.java @@ -234,20 +234,16 @@ public class VBORegion2PVBAAES2 extends GLRegion { // Thread.dumpStack(); } if( null != indicesBuffer ) { - indicesBuffer.seal(gl, false); - indicesBuffer.rewind(); + indicesBuffer.clear(gl);; } if( null != gca_VerticesAttr ) { - gca_VerticesAttr.seal(gl, false); - gca_VerticesAttr.rewind(); + gca_VerticesAttr.clear(gl); } if( null != gca_CurveParamsAttr ) { - gca_CurveParamsAttr.seal(gl, false); - gca_CurveParamsAttr.rewind(); + gca_CurveParamsAttr.clear(gl); } if( null != gca_ColorsAttr ) { - gca_ColorsAttr.seal(gl, false); - gca_ColorsAttr.rewind(); + gca_ColorsAttr.clear(gl);; } fboDirty = true; } @@ -337,7 +333,7 @@ public class VBORegion2PVBAAES2 extends GLRegion { @Override protected void drawImpl(final GL2ES2 gl, final RegionRenderer renderer, final int[/*1*/] sampleCount) { - if( 0 >= indicesBuffer.getElementCount() ) { + if( 0 >= indicesBuffer.getElemCount() ) { if(DEBUG_INSTANCE) { System.err.printf("VBORegion2PVBAAES2.drawImpl: Empty%n"); } @@ -545,7 +541,7 @@ public class VBORegion2PVBAAES2 extends GLRegion { gca_FboTexCoordsAttr.enableBuffer(gl, true); indicesFbo.bindBuffer(gl, true); // keeps VBO binding - gl.glDrawElements(GL.GL_TRIANGLES, indicesFbo.getElementCount() * indicesFbo.getComponentCount(), GL.GL_UNSIGNED_SHORT, 0); + gl.glDrawElements(GL.GL_TRIANGLES, indicesFbo.getElemCount() * indicesFbo.getCompsPerElem(), GL.GL_UNSIGNED_SHORT, 0); indicesFbo.bindBuffer(gl, false); gca_FboTexCoordsAttr.enableBuffer(gl, false); @@ -640,10 +636,10 @@ public class VBORegion2PVBAAES2 extends GLRegion { gcu_ColorTexUnit.setData(colorTexSeq.getTextureUnit()); gl.glUniform(gcu_ColorTexUnit); // Always update, since program maybe used by multiple regions gl.glUniform(gcu_ColorTexBBox); // Always update, since program maybe used by multiple regions - gl.glDrawElements(GL.GL_TRIANGLES, indicesBuffer.getElementCount() * indicesBuffer.getComponentCount(), GL.GL_UNSIGNED_SHORT, 0); + gl.glDrawElements(GL.GL_TRIANGLES, indicesBuffer.getElemCount() * indicesBuffer.getCompsPerElem(), glIdxType(), 0); tex.disable(gl); // nop on core } else { - gl.glDrawElements(GL.GL_TRIANGLES, indicesBuffer.getElementCount() * indicesBuffer.getComponentCount(), GL.GL_UNSIGNED_SHORT, 0); + gl.glDrawElements(GL.GL_TRIANGLES, indicesBuffer.getElemCount() * indicesBuffer.getCompsPerElem(), glIdxType(), 0); } indicesBuffer.bindBuffer(gl, false); diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegionSPES2.java b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegionSPES2.java index a8e74aed5..5b0d38929 100644 --- a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegionSPES2.java +++ b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegionSPES2.java @@ -95,20 +95,16 @@ public class VBORegionSPES2 extends GLRegion { System.err.println("VBORegionSPES2 Clear: " + this); } if( null != indicesBuffer ) { - indicesBuffer.seal(gl, false); - indicesBuffer.rewind(); + indicesBuffer.clear(gl); } if( null != gca_VerticesAttr ) { - gca_VerticesAttr.seal(gl, false); - gca_VerticesAttr.rewind(); + gca_VerticesAttr.clear(gl); } if( null != gca_CurveParamsAttr ) { - gca_CurveParamsAttr.seal(gl, false); - gca_CurveParamsAttr.rewind(); + gca_CurveParamsAttr.clear(gl); } if( null != gca_ColorsAttr ) { - gca_ColorsAttr.seal(gl, false); - gca_ColorsAttr.rewind(); + gca_ColorsAttr.clear(gl); } } @@ -218,7 +214,7 @@ public class VBORegionSPES2 extends GLRegion { final int renderModes = getRenderModes(); useShaderProgram(gl, renderer, renderModes, getQuality()); - if( 0 >= indicesBuffer.getElementCount() ) { + if( 0 >= indicesBuffer.getElemCount() ) { if(DEBUG_INSTANCE) { System.err.printf("VBORegionSPES2.drawImpl: Empty%n"); } @@ -244,10 +240,12 @@ public class VBORegionSPES2 extends GLRegion { gcu_ColorTexUnit.setData(colorTexSeq.getTextureUnit()); gl.glUniform(gcu_ColorTexUnit); // Always update, since program maybe used by multiple regions gl.glUniform(gcu_ColorTexBBox); // Always update, since program maybe used by multiple regions - gl.glDrawElements(GL.GL_TRIANGLES, indicesBuffer.getElementCount() * indicesBuffer.getComponentCount(), GL.GL_UNSIGNED_SHORT, 0); + gl.glDrawElements(GL.GL_TRIANGLES, indicesBuffer.getElemCount() * indicesBuffer.getCompsPerElem(), glIdxType(), 0); + // gl.glDrawElements(GL.GL_LINE_STRIP, indicesBuffer.getElementCount() * indicesBuffer.getComponentCount(), gl_idx_type, 0); tex.disable(gl); // nop on core } else { - gl.glDrawElements(GL.GL_TRIANGLES, indicesBuffer.getElementCount() * indicesBuffer.getComponentCount(), GL.GL_UNSIGNED_SHORT, 0); + gl.glDrawElements(GL.GL_TRIANGLES, indicesBuffer.getElemCount() * indicesBuffer.getCompsPerElem(), glIdxType(), 0); + // gl.glDrawElements(GL.GL_LINE_STRIP, indicesBuffer.getElementCount() * indicesBuffer.getComponentCount(), gl_idx_type, 0); } indicesBuffer.bindBuffer(gl, false); |