home *** CD-ROM | disk | FTP | other *** search
/ Virtual Reality Madness / VRMAD96_ONE.ISO / virtek / libex / libex063.c < prev    next >
C/C++ Source or Header  |  1995-08-24  |  1KB  |  38 lines

  1.                                      // Example: 063 from Library Reference
  2. #include "..\3D-Ware\dddware.h"
  3. #include <conio.h>
  4. #include <dos.h>
  5.  
  6. #ifdef __WATCOMC__                   // If using Watcom C
  7. #define outportb outp                // Then make sure the name is correct.
  8. #endif                               // Finished with Watcom C specific code.
  9.  
  10. char  red, green, blue;
  11. short  main(void)
  12. {
  13.   dddInitAll();
  14.   while  (!dddkeycode)               // Wait for a keypress before finishing.
  15.   {
  16.     dddVsync();                      // Do a vertical sync before we start.
  17.     outportb(0x3C8,0);
  18.     outportb(0x3C9,0);
  19.     outportb(0x3C9,63);              // Write out the maximum green value for color 0.
  20.     outportb(0x3C9,0);
  21.     delay(4);                        // Wait for 4 milliseconds.
  22.       for  (red=0; red<64; red++)    // Increment the red portion of color 0.
  23.       {
  24.         dddHsync();                  // Wait for the next horizontal sync pulse.
  25.         outportb(0x3C8,0);
  26.         outportb(0x3C9,red);         // Write out the red portion of color 0.
  27.         outportb(0x3C9,green);
  28.         outportb(0x3C9,blue);
  29.       }
  30.         outportb(0x3C8,0);
  31.         outportb(0x3C9,0);
  32.         outportb(0x3C9,63);          // write out the maximum green value for color 0.
  33.         outportb(0x3C9,0);
  34.       }
  35.   dddRestoreAll();
  36.   return (0);                        // Bye.
  37. }
  38.