home *** CD-ROM | disk | FTP | other *** search
/ Black Art of 3D Game Programming / Black_Art_of_3D_Game_Programming.iso / source / msc / chap_12 / tridemo.c < prev    next >
Text File  |  1995-01-31  |  1KB  |  63 lines

  1.  
  2. // I N C L U D E S ///////////////////////////////////////////////////////////
  3.  
  4. #include <io.h>
  5. #include <conio.h>
  6. #include <stdio.h>
  7. #include <stdlib.h>
  8. #include <dos.h>
  9. #include <bios.h>
  10. #include <fcntl.h>
  11. #include <memory.h>
  12. #include <malloc.h>
  13. #include <math.h>
  14. #include <string.h>
  15.  
  16. // include all of our stuff
  17.  
  18. #include "black3.h"
  19. #include "black4.h"
  20. #include "black5.h"
  21. #include "black6.h"
  22. #include "black8.h"
  23. #include "black9.h"
  24. #include "black11.h"
  25.  
  26. // M A I N /////////////////////////////////////////////////////////////////////
  27.  
  28. void main(void)
  29. {
  30.  
  31. int done=0;         // exit flag
  32.  
  33. // set graphics mode to 13h
  34.  
  35. Set_Graphics_Mode(GRAPHICS_MODE13);
  36.  
  37. // point double buffer to video buffer since the triangle function
  38. // only writes to the double buffer and we want to see it doing the
  39. // writing
  40.  
  41. double_buffer = video_buffer;
  42.  
  43. // main loop
  44.  
  45. while(!kbhit())
  46.      {
  47.  
  48.      // draw a triangle somewhere on the screen
  49.  
  50.      Draw_Triangle_2D(rand()%320,rand()%200,
  51.                       rand()%320,rand()%200,
  52.                       rand()%320,rand()%200,
  53.                       rand()%256);
  54.  
  55.      } // end while
  56.  
  57. // restore text mode
  58.  
  59. Set_Graphics_Mode(TEXT_MODE);
  60.  
  61. } // end main
  62.  
  63.