# CLContext (LWJGL API)
Date: 2015-07-28

## 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
`static CLContext` `create(CLPlatform platform, java.util.List<CLDevice> devices, CLContextCallback pfn_notify, Drawable share_drawable, java.nio.IntBuffer errcode_ret)` Creates a new CLContext.
`static CLContext` `create(CLPlatform platform, java.util.List<CLDevice> devices, CLContextCallback pfn_notify, java.nio.IntBuffer errcode_ret)` Creates a new CLContext.
`static CLContext` `create(CLPlatform platform, java.util.List<CLDevice> devices, java.nio.IntBuffer errcode_ret)` Creates a new CLContext.
`static CLContext` `createFromType(CLPlatform platform, long device_type, CLContextCallback pfn_notify, Drawable share_drawable, java.nio.IntBuffer errcode_ret)` Creates a new CLContext.
`static CLContext` `createFromType(CLPlatform platform, long device_type, CLContextCallback pfn_notify, java.nio.IntBuffer errcode_ret)` Creates a new CLContext.
`static CLContext` `createFromType(CLPlatform platform, long device_type, java.nio.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.
`java.util.List<CLDevice>` `getInfoDevices()` Returns the list of devices in context.
`int` `getInfoInt(int param_name)` Returns the integer value of the specified parameter.
`P` `getParent()`
`int` `getReferenceCount()`
`java.util.List<CLImageFormat>` `getSupportedImageFormats(long flags, int image_type)`
`java.util.List<CLImageFormat>` `getSupportedImageFormats(long flags, int image_type, Filter<CLImageFormat> filter)`
`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 Detail

### 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,
                                   java.util.List<CLDevice> devices,
                                   java.nio.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,
                                   java.util.List<CLDevice> devices,
                                   CLContextCallback pfn_notify,
                                   java.nio.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,
                                   java.util.List<CLDevice> devices,
                                   CLContextCallback pfn_notify,
                                   Drawable share_drawable,
                                   java.nio.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,
                                           java.nio.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,
                                           java.nio.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,
                                           java.nio.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 java.util.List<CLDevice> getInfoDevices()

  Returns the list of devices in context.

  Returns:
    the list of devices

### getSupportedImageFormats

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

### getSupportedImageFormats

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

### getParent

    public P 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

Copyright © 2002-2009 lwjgl.org. All Rights Reserved.