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

SDL & OpenGL

Started by phraine Aug 4, 2005 at 1:19 PM 3 replies 2.4k views
Original Post
phraine
phraine
Hi, someone... I've written a small GUI library for future use in my games. I've used SDL for graphics and mouse/keyboard. My question is: can I use OpenGL for 3D rendering && SDL for GUI? Should I use SDL_GL_SwapBuffers after rendering, then draw the GUI (HUD, menus, etc), and then do a SDL_Flip? This sounds a bit slow. Well, I hope someone will atleast read this... phraine
smr
smr
I don't think you can. If you create an opengl context with SDL, I don't think you can use SDL's rendering functions.
phraine
phraine
Quote:
Original post by smr
I don't think you can. If you create an opengl context with SDL, I don't think you can use SDL's rendering functions.


Okay then... :(
Spent the whole weekend writing code for drawing primitives, widgets, geometry manager,... I guess I'll just have to use OpenGL for GUI and SDL for mouse/keyboard/(joystick?)...
SiCrane
SiCrane
You can use the SDL_OPENGLBLIT flag when setting video mode to allow normal SDL functions on the video surface, but it is slow.

Topic Locked

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

Sign in to reply to this topic.