# OpenCL Runtime: OpenGL Interoperability

Functionality in this section is only available when PyOpenCL is compiled with GL support. See `have_gl()`.

Added in version 0.91.

pyopencl.have_gl()

  Return True if PyOpenCL was compiled with OpenGL interoperability, otherwise False.

pyopencl.get_gl_sharing_context_properties()

  Return a `list` of `context_properties` that will allow a newly created context to share the currently active GL context.

pyopencl.get_apple_cgl_share_group()

  Get share group handle for current CGL context.

  Apple OS X only.

  Added in version 2011.1.

class pyopencl.GLBuffer(context, flags, bufobj)

  `GLBuffer` inherits from `MemoryObject`.

  gl_object

class pyopencl.GLRenderBuffer(context, flags, bufobj)

  `GLRenderBuffer` inherits from `MemoryObject`.

  gl_object

class pyopencl.GLTexture(context, flags, texture_target, miplevel, texture, dims)

  `GLTexture` inherits from `Image`. Only available in OpenCL 1.2 and newer.

  gl_object
  get_gl_texture_info(param)

    See `gl_texture_info` for values of param. Only available when PyOpenCL is compiled with GL support. See `have_gl()`.

pyopencl.enqueue_acquire_gl_objects(queue, mem_objects, wait_for=None)

  mem_objects is a list of `MemoryObject` instances. Returns a new `pyopencl.Event`. wait_for may either be None or a list of `pyopencl.Event` instances for whose completion this command waits before starting execution.

pyopencl.enqueue_release_gl_objects(queue, mem_objects, wait_for=None)

  mem_objects is a list of `MemoryObject` instances. Returns a new `pyopencl.Event`. wait_for may either be None or a list of `pyopencl.Event` instances for whose completion this command waits before starting execution.

pyopencl.get_gl_context_info_khr(properties, param_name, platform=None)

  Get information on which CL device corresponds to a given GL/EGL/WGL/CGL device.

  See the `Context` constructor for the meaning of properties and `gl_context_info` for param_name.

  Changed in version 2011.2: Accepts the platform argument. Using platform equal to None is deprecated as of PyOpenCL 2011.2.