aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/GLArrayDataClient.java13
-rw-r--r--src/jogl/classes/jogamp/opengl/util/GLArrayHandlerInterleaved.java4
-rw-r--r--src/jogl/classes/jogamp/opengl/util/GLDataArrayHandler.java2
-rw-r--r--src/jogl/classes/jogamp/opengl/util/GLFixedArrayHandler.java2
-rw-r--r--src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandler.java3
-rw-r--r--src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandlerInterleaved.java5
6 files changed, 19 insertions, 10 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataClient.java b/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataClient.java
index e281b14fd..f84342e88 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataClient.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataClient.java
@@ -28,6 +28,7 @@
package com.jogamp.opengl.util;
+import java.lang.reflect.Constructor;
import java.nio.Buffer;
import java.nio.ByteBuffer;
import java.nio.FloatBuffer;
@@ -461,7 +462,17 @@ public class GLArrayDataClient extends GLArrayDataWrapper implements GLArrayData
this.bufferWritten = src.bufferWritten;
this.enableBufferAlways = src.enableBufferAlways;
this.initialElementCount = src.initialElementCount;
- this.glArrayHandler = src.glArrayHandler;
+ if( null != src.glArrayHandler ) {
+ final Class<? extends GLArrayHandler> clazz = src.glArrayHandler.getClass();
+ try {
+ final Constructor<? extends GLArrayHandler> ctor = clazz.getConstructor(GLArrayDataEditable.class);
+ this.glArrayHandler = ctor.newInstance(this);
+ } catch (Exception e) {
+ throw new RuntimeException("Could not ctor "+clazz.getName()+"("+this.getClass().getName()+")", e);
+ }
+ } else {
+ this.glArrayHandler = null;
+ }
this.usesGLSL = src.usesGLSL;
this.shaderState = src.shaderState;
}
diff --git a/src/jogl/classes/jogamp/opengl/util/GLArrayHandlerInterleaved.java b/src/jogl/classes/jogamp/opengl/util/GLArrayHandlerInterleaved.java
index 0d4452864..89e01edd8 100644
--- a/src/jogl/classes/jogamp/opengl/util/GLArrayHandlerInterleaved.java
+++ b/src/jogl/classes/jogamp/opengl/util/GLArrayHandlerInterleaved.java
@@ -39,8 +39,8 @@ import com.jogamp.opengl.util.GLArrayDataEditable;
* Interleaved fixed function arrays, i.e. where this buffer data
* represents many arrays.
*/
-public class GLArrayHandlerInterleaved extends GLVBOArrayHandler implements GLArrayHandler {
- private List<GLArrayHandlerFlat> subArrays = new ArrayList<GLArrayHandlerFlat>();
+public class GLArrayHandlerInterleaved extends GLVBOArrayHandler {
+ private final List<GLArrayHandlerFlat> subArrays = new ArrayList<GLArrayHandlerFlat>();
public GLArrayHandlerInterleaved(GLArrayDataEditable ad) {
super(ad);
diff --git a/src/jogl/classes/jogamp/opengl/util/GLDataArrayHandler.java b/src/jogl/classes/jogamp/opengl/util/GLDataArrayHandler.java
index c1f6b954a..8a587980d 100644
--- a/src/jogl/classes/jogamp/opengl/util/GLDataArrayHandler.java
+++ b/src/jogl/classes/jogamp/opengl/util/GLDataArrayHandler.java
@@ -38,7 +38,7 @@ import com.jogamp.opengl.util.GLArrayDataEditable;
* Used for pure VBO data arrays, i.e. where the buffer data
* does not represents a specific array name.
*/
-public class GLDataArrayHandler extends GLVBOArrayHandler implements GLArrayHandler {
+public class GLDataArrayHandler extends GLVBOArrayHandler {
public GLDataArrayHandler(GLArrayDataEditable ad) {
super(ad);
diff --git a/src/jogl/classes/jogamp/opengl/util/GLFixedArrayHandler.java b/src/jogl/classes/jogamp/opengl/util/GLFixedArrayHandler.java
index 3aac9612a..7f7a99a2d 100644
--- a/src/jogl/classes/jogamp/opengl/util/GLFixedArrayHandler.java
+++ b/src/jogl/classes/jogamp/opengl/util/GLFixedArrayHandler.java
@@ -38,7 +38,7 @@ import com.jogamp.opengl.util.GLArrayDataEditable;
* Used for 1:1 fixed function arrays, i.e. where the buffer data
* represents this array only.
*/
-public class GLFixedArrayHandler extends GLVBOArrayHandler implements GLArrayHandler {
+public class GLFixedArrayHandler extends GLVBOArrayHandler {
public GLFixedArrayHandler(GLArrayDataEditable ad) {
super(ad);
}
diff --git a/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandler.java b/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandler.java
index 3b443fdd0..1f402f48b 100644
--- a/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandler.java
+++ b/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandler.java
@@ -33,7 +33,6 @@ import java.nio.Buffer;
import javax.media.opengl.GL;
import javax.media.opengl.GL2ES2;
-import jogamp.opengl.util.GLArrayHandler;
import jogamp.opengl.util.GLArrayHandlerFlat;
import jogamp.opengl.util.GLVBOArrayHandler;
@@ -44,7 +43,7 @@ import com.jogamp.opengl.util.glsl.ShaderState;
* Used for 1:1 GLSL arrays, i.e. where the buffer data
* represents this array only.
*/
-public class GLSLArrayHandler extends GLVBOArrayHandler implements GLArrayHandler {
+public class GLSLArrayHandler extends GLVBOArrayHandler {
public GLSLArrayHandler(GLArrayDataEditable ad) {
super(ad);
diff --git a/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandlerInterleaved.java b/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandlerInterleaved.java
index b175bb5dc..e153082e0 100644
--- a/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandlerInterleaved.java
+++ b/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandlerInterleaved.java
@@ -33,7 +33,6 @@ import java.util.List;
import javax.media.opengl.GL;
-import jogamp.opengl.util.GLArrayHandler;
import jogamp.opengl.util.GLArrayHandlerFlat;
import jogamp.opengl.util.GLVBOArrayHandler;
@@ -43,8 +42,8 @@ import com.jogamp.opengl.util.GLArrayDataEditable;
* Interleaved fixed function arrays, i.e. where this buffer data
* represents many arrays.
*/
-public class GLSLArrayHandlerInterleaved extends GLVBOArrayHandler implements GLArrayHandler {
- private List<GLArrayHandlerFlat> subArrays = new ArrayList<GLArrayHandlerFlat>();
+public class GLSLArrayHandlerInterleaved extends GLVBOArrayHandler {
+ private final List<GLArrayHandlerFlat> subArrays = new ArrayList<GLArrayHandlerFlat>();
public GLSLArrayHandlerInterleaved(GLArrayDataEditable ad) {
super(ad);