summaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp/graph/curve/opengl
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2011-08-30 03:41:38 +0200
committerSven Gothel <[email protected]>2011-08-30 03:41:38 +0200
commit7f2da7bb878813817efab0eb01bbf274065ef6c6 (patch)
tree6c4df36439747e239c84f88e676c4a6145738c54 /src/jogl/classes/jogamp/graph/curve/opengl
parentb8b25bb01b826e1216551c8f3d192bcec670e265 (diff)
GLSL DataArray/Handler: Remove ShaderState state and pass it through: ShaderState.getShaderState(gl)
This removes the dependency of a GLSL GLDataArray object to a specific ShaderState and enables sharing of this VBO data, i.e. via a shared context. Test: TestSharedContextVBOES2NEWT
Diffstat (limited to 'src/jogl/classes/jogamp/graph/curve/opengl')
-rw-r--r--src/jogl/classes/jogamp/graph/curve/opengl/RenderStateImpl.java5
-rw-r--r--src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PES2.java16
-rw-r--r--src/jogl/classes/jogamp/graph/curve/opengl/VBORegionSPES2.java8
3 files changed, 12 insertions, 17 deletions
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/RenderStateImpl.java b/src/jogl/classes/jogamp/graph/curve/opengl/RenderStateImpl.java
index 996ab4c02..51356ca13 100644
--- a/src/jogl/classes/jogamp/graph/curve/opengl/RenderStateImpl.java
+++ b/src/jogl/classes/jogamp/graph/curve/opengl/RenderStateImpl.java
@@ -29,7 +29,6 @@ package jogamp.graph.curve.opengl;
import java.nio.FloatBuffer;
-import javax.media.opengl.GL2ES2;
import javax.media.opengl.GLUniformData;
import jogamp.graph.curve.opengl.shader.UniformNames;
@@ -49,10 +48,6 @@ public class RenderStateImpl extends RenderState {
private final GLUniformData gcu_Alpha;
private final GLUniformData gcu_ColorStatic;
- public static final RenderState getRenderState(GL2ES2 gl) {
- return (RenderState) gl.getContext().getAttachedObject(RenderState.class.getName());
- }
-
public RenderStateImpl(ShaderState st, Vertex.Factory<? extends Vertex> pointFactory, PMVMatrix pmvMatrix) {
super(st, pointFactory, pmvMatrix);
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PES2.java b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PES2.java
index 2d13f5ba0..758d0e999 100644
--- a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PES2.java
+++ b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PES2.java
@@ -89,8 +89,8 @@ public class VBORegion2PES2 extends GLRegion {
indicesFbo.puts((short) 1); indicesFbo.puts((short) 2); indicesFbo.puts((short) 3);
indicesFbo.seal(true);
- texCoordFboAttr = GLArrayDataServer.createGLSL(st, AttributeNames.TEXCOORD_ATTR_NAME, 2,
- GL2ES2.GL_FLOAT, false, initialSize, GL.GL_STATIC_DRAW);
+ texCoordFboAttr = GLArrayDataServer.createGLSL(AttributeNames.TEXCOORD_ATTR_NAME, 2, GL2ES2.GL_FLOAT,
+ false, initialSize, GL.GL_STATIC_DRAW);
st.ownAttribute(texCoordFboAttr, true);
texCoordFboAttr.putf(5); texCoordFboAttr.putf(5);
texCoordFboAttr.putf(5); texCoordFboAttr.putf(6);
@@ -98,19 +98,19 @@ public class VBORegion2PES2 extends GLRegion {
texCoordFboAttr.putf(6); texCoordFboAttr.putf(5);
texCoordFboAttr.seal(true);
- verticeFboAttr = GLArrayDataServer.createGLSL(st, AttributeNames.VERTEX_ATTR_NAME, 3,
- GL2ES2.GL_FLOAT, false, initialSize, GL.GL_STATIC_DRAW);
+ verticeFboAttr = GLArrayDataServer.createGLSL(AttributeNames.VERTEX_ATTR_NAME, 3, GL2ES2.GL_FLOAT,
+ false, initialSize, GL.GL_STATIC_DRAW);
st.ownAttribute(verticeFboAttr, true);
indicesTxt = GLArrayDataServer.createData(3, GL2ES2.GL_SHORT, initialSize, GL.GL_STATIC_DRAW, GL.GL_ELEMENT_ARRAY_BUFFER);
- verticeTxtAttr = GLArrayDataServer.createGLSL(st, AttributeNames.VERTEX_ATTR_NAME, 3,
- GL2ES2.GL_FLOAT, false, initialSize, GL.GL_STATIC_DRAW);
+ verticeTxtAttr = GLArrayDataServer.createGLSL(AttributeNames.VERTEX_ATTR_NAME, 3, GL2ES2.GL_FLOAT,
+ false, initialSize, GL.GL_STATIC_DRAW);
st.ownAttribute(verticeTxtAttr, true);
- texCoordTxtAttr = GLArrayDataServer.createGLSL(st, AttributeNames.TEXCOORD_ATTR_NAME, 2,
- GL2ES2.GL_FLOAT, false, initialSize, GL.GL_STATIC_DRAW);
+ texCoordTxtAttr = GLArrayDataServer.createGLSL(AttributeNames.TEXCOORD_ATTR_NAME, 2, GL2ES2.GL_FLOAT,
+ false, initialSize, GL.GL_STATIC_DRAW);
st.ownAttribute(texCoordTxtAttr, true);
if(DEBUG_INSTANCE) {
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegionSPES2.java b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegionSPES2.java
index 83cd6fab9..21671386c 100644
--- a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegionSPES2.java
+++ b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegionSPES2.java
@@ -59,12 +59,12 @@ public class VBORegionSPES2 extends GLRegion {
indices = GLArrayDataServer.createData(3, GL2ES2.GL_SHORT, initialSize, GL.GL_STATIC_DRAW, GL.GL_ELEMENT_ARRAY_BUFFER);
- verticeAttr = GLArrayDataServer.createGLSL(st, AttributeNames.VERTEX_ATTR_NAME, 3,
- GL2ES2.GL_FLOAT, false, initialSize, GL.GL_STATIC_DRAW);
+ verticeAttr = GLArrayDataServer.createGLSL(AttributeNames.VERTEX_ATTR_NAME, 3, GL2ES2.GL_FLOAT,
+ false, initialSize, GL.GL_STATIC_DRAW);
st.ownAttribute(verticeAttr, true);
- texCoordAttr = GLArrayDataServer.createGLSL(st, AttributeNames.TEXCOORD_ATTR_NAME, 2,
- GL2ES2.GL_FLOAT, false, initialSize, GL.GL_STATIC_DRAW);
+ texCoordAttr = GLArrayDataServer.createGLSL(AttributeNames.TEXCOORD_ATTR_NAME, 2, GL2ES2.GL_FLOAT,
+ false, initialSize, GL.GL_STATIC_DRAW);
st.ownAttribute(texCoordAttr, true);
if(DEBUG_INSTANCE) {