aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp/graph/curve/opengl
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2012-10-12 14:56:20 +0200
committerSven Gothel <[email protected]>2012-10-12 14:56:20 +0200
commitf49f8e22953ed2426fd4264ee407e2dc3fc07cfc (patch)
treea1a646e638b02c6c0c7a3778d3bb2f8728c7f8e9 /src/jogl/classes/jogamp/graph/curve/opengl
parent8582ece7dc7f65271b3184261697a542766d9864 (diff)
GLArrayData* VBO binding: Adding explicit bindBuffer(..) method, since VBO is not more bound after enableBuffer(); Fix unit test (test VBO bound).
Explicit bindBuffer(..) is required now, since enableBuffer() doesn't leave it bound. See fixed VBORegion* patch for use case, i.e. using a VBO index buffer for glDrawElements(). Complets commit 8582ece7dc7f65271b3184261697a542766d9864.
Diffstat (limited to 'src/jogl/classes/jogamp/graph/curve/opengl')
-rw-r--r--src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PES2.java8
-rw-r--r--src/jogl/classes/jogamp/graph/curve/opengl/VBORegionSPES2.java6
2 files changed, 10 insertions, 4 deletions
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PES2.java b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PES2.java
index aabef29b0..765b94855 100644
--- a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PES2.java
+++ b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PES2.java
@@ -223,7 +223,9 @@ public class VBORegion2PES2 extends GLRegion {
texCoordFboAttr.enableBuffer(gl, true);
indicesFbo.enableBuffer(gl, true);
- gl.glDrawElements(GL2ES2.GL_TRIANGLES, indicesFbo.getElementCount() * indicesFbo.getComponentCount(), GL2ES2.GL_UNSIGNED_SHORT, 0);
+ indicesFbo.bindBuffer(gl, true);
+ gl.glDrawElements(GL2ES2.GL_TRIANGLES, indicesFbo.getElementCount() * indicesFbo.getComponentCount(), GL2ES2.GL_UNSIGNED_SHORT, 0);
+ indicesFbo.bindBuffer(gl, false);
verticeFboAttr.enableBuffer(gl, false);
texCoordFboAttr.enableBuffer(gl, false);
@@ -289,7 +291,9 @@ public class VBORegion2PES2 extends GLRegion {
texCoordTxtAttr.enableBuffer(gl, true);
indicesTxt.enableBuffer(gl, true);
- gl.glDrawElements(GL2ES2.GL_TRIANGLES, indicesTxt.getElementCount() * indicesTxt.getComponentCount(), GL2ES2.GL_UNSIGNED_SHORT, 0);
+ indicesTxt.bindBuffer(gl, true);
+ gl.glDrawElements(GL2ES2.GL_TRIANGLES, indicesTxt.getElementCount() * indicesTxt.getComponentCount(), GL2ES2.GL_UNSIGNED_SHORT, 0);
+ indicesTxt.bindBuffer(gl, false);
verticeTxtAttr.enableBuffer(gl, false);
texCoordTxtAttr.enableBuffer(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 14ff0380f..7f3e937e1 100644
--- a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegionSPES2.java
+++ b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegionSPES2.java
@@ -129,8 +129,10 @@ public class VBORegionSPES2 extends GLRegion {
verticeAttr.enableBuffer(gl, true);
texCoordAttr.enableBuffer(gl, true);
indices.enableBuffer(gl, true);
-
- gl.glDrawElements(GL2ES2.GL_TRIANGLES, indices.getElementCount() * indices.getComponentCount(), GL2ES2.GL_UNSIGNED_SHORT, 0);
+
+ indices.bindBuffer(gl, true);
+ gl.glDrawElements(GL2ES2.GL_TRIANGLES, indices.getElementCount() * indices.getComponentCount(), GL2ES2.GL_UNSIGNED_SHORT, 0);
+ indices.bindBuffer(gl, false);
verticeAttr.enableBuffer(gl, false);
texCoordAttr.enableBuffer(gl, false);