home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
World of Shareware - Software Farm 2
/
wosw_2.zip
/
wosw_2
/
CPROG
/
WGT_TC21.ZIP
/
WGT06.C
< prev
next >
Wrap
C/C++ Source or Header
|
1992-07-17
|
1KB
|
53 lines
#include <conio.h>
#include "c:\tc\wgt\wgt.h"
/* WORDUP Graphic Toolkit Version 2.1
Demonstration program 6
Draws vertical lines of different colours, waits for a key, then
fades the colours in and out.
*/
int x,y,col;
color palette[255];
void main(void)
{
vga256(); // initializes system
for (y=0; y<64; y++)
wsetrgb(y,y,y,y,&palette); // sets first 64 colours to grey
// note the use of &
for (y=0; y<64; y++)
wsetrgb(y+64,y,0,0,&palette); // next 64 to red
for (y=0; y<64; y++)
wsetrgb(y+128,0,y,0,&palette); // green
for (y=0; y<64; y++)
wsetrgb(y+192,0,0,y,&palette); // blue
wsetpalette(0,255,palette); // and finally change them
// all at once
for (y=0; y<200; y++) // draw lines down the screen
{
wsetcolor(y);
wline(0,y,319,y);
}
getch();
wfade_out(0,255,40,palette);
delay(1000);
wfade_in(1,255,40,palette);
wfade_out(25,50,0,palette);
wfade_out(50,75,0,palette);
wfade_out(75,100,0,palette);
wfade_out(100,125,0,palette);
wfade_out(125,150,0,palette);
wfade_out(150,175,0,palette);
wfade_out(175,200,0,palette);
getch(); // get the key
textmode(C80); // used to return to text mode
}