home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Virtual Reality Madness
/
VRMAD96_ONE.ISO
/
virtek
/
libex
/
libex167.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-08-24
|
1KB
|
34 lines
// Example: 167 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) // Run until a key is pressed.
{
for (red=0; red<64; red++) // Loop, whilst incrementing the red value.
{
dddVsync(); // Wait for a Vertical Sync pulse.
delay(2); // Delay for 2 milliseconds.
outportb(0x3C8,0); // Select color 0 via hardware port.
outportb(0x3C9,red); // Write the red potion of color 0.
outportb(0x3C9,green); // Write the green portion of color 0.
outportb(0x3C9,blue); // Write the blue portion of color 0.
delay(3); // Wait 3 milliseconds.
outportb(0x3C8,0); // Select color 0 via hardware port.
outportb(0x3C9,0); // Red portion is 0.
outportb(0x3C9,0); // Green portion is 0.
outportb(0x3C9,0); // Blue portion is 0.
}
}
dddRestoreAll(); // Clean up.
return (0); // Bye.
}