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

◆ mousePosGlobal()

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

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

int x,y;
mousePosGlobal(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)
void mousePosGlobal(int &x, int &y)
After this function (x,y) store the mouse position.
bool isMousePressed(int button)
return true if the mouse button 'button' is pressed
Definition: Grapic.h:486