Skip to main content
GameDev.net gamedev.net
🔒 Locked

SDL & OpenGL simultaneously?

Started by MobileOak Feb 22, 2005 at 4:00 PM 0 replies 700+ views
Original Post
MobileOak
MobileOak
So I have successfully gotten SDL to display both a bitmap image and also to display an OpenGL window, but these seem to be mutually exlusive modes. I've tried to figure out if I could split the screen and have both an OpenGL window bordered by SDL 2d faces, but so far have been unsuccessful in either finding documentation on how this is possible, or accomplishing it myself. Does anyone know whether this can be done and how?
Drew_Benton
Drew_Benton
It *can* be done but is higly advisible not to, but what you need is to use SDL_OPENGLBLIT when you create your screen. Like I said, it is not advisible because it is a 'hack' implemented into SDL to make sure a few things worked with older versions. I do not know how much longer it will stay in the library for it is already depreciated.

When you do that you should be able to do what you have described. However, take a look at how you will need to blit now. When you do this, you will see a significant drop in FPS. Just a note that I have had since, chanced opinions on thse use of that flag since that post [smile]. The new way most perferable is to not use SDL_Surface's at all and rather OpenGL textures in glOrtho mode.

- Drew

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.