Jump to content
  • Advertisement
Sign in to follow this  
2dcoder

Is this possible? (Textures, DirectX8)

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

Is it possible to save a texture's current contents and then load it back in? I'm experimenting with rendering to a texture and I want to save the generated contents to a file and then load it back in if needed. Thanks.

Share this post


Link to post
Share on other sites
Advertisement
How about D3DXSaveSurfaceToFile? You'll need to call the GetSurfaceLevel method on the texture to get a surface, but otherwise it should work nicely.

Share this post


Link to post
Share on other sites
I thought of that, but won't I lose any alpha channel in the texture? I think that method only saves as .bmp?

Share this post


Link to post
Share on other sites
The docs say it also supports DDS. I don't know what exactly it would write out, but it is an option. Failing that, lock the surface and write out the bits yourself in any manner you like.

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!