[SDL] OpenGL and blitting
kuran at ruinsmud.com
Mon Oct 15 09:42:01 PDT 2001
On Mon, 15 Oct 2001, Joe Tennies wrote:
> I have an SDL_Surface I loaded. And the screen SDL_Surface is a double buffered OpenGL window. I want to blit the SDL_Surface to the screen. How do I do this? Can I use SDL_BlitSurface or must I use some OpenGL calls? Some sample code that also has the call to SDL_GL_SwapBuffers would be much appreciated.
Pass SDL_OPENGLBLIT to SDL_SetVideoMode() instead of SDL_OPENGL,
then use gl calls and SDL calls as you normally would, including
SDL_GL_SwapBuffers() to swap the gl buffers and SDL_Flip/SDL_UpdateRect(s)
to update the 2d stuff you draw with SDL calls.
More information about the SDL