-
Notifications
You must be signed in to change notification settings - Fork 0
/
testgraficos.cpp
40 lines (31 loc) · 924 Bytes
/
testgraficos.cpp
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
#include <graphics.h>
#include <iostream>
using namespace std;
void waitForLeftMouseClick();
int main()
{
int gd = DETECT,gm;
initgraph (& gd,& gm,NULL);
initwindow(800,600); //open a 400x300 graphics window
// delete these lines and replace them with your own code:
settextstyle(1,0,3);
setcolor(2);
outtextxy(100,200,"Consola grafica");
setcolor(4);
outtextxy(100,300,"Ahora un circulo:");
setcolor( 14 );
circle(200,400,50);
// while(!kbhit()); // wait for user to press a key
waitForLeftMouseClick(); // use one or the other of these--not both
closegraph(); //close graphics window
return 0;
}
void waitForLeftMouseClick()
{
clearmouseclick(WM_LBUTTONDOWN);
const int DELAY = 50; // Milliseconds of delay between checks
int x, y;
while (!ismouseclick(WM_LBUTTONDOWN))
delay(DELAY);
getmouseclick(WM_LBUTTONDOWN, x, y);
}