Advertisement

Just wondering...

Started by August 08, 2000 12:46 AM
4 comments, last by Ironblayde 24 years, 5 months ago
I''m working in a 16-bit screen mode on my RPG, and recently I found that looking at the ''dwRGBBitCount'' member of a DDPIXELFORMAT structure wasn''t discerning the difference between 5.5.5 and 5.6.5 modes. Shouldn''t this value be 15 instead of 16 if the color is in 5.5.5 mode? The reason isn''t terribly important -- I''m detecting the difference by instead looking at one of the masks like dwRBitMask -- but I would like to know why dwRGBBitCount doesn''t show the difference. -Ironblayde Aeon Software
"Your superior intellect is no match for our puny weapons!"
Some books and code samples use the rgb bit count to determine the color mode, but I''ve never gotten it to work for me. I''ve always had to look at the masks too. Maybe it''s a problem with some cards or something.
Advertisement
Hi...

It''s becouse of ''dwRGBBitCount'' member dont show ''real'' bit count, it shows the ''useble'' as is (as 8, 16, 24 or 32)....

In the memory it looks like what:

|r|r|r|r|r|g|g|g|g|g|g|b|b|b|b|b| - for real 16 bit

and

|r|r|r|r|r|g|g|g|g|g|b|b|b|b|b|0| for ''unreal'' 16 bit

but it use all 16 bit...



Denis "Mr.Snow" Kozhukhov
CEO & Lead programmer
Choco Snow Creation
=============================Denis "Mr.Snow" KozhukhovCEO & Lead programmerChoco Snow CreationdkcscPortal=============================
because 5-5-5 is really 0-5-5-5

"Now go away or I shall taunt you a second time"
- Monty Python and the Holy Grail
themGames Productions

You can also get fake 15-bit modes in 1555 and 5551.

You can in fact use the 1 bit to represent a transparency value for that pixel (i.e. a transparent sprite).

Useful for making quick and easy billboards.



========
Smidge
www.smidge-tech.co.uk
========
--Mr Smidge
Thanks guys, that makes sense. I was just confused about it because there is some code in TOTWGPG that tries to use the dwRGBBitCount member to discern the difference between 5.5.5 and 5.6.5. Strange...


-Ironblayde
Aeon Software
"Your superior intellect is no match for our puny weapons!"

This topic is closed to new replies.

Advertisement