home *** CD-ROM | disk | FTP | other *** search
/ Teach Yourself Game Programming in 21 Days / TYGAMES_R.ISO / source / day_03 / dots.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-04-27  |  815 b   |  40 lines

  1.  
  2. // I N C L U D E S ///////////////////////////////////////////////////////////
  3.  
  4. #include <stdio.h>
  5. #include <stdlib.h>
  6. #include <conio.h>
  7.  
  8. #include "graph3.h" // this is all we need to include so that the program
  9.                     // knows all the #defines, structures, prototypes etc.
  10.  
  11. // M A I N ///////////////////////////////////////////////////////////////////
  12.  
  13. void main(void)
  14. {
  15.  
  16. int done=0, // exit flag
  17.     index;  // loop index
  18.  
  19. // set video mode to 320x200 256 color mode
  20.  
  21. Set_Video_Mode(VGA256);
  22.  
  23. // plot 10000 dots
  24.  
  25. for (index=0; index<10000; index++)
  26.     Plot_Pixel_Fast(rand()%320, rand()%200,rand()%256);
  27.  
  28. // wait for user to hit a key
  29.  
  30. while(!kbhit()){}
  31.  
  32. // reset back set video mode to 320x200 256 color mode
  33.  
  34. Set_Video_Mode(TEXT_MODE);
  35.  
  36. } // end main
  37.  
  38.  
  39.  
  40.