Jump to content
  • Advertisement
Sign in to follow this  
phraine

SDL & OpenGL

This topic is 4857 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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!