home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / TP_ADV.ZIP / LIST1008.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1989-07-31  |  1.3 KB  |  32 lines

  1. Program EGAPaletteDemo;
  2. {--------------------------------------------------------------}
  3. { This program is a demonstration of the EGA's palette and how }
  4. { the BGI implements it.  To get full benefit from this        }
  5. { program, you should set a watch variable on the variable P   }
  6. { and then single step through the code, paying attention to   }
  7. { what happens to that variable as each statement is executed. }
  8. {--------------------------------------------------------------}
  9.  
  10. Uses Crt, Graph;         { Link in necessary library units     }
  11.  
  12. Const
  13.   PathToDrivers = '';    { Location of support file for BGI    }
  14.  
  15. Var
  16.   GraphDriver,
  17.   GraphMode : Integer;   { Variables for graphics mode         }
  18.   P : PaletteType;       { Value to hold result of GetPalette  }
  19.  
  20. Begin
  21.   GraphDriver := Detect;{ Initialize graphics mode with detect }
  22.   InitGraph( GraphDriver, GraphMode, PathToDrivers );
  23.   GetPalette( P );      { Get the default palette              }
  24.   SetBKColor( 15 );    GetPalette( P );
  25.                         { Set background color examine palette }
  26.   SetPalette( 5,50 );  GetPalette( P );
  27.                         { Set Palette entry 5, examine results }
  28.   SetPalette( 6,0 );   GetPalette( P );
  29.                         { Set Palette entry 6, examine results }
  30.   CloseGraph;           { Shut down graphics system            }
  31. End.
  32.