Jump to content
  • Advertisement
Sign in to follow this  
ktw6675

OpenGL opengl texture to SDL surface

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

This is kind of an SDL question as well, but probably belongs here since I'm looking for the right GL function. My texture class keeps an SDL surface so that the GL texture can be reloaded when needed (like during a fullscreeen toggle, for instance), since the SDL surface never "goes out of scope." So I know how to go from an SDL surface to an OpenGL texture with no problem--but what about going from an OpenGL texture to an SDL surface? For example, I have a openFromScreen function that returns a texture that is a copy of the specified portion of the screen buffer...this is a pure GL call, so there is a resulting OpenGL texture, but no SDL surface. If my app then toggles fullscreen, there is no surface to reload from. Is there anyway to get at the pixel data in an OpenGL texture so I can copy it to an SDL surface that I know will stay there?

Share this post


Link to post
Share on other sites
Advertisement
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!