Sign in to follow this  

OpenGL with SDL in only one window

This topic is 3867 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, I am working on my new 3d-programme. I am using OpenGL and SDL. Now I created a Media-Player in SDL. It should start in the same window as OpenGL. But everytime, it creates a new window. Can anyone show me, how I can use OpenGL and SDL in one window? (SDL is only needed for the media-player, everything else was written in OpenGL. I just want, that SDL uses the same window)

Share this post


Link to post
Share on other sites
OpenGL does not know about windows. OpenGL only knows of rendering contexts, and those are platform specific. You can tell SDL to create a window that you will be able to render to using OpenGL. How is your current OpenGL window being created? Through GLUT or the windows API? If so, just stop using GLUT (or the windows API). Or don't use SDL's video system.

If you want to use SDL for 2d rendering in the same place as OpenGL, then you're out of luck. The display can only be 2d or openGL, not both. A workaround is to update a texture in openGL using glTexSubImage2D and then render it onto a quad. The source data for the texture can come from an SDL surface, which you can blit to.

[Edited by - Vorpy on May 18, 2007 11:12:20 AM]

Share this post


Link to post
Share on other sites

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this