summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
Diffstat (limited to 'src/com')
-rw-r--r--src/com/jogamp/opencl/gl/CLGLContext.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/com/jogamp/opencl/gl/CLGLContext.java b/src/com/jogamp/opencl/gl/CLGLContext.java
index ac1e5da7..1c6069b9 100644
--- a/src/com/jogamp/opencl/gl/CLGLContext.java
+++ b/src/com/jogamp/opencl/gl/CLGLContext.java
@@ -120,7 +120,10 @@ public final class CLGLContext extends CLContext {
}
// context must be current
- glContext.makeCurrent();
+ if(!glContext.isCurrent()) {
+ throw new IllegalArgumentException("OpenGL context is not current,\n"+
+ " creating a OpenCL context for context sharing is not allowed in this situation.");
+ }
GLContextImpl ctxImpl = (GLContextImpl)glContext;
glID[0] = glContext.getHandle();