Mail Archives: djgpp/1998/02/23/20:22:21
A Bester wrote:
> I seem to be missing something about True Color graphics modes...
> I've set_color_depth(15) and set_gfx_mode(GFX_AUTODETECT, 640, 480, 0, 0).
> How many palette registers should I have? Specifically, I'm trying to set
> up a screen that I can treat as 256x256 with 512 palettes. Have I gone
> wrong here?
15, 16, 24, and 32 bit modes don't use a palette (a palette for 24 bit
mode would take 48 megabytes). A given number is always the same
color.
> After that, how can I go about generating the palette? Do I continue to use
> set_color()? I need to be able to copy values from a table and copy them
> into the palette. And how many bits per r, g, or b do I have?
In 15 and 24 bit modes the bits are split evenly among red, green, and
blue. 32 bit mode is the same as 24. In 16 bit mode the extra bit goes
to green.
> Is the answer to create my own registers in an array, and then use
> line[x][y]=makecol15(palette[reg]->r, palette[reg]->g, palette[reg]->b) as
> the parameter?
Yes, that would work, though if I'm interpreting your suggestion
correctly there should be a . between the ] and the structure member
instead of an ->. If you use that method pretend you have 8 bits each
for red, green, and blue.
p.s. Actualy the above isn't entirely true, at least on my video card.
When in 15 bit mode I CAN use hardware palette support: when the
normally unused bit 15 is set to high it ignores bits 8-14 and uses bits
0-7 as a palette entry just like in 8 bit mode. Unfortunately, I don't
know if that is standard or just a nifty little feature of my video
card.
>I've RTFM, but I still don't get it.
- Raw text -