   Multi threading - Opengl
  Hi,I have read great tutorial about SDL & opengl multi-threading.http://veelck.wordpress.com/2008/11/28/multithread-texture-loading-in-opengl/You can see that the tutorial is not cross platform. ( So why use SDL? )How can I get the same result and stay cross platform?   
  SDL provides some glue to OpenGL by itself that lets you stay cross platform.   ;  Can you point me to a tutorial? I have looked around so long and have manageto find any use of SDL and glue. All I can see is platform depended tutorials.;  The words of interest are ...#include <SDL/SDL_opengl.h> // possibly without SDL/-path... and e.g. ...SDL_WM_SetCaption ("picogen - instant open-gl preview", "picogen");SDL_GL_SetAttribute (SDL_GL_DOUBLEBUFFER, 1);SDL_SetVideoMode (800, 600, 32, SDL_OPENGL);...SDL_GL_SwapBuffers();The rest of my code there is standard OpenGL.I guess there are more functions, but those should give you a good start for a google search. On the SDL site, they also link to some SDL+OpenGL examples.   ;  Are you asking about how to do cross-platform threading?   ;  Looking over the tutorial you linked to, I guess you're looking for a cross-platform way to to create threads, and then share an OpenGL context or at least a texture between them. I don't think there's any cross-platform way to do this, unless you find a higher level library that wraps it, and is available on the different platforms you want to target.   ;  Instead of using the wgl* commands directly (which are Windows only), you'll have to write a wrapper that calls wgl* when compiling for Windows, GLX* when compiling for Linux, whatever the Mac uses when compiling for MacOS, etc.Quote:So why use SDL?Because it's a nice library.   ;Quote:Original post by Erik RufeltLooking over the tutorial you linked to, I guess you're looking for a cross-platform way to to create threads, and then share an OpenGL context or at least a texture between them. I don't think there's any cross-platform way to do this, unless you find a higher level library that wraps it, and is available on the different platforms you want to target.The closest one can get at the moment is to use the boost threads library. Something very similar is being added to the C++11 standard.   ;  Yep preprocessing might be the answer.I thought that SDL already done it for us, to bed they didn't.tnx guys   ;  There are many good thread wrapping libraries out there, I personally use pthreads (there is a win32 port I use for my windows builds, the only feature missing is fork)You could not use SDL, alternatives such as SFML and GLFW have threading and thread syncronisation object wrappers.   