Is there an --> existing <-- function/macro that picks out the R,G,B,A channels from a D3DCOLOR type? The closest thing I know is GetRValue etc... but they use a different RGB format.
Is there an --> existing <-- function/macro that picks out the R,G,B,A channels from a D3DCOLOR type? The closest thing I know is GetRValue etc... but they use a different RGB format.
MagosX.com
Give a man a fish and you feed him for a day.
Teach a man to fish and you feed him for a lifetime.
To my knowledge, there are none that are provided by DX. If you want to only use D3D defined macros:
Code://HACK D3DCOLOR redMask = D3DCOLOR_RGBA(255, 0, 0, 0); D3DCOLOR redChannel = origColor & redMask; while( (redMask & 1) != 1) { //could use 8 if you want to rely on each channel taking up a byte redMask >>= 1; redChannel >>= 1; }