From ab48dac3f4419ceac51fdf059f310f0f0499c4d7 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Fri, 8 Apr 2011 14:51:22 +0200 Subject: FIX: Refactor GLArrayData and all it's implementations/sub-interfaces (VBO target, comments, names) VBO target: Allowing ELEMENT_VERTEX_ARRAY w/o corresponding GLSL/Fixed attribute Names: Clarified method named. Comments: Added and fixed comments --- .../com/jogamp/opengl/util/GLFixedArrayHandler.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/jogl/classes/com/jogamp/opengl/util/GLFixedArrayHandler.java') diff --git a/src/jogl/classes/com/jogamp/opengl/util/GLFixedArrayHandler.java b/src/jogl/classes/com/jogamp/opengl/util/GLFixedArrayHandler.java index f0f5ea896..a825ca690 100644 --- a/src/jogl/classes/com/jogamp/opengl/util/GLFixedArrayHandler.java +++ b/src/jogl/classes/com/jogamp/opengl/util/GLFixedArrayHandler.java @@ -13,7 +13,7 @@ public class GLFixedArrayHandler implements GLArrayHandler { this.ad = ad; } - protected final void passArrayPointer(GLPointerFunc gl) { + private final void passArrayPointer(GLPointerFunc gl) { switch(ad.getIndex()) { case GLPointerFunc.GL_VERTEX_ARRAY: gl.glVertexPointer(ad); @@ -42,21 +42,21 @@ public class GLFixedArrayHandler implements GLArrayHandler { if(ad.isVBO()) { // always bind and refresh the VBO mgr, // in case more than one gl*Pointer objects are in use - gl.glBindBuffer(GL.GL_ARRAY_BUFFER, ad.getVBOName()); - if(!ad.isBufferWritten()) { + gl.glBindBuffer(ad.getVBOTarget(), ad.getVBOName()); + if(!ad.isVBOWritten()) { if(null!=buffer) { - gl.glBufferData(GL.GL_ARRAY_BUFFER, buffer.limit() * ad.getComponentSize(), buffer, ad.getBufferUsage()); + gl.glBufferData(ad.getVBOTarget(), buffer.limit() * ad.getComponentSize(), buffer, ad.getVBOUsage()); } - ad.setBufferWritten(true); + ad.setVBOWritten(true); } passArrayPointer(glp); } else if(null!=buffer) { passArrayPointer(glp); - ad.setBufferWritten(true); + ad.setVBOWritten(true); } } else { if(ad.isVBO()) { - gl.glBindBuffer(GL.GL_ARRAY_BUFFER, 0); + gl.glBindBuffer(ad.getVBOTarget(), 0); } glp.glDisableClientState(ad.getIndex()); } -- cgit v1.2.3