Archived

This topic is now archived and is closed to further replies.

Surface/Texture Formats and colour masking

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

Does anybody know of a function in DX8 that will give me back all of the colour masks for a specified format. e.g. if the format is D3DFMT_A8R8G8B8 then the red mask cound be 0x00FF0000, but if I was using D3DFMT_A1R5G5B5 then the mask would be 0x7C00. Something similar to the DX7 surface desciption ddpfPixelFormat.dwxBitMask. Thanks Scott

Share this post


Link to post
Share on other sites
You''ll have to roll your own lookup table for that, DX8 no longer has it implemented. You might also want to store it in a more useful format, say, number of bits and the start bit.
Fortunately, there aren''t that many pixel formats...

- JQ
Full Speed Games. Coming soon.

Share this post


Link to post
Share on other sites
Bummer...that is what I thought I might end up having to do

quote:

You might also want to store it in a more useful format, say, number of bits and the start bit.



Can you explain this a bit more, I was going to create a function that pulled all the masks back (R, G, B & A), having a lovely large switch statement to choose between the formats?

Share this post


Link to post
Share on other sites