summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/com/jogamp/opencl/gl/CLGLContext.java6
-rw-r--r--test/com/jogamp/opencl/gl/CLGLTest.java8
2 files changed, 5 insertions, 9 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
diff --git a/test/com/jogamp/opencl/gl/CLGLTest.java b/test/com/jogamp/opencl/gl/CLGLTest.java
index aba827e7..464f1468 100644
--- a/test/com/jogamp/opencl/gl/CLGLTest.java
+++ b/test/com/jogamp/opencl/gl/CLGLTest.java
@@ -33,7 +33,6 @@
package com.jogamp.opencl.gl;
import com.jogamp.common.nio.Buffers;
-import com.jogamp.common.os.Platform;
import com.jogamp.opencl.CLCommandQueue;
import javax.media.opengl.GL2;
import javax.media.opengl.GLException;
@@ -77,11 +76,6 @@ public class CLGLTest {
public static void initGL() {
GLProfile.initSingleton(true);
- // FIXME remove when JOCL is stabelized on mac
- if(Platform.getOS().toLowerCase().contains("mac")) {
- fail("quick exit to prevent deadlock");
- }
-
Display display = NewtFactory.createDisplay(null); // local display
assertNotNull(display);
@@ -215,7 +209,7 @@ public class CLGLTest {
while(clData.hasRemaining()) {
assertEquals(glData.get(), clData.get());
}
-
+
out.println(clBuffer);
clBuffer.release();