Texture Formats

Started by
1 comment, last by dragon9 21 years, 7 months ago
I am using D3DXCreateTextureFromFileEx to load my textures. I saved the textures as 8 bit color indexed TGAs and then specified the loading format as D3DFMT_UNKNOWN so the function would auto detect and set the appropriate format. According to the D3DSURFACE_DESC returned by the texture though, everything was loaded with the D3DFMT_A8R8G8B8 format. I tried forcing the D3DFMT_P8 and at least got the textures to load as D3DFMT_R5G6B5. So what am I doing wrong? What I want is 8 bit paletized data, or any other form of 8 bit data. How do I get it?
Advertisement
Make sure you are not passing in NULL for the pPalette parameter. Without it, D3DXCreateTextureFromFileEx will always depaletteize your image, since it has no way to return the palette.

xyzzy
Does your graphics chip support palettised textures? Some don''t!

Check the caps/device format before assuming your hardware can do it.

--
Simon O''Connor
Creative Asylum Ltd
www.creative-asylum.com

Simon O'Connor | Technical Director (Newcastle) Lockwood Publishing | LinkedIn | Personal site

This topic is closed to new replies.

Advertisement