Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Zortech C++ Language Reference - fg_setcolornum http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
                              fg_setcolornum

   Usage
   #include <fg.h>
   int far fg_setcolornum(old,new);

   Description
   Change the definition of an FG_COLOR. As in
   fg_setcolornum(FG_WHITE, 3);
   If  3 actually produces green then whenever your program  subsequently
   uses FG_WHITE, green will be the actual color output to the screen.

   Example

   if(fg_init() == FG_NULL)
   {
   fputs("Unable to initialize graphics.", stderr);
   return 0;
   }

   /*
   If  this  board only has 2 colors map the red, green and  blue  colors
   used throughout the program to black and white.
   */
   if(fg.nsimulcolors == 2)
   {
   fg_setcolornum(FG_BLUE, FG_WHITE);
   fg_setcolornum(FG_RED, FG_WHITE);
   fg_setcolornum(FG_GREEN, FG_BLACK);
   }

   /*
   Code  originally intended to require red green and blue will now  have
   black and white functionality (dependant on the use of the colors.
   */


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