Mail Archives: djgpp/2000/05/12/09:15:40
I want to set a 256-color grayscale on a 8bit screen, so i wrote:
int x;
for(x = 0; x<256; x++)
_current_pallete.r = _current_pallete.g = _current_pallete.b = x;
set_palette(_current_pallete);
Yes, it is a weird write directly in _current_pallete, but i'm quite
lazy...
However it works, with just a problem: i don't get a 256-color
grayscale, i get 4 equal 64-color grayscales!
I figured it out with:
int x;
for(x = 0; x<256; x++) putpixel(screen, x+20, 20, x);
That draws 4 scales, 64 pixel each.
How can I fix this? (i need more than 64 grays!)
Thanx, Night Walker
- Raw text -