diff options
-rw-r--r-- | src/com/jogamp/opencl/gl/CLGLContext.java | 6 | ||||
-rw-r--r-- | test/com/jogamp/opencl/gl/CLGLTest.java | 17 |
2 files changed, 12 insertions, 11 deletions
diff --git a/src/com/jogamp/opencl/gl/CLGLContext.java b/src/com/jogamp/opencl/gl/CLGLContext.java index 74da453d..ac1e5da7 100644 --- a/src/com/jogamp/opencl/gl/CLGLContext.java +++ b/src/com/jogamp/opencl/gl/CLGLContext.java @@ -133,7 +133,7 @@ public final class CLGLContext extends CLContext { // set to the Display handle of the X Window System display used to // create the OpenGL context." properties = PointerBuffer.allocateDirect(7); - long displayHandle = ctxImpl.getDrawableImpl().getNativeWindow().getDisplayHandle(); + long displayHandle = ctxImpl.getDrawableImpl().getNativeSurface().getDisplayHandle(); properties.put(CL_GL_CONTEXT_KHR).put(glID[0]) .put(CL_GLX_DISPLAY_KHR).put(displayHandle) .put(CL_CONTEXT_PLATFORM).put(platform.ID); @@ -143,7 +143,7 @@ public final class CLGLContext extends CLContext { // context, and the attribute CL_WGL_HDC_KHR should be set to the // HDC handle of the display used to create the OpenGL context." properties = PointerBuffer.allocateDirect(7); - long surfaceHandle = ctxImpl.getDrawableImpl().getNativeWindow().getSurfaceHandle(); + long surfaceHandle = ctxImpl.getDrawableImpl().getNativeSurface().getSurfaceHandle(); properties.put(CL_GL_CONTEXT_KHR).put(glID[0]) .put(CL_WGL_HDC_KHR).put(surfaceHandle) .put(CL_CONTEXT_PLATFORM).put(platform.ID); @@ -163,7 +163,7 @@ public final class CLGLContext extends CLContext { // CL_EGL_DISPLAY_KHR should be set to the EGLDisplay handle of the // display used to create the OpenGL ES or OpenGL context." properties = PointerBuffer.allocateDirect(7); - long displayHandle = ctxImpl.getDrawableImpl().getNativeWindow().getDisplayHandle(); + long displayHandle = ctxImpl.getDrawableImpl().getNativeSurface().getDisplayHandle(); properties.put(CL_GL_CONTEXT_KHR).put(glID[0]) .put(CL_EGL_DISPLAY_KHR).put(displayHandle) .put(CL_CONTEXT_PLATFORM).put(platform.ID); diff --git a/test/com/jogamp/opencl/gl/CLGLTest.java b/test/com/jogamp/opencl/gl/CLGLTest.java index bcd6342d..f8cd28d5 100644 --- a/test/com/jogamp/opencl/gl/CLGLTest.java +++ b/test/com/jogamp/opencl/gl/CLGLTest.java @@ -18,8 +18,6 @@ import com.jogamp.opencl.CLContext; import com.jogamp.opencl.CLPlatform; import javax.media.opengl.GLCapabilities; import javax.media.opengl.GLProfile; -import org.junit.AfterClass; -import org.junit.BeforeClass; import javax.media.opengl.GLContext; import org.junit.Test; @@ -38,10 +36,9 @@ public class CLGLTest { private static GLContext glcontext; private static GLWindow glWindow; - @BeforeClass +// @BeforeClass public static void init() { - - GLProfile.initSingleton(); + GLProfile.initSingleton(true); // FIXME remove when JOCL is stabelized on mac if(Platform.getOS().toLowerCase().contains("mac")) { @@ -65,15 +62,14 @@ public class CLGLTest { glWindow.setVisible(true); glcontext = glWindow.getContext(); - glcontext.makeCurrent(); +// glcontext.makeCurrent(); out.println("useing glcontext:"); out.println(glcontext); } - @AfterClass +// @AfterClass public static void release() { if(glcontext!= null) { - glcontext.destroy(); glcontext = null; } } @@ -81,6 +77,8 @@ public class CLGLTest { @Test public void createContextTest() { + init(); + out.println(" - - - glcl; createContextTest - - - "); CLDevice[] devices = CLPlatform.getDefault().listCLDevices(); @@ -116,7 +114,10 @@ public class CLGLTest { context.release(); } + glcontext.destroy(); + + release(); } |