zhensydow/opencl — pull request #28 by acowley (2012-02-07 18:20:57+00:00)
Title: Preliminary support for OpenGL <-> OpenCL interop

I've started implementing OpenGL interop.

* Some of the complexity is that Apple's OpenCL implementation violates the spec regarding the defined constants for GL context sharing. I've accounted for this with #ifdefs in the code.

* The context is treated as a `Ptr ()`. I don't know if it's worth trying to use a more descriptive type. I suspect not as this is inherently low-level, platform-dependent plumbing, and should really be sealed up in a library.

* To that end, it may be helpful to add a module, or release a separate package, including the requisite glue-code for each platform. I've written this code on OS X (it's just a few lines of FFI), but not yet released it anywhere public. One argument for not including this in the OpenCL package is that it seems to violate the package's design principle of being a direct, low-level mapping to the OpenCL API. I will probably add this to my CLUtil library in the near term.