Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Microsoft C 6.0 - <b>_selectpalette() select predefined palette</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 _selectpalette()        Select predefined palette

 #include   <graph.h>

 short far _selectpalette( number );
  short number;     Palette number

    _selectpalette() allows selection among four standard palettes in the
    MRES4COLOR video mode, or among two or three (CGA or EGA) standard
    palettes in the MRESNOCOLOR video mode. These two video modes are the
    only ones supported by this function.

       Returns:     _selectpalette() returns the value of the previous
                    palette.

         Notes:     Under the MRES4COLOR mode the number argument selects
                    one of the following four palettes:

                    Palette               Pixel Values
                    Number    Color 1        Color 2        Color 3
                    -------   -----------    -----------    -----------
                      0       Green          Red            Brown
                      1       Cyan           Magenta        Light gray
                      2       Light green    Light red      Yellow
                      3       Light cyan     Light magenta  White

                    Under the MRESNOCOLOR mode on a CGA the number
                    argument selects one of the following two palettes:

                    Palette               Pixel Values
                    Number    Color 1        Color 2        Color 3
                    -------   -----------    -----------    -----------
                      0       Blue           Red            Light gray
                      1       Light blue     Light red      White

                    Under the MRESNOCOLOR mode on an EGA the number
                    argument selects one of the following three palettes:

                    Palette               Pixel Values
                    Number    Color 1        Color 2        Color 3
                    -------   -----------    -----------    -----------
                      0       Green          Red            Brown
                      1       Light green    Light red      Yellow
                      2       Light cyan     Light red      Yellow

                    With an EGA in MRESNOCOLOR video mode, A
                    specification of Palette 3 will generate the same
                    colors as Palette 1.

   Portability:     MS-DOS only, true MDPA, CGA, EGA, MCGA, or VGA video
                    compatibles

 -------------------------------- Example ---------------------------------

    This program selects Palette 1 as the displayed screen colors.

           #include <graph.h>

           main()
           {
              _setvideomode ( _MRES4COLOR );
              _selectpalette( 1 );

              . . . display images . . .

              _setvideomode ( _DEFAULTMODE );
           }


See Also: _remappalette() _remapallpalette() _getvideoconfig()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson