home *** CD-ROM | disk | FTP | other *** search
- Program EGAPaletteDemo;
- {--------------------------------------------------------------}
- { This program is a demonstration of the EGA's palette and how }
- { the BGI implements it. To get full benefit from this }
- { program, you should set a watch variable on the variable P }
- { and then single step through the code, paying attention to }
- { what happens to that variable as each statement is executed. }
- {--------------------------------------------------------------}
-
- Uses Crt, Graph; { Link in necessary library units }
-
- Const
- PathToDrivers = ''; { Location of support file for BGI }
-
- Var
- GraphDriver,
- GraphMode : Integer; { Variables for graphics mode }
- P : PaletteType; { Value to hold result of GetPalette }
-
- Begin
- GraphDriver := Detect;{ Initialize graphics mode with detect }
- InitGraph( GraphDriver, GraphMode, PathToDrivers );
- GetPalette( P ); { Get the default palette }
- SetBKColor( 15 ); GetPalette( P );
- { Set background color examine palette }
- SetPalette( 5,50 ); GetPalette( P );
- { Set Palette entry 5, examine results }
- SetPalette( 6,0 ); GetPalette( P );
- { Set Palette entry 6, examine results }
- CloseGraph; { Shut down graphics system }
- End.