aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataClient.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2011-08-30 15:41:00 +0200
committerSven Gothel <[email protected]>2011-08-30 15:41:00 +0200
commit1ac5a3f0643a761d2d9e217883da73ad993a91b9 (patch)
tree60f013931bb8414149909fb1146f5b4f086fed3c /src/jogl/classes/com/jogamp/opengl/util/GLArrayDataClient.java
parent736d1c5d27e0cee36993f74dca787aefd3df7d18 (diff)
ShaderState Usage/Test: Add setShaderState(GL) for pre-use attachment to the GL context ; GLArrayDataClient-GLSL: Check if ShaderState is attached.
ShaderState Usage/Test: Add setShaderState(GL) for pre-use attachment to the GL context - test cases utilize ShaderState before useProgram() was invoked, hence we need an API entry to attach the ShaderState explictly GLArrayDataClient-GLSL: Check if ShaderState is attached. - catch error case of non bound ShaderState to GL context
Diffstat (limited to 'src/jogl/classes/com/jogamp/opengl/util/GLArrayDataClient.java')
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/GLArrayDataClient.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataClient.java b/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataClient.java
index ee9a21095..99500adfb 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataClient.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataClient.java
@@ -158,7 +158,15 @@ public class GLArrayDataClient extends GLArrayDataWrapper implements GLArrayData
// init/generate VBO name if not done yet
init_vbo(gl);
}
- final Object ext = usesGLSL ? ShaderState.getShaderState(gl) : null ;
+ final Object ext;
+ if(usesGLSL) {
+ ext = ShaderState.getShaderState(gl);
+ if(null == ext) {
+ throw new GLException("A ShaderState must be bound to the GL context, use 'ShaderState.setShaderState(gl)'");
+ }
+ } else {
+ ext = null;
+ }
if(enable) {
glArrayHandler.syncData(gl, true, ext);
glArrayHandler.enableState(gl, true, ext);