From a3c9e4f61181998b3672fa5d84747ad4ea67b50f Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner <inform@tiker.net> Date: Thu, 28 Jan 2016 17:57:06 -0600 Subject: [PATCH] Fix for GL interop from Kevin Jones (Issue #109) --- pyopencl/cffi_cl.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pyopencl/cffi_cl.py b/pyopencl/cffi_cl.py index 181699e4..2b659bde 100644 --- a/pyopencl/cffi_cl.py +++ b/pyopencl/cffi_cl.py @@ -625,10 +625,9 @@ def _parse_context_properties(properties): 'CGL_SHAREGROUP_KHR', )]: - import ctypes - if isinstance(value, ctypes._Pointer): - import struct - val, = struct.unpack("P", bytes(memoryview(value))) + from ctypes import _Pointer, addressof + if isinstance(value, _Pointer): + val = addressof(value) else: val = int(value) -- GitLab