summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMichael Bien <[email protected]>2011-04-26 21:29:40 +0200
committerMichael Bien <[email protected]>2011-04-26 21:29:40 +0200
commit7d44ee784ffa59146d2d1d124f5ffc482fb0f5f0 (patch)
tree4236ea1fdda5f7b423a457f7fb8dc8c058d9a060 /src
parent5e3020e831a4b5fc04843db88642097b2ad072a9 (diff)
using CL_CGL sharegroup for context creation on mac + enabled CLGLTest on mac
Diffstat (limited to 'src')
-rw-r--r--src/com/jogamp/opencl/gl/CLGLContext.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/com/jogamp/opencl/gl/CLGLContext.java b/src/com/jogamp/opencl/gl/CLGLContext.java
index 6482f041..ee6c2108 100644
--- a/src/com/jogamp/opencl/gl/CLGLContext.java
+++ b/src/com/jogamp/opencl/gl/CLGLContext.java
@@ -37,6 +37,7 @@ import com.jogamp.common.nio.NativeSizeBuffer;
import jogamp.opengl.GLContextImpl;
import jogamp.opengl.egl.EGLContext;
import jogamp.opengl.macosx.cgl.MacOSXCGLContext;
+import jogamp.opengl.macosx.cgl.CGL;
import jogamp.opengl.windows.wgl.WindowsWGLContext;
import jogamp.opengl.x11.glx.X11GLXContext;
import javax.media.opengl.GLContext;
@@ -174,12 +175,13 @@ public final class CLGLContext extends CLContext {
.put(CL_WGL_HDC_KHR).put(surfaceHandle)
.put(CL_CONTEXT_PLATFORM).put(platform.ID);
}else if(glContext instanceof MacOSXCGLContext) {
-// TODO test on mac
// spec: "When the CGL binding API is supported, the attribute
// CL_CGL_SHAREGROUP_KHR should be set to a CGLShareGroup handle to
// a CGL share group object."
+ long cgl = CGL.getCGLContext(glID[0]);
+ long group = CGL.CGLGetShareGroup(cgl);
properties = NativeSizeBuffer.allocateDirect(5);
- properties.put(CL_CGL_SHAREGROUP_KHR).put(glID[0])
+ properties.put(CL_CGL_SHAREGROUP_KHR).put(group)
.put(CL_CONTEXT_PLATFORM).put(platform.ID);
}else if(glContext instanceof EGLContext) {
// TODO test EGL