aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp/opengl/util/GLArrayHandlerInterleaved.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/util/GLArrayHandlerInterleaved.java')
-rw-r--r--src/jogl/classes/jogamp/opengl/util/GLArrayHandlerInterleaved.java26
1 files changed, 5 insertions, 21 deletions
diff --git a/src/jogl/classes/jogamp/opengl/util/GLArrayHandlerInterleaved.java b/src/jogl/classes/jogamp/opengl/util/GLArrayHandlerInterleaved.java
index ab916c329..98f711b8e 100644
--- a/src/jogl/classes/jogamp/opengl/util/GLArrayHandlerInterleaved.java
+++ b/src/jogl/classes/jogamp/opengl/util/GLArrayHandlerInterleaved.java
@@ -28,8 +28,6 @@
package jogamp.opengl.util;
-
-import java.nio.Buffer;
import java.util.ArrayList;
import java.util.List;
@@ -41,12 +39,11 @@ import com.jogamp.opengl.util.GLArrayDataEditable;
* Interleaved fixed function arrays, i.e. where this buffer data
* represents many arrays.
*/
-public class GLArrayHandlerInterleaved implements GLArrayHandler {
- private GLArrayDataEditable ad;
+public class GLArrayHandlerInterleaved extends GLVBOArrayHandler implements GLArrayHandler {
private List<GLArrayHandlerFlat> subArrays = new ArrayList<GLArrayHandlerFlat>();
public GLArrayHandlerInterleaved(GLArrayDataEditable ad) {
- this.ad = ad;
+ super(ad);
}
public final void setSubArrayVBOName(int vboName) {
@@ -67,24 +64,11 @@ public class GLArrayHandlerInterleaved implements GLArrayHandler {
public final void enableState(GL gl, boolean enable, Object ext) {
if(enable) {
- final Buffer buffer = ad.getBuffer();
- final boolean vboBound = ad.isVBO();
- if(vboBound) {
- // always bind and refresh the VBO mgr,
- // in case more than one gl*Pointer objects are in use
- gl.glBindBuffer(ad.getVBOTarget(), ad.getVBOName());
- if(!ad.isVBOWritten()) {
- if(null!=buffer) {
- gl.glBufferData(ad.getVBOTarget(), buffer.limit() * ad.getComponentSizeInBytes(), buffer, ad.getVBOUsage());
- }
- ad.setVBOWritten(true);
- }
- }
+ final boolean vboBound = bindBuffer(gl, true);
syncSubData(gl, ext);
if(vboBound) {
- gl.glBindBuffer(ad.getVBOTarget(), 0);
- }
-
+ bindBuffer(gl, false);
+ }
}
for(int i=0; i<subArrays.size(); i++) {
subArrays.get(i).enableState(gl, enable, ext);