summaryrefslogtreecommitdiffstats
path: root/src/com/jogamp/opencl/gl
diff options
context:
space:
mode:
authorMichael Bien <[email protected]>2010-04-24 05:01:43 +0200
committerMichael Bien <[email protected]>2010-04-24 05:01:43 +0200
commit7543640d906f7ae2339faa40d0fc019c7a787593 (patch)
tree584d9f0624f35bfa07c067d90c962210e348995b /src/com/jogamp/opencl/gl
parentbec58034b631656d3ec436ea350fa1652a8f9195 (diff)
CLGLContext.create() makes GLContext current.
made CLContext.release() more bulletproof. added CLGLTest.
Diffstat (limited to 'src/com/jogamp/opencl/gl')
-rw-r--r--src/com/jogamp/opencl/gl/CLGLContext.java18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/com/jogamp/opencl/gl/CLGLContext.java b/src/com/jogamp/opencl/gl/CLGLContext.java
index f8ca92f3..7b574664 100644
--- a/src/com/jogamp/opencl/gl/CLGLContext.java
+++ b/src/com/jogamp/opencl/gl/CLGLContext.java
@@ -31,6 +31,8 @@ public final class CLGLContext extends CLContext {
/**
* Creates a shared context on all available devices (CL_DEVICE_TYPE_ALL).
+ * Note: This will make the GLContext current.
+ * @see GLContext#makeCurrent()
*/
public static CLGLContext create(GLContext glContext) {
return create(glContext, (CLPlatform)null, CLDevice.Type.ALL);
@@ -38,6 +40,8 @@ public final class CLGLContext extends CLContext {
/**
* Creates a shared context on the specified platform on all available devices (CL_DEVICE_TYPE_ALL).
+ * Note: This will make the GLContext current.
+ * @see GLContext#makeCurrent()
*/
public static CLGLContext create(GLContext glContext, CLPlatform platform) {
return create(glContext, platform, CLDevice.Type.ALL);
@@ -46,6 +50,8 @@ public final class CLGLContext extends CLContext {
/**
* Creates a shared context on the specified platform and with the specified
* device types.
+ * Note: This will make the GLContext current.
+ * @see GLContext#makeCurrent()
*/
public static CLGLContext create(GLContext glContext, CLDevice.Type... deviceTypes) {
return create(glContext, null, deviceTypes);
@@ -54,6 +60,8 @@ public final class CLGLContext extends CLContext {
/**
* Creates a shared context on the specified devices.
* The platform to be used is implementation dependent.
+ * Note: This will make the GLContext current.
+ * @see GLContext#makeCurrent()
*/
public static CLGLContext create(GLContext glContext, CLDevice... devices) {
return create(glContext, null, devices);
@@ -62,6 +70,8 @@ public final class CLGLContext extends CLContext {
/**
* Creates a shared context on the specified platform and with the specified
* device types.
+ * Note: This will make the GLContext current.
+ * @see GLContext#makeCurrent()
*/
public static CLGLContext create(GLContext glContext, CLPlatform platform, CLDevice.Type... deviceTypes) {
@@ -80,6 +90,8 @@ public final class CLGLContext extends CLContext {
/**
* Creates a shared context on the specified platform and with the specified
* devices.
+ * Note: This will make the GLContext current.
+ * @see GLContext#makeCurrent()
*/
public static CLGLContext create(GLContext glContext, CLPlatform platform, CLDevice... devices) {
@@ -106,6 +118,12 @@ public final class CLGLContext extends CLContext {
if(platform == null) {
throw new RuntimeException("no OpenCL installation found");
}
+ if(glContext == null) {
+ throw new IllegalArgumentException("GLContext was null.");
+ }
+
+ // context must be current
+ glContext.makeCurrent();
GLContextImpl ctxImpl = (GLContextImpl)glContext;