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

Started by
1 comment, last by Atridas 16 years, 5 months ago
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.

I would love to change the world, but they won’t give me the source code.

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.
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.

This topic is closed to new replies.

Advertisement