Sign in to follow this  

Getting the palette of a D3DFMT_P8 texture

This topic is 1992 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'm working on an application that needs to support using P8 textures, but the way it needs to use them is by converting them into a 32-bit ARGB image. To do this I need to somehow get the palette of the texture after it has been loaded, but I can't find anything after looking through the DirectX docs.

So, does anyone know how to get the palette of a texture? That's the last piece of the puzzle I'm missing.

Share this post


Link to post
Share on other sites
I [i]believe[/i] that a P8 texture is just up-converted to ARGB32 at load-time; if so then there is no palette to get. Hardware support for palettized textures is very patchy these days (and has been for quite some time).

Share this post


Link to post
Share on other sites
[quote name='mhagain' timestamp='1341100921' post='4954404']
I [i]believe[/i] that a P8 texture is just up-converted to ARGB32 at load-time; if so then there is no palette to get. Hardware support for palettized textures is very patchy these days (and has been for quite some time).
[/quote]

You are correct. After spending a bit of time looking into the resulting texture data it is indeed being covereted to an equivelant of D3DFMT_A8R8G8B8. So this thread can be closed. Just need to treat the image as a 32-bit ARGB image and it's fine.

Share this post


Link to post
Share on other sites

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