Package org.lwjgl.opencl

# Class CLContext

java.lang.Object
org.lwjgl.PointerWrapperAbstract
org.lwjgl.opencl.CLContext

All Implemented Interfaces:
  `PointerWrapper`

public final class CLContext extends PointerWrapperAbstract
This class is a wrapper around a cl_context pointer.

Author:
  Spasi

## Field Summary

### Fields inherited from class org.lwjgl.PointerWrapperAbstract

`pointer`

## Method Summary

Modifier and Type
Method
Description
`static CLContext`
`create(CLPlatform platform, List<CLDevice> devices, IntBuffer errcode_ret)`
Creates a new CLContext.
`static CLContext`
`create(CLPlatform platform, List<CLDevice> devices, CLContextCallback pfn_notify, IntBuffer errcode_ret)`
Creates a new CLContext.
`static CLContext`
`create(CLPlatform platform, List<CLDevice> devices, CLContextCallback pfn_notify, Drawable share_drawable, IntBuffer errcode_ret)`
Creates a new CLContext.
`static CLContext`
`createFromType(CLPlatform platform, long device_type, IntBuffer errcode_ret)`
Creates a new CLContext.
`static CLContext`
`createFromType(CLPlatform platform, long device_type, CLContextCallback pfn_notify, IntBuffer errcode_ret)`
Creates a new CLContext.
`static CLContext`
`createFromType(CLPlatform platform, long device_type, CLContextCallback pfn_notify, Drawable share_drawable, IntBuffer errcode_ret)`
Creates a new CLContext.
`CLCommandQueue`
`getCLCommandQueue(long id)`
Returns a CLCommandQueue associated with this context.
`CLEvent`
`getCLEvent(long id)`
Returns a user CLEvent associated with this context.
`CLMem`
`getCLMem(long id)`
Returns a CLMem associated with this context.
`CLProgram`
`getCLProgram(long id)`
Returns a CLProgram associated with this context.
`CLSampler`
`getCLSampler(long id)`
Returns a CLSampler associated with this context.
`List<CLDevice>`
`getInfoDevices()`
Returns the list of devices in context.
`int`
`getInfoInt(int param_name)`
Returns the integer value of the specified parameter.
`CLPlatform`
`getParent()`
`final int`
`getReferenceCount()`
`List<CLImageFormat>`
`getSupportedImageFormats(long flags, int image_type)`
`List<CLImageFormat>`
`getSupportedImageFormats(long flags, int image_type, Filter<CLImageFormat> filter)`
`final boolean`
`isValid()`
Returns true if this object represents a valid pointer.

### Methods inherited from class org.lwjgl.PointerWrapperAbstract

`checkValid, equals, getPointer, hashCode, toString`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

## Method Details

### getCLCommandQueue

public CLCommandQueue getCLCommandQueue(long id)
Returns a CLCommandQueue associated with this context.

Parameters:
  `id` - the command queue object id
Returns:
  the CLCommandQueue object

### getCLMem

public CLMem getCLMem(long id)
Returns a CLMem associated with this context.

Parameters:
  `id` - the memory object id
Returns:
  the CLMem object

### getCLSampler

public CLSampler getCLSampler(long id)
Returns a CLSampler associated with this context.

Parameters:
  `id` - the sampler object id
Returns:
  the CLSampler object

### getCLProgram

public CLProgram getCLProgram(long id)
Returns a CLProgram associated with this context.

Parameters:
  `id` - the program object id
Returns:
  the CLProgram object

### getCLEvent

public CLEvent getCLEvent(long id)
Returns a user CLEvent associated with this context.

Parameters:
  `id` - the event object id
Returns:
  the CLEvent object

### create

public static CLContext create(CLPlatform platform, List<CLDevice> devices, IntBuffer errcode_ret) throws LWJGLException
Creates a new CLContext.

Parameters:
  `platform` - the platform to use
  `devices` - the devices to use
  `errcode_ret` - the error code result
Returns:
  the new CLContext
Throws:
  `LWJGLException` - if an exception occurs while creating the context

### create

public static CLContext create(CLPlatform platform, List<CLDevice> devices, CLContextCallback pfn_notify, IntBuffer errcode_ret) throws LWJGLException
Creates a new CLContext.

Parameters:
  `platform` - the platform to use
  `devices` - the devices to use
  `pfn_notify` - the context callback function
  `errcode_ret` - the error code result
Returns:
  the new CLContext
Throws:
  `LWJGLException` - if an exception occurs while creating the context

### create

public static CLContext create(CLPlatform platform, List<CLDevice> devices, CLContextCallback pfn_notify, Drawable share_drawable, IntBuffer errcode_ret) throws LWJGLException
Creates a new CLContext.

Parameters:
  `platform` - the platform to use
  `devices` - the devices to use
  `share_drawable` - the OpenGL drawable to share objects with
  `errcode_ret` - the error code result
Returns:
  the new CLContext
Throws:
  `LWJGLException` - if an exception occurs while creating the context

### createFromType

public static CLContext createFromType(CLPlatform platform, long device_type, IntBuffer errcode_ret) throws LWJGLException
Creates a new CLContext.

Parameters:
  `platform` - the platform to use
  `device_type` - the device type to use
  `errcode_ret` - the error code result
Returns:
  the new CLContext
Throws:
  `LWJGLException` - if an exception occurs while creating the context

### createFromType

public static CLContext createFromType(CLPlatform platform, long device_type, CLContextCallback pfn_notify, IntBuffer errcode_ret) throws LWJGLException
Creates a new CLContext.

Parameters:
  `platform` - the platform to use
  `device_type` - the device type to use
  `pfn_notify` - the context callback function
  `errcode_ret` - the error code result
Returns:
  the new CLContext
Throws:
  `LWJGLException` - if an exception occurs while creating the context

### createFromType

public static CLContext createFromType(CLPlatform platform, long device_type, CLContextCallback pfn_notify, Drawable share_drawable, IntBuffer errcode_ret) throws LWJGLException
Creates a new CLContext.

Parameters:
  `platform` - the platform to use
  `device_type` - the device type to use
  `share_drawable` - the OpenGL drawable to share objects with
  `errcode_ret` - the error code result
Returns:
  the new CLContext
Throws:
  `LWJGLException` - if an exception occurs while creating the context

### getInfoInt

public int getInfoInt(int param_name)
Returns the integer value of the specified parameter.

Parameters:
  `param_name` - the parameter
Returns:
  the parameter value

### getInfoDevices

public List<CLDevice> getInfoDevices()
Returns the list of devices in context.

Returns:
  the list of devices

### getSupportedImageFormats

public List<CLImageFormat> getSupportedImageFormats(long flags, int image_type)

### getSupportedImageFormats

public List<CLImageFormat> getSupportedImageFormats(long flags, int image_type, Filter<CLImageFormat> filter)

### getParent

public CLPlatform getParent()

### getReferenceCount

public final int getReferenceCount()

### isValid

public final boolean isValid()
Description copied from class: `PointerWrapperAbstract`
Returns true if this object represents a valid pointer. The pointer might be invalid because it is NULL or because some other action has deleted the object that this pointer represents.

Overrides:
  `isValid` in class `PointerWrapperAbstract`
Returns:
  true if the pointer is valid