0
votes

I'm moving a graphical and computational engine from DirectX to OpenGL and OpenCL mainly to gain desktop cross platform functionallity. I'm using GLFW but i'm considering moving the engine to mobile devices too because some of them are starting to be OpenCL compatible.

My main concern is that i need total control of the threads and the OpenGL context. Also consider i will have to use specific SDKS to be able to use OpenCL depending on the device.

Will i have any known limitations if i use SDL? (i've read too often that SDL is kind of rigid)

1

1 Answers

1
votes

While I have no experience with SDL, there is a very good chance you will not hit any barriers as a result of using it with OpenCL.

The only thing required to get OpenCL-OpenGL interop working, is that both the OpenGL context, and all the resources that you want to share with OpenCL need to be created BEFORE you even create your OpenCL context. To create an interop context in OpenCL, you either ask the OpenGL utility library that you are using (SDL in your case) to give you a platform specific OpenGL context handle (HGLRC, GLXContext, whatetever...) because you need that to construct the OpenCL context. Either your lib provides you with a fancy function, or you can call glGetCurrent() (or whatever the actual name is on each platform) to obtain the handle yourself.

As for SDL being rigid... I have no experience with it, I only used SFML during my developments, and I was very much satisfied with it. The lead dev, Laurent is very responsive and does a good job with the lib. The C++ bindings are superb, and the website indicated that Android and iOS support is on the way. You might want to give it a try, although if SDL is not as rigid as GLUT is for eg, than you are good to go.