From 8beeca6fcb1b5fe98e7c04a208fc208014f35c1f Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Wed, 13 Aug 2008 13:22:21 +0000 Subject: GLArrayData* - cleanup names and enable/disable code - bail out if components==0 in GL* impl. - add passing the VBO name for wrapping VBO server objects from the fixed function calls ShaderState: - reset: - only pass _enabled_ vertex attribute data in case of a reset - enable VBO in case of a wrapped VBO server object Fixed: - Added glMaterialf to GL (enables Angeles demo) - Working: Angeles on ES2 git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/branches/JOGL_2_SANDBOX@1755 232f8b59-042b-4e1e-8c03-345bb8c30851 --- make/gl-impl-CustomJavaCode-gl2es12.java | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'make/gl-impl-CustomJavaCode-gl2es12.java') diff --git a/make/gl-impl-CustomJavaCode-gl2es12.java b/make/gl-impl-CustomJavaCode-gl2es12.java index eaea3afd6..643443b91 100644 --- a/make/gl-impl-CustomJavaCode-gl2es12.java +++ b/make/gl-impl-CustomJavaCode-gl2es12.java @@ -395,34 +395,38 @@ native private long dispatch_glMapBuffer(int target, int access, long glProcAddr } public void glVertexPointer(GLArrayData array) { + if(array.getComponentNumber()==0) return; if(array.isVBO()) { - glVertexPointer(array.getComponents(), array.getDataType(), array.getStride(), array.getOffset()); + glVertexPointer(array.getComponentNumber(), array.getComponentType(), array.getStride(), array.getOffset()); } else { - glVertexPointer(array.getComponents(), array.getDataType(), array.getStride(), array.getBuffer()); + glVertexPointer(array.getComponentNumber(), array.getComponentType(), array.getStride(), array.getBuffer()); } } public void glColorPointer(GLArrayData array) { + if(array.getComponentNumber()==0) return; if(array.isVBO()) { - glColorPointer(array.getComponents(), array.getDataType(), array.getStride(), array.getOffset()); + glColorPointer(array.getComponentNumber(), array.getComponentType(), array.getStride(), array.getOffset()); } else { - glColorPointer(array.getComponents(), array.getDataType(), array.getStride(), array.getBuffer()); + glColorPointer(array.getComponentNumber(), array.getComponentType(), array.getStride(), array.getBuffer()); } } public void glNormalPointer(GLArrayData array) { - if(array.getComponents()!=3) { + if(array.getComponentNumber()==0) return; + if(array.getComponentNumber()!=3) { throw new GLException("Only 3 components per normal allowed"); } if(array.isVBO()) { - glNormalPointer(array.getDataType(), array.getStride(), array.getOffset()); + glNormalPointer(array.getComponentType(), array.getStride(), array.getOffset()); } else { - glNormalPointer(array.getDataType(), array.getStride(), array.getBuffer()); + glNormalPointer(array.getComponentType(), array.getStride(), array.getBuffer()); } } public void glTexCoordPointer(GLArrayData array) { + if(array.getComponentNumber()==0) return; if(array.isVBO()) { - glTexCoordPointer(array.getComponents(), array.getDataType(), array.getStride(), array.getOffset()); + glTexCoordPointer(array.getComponentNumber(), array.getComponentType(), array.getStride(), array.getOffset()); } else { - glTexCoordPointer(array.getComponents(), array.getDataType(), array.getStride(), array.getBuffer()); + glTexCoordPointer(array.getComponentNumber(), array.getComponentType(), array.getStride(), array.getBuffer()); } } -- cgit v1.2.3