aboutsummaryrefslogtreecommitdiffstats
path: root/src/classes/javax/media/opengl/glsl
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2008-08-13 13:22:21 +0000
committerSven Gothel <[email protected]>2008-08-13 13:22:21 +0000
commit8beeca6fcb1b5fe98e7c04a208fc208014f35c1f (patch)
tree033fabe8cf8389aae3ba41b31366b50c661ef13a /src/classes/javax/media/opengl/glsl
parentfc37b49b6890531ed87b45956c7d369b46c4fd88 (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 'src/classes/javax/media/opengl/glsl')
-rw-r--r--src/classes/javax/media/opengl/glsl/ShaderState.java17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/classes/javax/media/opengl/glsl/ShaderState.java b/src/classes/javax/media/opengl/glsl/ShaderState.java
index f17e844e8..3d4983152 100644
--- a/src/classes/javax/media/opengl/glsl/ShaderState.java
+++ b/src/classes/javax/media/opengl/glsl/ShaderState.java
@@ -412,7 +412,7 @@ public class ShaderState {
}
/**
- * Reset all previously mapped vertex attribute data,
+ * Reset all previously enabled mapped vertex attribute data,
* incl enabling them
*
* @throws GLException is the program is not in use
@@ -430,11 +430,16 @@ public class ShaderState {
attribMap2Idx.clear();
for(Iterator iter = enabledVertexAttribArraySet.iterator(); iter.hasNext(); ) {
- glEnableVertexAttribArray(gl, (String) iter.next());
- }
-
- for(Iterator iter = vertexAttribMap2Data.values().iterator(); iter.hasNext(); ) {
- glVertexAttribPointer(gl, (GLArrayData) iter.next());
+ String name = (String) iter.next();
+ glEnableVertexAttribArray(gl, name);
+ GLArrayData data = getVertexAttribPointer(name);
+
+ if( data.isVBO() && data.getBuffer()==null ) {
+ // make sure the VBO is bound again
+ // in case this is only a VBO wrapped object (no buffer)
+ gl.glBindBuffer(GL.GL_ARRAY_BUFFER, data.getVBOName());
+ }
+ glVertexAttribPointer(gl, data);
}
}