diff options
author | Sven Gothel <[email protected]> | 2008-08-13 13:22:21 +0000 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2008-08-13 13:22:21 +0000 |
commit | 8beeca6fcb1b5fe98e7c04a208fc208014f35c1f (patch) | |
tree | 033fabe8cf8389aae3ba41b31366b50c661ef13a /make/gl-impl-CustomJavaCode-gles2.java | |
parent | fc37b49b6890531ed87b45956c7d369b46c4fd88 (diff) |
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
Diffstat (limited to 'make/gl-impl-CustomJavaCode-gles2.java')
-rwxr-xr-x | make/gl-impl-CustomJavaCode-gles2.java | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/make/gl-impl-CustomJavaCode-gles2.java b/make/gl-impl-CustomJavaCode-gles2.java index a3c274f9a..895d6865e 100755 --- a/make/gl-impl-CustomJavaCode-gles2.java +++ b/make/gl-impl-CustomJavaCode-gles2.java @@ -526,6 +526,9 @@ public void glMaterialfv(int face, int pname, java.nio.FloatBuffer params) { public void glMaterialfv(int face, int pname, float[] params, int params_offset) { glMaterialfv(face, pname, BufferUtil.newFloatBuffer(params, params_offset)); } +public void glMaterialf(int face, int pname, float param) { + glMaterialfv(face, pname, BufferUtil.newFloatBuffer(new float[] { param })); +} public void glShadeModel(int mode) { if(!fixedFunctionShaderActive) { throw new GLUnsupportedException("not enabled"); @@ -592,7 +595,11 @@ public void glVertexPointer(int size, int type, int stride, java.nio.Buffer poin glVertexPointer(GLArrayDataClient.createFixed(GL.GL_VERTEX_ARRAY, null, size, type, false, stride, pointer)); } public void glVertexPointer(int size, int type, int stride, long pointer_buffer_offset) { - glVertexPointer(GLArrayDataServer.createFixed(GL.GL_VERTEX_ARRAY, null, size, type, false, stride, pointer_buffer_offset)); + int vboName = bufferStateTracker.getBoundBufferObject(GL.GL_ARRAY_BUFFER, this); + if(vboName==0) { + throw new GLException("no GL_ARRAY_BUFFER VBO bound"); + } + glVertexPointer(GLArrayDataServer.createFixed(GL.GL_VERTEX_ARRAY, null, size, type, false, stride, pointer_buffer_offset, vboName)); } public void glColorPointer(GLArrayData array) { @@ -613,14 +620,18 @@ public void glColorPointer(int size, int type, int stride, java.nio.Buffer point glColorPointer(GLArrayDataClient.createFixed(GL.GL_COLOR_ARRAY, null, size, type, false, stride, pointer)); } public void glColorPointer(int size, int type, int stride, long pointer_buffer_offset) { - glColorPointer(GLArrayDataServer.createFixed(GL.GL_COLOR_ARRAY, null, size, type, false, stride, pointer_buffer_offset)); + int vboName = bufferStateTracker.getBoundBufferObject(GL.GL_ARRAY_BUFFER, this); + if(vboName==0) { + throw new GLException("no GL_ARRAY_BUFFER VBO bound"); + } + glColorPointer(GLArrayDataServer.createFixed(GL.GL_COLOR_ARRAY, null, size, type, false, stride, pointer_buffer_offset, vboName)); } public void glNormalPointer(GLArrayData array) { if(!fixedFunctionShaderActive) { throw new GLUnsupportedException("Fixed function not enabled"); } - if(array.getComponents()!=3) { + if(array.getComponentNumber()!=3) { throw new GLException("Only 3 components per normal allowed"); } if(array.isVBO()) { @@ -637,7 +648,11 @@ public void glNormalPointer(int type, int stride, java.nio.Buffer pointer) { glNormalPointer(GLArrayDataClient.createFixed(GL.GL_NORMAL_ARRAY, null, 3, type, false, stride, pointer)); } public void glNormalPointer(int type, int stride, long pointer_buffer_offset) { - glNormalPointer(GLArrayDataServer.createFixed(GL.GL_NORMAL_ARRAY, null, 3, type, false, stride, pointer_buffer_offset)); + int vboName = bufferStateTracker.getBoundBufferObject(GL.GL_ARRAY_BUFFER, this); + if(vboName==0) { + throw new GLException("no GL_ARRAY_BUFFER VBO bound"); + } + glNormalPointer(GLArrayDataServer.createFixed(GL.GL_NORMAL_ARRAY, null, 3, type, false, stride, pointer_buffer_offset, vboName)); } public void glTexCoordPointer(GLArrayData array) { @@ -659,10 +674,11 @@ public void glTexCoordPointer(int size, int type, int stride, java.nio.Buffer po GLArrayDataClient.createFixed(GL.GL_TEXTURE_COORD_ARRAY, null, size, type, false, stride, pointer)); } public void glTexCoordPointer(int size, int type, int stride, long pointer_buffer_offset) { - if(!fixedFunctionShaderActive) { - throw new GLUnsupportedException("Fixed function not enabled"); + int vboName = bufferStateTracker.getBoundBufferObject(GL.GL_ARRAY_BUFFER, this); + if(vboName==0) { + throw new GLException("no GL_ARRAY_BUFFER VBO bound"); } glTexCoordPointer( - GLArrayDataServer.createFixed(GL.GL_TEXTURE_COORD_ARRAY, null, size, type, false, stride, pointer_buffer_offset) ); + GLArrayDataServer.createFixed(GL.GL_TEXTURE_COORD_ARRAY, null, size, type, false, stride, pointer_buffer_offset, vboName) ); } |