home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Virtual Reality Madness
/
VRMAD96_ONE.ISO
/
virtek
/
libex
/
libex063.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-08-24
|
1KB
|
38 lines
// Example: 063 from Library Reference
#include "..\3D-Ware\dddware.h"
#include <conio.h>
#include <dos.h>
#ifdef __WATCOMC__ // If using Watcom C
#define outportb outp // Then make sure the name is correct.
#endif // Finished with Watcom C specific code.
char red, green, blue;
short main(void)
{
dddInitAll();
while (!dddkeycode) // Wait for a keypress before finishing.
{
dddVsync(); // Do a vertical sync before we start.
outportb(0x3C8,0);
outportb(0x3C9,0);
outportb(0x3C9,63); // Write out the maximum green value for color 0.
outportb(0x3C9,0);
delay(4); // Wait for 4 milliseconds.
for (red=0; red<64; red++) // Increment the red portion of color 0.
{
dddHsync(); // Wait for the next horizontal sync pulse.
outportb(0x3C8,0);
outportb(0x3C9,red); // Write out the red portion of color 0.
outportb(0x3C9,green);
outportb(0x3C9,blue);
}
outportb(0x3C8,0);
outportb(0x3C9,0);
outportb(0x3C9,63); // write out the maximum green value for color 0.
outportb(0x3C9,0);
}
dddRestoreAll();
return (0); // Bye.
}