home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Programmer's Library 1.3 / Microsoft-Programers-Library-v1.3.iso / sampcode / c / other / graphics / ega.c < prev    next >
Encoding:
C/C++ Source or Header  |  1988-10-07  |  706 b   |  34 lines

  1. /* EGA.C: Demonstrates EGA palettes */
  2. #include <stdio.h>
  3. #include <conio.h>
  4. #include <graph.h>
  5.  
  6. main()
  7. {
  8.    _setvideomode( _ERESCOLOR );
  9.    _setcolor( 4 );
  10.    _rectangle( _GFILLINTERIOR, 50, 50, 200, 200 );
  11.  
  12.    _settextposition( 1, 1 );
  13.    printf( "Normal palette\n" );
  14.    printf( "Press a key" );
  15.    getch();
  16.  
  17.    _remappalette( 4, _BLUE );
  18.  
  19.    _settextposition( 1, 1 );
  20.    printf( "Remapped palette\n" );
  21.    printf( "Press a key" );
  22.    getch();
  23.  
  24.    _remappalette( 4, _RED );
  25.  
  26.    _settextposition( 1, 1 );
  27.    printf( "Restored palette\n" );
  28.    printf( "Press a key to clear the screen" );
  29.    getch();
  30.  
  31.    _clearscreen( _GCLEARSCREEN );
  32.    _setvideomode( _DEFAULTMODE );
  33. }
  34.