Mail Archives: djgpp/1998/03/10/18:45:24
Jason Dagit writes:
>I have been looking at the DJGPP user guide, the one with the graphics
>chapter by Shawn Hargreaves. I would like to know more about 16 bit and
>24 bit color modes.
Once you can set a 256 color mode, these are really pretty simple to
use. When you are searching for the mode number, look for one with a
MemoryModel value of 6 (which represents truecolor, as opposed to 4 for
a paletted mode), and a BitsPerPixel value of 15, 16, 24, or 32. You can
set this mode exactly as for a 256 color resolution, but need to modify
your drawing code to work with 2, 3 or 4 byte pixels rather than just a
single byte per pixel.
There is no palette in a truecolor mode: instead you form color values
by combining the red, green and blue components directly into a packed
bitfield. To find out how far these values should be shifted, look at
the RedMaskSize, RedMaskPos, GreenMaskSize, etc, fields in the VESA mode
info struct.
>Also I would like to learn more about linear frame buffers.
What do you need to know? I tried to cover all the essential information
in the guide, so I will be happy to answer any specific questions that
you may have (and hopefully then improve the guide to make things
clearer in the future :-)
--
Shawn Hargreaves - shawn AT talula DOT demon DOT co DOT uk - http://www.talula.demon.co.uk/
"Pigs use it for a tambourine" - Frank Zappa
- Raw text -