diff --git a/pyopencl/__init__.py b/pyopencl/__init__.py index 156a4de18e953151291bce504daf4649c5d755d7..6b678b377afd41842317d7dedc4ede8d966f7009 100644 --- a/pyopencl/__init__.py +++ b/pyopencl/__init__.py @@ -149,7 +149,6 @@ from pyopencl.cffi_cl import ( # noqa _GLObject, GLBuffer, GLRenderBuffer, - _create_gl_enqueue, ImageFormat, get_supported_image_formats, @@ -160,6 +159,20 @@ from pyopencl.cffi_cl import ( # noqa GLTexture, ) +if _cl.have_gl(): + try: + from pyopencl.cffi_cl import get_apple_cgl_share_group # noqa + except ImportError: + pass + + try: + from pyopencl.cffi_cl import ( # noqa + enqueue_acquire_gl_objects, + enqueue_release_gl_objects, + ) + except ImportError: + pass + import inspect as _inspect diff --git a/pyopencl/cffi_cl.py b/pyopencl/cffi_cl.py index dbbe762a12f58b2189ae168808cf8b11b261b76d..f2c9206378a2b898ad0602905d743ce7469a2c29 100644 --- a/pyopencl/cffi_cl.py +++ b/pyopencl/cffi_cl.py @@ -1598,11 +1598,10 @@ class GLBuffer(MemoryObject, _GLObject): _id = 'gl_buffer' def __init__(self, context, flags, bufobj): - MemoryObject.__init__(self, bufobj) - c_buf, bufsize, retained = self._handle_buf_flags(flags) + MemoryObject.__init__(self) ptr = _ffi.new('clobj_t*') _handle_error(_lib.create_from_gl_buffer( - ptr, context.ptr, flags, c_buf)) + ptr, context.ptr, flags, bufobj)) self.ptr = ptr[0]