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>setgraphmode() set the system to graphics mode</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 setgraphmode()          Set the System to Graphics Mode

 #include   <graphics.h>

 void       far setgraphmode(mode);
 int        mode;

    setgraphmode() sets the system to graphics mode 'mode'.  'mode' must
    be one of the predefined graphics modes listed below and a valid mode
    for the current device driver. The modes (defined in <graphics.h>)
    are as follows:


    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     4**

    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    4
               VGAMED         1     640x350    16 color    2
               VGAHI          2     640x480    16 color    1

    PC3270     PC3270HI       0     720x350    2 color     1

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

    *64K EGAMONO card
    **256K EGAMONO card

      Notes:    Be sure that initgraph() has been successfully called
                before setgraphmode().

   -------------------------------- 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: getgraphmode() restorecrtmode() initgraph()

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