1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
|
#include <graphics.h>
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>
int main(void)
{
int DETECT;
int gdriver = DETECT, gmode, errorcode;
int maxx, maxy;
initgraph(&gdriver, &gmode, "c:\\bor\\turbo5\\bgi");
errorcode = graphresult();
if (errorcode != grOk)
{
printf("Graphics error: %s\n", grapherrormsg(errorcode));
printf("Press any key to halt:");
getch();
exit(1);
}
maxx = getmaxx();
maxy = getmaxy();
setlinestyle(DOTTED_LINE, 0, 3); line(0, 0, maxx, maxy);
outtextxy(maxx/2, maxy/3, "Before default values are restored.");
getch();
graphdefaults();
cleardevice();
line(0, 0, maxx, maxy);
outtextxy(maxx/2, maxy/3, "After restoring default values.");
getch();
closegraph();
return 0;
}
|