Using SDL_Rect/SDL_Surface with OpenGL

Started by
3 comments, last by feti 16 years, 5 months ago
Is it possible with an OpenGL window in SDL to still somehow use SDL_Rect and other non OpenGL objects on top of the OpenGL window? I'm in the process of making a menu system, but to speed up the process I'd like to use SDL stuff on top of OpenGL instead of writing all the mundane mouse menu items and whatnot in OpenGL. If not, it's what I expected, but I'd still like a professionals opinion.
Advertisement
Short answer: No.

Long answer: No. You can only use SDL's rendering in memory when you have an OpenGL window.

Learn to make games with my SDL 2 Tutorials

all tho you cant use rects and the such from sdl when using opengl for rendering you can still use the sdl event manager to handle events which makes it not so mundane.
I use SDL surfaces for my menus and GUI objects while my actual game scene is rendered with Opengl.

SDL won't render to the opengl window however a SDL_Surface can be converted into an opengl texture which of course can be rendered.
Thanks for the insight guys. This makes quite a bit of sense.

This topic is closed to new replies.

Advertisement