Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Borland C++ 2.x ( with Turbo C ) - <b>getgraphmode() get the current graphics mode</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 getgraphmode()          Get the Current Graphics Mode

 #include   <graphics.h>

 int far    getgraphmode(void);

    getgraphmode() returns the current graphics mode set by a previously
    successful call to initgraph() or setgraphmode(). With the current
    graphics mode stored in a temporary variable, the system can be set
    to various graphics modes supported by the driver, or to text mode,
    and then restored via setgraphmode().

    The following table lists the pre-defined graphics modes:

    GRAPHICS
    DRIVER   GRAPHICS_MODES  VALUE   RES      PALETTE   PAGES

    CGA        CGAC0          0     320x200    C0          1
               CGAC1          1     320x200    C1          1
               CGAC2          2     320x200    C2          1
               CGAC3          3     320x200    C3          1
               CGAHI          4     640x200    2 color     1

    MCGA       MCGAC0         0     320x200    C0          1
               MCGAC1         1     320x200    C1          1
               MCGAC2         2     320x200    C2          1
               MCGAC3         3     320x200    C3          1
               MCGAMED        4     640x200    2 color     1
               MCGAHI         5     640x480    2 color     1

    EGA        EGALO          0     640x200    16 color    4
               EGAHI          1     640x350    16 color    2

    EGA64      EGA64LO        0     640x200    16 color    1
               EGA64HI        1     640x350    4 color     1

    EGAMONO    EGAMONOHI      3     640x350    2 color     1*
               EGAMONOHI      3     640x350    2 color     2**

    HERCMONO   HERCMONOHI     0     720x348    2 color     2

    ATT400     ATT400C0       0     320x200    C0          1
               ATT400C1       1     320x200    C1          1
               ATT400C2       2     320x200    C2          1
               ATT400C3       3     320x200    C3          1
               ATT400MED      4     640x200    2 color     1
               ATT400HI       5     640x400    2 color     1

    VGA        VGALO          0     640x200    16 color    2
               VGAMED         1     640x350    16 color    2
               VGAHI          2     640x480    16 color    1

    PC3270     PC3270HI       0     720x350     2 color     1

    IBM8514    IBM8514LO      0     640x480    256 color
               IBM8514HI      1     1024x768   256 color

    *64K EGAMONO card
    **256K EGAMONO card

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

    The following statements save the current graphics mode before
    changing it to something else and restore it before the program
    terminates.

           #include <graphics.h>

           int gdriver = DETECT;
           int gmode;

           main()
           {
               int savemode;

               initgraph(&gdriver,&gmode,"");
               savemode = getgraphmode();
               .
               .
           /* change to other graphics or text mode*/
               .
               .
               setgraphmode(savemode);
               closegraph();
           }


See Also: setgraphmode()

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