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
listofcontext_propertiesthat will allow a newly created context to share the currently active GL context.
Get share group handle for current CGL context.
Apple OS X only.
Added in version 2011.1.
- class pyopencl.GLBuffer(context, flags, bufobj)¶
GLBufferinherits fromMemoryObject.- gl_object¶
- class pyopencl.GLRenderBuffer(context, flags, bufobj)¶
GLRenderBufferinherits fromMemoryObject.- gl_object¶
- class pyopencl.GLTexture(context, flags, texture_target, miplevel, texture, dims)¶
GLTextureinherits fromImage. Only available in OpenCL 1.2 and newer.- gl_object¶
- pyopencl.enqueue_acquire_gl_objects(queue, mem_objects, wait_for=None)¶
mem_objects is a list of
MemoryObjectinstances. Returns a newpyopencl.Event. wait_for may either be None or a list ofpyopencl.Eventinstances 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
MemoryObjectinstances. Returns a newpyopencl.Event. wait_for may either be None or a list ofpyopencl.Eventinstances 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
Contextconstructor for the meaning of properties andgl_context_infofor param_name.Changed in version 2011.2: Accepts the platform argument. Using platform equal to None is deprecated as of PyOpenCL 2011.2.