aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp/opengl/util/GLFixedArrayHandlerInterleaved.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2011-08-22 16:38:45 +0200
committerSven Gothel <[email protected]>2011-08-22 16:38:45 +0200
commit87ff90fb03216737df70ff83246664b7fba2663e (patch)
treed62c0a3c95e2f1eabd9fa69a95c814c668c4ff15 /src/jogl/classes/jogamp/opengl/util/GLFixedArrayHandlerInterleaved.java
parent6602d8eb5af13dc317fff8e044db52c3388f99fa (diff)
Fix regression of commit 6c346d98f04e2355210960fe9ffde47432f04d62, where VBO/attribute binding wasn't updated (VBO data written, shader change/switch attribute on same location) ; Optimized interleaved GLSL VBO binding, hence split up GLArrayHandler syncData/enableState
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/util/GLFixedArrayHandlerInterleaved.java')
-rw-r--r--src/jogl/classes/jogamp/opengl/util/GLFixedArrayHandlerInterleaved.java18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/jogl/classes/jogamp/opengl/util/GLFixedArrayHandlerInterleaved.java b/src/jogl/classes/jogamp/opengl/util/GLFixedArrayHandlerInterleaved.java
index 838032646..4bac20217 100644
--- a/src/jogl/classes/jogamp/opengl/util/GLFixedArrayHandlerInterleaved.java
+++ b/src/jogl/classes/jogamp/opengl/util/GLFixedArrayHandlerInterleaved.java
@@ -54,15 +54,15 @@ public class GLFixedArrayHandlerInterleaved implements GLArrayHandler {
subArrays.add(handler);
}
- private final void enableSubBuffer(GL gl, boolean enable) {
+ private final void syncSubData(GL gl, boolean enable) {
for(int i=0; i<subArrays.size(); i++) {
- subArrays.get(i).enableBuffer(gl, enable);
+ subArrays.get(i).syncData(gl, enable);
}
}
- public final void enableBuffer(GL gl, boolean enable) {
+ 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,
@@ -75,13 +75,19 @@ public class GLFixedArrayHandlerInterleaved implements GLArrayHandler {
ad.setVBOWritten(true);
}
}
- enableSubBuffer(gl, true);
+ syncSubData(gl, true);
} else {
- enableSubBuffer(gl, false);
+ syncSubData(gl, false);
if(ad.isVBO()) {
gl.glBindBuffer(ad.getVBOTarget(), 0);
}
}
}
+
+ public final void enableState(GL gl, boolean enable) {
+ for(int i=0; i<subArrays.size(); i++) {
+ subArrays.get(i).enableState(gl, enable);
+ }
+ }
}