Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

nicosio

Taking snapshop of application

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

Hello Does anyone knows how to make the application take a snapshot of the OpenGL Window?, so it canbe saved as BMP, TGA or other format. Thank you, Nicosio

Share this post


Link to post
Share on other sites
Advertisement
Here is what I recommend....

Use glReadPixels() to retrieve the picture information from the framebuffer in GL_RGB format.

Create A DIB or do some other type of routine to convert the raw RGB pixel data into a usable picture format. (for info on formats, try www.wotsit.org)

come up with some way to name each new screenshot file so that it is different than the last.

finally, Use ofstream (or other file-writing code option) to write the picture data into a file using the aforementioned filename.

Good Luck!

Share this post


Link to post
Share on other sites

  • 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!