Advertisement Jump to content
Sign in to follow this  
phraine

SDL & OpenGL

This topic is 4919 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
Advertisement
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.

Share this post


Link to post
Share on other sites
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?)...

Share this post


Link to post
Share on other sites
You can use the SDL_OPENGLBLIT flag when setting video mode to allow normal SDL functions on the video surface, but it is slow.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!