Sign in to follow this  
Shenjoku

Getting the palette of a D3DFMT_P8 texture

Recommended Posts

Shenjoku    161
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
mhagain    13430
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
Shenjoku    161
[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

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