GrAPiC
Graphics for Algo/Prog in C/C++

◆ mousePos()

void grapic::mousePos ( int &  x,
int &  y 
)

After this function (x,y) store the mouse position.

int x,y;
mousePos(x,y); // test if the left button of the mouse is pressed
if ((isMousePressed(SDL_BUTTON_LEFT)) && (x>10) && (y>10) && (x<50) && (y<50)) { ... } // if the user clicks if the square (10,10)(50,50)
bool isMousePressed(int button)
return true if the mouse button 'button' is pressed
Definition: Grapic.h:486
void mousePos(int &x, int &y)
After this function (x,y) store the mouse position.