Jump to content
  • Advertisement
Sign in to follow this  
tonicscorp

storing a compressed d3d surface

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

Hi, I have to store meshes combined with textures in a custom binary format. My original images are jpeg's which I read from files. Now I would like directly store a compressed (DXT1) Direct3DSurface9 so that the target application is able to use the surface as it is and put it into a Direct3DTexture9. I'm already creating this surface but I have to know the size of the resulting surface in order to store it within the file. Is it possible to get the size of the entire Direct3DSurface9 structure in memory? Or is there another way to do this? Maybe creating a DDS texture and store that. Thanks a lot.

Share this post


Link to post
Share on other sites
Advertisement
Yep, just create DDS files and load them instead - this is exactly what the DDS format is for. There's a tool with the SDK (DirectX Texture Tool) that does this.

As an aside, JPEG is an extremely bad choice for textures because of the lossy compression that assumes the image won't be rotated or scaled.

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!