home *** CD-ROM | disk | FTP | other *** search
/ Black Art of 3D Game Programming / Black_Art_of_3D_Game_Programming.iso / source / borland / chap_11 / linedemo.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-01-24  |  1.1 KB  |  53 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. #include <search.h>             // this one is needed for qsort()
  16.  
  17. // include all of our stuff
  18.  
  19. #include "black3.h"
  20. #include "black4.h"
  21. #include "black5.h"
  22. #include "black6.h"
  23. #include "black8.h"
  24. #include "black9.h"
  25. #include "black11.h"
  26.  
  27. // M A I N ////////////////////////////////////////////////////////////////////
  28.  
  29. void main(void)
  30. {
  31.  
  32. // set graphics mode to mode 13h
  33.  
  34. Set_Graphics_Mode(GRAPHICS_MODE13);
  35.  
  36. // draw randomly positioned lines until user hits a key
  37.  
  38. while(!kbhit())
  39.      {
  40.      // draw the line with random (xo,yo) - (x1,y1) with a random color
  41.      Draw_Line(rand()%320,rand()%200,
  42.                rand()%320,rand()%200,
  43.                rand()%256,video_buffer);
  44.  
  45.      } // end while
  46.  
  47. // restore graphics mode back to text
  48.  
  49. Set_Graphics_Mode(TEXT_MODE);
  50.  
  51. } // end main
  52.  
  53.