Game Development Community

Gfxformatr8g8b8a8 = D3dfmt_a8r8g8b8

by Eric Preisz · in Torque Game Engine Advanced · 08/23/2007 (6:52 am) · 3 replies

I notied that GFXFormatR8G8B8A8 maps to D3DFMT_A8R8G8B8. The bit order difference is likely to confuse someone, caught me for a second.

Thanks.

About the author

Manager, Programmer, Author, Professor, Small Business Owner, and Marketer.


#1
08/23/2007 (10:58 am)
Eric,
This is true, but D3D does not have that byte ordering as an option. The re-ordering of bytes happens in the texture manager when the texture is uploaded. If the Swizzle class is in TGEA, you can use it to easily do bit-swapping.
#2
08/23/2007 (2:37 pm)
Yea, it's not really a problem to someone from load time. The confusion is when you lock a dynamic texture. Now, I should have remembered that D3D doesn't have that format, but I always forget because I know they have those darn argb macros lying around.

Not a big deal really, just an opportunity for beginner, who is locking a texture, to get confused.

Thanks for your time.
#3
08/24/2007 (11:13 am)
Yeah GL, and D3D use reversed byte orderings. It's a total pain because I don't think the tgea textures differentiate between what order the bytes are in and what format they are in. This is very annoying.