Package com.jogamp.opencl.gl
Class CLGLContext
- java.lang.Object
-
- com.jogamp.opencl.CLObject
-
- com.jogamp.opencl.CLContext
-
- com.jogamp.opencl.gl.CLGLContext
-
- All Implemented Interfaces:
AutoCloseable
,CLResource
,AutoCloseable
public final class CLGLContext extends CLContext
OpenCL Context supporting JOGL-JOCL interoperablity.- Author:
- Michael Bien, et al.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.jogamp.opencl.CLContext
CLContext.ErrorDispatcher
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
close()
Deprecated.This method is not intended to be called from client code.static CLGLContext
create(com.jogamp.opengl.GLContext glContext)
Creates a shared context on all available devices (CL_DEVICE_TYPE_ALL).static CLGLContext
create(com.jogamp.opengl.GLContext glContext, CLDevice.Type... deviceTypes)
Creates a shared context on the specified platform and with the specified device types.static CLGLContext
create(com.jogamp.opengl.GLContext glContext, CLDevice... devices)
Creates a shared context on the specified platform and with the specified devices.static CLGLContext
create(com.jogamp.opengl.GLContext glContext, CLPlatform platform)
Creates a shared context on the specified platform on all available devices (CL_DEVICE_TYPE_ALL).static CLGLContext
create(com.jogamp.opengl.GLContext glContext, CLPlatform platform, CLDevice.Type... deviceTypes)
Creates a shared context on the specified platform and with the specified device types.CLGLBuffer<?>
createFromGLBuffer(int glBuffer, long glBufferSize, int flags)
Creates a CLGLBuffer for memory sharing with the specified OpenGL buffer.CLGLBuffer<?>
createFromGLBuffer(int glBuffer, long glBufferSize, CLMemory.Mem... flags)
Creates a CLGLBuffer for memory sharing with the specified OpenGL buffer.<B extends Buffer>
CLGLBuffer<B>createFromGLBuffer(B directBuffer, int glBuffer, long glBufferSize, int flags)
Creates a CLGLBuffer for memory sharing with the specified OpenGL buffer.<B extends Buffer>
CLGLBuffer<B>createFromGLBuffer(B directBuffer, int glBuffer, long glBufferSize, CLMemory.Mem... flags)
Creates a CLGLBuffer for memory sharing with the specified OpenGL buffer.CLGLImage2d<?>
createFromGLRenderbuffer(int glBuffer, int flags)
CLGLImage2d<?>
createFromGLRenderbuffer(int glBuffer, CLMemory.Mem... flags)
<B extends Buffer>
CLGLImage2d<B>createFromGLRenderbuffer(B directBuffer, int glBuffer, int flags)
<B extends Buffer>
CLGLImage2d<B>createFromGLRenderbuffer(B directBuffer, int glBuffer, CLMemory.Mem... flags)
CLGLTexture2d<?>
createFromGLTexture2d(int target, int texture, int mipmap, int flags)
CLGLTexture2d<?>
createFromGLTexture2d(int target, int texture, int mipmap, CLMemory.Mem... flags)
<B extends Buffer>
CLGLTexture2d<B>createFromGLTexture2d(B directBuffer, int target, int texture, int mipmap, int flags)
<B extends Buffer>
CLGLTexture2d<B>createFromGLTexture2d(B directBuffer, int target, int texture, int mipmap, CLMemory.Mem... flags)
CLGLTexture3d<?>
createFromGLTexture3d(int target, int texture, int mipmap, int flags)
CLGLTexture3d<?>
createFromGLTexture3d(int target, int texture, int mipmap, CLMemory.Mem... flags)
<B extends Buffer>
CLGLTexture3d<B>createFromGLTexture3d(B directBuffer, int target, int texture, int mipmap, int flags)
<B extends Buffer>
CLGLTexture3d<B>createFromGLTexture3d(B directBuffer, int target, int texture, int mipmap, CLMemory.Mem... flags)
CL
getCL()
Return the low level OpenCL interface with OpenGL interoperability.CLGLContext
getContext()
Returns the context for this OpenCL object.com.jogamp.opengl.GLContext
getGLContext()
Returns the OpenGL context this context was shared with.boolean
isReleased()
Returns true ifCLResource.release()
has been called.-
Methods inherited from class com.jogamp.opencl.CLContext
addCLErrorHandler, create, create, create, create, create, createBuffer, createBuffer, createBuffer, createBuffer, createByteBuffer, createByteBuffer, createContext, createContextFromType, createDoubleBuffer, createErrorHandler, createFloatBuffer, createImage2d, createImage2d, createImage2d, createImage2d, createImage3d, createImage3d, createImage3d, createImage3d, createIntBuffer, createLongBuffer, createProgram, createProgram, createProgram, createSampler, createShortBuffer, equals, getDevices, getMaxFlopsDevice, getMaxFlopsDevice, getMaxMemBaseAddrAlign, getMemoryObjects, getPlatform, getPrograms, getSamplers, getSupportedImage2dFormats, getSupportedImage3dFormats, hashCode, overrideContext, release, removeCLErrorHandler, toDeviceBitmap, toString
-
-
-
-
Method Detail
-
create
public static CLGLContext create(com.jogamp.opengl.GLContext glContext)
Creates a shared context on all available devices (CL_DEVICE_TYPE_ALL).- See Also:
GLContext.makeCurrent()
-
create
public static CLGLContext create(com.jogamp.opengl.GLContext glContext, CLPlatform platform)
Creates a shared context on the specified platform on all available devices (CL_DEVICE_TYPE_ALL).- See Also:
GLContext.makeCurrent()
-
create
public static CLGLContext create(com.jogamp.opengl.GLContext glContext, CLDevice.Type... deviceTypes)
Creates a shared context on the specified platform and with the specified device types.- See Also:
GLContext.makeCurrent()
-
create
public static CLGLContext create(com.jogamp.opengl.GLContext glContext, CLPlatform platform, CLDevice.Type... deviceTypes)
Creates a shared context on the specified platform and with the specified device types.- See Also:
GLContext.makeCurrent()
-
create
public static CLGLContext create(com.jogamp.opengl.GLContext glContext, CLDevice... devices)
Creates a shared context on the specified platform and with the specified devices.- See Also:
GLContext.makeCurrent()
-
createFromGLBuffer
public final CLGLBuffer<?> createFromGLBuffer(int glBuffer, long glBufferSize, CLMemory.Mem... flags)
Creates a CLGLBuffer for memory sharing with the specified OpenGL buffer.- Parameters:
glBuffer
- The OpenGL buffer handle like a vertex buffer or pixel buffer object.glBufferSize
- The size of the OpenGL buffer in bytesflags
- optional flags.
-
createFromGLBuffer
public final CLGLBuffer<?> createFromGLBuffer(int glBuffer, long glBufferSize, int flags)
Creates a CLGLBuffer for memory sharing with the specified OpenGL buffer.- Parameters:
glBuffer
- The OpenGL buffer handle like a vertex buffer or pixel buffer object.glBufferSize
- The size of the OpenGL buffer in bytesflags
- optional flags.
-
createFromGLBuffer
public final <B extends Buffer> CLGLBuffer<B> createFromGLBuffer(B directBuffer, int glBuffer, long glBufferSize, CLMemory.Mem... flags)
Creates a CLGLBuffer for memory sharing with the specified OpenGL buffer.- Parameters:
directBuffer
- A direct allocated NIO buffer for data transfers between java and OpenCL.glBuffer
- The OpenGL buffer handle like a vertex buffer or pixel buffer object.glBufferSize
- The size of the OpenGL buffer in bytesflags
- optional flags.
-
createFromGLBuffer
public final <B extends Buffer> CLGLBuffer<B> createFromGLBuffer(B directBuffer, int glBuffer, long glBufferSize, int flags)
Creates a CLGLBuffer for memory sharing with the specified OpenGL buffer.- Parameters:
directBuffer
- A direct allocated NIO buffer for data transfers between java and OpenCL.glBuffer
- The OpenGL buffer handle like a vertex buffer or pixel buffer object.glBufferSize
- The size of the OpenGL buffer in bytesflags
- optional flags.
-
createFromGLRenderbuffer
public final CLGLImage2d<?> createFromGLRenderbuffer(int glBuffer, CLMemory.Mem... flags)
-
createFromGLRenderbuffer
public final CLGLImage2d<?> createFromGLRenderbuffer(int glBuffer, int flags)
-
createFromGLRenderbuffer
public final <B extends Buffer> CLGLImage2d<B> createFromGLRenderbuffer(B directBuffer, int glBuffer, CLMemory.Mem... flags)
-
createFromGLRenderbuffer
public final <B extends Buffer> CLGLImage2d<B> createFromGLRenderbuffer(B directBuffer, int glBuffer, int flags)
-
createFromGLTexture2d
public final CLGLTexture2d<?> createFromGLTexture2d(int target, int texture, int mipmap, CLMemory.Mem... flags)
-
createFromGLTexture2d
public final CLGLTexture2d<?> createFromGLTexture2d(int target, int texture, int mipmap, int flags)
-
createFromGLTexture2d
public final <B extends Buffer> CLGLTexture2d<B> createFromGLTexture2d(B directBuffer, int target, int texture, int mipmap, CLMemory.Mem... flags)
-
createFromGLTexture2d
public final <B extends Buffer> CLGLTexture2d<B> createFromGLTexture2d(B directBuffer, int target, int texture, int mipmap, int flags)
-
createFromGLTexture3d
public final CLGLTexture3d<?> createFromGLTexture3d(int target, int texture, int mipmap, CLMemory.Mem... flags)
-
createFromGLTexture3d
public final CLGLTexture3d<?> createFromGLTexture3d(int target, int texture, int mipmap, int flags)
-
createFromGLTexture3d
public final <B extends Buffer> CLGLTexture3d<B> createFromGLTexture3d(B directBuffer, int target, int texture, int mipmap, CLMemory.Mem... flags)
-
createFromGLTexture3d
public final <B extends Buffer> CLGLTexture3d<B> createFromGLTexture3d(B directBuffer, int target, int texture, int mipmap, int flags)
-
getCL
public CL getCL()
Return the low level OpenCL interface with OpenGL interoperability.
-
getGLContext
public com.jogamp.opengl.GLContext getGLContext()
Returns the OpenGL context this context was shared with.
-
getContext
public CLGLContext getContext()
Description copied from class:CLObject
Returns the context for this OpenCL object.- Overrides:
getContext
in classCLContext
-
close
@Deprecated public final void close()
Deprecated.This method is not intended to be called from client code.Implementation detail, satisfyingAutoCloseable
. Might be remove as soon we have extension methods, but shall validate with Java 1.5 specs.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceAutoCloseable
- See Also:
AutoCloseable
-
isReleased
public boolean isReleased()
Description copied from interface:CLResource
Returns true ifCLResource.release()
has been called.- Specified by:
isReleased
in interfaceCLResource
-
-