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++ 3.0r4 - <b>fg_init</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
fg_init

Usage

   #include <fg.h>
   int far fg_init(void);

Description

   Initialize the graphics variables and put the crt in graphics mode. If
   the fg  graphics package has never been initialized fg_init will search

   the  environment for "FG_DISPLAY" and use the board and mode specified by
   that environment string. If the "FG_DISPLAY" is not found an attempt is
   made to identify the current graphics hardware available and initialize
   it  to the highest resolution available (maximum number of pixels which
   may  not be the maximum number of colors). It returns fg_display which is
   non-zero if the initialization was successful.

   If the graphics package is closed down using fg_term, and then reopened
   using fg_init, the previously set graphics mode is restored. This is
   useful  if the program has called a specific initialization routine (such
   as  fg_init_vga13) at the beginning of the program and later wants to
   temporarily switch to text mode without the additional overhead of
   remembering the specific initialization routine was that was previously
   called.

Example 

   This is useful if you need to temporarily switch to text mode
   int status = 0;


   fputs("EGA found. Monochrome (M) or Color Display (C)?",
   stdout);
   fflush(stdout);

   switch (getc(stdin))
   {
   case 'M':
   case 'm':
       status = fg_init_egamono();
       break;
   case 'c':
   case 'C':
       status = fg_init_egaecd();
       break;
   default:
       status = 0;
   }

   if (status == 0)
       return;

           /* MORE CODE */
   fg_term();
   system("dir");
   fg_init();
           /* MORE CODE */
   fg_term();





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