aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp/opengl/util/GLFixedArrayHandlerFlat.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2011-08-22 16:38:45 +0200
committerSven Gothel <[email protected]>2011-08-22 16:38:45 +0200
commit87ff90fb03216737df70ff83246664b7fba2663e (patch)
treed62c0a3c95e2f1eabd9fa69a95c814c668c4ff15 /src/jogl/classes/jogamp/opengl/util/GLFixedArrayHandlerFlat.java
parent6602d8eb5af13dc317fff8e044db52c3388f99fa (diff)
Fix regression of commit 6c346d98f04e2355210960fe9ffde47432f04d62, where VBO/attribute binding wasn't updated (VBO data written, shader change/switch attribute on same location) ; Optimized interleaved GLSL VBO binding, hence split up GLArrayHandler syncData/enableState
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/util/GLFixedArrayHandlerFlat.java')
-rw-r--r--src/jogl/classes/jogamp/opengl/util/GLFixedArrayHandlerFlat.java40
1 files changed, 21 insertions, 19 deletions
diff --git a/src/jogl/classes/jogamp/opengl/util/GLFixedArrayHandlerFlat.java b/src/jogl/classes/jogamp/opengl/util/GLFixedArrayHandlerFlat.java
index e1cf5d572..4dda9c6a1 100644
--- a/src/jogl/classes/jogamp/opengl/util/GLFixedArrayHandlerFlat.java
+++ b/src/jogl/classes/jogamp/opengl/util/GLFixedArrayHandlerFlat.java
@@ -50,29 +50,31 @@ public class GLFixedArrayHandlerFlat implements GLArrayHandler {
throw new UnsupportedOperationException();
}
- private final void passArrayPointer(GLPointerFunc gl) {
- switch(ad.getIndex()) {
- case GLPointerFunc.GL_VERTEX_ARRAY:
- gl.glVertexPointer(ad);
- break;
- case GLPointerFunc.GL_NORMAL_ARRAY:
- gl.glNormalPointer(ad);
- break;
- case GLPointerFunc.GL_COLOR_ARRAY:
- gl.glColorPointer(ad);
- break;
- case GLPointerFunc.GL_TEXTURE_COORD_ARRAY:
- gl.glTexCoordPointer(ad);
- break;
- default:
- throw new GLException("invalid glArrayIndex: "+ad.getIndex()+":\n\t"+ad);
+ public final void syncData(GL gl, boolean enable) {
+ if(enable) {
+ final GLPointerFunc glp = gl.getGL2ES1();
+ switch(ad.getIndex()) {
+ case GLPointerFunc.GL_VERTEX_ARRAY:
+ glp.glVertexPointer(ad);
+ break;
+ case GLPointerFunc.GL_NORMAL_ARRAY:
+ glp.glNormalPointer(ad);
+ break;
+ case GLPointerFunc.GL_COLOR_ARRAY:
+ glp.glColorPointer(ad);
+ break;
+ case GLPointerFunc.GL_TEXTURE_COORD_ARRAY:
+ glp.glTexCoordPointer(ad);
+ break;
+ default:
+ throw new GLException("invalid glArrayIndex: "+ad.getIndex()+":\n\t"+ad);
+ }
}
}
- public final void enableBuffer(GL gl, boolean enable) {
- GLPointerFunc glp = gl.getGL2ES1();
+ public final void enableState(GL gl, boolean enable) {
+ final GLPointerFunc glp = gl.getGL2ES1();
if(enable) {
- passArrayPointer(glp);
glp.glEnableClientState(ad.getIndex());
} else {
glp.glDisableClientState(ad.getIndex());