aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp/graph/curve/opengl
diff options
context:
space:
mode:
Diffstat (limited to 'src/jogl/classes/jogamp/graph/curve/opengl')
-rw-r--r--src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PES2.java18
-rw-r--r--src/jogl/classes/jogamp/graph/curve/opengl/VBORegionSPES2.java10
2 files changed, 11 insertions, 17 deletions
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PES2.java b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PES2.java
index 765b94855..85d3ad5a7 100644
--- a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PES2.java
+++ b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PES2.java
@@ -220,16 +220,14 @@ public class VBORegion2PES2 extends GLRegion {
gl.glActiveTexture(GL.GL_TEXTURE0 + mgl_ActiveTexture.intValue());
fbo.use(gl, texA);
verticeFboAttr.enableBuffer(gl, true);
- texCoordFboAttr.enableBuffer(gl, true);
- indicesFbo.enableBuffer(gl, true);
+ texCoordFboAttr.enableBuffer(gl, true);
+ indicesFbo.bindBuffer(gl, true); // keeps VBO binding
- 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);
+ indicesFbo.bindBuffer(gl, false);
texCoordFboAttr.enableBuffer(gl, false);
- indicesFbo.enableBuffer(gl, false);
+ verticeFboAttr.enableBuffer(gl, false);
fbo.unuse(gl);
// setback: gl.glActiveTexture(currentActiveTextureEngine[0]);
@@ -289,15 +287,13 @@ public class VBORegion2PES2 extends GLRegion {
private void renderRegion(GL2ES2 gl) {
verticeTxtAttr.enableBuffer(gl, true);
texCoordTxtAttr.enableBuffer(gl, true);
- indicesTxt.enableBuffer(gl, true);
+ indicesTxt.bindBuffer(gl, true); // keeps VBO binding
- 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);
+ indicesTxt.bindBuffer(gl, false);
texCoordTxtAttr.enableBuffer(gl, false);
- indicesTxt.enableBuffer(gl, false);
+ verticeTxtAttr.enableBuffer(gl, false);
}
public void destroy(GL2ES2 gl, RenderState rs) {
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegionSPES2.java b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegionSPES2.java
index 7f3e937e1..0cba444ad 100644
--- a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegionSPES2.java
+++ b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegionSPES2.java
@@ -127,16 +127,14 @@ public class VBORegionSPES2 extends GLRegion {
protected void drawImpl(GL2ES2 gl, RenderState rs, int vp_width, int vp_height, int[/*1*/] texWidth) {
verticeAttr.enableBuffer(gl, true);
- texCoordAttr.enableBuffer(gl, true);
- indices.enableBuffer(gl, true);
+ texCoordAttr.enableBuffer(gl, true);
+ indices.bindBuffer(gl, true); // keeps VBO binding
- 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);
- indices.enableBuffer(gl, false);
+ verticeAttr.enableBuffer(gl, false);
}
public final void destroy(GL2ES2 gl, RenderState rs) {