aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp
diff options
context:
space:
mode:
Diffstat (limited to 'src/jogl/classes/jogamp')
-rw-r--r--src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PMSAAES2.java20
-rw-r--r--src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PVBAAES2.java20
-rw-r--r--src/jogl/classes/jogamp/graph/curve/opengl/VBORegionSPES2.java20
-rw-r--r--src/jogl/classes/jogamp/opengl/util/GLVBOArrayHandler.java2
-rw-r--r--src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncHook.java2
5 files changed, 27 insertions, 37 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);
diff --git a/src/jogl/classes/jogamp/opengl/util/GLVBOArrayHandler.java b/src/jogl/classes/jogamp/opengl/util/GLVBOArrayHandler.java
index a9424282e..1eed318bf 100644
--- a/src/jogl/classes/jogamp/opengl/util/GLVBOArrayHandler.java
+++ b/src/jogl/classes/jogamp/opengl/util/GLVBOArrayHandler.java
@@ -57,7 +57,7 @@ public abstract class GLVBOArrayHandler implements GLArrayHandler {
if(!ad.isVBOWritten()) {
final Buffer buffer = ad.getBuffer();
if(null!=buffer) {
- gl.glBufferData(ad.getVBOTarget(), buffer.limit() * ad.getComponentSizeInBytes(), buffer, ad.getVBOUsage());
+ gl.glBufferData(ad.getVBOTarget(), buffer.limit() * ad.getBytesPerComp(), buffer, ad.getVBOUsage());
}
ad.setVBOWritten(true);
}
diff --git a/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncHook.java b/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncHook.java
index 0b8a15557..9cd8c863f 100644
--- a/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncHook.java
+++ b/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncHook.java
@@ -433,7 +433,7 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
@Override
public void glNormalPointer(final GLArrayData array) {
- if(array.getComponentCount()!=3) {
+ if(array.getCompsPerElem()!=3) {
throw new GLException("Only 3 components per normal allowed");
}
if(array.isVBO()) {