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>clearviewport() erase the current viewport</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 clearviewport()         Erase the Current Viewport

 #include   <graphics.h>

 void far   clearviewport(void);

    clearviewport() clears the current viewport.  The current position
    (CP) is returned to home position (0,0).

    Returns:    Nothing.

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

    The following statements establish a viewport and draws two
    rectangles in the viewport. The viewport is cleared and one more
    rectangle is drawn in it.

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

           main()
           {
               int gdriver = DETECT;
               int gmode;

               initgraph(&gdriver,&gmode,"");
               setviewport(0,0,400,200,1);
               rectangle(100,50,300,100);
               rectangle(200,25,400,75);
               getch();
               clearviewport();
               rectangle(300,50,400,100);
               getch();
               closegraph();
           }


See Also: cleardevice() getviewsettings()

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