Skip to content

Commit

Permalink
(Not just OS X) GL interop fixes from Gregor Thalhammer
Browse files Browse the repository at this point in the history
  • Loading branch information
inducer committed Aug 24, 2015
1 parent 671ad7f commit 9c38a41
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
15 changes: 14 additions & 1 deletion pyopencl/__init__.py
Expand Up @@ -149,7 +149,6 @@
_GLObject,
GLBuffer,
GLRenderBuffer,
_create_gl_enqueue,

ImageFormat,
get_supported_image_formats,
Expand All @@ -160,6 +159,20 @@
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

Expand Down
5 changes: 2 additions & 3 deletions pyopencl/cffi_cl.py
Expand Up @@ -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]


Expand Down

0 comments on commit 9c38a41

Please sign in to comment.