On Wed, 28 Jul 2010 11:44:26 +0200, Paolo Simone Gasparello <djgaspa(a)gmail.com>
I wrote this patch to facilitate the creation of an OpenCL context
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 :)
I do like this, however two things should be sorted before I merge it:
- It should not be on by default. (I.e. add gl_sharing=False) as an argument
to create_some_context. (and document it)
- The Mac situation is not clear to me. It seems that Macs *can* do GLX,
and they have some 'native' way of GL context creation (which Holger
mentioned). Mac crowd (Holger?), two questions: How likely is it that
a program will have both GL and the 'native' way available to it? If
likely enough, how would you choose?