[PyOpenCL] OpenGL context auto-detection

Paolo Simone Gasparello djgaspa at gmail.com
Wed Jul 28 02:44:26 PDT 2010


I wrote this patch to facilitate the creation of an OpenCL context with
GL sharing capabilities.

I add the function gl_context_properties() which tries to detect a valid
OpenGL context. If found, an array of cl context properties is returned.

The current operating system and respective flags are automatically
detected, so the programmer does not have to think about it.

I modified the function create_some_context to try to add those flags
when creating a new context. In other words, if you call
create_some_context inside a yet valid OpenGL context, a GL sharing
environment should be automatically created. (MAC NOT TESTED)

Let me know if you think this patch could be useful, critiques and
suggestions are well accepted :)

-- 
Paolo Simone Gasparello
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pyopencl.patch
Type: text/x-patch
Size: 928 bytes
Desc: not available
URL: <http://lists.tiker.net/pipermail/pyopencl/attachments/20100728/f782a21b/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 262 bytes
Desc: OpenPGP digital signature
URL: <http://lists.tiker.net/pipermail/pyopencl/attachments/20100728/f782a21b/attachment.pgp>


More information about the PyOpenCL mailing list