summaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp/opengl/util/GLArrayHandlerInterleaved.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2011-10-07 19:59:29 +0200
committerSven Gothel <[email protected]>2011-10-07 19:59:29 +0200
commit274df7766467ca79dbd593d59aa1e4908d40cfa5 (patch)
treec3770d2b6d96101b5c5eaa13b86fbaae26177f6d /src/jogl/classes/jogamp/opengl/util/GLArrayHandlerInterleaved.java
parentc8eab433735f5da0779843b227e2f0f5057df776 (diff)
GLArrayData<VBO>: Add GLArrayHandlerFlat ; Update VBO name to interleaved subarrays
- Add GLArrayHandlerFlat gives better distinction of semantics - update sub-array VBO name, if parent's interleaved array initializes it.
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/util/GLArrayHandlerInterleaved.java')
-rw-r--r--src/jogl/classes/jogamp/opengl/util/GLArrayHandlerInterleaved.java18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/jogl/classes/jogamp/opengl/util/GLArrayHandlerInterleaved.java b/src/jogl/classes/jogamp/opengl/util/GLArrayHandlerInterleaved.java
index 8e813a79b..d31b41582 100644
--- a/src/jogl/classes/jogamp/opengl/util/GLArrayHandlerInterleaved.java
+++ b/src/jogl/classes/jogamp/opengl/util/GLArrayHandlerInterleaved.java
@@ -43,19 +43,25 @@ import com.jogamp.opengl.util.GLArrayDataEditable;
*/
public class GLArrayHandlerInterleaved implements GLArrayHandler {
private GLArrayDataEditable ad;
- private List<GLArrayHandler> subArrays = new ArrayList<GLArrayHandler>();
+ private List<GLArrayHandlerFlat> subArrays = new ArrayList<GLArrayHandlerFlat>();
public GLArrayHandlerInterleaved(GLArrayDataEditable ad) {
this.ad = ad;
}
- public final void addSubHandler(GLArrayHandler handler) {
+ public final void setSubArrayVBOName(int vboName) {
+ for(int i=0; i<subArrays.size(); i++) {
+ subArrays.get(i).getData().setVBOName(vboName);
+ }
+ }
+
+ public final void addSubHandler(GLArrayHandlerFlat handler) {
subArrays.add(handler);
}
- private final void syncSubData(GL gl, boolean enable, Object ext) {
+ private final void syncSubData(GL gl, boolean enable, boolean force, Object ext) {
for(int i=0; i<subArrays.size(); i++) {
- subArrays.get(i).syncData(gl, enable, ext);
+ subArrays.get(i).syncData(gl, enable, force, ext);
}
}
@@ -74,9 +80,9 @@ public class GLArrayHandlerInterleaved implements GLArrayHandler {
ad.setVBOWritten(true);
}
}
- syncSubData(gl, true, ext);
+ syncSubData(gl, true, true, ext);
} else {
- syncSubData(gl, false, ext);
+ syncSubData(gl, false, true, ext);
if(ad.isVBO()) {
gl.glBindBuffer(ad.getVBOTarget(), 0);
}