Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Watcom C/C++ v10.0 : C library - <b>synopsis:</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Synopsis:
    #include <graph.h>
    long _FAR _getbkcolor( void );

Description:
    The _getbkcolor function returns the current background color.  In text
    modes, the background color controls the area behind each individual
    character.  In graphics modes, the background refers to the entire
    screen.  The default background color is 0.

Returns:
    The _getbkcolor function returns the current background color.

See Also:
    _setbkcolor, _remappalette

Example:
    #include <conio.h>
    #include <graph.h>

    long colors[ 16 ] = {
       _BLACK, _BLUE, _GREEN, _CYAN,
       _RED, _MAGENTA, _BROWN, _WHITE,
       _GRAY, _LIGHTBLUE, _LIGHTGREEN, _LIGHTCYAN,
       _LIGHTRED, _LIGHTMAGENTA, _YELLOW, _BRIGHTWHITE
    };

    main()
    {
        long old_bk;
        int bk;

        _setvideomode( _VRES16COLOR );
        old_bk = _getbkcolor();
        for( bk = 0; bk < 16; ++bk ) {
            _setbkcolor( colors[ bk ] );
            getch();
        }
        _setbkcolor( old_bk );
        _setvideomode( _DEFAULTMODE );
    }

Classification:
    PC Graphics

Systems:
    DOS, QNX

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