Post

 Resources 

Console


RE: Yep... Jay Wheeler (1 reply, 0 views) (2000-Sep-5)
-
I have heard that there are DLL's that are nothing but compiled C++ commands that perform the bitshift. Try looking for these if you're really interested, but I don't know if the DLL procedure call overhead outweighs the benefits or not. Just a note that the logical AND operator can do just as well, if you are using DirectX. Just AND your color value with the mask returned by SurfaceDesc.ddpfPixelFormat.lRBitMask (as well as the green and blue masks). For instance, a 24-bit pixel would be packed as 8-8-8 RGB something like this: 101011110101101011111111 DirectX would return 111111110000000000000000 as the red mask, 000000001111111100000000 as the green mask, and 000000000000000011111111 as the blue mask. That way you can get the byte value using logical AND. Note that you should never assume the bitmasks because difference video cards use different formats. Especially important in 16-bit mode.


-
Up One Level | Back to Forum

RE: Yep... Corre (0 replies) (2000-Sep-6)

Copyright © 2002 - 2004 Eric Coleman, Peter Kuchnio , et. al.
There have been 225 visitors within the last 20 minutes
RSS News Feed