Hi guys, I have started to learn c++ yesterday, and now i have little problem due to lack of knowledge.
I developed this simple code:
#include <cstdlib>
#include <iostream>
#include <winbgim.h>
using namespace std;
int main()
{
int gdriver = 9, gmode = 2;
initgraph(&gdriver, &gmode, "");
setbkcolor(WHITE);
setcolor(BLACK);
cleardevice();
while (!kbhit())
{
if(ismouseclick(WM_MOUSEMOVE))
{
cleardevice();
line(mousex()-20,mousey(),mousex()+20,mousey());
line(mousex(),mousey()-20,mousex(),mousey()+20);
}
if(ismouseclick(WM_LBUTTONDOWN))
{
circle(mousex(),mousey(),100);
}
clearmouseclick(WM_MOUSEMOVE);
clearmouseclick(WM_LBUTTONDOWN);
}
closegraph();
return 0;
}
Question is how can i made this onclick circle to stay on screen on spot where we clicked it?
cleardevice() clear all screen, so i need something else.
Thx ahead,
Antun