
CLGL Interop on platforms other than WGL?
Posted Sunday, 15 January, 2012 - 17:38 by Drac32Drac inFirst off, I want to that the creators of openTK and cloo for creating such wonderful products. I am having a blast creating a new game engine from scratch utilizing this feature and am amazed at the performance I am reaching with an opengl 3.2 context plus clgl interop. The project is just a hobbyist project right now though and more of a learning excercise than anything. The engine is only very lightly coupled to a GameWindow derived class that would be relatively simple to convert to glControl or other method if needed.
Now to my questions... does CLGL interop work at all for non windows platforms as of yet?
If it does, how would the CLContext be created for X11 or OSX? (either platform independant IntPtr from openTK or platform dependant p/invoke)


Comments
Re: CLGL Interop on platforms other than WGL?
Ok, I've been doing a lot of digging around on this question and it looks like I may have figured out a working solution, but I have no means to test it right now on OSX or X11.
First off, we need access to different context commands for different platforms. So...
The ContextPropertyList should then be able to be populated by...
Once the property list is populated, it should be usable for clgl context creation on X11 or OSX the same way it would be for Windows.
I will admit a lack of experience on p/invoking in general, so I have no idea if the code listed is even sound on OSX or X11. If I am way off base with my solution, please let me know.
Re: CLGL Interop on platforms other than WGL?
I haven't tried running a CL/GL interop outside windows. On the other hand, no one has submitted a bug or anything else regarding this area, so I assume Cloo can handle it.
Your code looks like it could work. I haven't tried it though.
Edit: Before accessing ComputePlatform.Platforms[0] check its existence. If no OpenCL is installed the list contains no items.
Re: CLGL Interop on platforms other than WGL?
Thanks for the reply, it will be a few days before I can test if it works though. I'll try to throw a test app together for it by then. I am very interested to know if it does indeed work as CLGL is such a powerful tool.
You are definately right about the Platforms[0] though, that one slipped my notice.