Jump to content
  • Advertisement
Sign in to follow this  
DCent

OpenGL with SDL in only one window

This topic is 4078 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
Advertisement
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
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!