Jump to content
  • Advertisement
Sign in to follow this  
skwee

OpenGL + SDL (using SDL not only as wrapper for window/io handle)...

This topic is 3916 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

I did search in the forum and didn't find answer to my question. I know that SDL can be used with OpenGL as wrapper for creating window, managing input and etc. But lets say I want to code a GUI in SDL (100% SDL) and to be able to render it in my OpenGL program, or another example: I want to use SDL_ttf inside my OpenGL program to render text. The question is it possible? I mean is it possible to use SDL's features except window creation and io handling? Or I must code the GUI in OpenGL, and looking for libs that work with fonts in opengl? Thanks a lot, and sorry if similar question already asked and was answered, i couldn't find any relevant topic.

Share this post


Link to post
Share on other sites
Advertisement
It is possible to use SDL_Surfaces as a canvas and then move them to OpenGL textures and then render them as quads, directly rendering to the screen using the screen surface is not.

I used this approach with aedGui but I didn't knew better back then and I wouldn't really recommend it now, its a kludge, particularly because you'll get better performance if you just do it in OpenGL anyway.

Share this post


Link to post
Share on other sites
I do use SDL_ttf for loading fonts, and SDL_image to do so with .jpg and others... And eventualy I'll use the SDL_mixer to do sound (2D, when I need 3D I use OpenAL).

It's not easy blend sdl_surface to a texture, but I think it's a good way to do some thinks.

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!