Sign in to follow this  

storing a compressed d3d surface

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

This topic is 3379 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this