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>cleardevice() clear the graphics screen</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 cleardevice()           Clear the Graphics Screen

 #include   <graphics.h>

 void far   cleardevice(void);

    cleardevice() erases the entire graphics screen and moves the current
    position (CP) to home position which is the upper left hand corner of
    the screen with coordinates (0,0).  All other graphics system
    settings, such as the viewport settings, the line settings, the style
    settings, etc., remain the same.

    Returns:    Nothing.

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

    The following statements draw two rectangles, clear the entire screen
    then draw another rectangle.

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

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

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


See Also: clearviewport()

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