Advertisement

When you use OpenGL with SDL, can you use both API's graphical functions?

Started by November 03, 2004 06:24 PM
1 comment, last by Roboguy 19 years, 10 months ago
I'm thinking of starting to learn OpenGL again and since I highly dislike Win32 now, I'm going to use SDL to handle all the window stuff. So, since I'm going to be using both, I figured I'd update my sprite classes and such but I don't know whether it'd be easier to load the bitmaps with SDL or OpenGL. Any suggestions?
Well, you can't realy load bitmaps using OpenGL, there are no such functions. In SDL there is SDL_LoadBMP function but I would encourage you to try SDL_Image or DevIL, they both support huge variety of popular file formats.
And if you're actually using OGL there is no excuse not to remove every SDL_Surface occurence from your code and use instead OGL textures - you'll get HUUUUGE performance gain. Yes, at first it may be tricky to mimic some of SDL surface functions (but it isn't impossible), hovewer, it will do you only good.

And one more thing - I'm writing now engine which uses both SDL and OpenGL and so far everything goes right...
Advertisement
you can use all of SDL's library, except the functions that actually draw to the screen(so you can use SDL_LoadBMP)

This topic is closed to new replies.

Advertisement