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>getviewsettings() get current viewport information</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 getviewsettings()       Get Current Viewport Information

 #include   <graphics.h>

 void far                getviewsettings(vport);
 struct viewporttype far *vport;

    getviewsettings() returns the current viewport's absolute screen
    coordinates and clipping status.  This information is stored in the
    viewporttype structure pointed to by 'vport'.
    The viewporttype structure is defined in <graphics.h> as:

          struct viewporttype {
               int left, top, right, bottom;
               int clip;
          };


    Returns:    Nothing.

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

           #include <graphics.h>
           #include <conio.h>

           main()
           {
               int gdriver = DETECT;
               int gmode;
               struct viewporttype vtype;
               int left, top, right, bottom;

               initgraph(&gdriver,&gmode,"");
               getviewsettings(&vtype);
               left = vtype.left;
               top = vtype.top;
               right = vtype.right;
               bottom = vtype.bottom;
               rectangle(left,top,right,bottom);
               getch();
               closegraph();
           }


See Also: initgraph() getgraphmode() setviewport()

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