summaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp/opengl/util/GLFixedArrayHandler.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/util/GLFixedArrayHandler.java')
-rw-r--r--src/jogl/classes/jogamp/opengl/util/GLFixedArrayHandler.java54
1 files changed, 27 insertions, 27 deletions
diff --git a/src/jogl/classes/jogamp/opengl/util/GLFixedArrayHandler.java b/src/jogl/classes/jogamp/opengl/util/GLFixedArrayHandler.java
index e365f0f4b..2cce72ff4 100644
--- a/src/jogl/classes/jogamp/opengl/util/GLFixedArrayHandler.java
+++ b/src/jogl/classes/jogamp/opengl/util/GLFixedArrayHandler.java
@@ -51,30 +51,9 @@ public class GLFixedArrayHandler 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 enableBuffer(GL gl, boolean enable) {
- GLPointerFunc glp = gl.getGL2ES1();
+ public final void syncData(GL gl, boolean enable) {
if(enable) {
- Buffer buffer = ad.getBuffer();
-
+ final Buffer buffer = ad.getBuffer();
if(ad.isVBO()) {
// always bind and refresh the VBO mgr,
// in case more than one gl*Pointer objects are in use
@@ -86,13 +65,34 @@ public class GLFixedArrayHandler implements GLArrayHandler {
ad.setVBOWritten(true);
}
}
- passArrayPointer(glp);
+ 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);
+ }
+ } else if(ad.isVBO()) {
+ gl.glBindBuffer(ad.getVBOTarget(), 0);
+ }
+ }
+
+ public final void enableState(GL gl, boolean enable) {
+ final GLPointerFunc glp = gl.getGL2ES1();
+ if(enable) {
glp.glEnableClientState(ad.getIndex());
} else {
glp.glDisableClientState(ad.getIndex());
- if(ad.isVBO()) {
- gl.glBindBuffer(ad.getVBOTarget(), 0);
- }
}
}
}