Clears the specified area of the screen.
#include <graph.h>
void __far _clearscreen( short area );
area | Target area |
The _clearscreen function erases the target area, filling it with the current background color. The area argument can be one of the following manifest constants (defined in GRAPH.H):
Constant | Action |
_GCLEARSCREEN | Clears and fills the entire screen |
_GVIEWPORT | Clears and fills only within the current view port |
_GWINDOW | Clears and fills only within the current text window |
None.
Standards:None
16-Bit:DOS
32-Bit:None
/* CLRSCRN.C */
#include <conio.h>
#include <graph.h>
#include <stdlib.h>
void main( void )
{
short xhalf, yhalf, xquar, yquar;
struct _videoconfig vc;
/* Find a valid graphics mode. */
if( !_setvideomode( _MAXRESMODE ) )
exit( 1 );
_getvideoconfig( &vc );
xhalf = vc.numxpixels / 2;
yhalf = vc.numypixels / 2;
xquar = xhalf / 2;
yquar = yhalf / 2;
_setviewport( 0, 0, xhalf - 1, yhalf - 1 );
_rectangle( _GBORDER, 0, 0, xhalf - 1, yhalf - 1 );
_ellipse( _GFILLINTERIOR, xquar / 4, yquar / 4,
xhalf - (xquar / 4), yhalf - (yquar / 4) );
_getch();
_clearscreen( _GVIEWPORT );
_getch();
_setvideomode( _DEFAULTMODE );
}