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>getmoderange() return mode range for specified driver</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 getmoderange()          Return Mode Range for Specified Driver

 #include   <graphics.h>

 void *far  getmoderange(gdriver,lo,hi);
 int        gdriver;
 int far    *lo;
 int far    *hi;

    getmoderange() returns the range of graphics modes for the specified
    graphics driver 'gdriver'.  The lowest value is returned in 'lo' and
    the highest value in 'hi'. For more information about the graphics
    driver types and graphics modes, see the two lists in initgraph(). If
    an invalid graphics driver is specified, both 'lo' and 'hi' are set
    to -1.

    Returns:    Nothing.

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

    The following statements initialize the graphics system and get the
    graphics mode range.  If the mode is within the legitimate range,
    graphics operations are performed.

           #include <graphics.h>
           #include <stdio.h>

           main()
           {
               int gdriver = DETECT;
               int gmode, cmode;
               int *lo, *hi;

               initgraph(&gdriver,&gmode,"");
               getmoderange(gdriver,&lo,&hi);
               printf("driver #%d mode range: %d - %d\n",gdriver,lo,hi);
               cmode = getgraphmode();
               if (cmode >= lo && cmode <= hi) {
                   printf("mode %d is within bounds\n",cmode);
                  /* graphics operations*/
               }
               closegraph();
           }


See Also: initgraph() getgraphmode()

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