From 0135df38d6ccdf17283a26c9c56adb08a0e6d30e Mon Sep 17 00:00:00 2001
From: Wade Walker <wwalker3@austin.rr.com>
Date: Sun, 4 Oct 2015 14:08:22 -0500
Subject: Remove CLGL interface

This removes the last sub-interface that would have to be separately
versioned for future versions of OpenCL. After this, new OpenCL versions
will only create one new interface and one new implementation.
---
 src/com/jogamp/opencl/gl/CLGLBuffer.java    |  7 +++----
 src/com/jogamp/opencl/gl/CLGLContext.java   | 13 ++++++-------
 src/com/jogamp/opencl/gl/CLGLImage2d.java   |  4 +---
 src/com/jogamp/opencl/gl/CLGLTexture2d.java |  4 +---
 src/com/jogamp/opencl/gl/CLGLTexture3d.java |  4 +---
 5 files changed, 12 insertions(+), 20 deletions(-)

(limited to 'src/com/jogamp/opencl/gl')

diff --git a/src/com/jogamp/opencl/gl/CLGLBuffer.java b/src/com/jogamp/opencl/gl/CLGLBuffer.java
index 11d3a553..660f243f 100644
--- a/src/com/jogamp/opencl/gl/CLGLBuffer.java
+++ b/src/com/jogamp/opencl/gl/CLGLBuffer.java
@@ -32,7 +32,7 @@ import com.jogamp.opencl.CLBuffer;
 import com.jogamp.opencl.CLCommandQueue;
 import com.jogamp.opencl.CLContext;
 import com.jogamp.opencl.CLException;
-import com.jogamp.opencl.llb.gl.CLGL;
+import com.jogamp.opencl.llb.CL;
 
 import java.nio.Buffer;
 import com.jogamp.opengl.GLContext;
@@ -59,10 +59,9 @@ public final class CLGLBuffer<B extends Buffer> extends CLBuffer<B> implements C
     static <B extends Buffer> CLGLBuffer<B> create(final CLContext context, final B directBuffer, final long size, final int flags, final int glBuffer) {
         checkBuffer(directBuffer, flags);
 
-        final CLGL clgli = (CLGL)getCL(context);
-
+        final CL cl = getCL(context);
         final int[] result = new int[1];
-        final long id = clgli.clCreateFromGLBuffer(context.ID, flags, glBuffer, result, 0);
+        final long id = cl.clCreateFromGLBuffer(context.ID, flags, glBuffer, result, 0);
         CLException.checkForError(result[0], "can not create CLGLObject from glBuffer #"+glBuffer);
 
         return new CLGLBuffer<B>(context, directBuffer, id, glBuffer, size, flags);
diff --git a/src/com/jogamp/opencl/gl/CLGLContext.java b/src/com/jogamp/opencl/gl/CLGLContext.java
index e1d7d0ce..44f349cd 100644
--- a/src/com/jogamp/opencl/gl/CLGLContext.java
+++ b/src/com/jogamp/opencl/gl/CLGLContext.java
@@ -45,7 +45,6 @@ import com.jogamp.opencl.CLDevice;
 import com.jogamp.opencl.CLMemory.Mem;
 import com.jogamp.opencl.CLPlatform;
 import com.jogamp.opencl.llb.CL;
-import com.jogamp.opencl.llb.gl.CLGL;
 
 /**
  * OpenCL Context supporting JOGL-JOCL interoperablity.
@@ -164,7 +163,7 @@ public final class CLGLContext extends CLContext {
 //          create the OpenGL context."
             properties = PointerBuffer.allocateDirect(7);
             final long displayHandle = ctxImpl.getDrawableImpl().getNativeSurface().getDisplayHandle();
-            properties.put(CLGL.CL_GL_CONTEXT_KHR).put(glID[0])
+            properties.put(CL.CL_GL_CONTEXT_KHR).put(glID[0])
                       .put(CL.CL_GLX_DISPLAY_KHR).put(displayHandle)
                       .put(CL.CL_CONTEXT_PLATFORM).put(platform.ID);
         }else if(glContext instanceof WindowsWGLContext) {
@@ -174,7 +173,7 @@ public final class CLGLContext extends CLContext {
 //          HDC handle of the display used to create the OpenGL context."
             properties = PointerBuffer.allocateDirect(7);
             final long surfaceHandle = ctxImpl.getDrawableImpl().getNativeSurface().getSurfaceHandle();
-            properties.put(CLGL.CL_GL_CONTEXT_KHR).put(glID[0])
+            properties.put(CL.CL_GL_CONTEXT_KHR).put(glID[0])
                       .put(CL.CL_WGL_HDC_KHR).put(surfaceHandle)
                       .put(CL.CL_CONTEXT_PLATFORM).put(platform.ID);
         }else if(glContext instanceof MacOSXCGLContext) {
@@ -191,7 +190,7 @@ public final class CLGLContext extends CLContext {
             final long cgl = CGL.getCGLContext(glID[0]);
             final long group = CGL.CGLGetShareGroup(cgl);
             properties = PointerBuffer.allocateDirect(5);
-            properties.put(CLGL.CL_CONTEXT_PROPERTY_USE_CGL_SHAREGROUP_APPLE).put(group)
+            properties.put(CL.CL_CONTEXT_PROPERTY_USE_CGL_SHAREGROUP_APPLE).put(group)
                       .put(CL.CL_CONTEXT_PLATFORM).put(platform.ID);
         }else if(glContext instanceof EGLContext) {
 //            TODO test EGL
@@ -202,7 +201,7 @@ public final class CLGLContext extends CLContext {
 //          display used to create the OpenGL ES or OpenGL context."
             properties = PointerBuffer.allocateDirect(7);
             final long displayHandle = ctxImpl.getDrawableImpl().getNativeSurface().getDisplayHandle();
-            properties.put(CLGL.CL_GL_CONTEXT_KHR).put(glID[0])
+            properties.put(CL.CL_GL_CONTEXT_KHR).put(glID[0])
                       .put(CL.CL_EGL_DISPLAY_KHR).put(displayHandle)
                       .put(CL.CL_CONTEXT_PLATFORM).put(platform.ID);
         }else{
@@ -318,8 +317,8 @@ public final class CLGLContext extends CLContext {
      * Return the low level OpenCL interface with OpenGL interoperability.
      */
     @Override
-    public CLGL getCL() {
-        return (CLGL)super.getCL();
+    public CL getCL() {
+        return super.getCL();
     }
 
     /**
diff --git a/src/com/jogamp/opencl/gl/CLGLImage2d.java b/src/com/jogamp/opencl/gl/CLGLImage2d.java
index 67616542..2422af93 100644
--- a/src/com/jogamp/opencl/gl/CLGLImage2d.java
+++ b/src/com/jogamp/opencl/gl/CLGLImage2d.java
@@ -29,7 +29,6 @@
 package com.jogamp.opencl.gl;
 
 import com.jogamp.opencl.llb.CL;
-import com.jogamp.opencl.llb.gl.CLGL;
 import com.jogamp.opencl.CLContext;
 import com.jogamp.opencl.CLException;
 import com.jogamp.opencl.CLImage2d;
@@ -62,9 +61,8 @@ public class CLGLImage2d<B extends Buffer> extends CLImage2d<B> implements CLGLO
 
         final CL cl = getCL(context);
         final int[] result = new int[1];
-        final CLGL clgli = (CLGL)cl;
 
-        final long id = clgli.clCreateFromGLRenderbuffer(context.ID, flags, renderbuffer, result, 0);
+        final long id = cl.clCreateFromGLRenderbuffer(context.ID, flags, renderbuffer, result, 0);
         CLException.checkForError(result[0], "can not create CLGLImage2d from renderbuffer #"+renderbuffer+".");
 
         return createImage(context, id, directBuffer, renderbuffer, flags);
diff --git a/src/com/jogamp/opencl/gl/CLGLTexture2d.java b/src/com/jogamp/opencl/gl/CLGLTexture2d.java
index 9b68e524..7cc591fa 100644
--- a/src/com/jogamp/opencl/gl/CLGLTexture2d.java
+++ b/src/com/jogamp/opencl/gl/CLGLTexture2d.java
@@ -33,7 +33,6 @@ import com.jogamp.opencl.CLContext;
 import com.jogamp.opencl.CLException;
 import com.jogamp.opencl.CLImageFormat;
 import com.jogamp.opencl.llb.impl.CLImageFormatImpl;
-import com.jogamp.opencl.llb.gl.CLGL;
 
 import java.nio.Buffer;
 
@@ -59,9 +58,8 @@ public class CLGLTexture2d<B extends Buffer> extends CLGLImage2d<B> implements C
 
         final CL cl = getCL(context);
         final int[] result = new int[1];
-        final CLGL clgli = (CLGL)cl;
 
-        final long id = clgli.clCreateFromGLTexture2D(context.ID, flags, target, mipLevel, texture, result, 0);
+        final long id = cl.clCreateFromGLTexture2D(context.ID, flags, target, mipLevel, texture, result, 0);
         CLException.checkForError(result[0], "can not create CLGLTexture2d from texture #"+texture+".");
 
         final CLImageInfoAccessor accessor = new CLImageInfoAccessor(cl, id);
diff --git a/src/com/jogamp/opencl/gl/CLGLTexture3d.java b/src/com/jogamp/opencl/gl/CLGLTexture3d.java
index 24893dd1..d61c4553 100644
--- a/src/com/jogamp/opencl/gl/CLGLTexture3d.java
+++ b/src/com/jogamp/opencl/gl/CLGLTexture3d.java
@@ -28,7 +28,6 @@
 
 package com.jogamp.opencl.gl;
 
-import com.jogamp.opencl.llb.gl.CLGL;
 import com.jogamp.opencl.llb.CL;
 import com.jogamp.opencl.CLContext;
 import com.jogamp.opencl.CLException;
@@ -68,9 +67,8 @@ public class CLGLTexture3d<B extends Buffer> extends CLImage3d<B> implements CLG
 
         final CL cl = getCL(context);
         final int[] result = new int[1];
-        final CLGL clgli = (CLGL)cl;
 
-        final long id = clgli.clCreateFromGLTexture3D(context.ID, flags, target, mipLevel, texture, result, 0);
+        final long id = cl.clCreateFromGLTexture3D(context.ID, flags, target, mipLevel, texture, result, 0);
         CLException.checkForError(result[0], "can not create CLGLTexture3d from texture #"+texture+".");
 
         final CLImageInfoAccessor accessor = new CLImageInfoAccessor(cl, id);
-- 
cgit v1.2.3