Sign in to follow this  

how can i save the texture to a file?

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

i use the glTexSubImage2D() modify the texture, and i want to save the texture to a file, how can i do?

Share this post


Link to post
Share on other sites
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
get your hands om the data array (image->data probably) and save this array to whatever you want.

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