SDL as an OpenGL Context Manager
As of version 1.1, SDL contains extensions which let you use the power of the 3D graphics API OpenGL with SDL's event handling, timer, audio, and thread functions. By simply adding an extra flag to your call to SDL_SetVideoMode, SDL will automatically initialize the appropriate OpenGL "context manager". In effect, you can now use SDL as an alternative to Mark Kilgard's GLUT library. It must be noted that as of version 1.1.0 of this library, the normal SDL blitting functions and surface manipulation functions do NOT work when SDL is in an OpenGL rendering mode. However, any library which uses OpenGL (for instance Nate Miller's glTexFontf) will work with OpenGL under SDL. In addition, the SDL add-on libraries, such as SDL_Image and SDLmixer, can all be made to work under OpenGL.
To initialize OpenGL under SDL, you must call
Here are some examples to get you started. A series of tutorials on using OpenGL with SDL is available online at: http://www.devolution.com/~slouken/SDL/opengl/intro.html |