Mail Archives: djgpp/1997/01/24/00:44:09
Rob Vasquez writes:
>I've set up and maked (made?) Allegro, and the only functions I can't
>get to work are the palette functions.
>
> There is a function:
>
> set_color(int index, RGB*);
>
> RGB is a structure as:
>
> typedef struct RGB
> {
> unsigned char r, g, b;
> } RGB;
>
> Can someone send me some code that will work with this function? I
What doesn't work with these functions? Posting some code that
demonstrates your problem would help a lot...
To fade the screen background (color 0) from black to white, try
something like:
int i;
RGB c;
for (i=0; i<64; i++) {
c.r = c.g = c.b = i;
vsync();
set_color(0, &c);
}
If you just want to fade in the entire screen, though, try using the
fade_in() function, which does all the work for you (look at the demo
game for an example of how it is used).
/*
* Shawn Hargreaves - shawn AT talula DOT demon DOT co DOT uk - http://www.talula.demon.co.uk/
* Ghoti: 'gh' as in 'enough', 'o' as in 'women', and 'ti' as in 'nation'.
*/
- Raw text -