home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS 1992 September / Simtel20_Sept92.cdr / msdos / turbo_c / tcega.arc / COLORS.C next >
Text File  |  1986-03-08  |  1KB  |  51 lines

  1. /*                                                                            */
  2. /*      EGA Graphic Demonstration, Turbo Pascal 3.01A, Version 10JAN86.       */
  3. /*      (C) 1986 by Kent Cedola, 2015 Meadow Lake Ct., Norfolk, VA, 23518     */
  4. /*                                                                            */
  5. /*      This program will display over a hundred different colors by using    */
  6. /*      a bit color map.  Only the standard palette setting are used, if      */
  7. /*      changed, more colors could be produced (but not at the same time).    */
  8. /*                                                                            */
  9.  
  10. #include <mcega.h>
  11.  
  12. main()
  13. {
  14.   char buffer[640];
  15.  
  16.   register x,y;
  17.  
  18.   GPParms();
  19.  
  20.   GPInit();
  21.  
  22.   gpinitwt(0,0,640,350,buffer,0);
  23.  
  24.   for (y = 0; y < GDMAXROW; y++)
  25.     {
  26.     for (x = 0; x < GDMAXCOL; x += 2)
  27.       {
  28.       buffer[x]   = y * GDMAXPAL / GDMAXROW;
  29.       buffer[x+1] = x / 40;
  30.       };
  31.  
  32.     gpwritrw();
  33.     y++;
  34.  
  35.     for (x = 0; x < GDMAXCOL; x += 2)
  36.       {
  37.       buffer[x]   = x / 40;
  38.       buffer[x+1] = y * GDMAXPAL / GDMAXROW;
  39.       };
  40.  
  41.     gpwritrw();
  42.     };
  43.  
  44.   gptermwt();
  45.  
  46.   getch();
  47.  
  48.   GPTerm();
  49.  
  50. }
  51.