Jump to content
  • Advertisement
Sign in to follow this  
zny2004

how can i save the texture to a file?

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

Advertisement
I depends on the format you want.
If it is bmp, it's quite easy but, other formats are not, maybe.

So, you can use image format libaries, or you have to implement them.

Share this post


Link to post
Share on other sites
use glGetTexImage to get the image data of a texture. then you can do anything you want with the image data. use your own file format, learn others or use a image format library to save it. i like .raw :)

Share this post


Link to post
Share on other sites
Quote:
Original post by zny2004
i use the glTexSubImage2D() modify the texture,
and i want to save the texture to a file,
how can i do?


You can use glReadPixels .

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!