Sign in to follow this  
jennypenny

getMousePos in GLFW

Recommended Posts

Hey, I'm having a bit of problem in my programming. I'd like to get the mouseposition after clicking, so I use the function glfwgetMousePos (int *xpos, int *ypos) in GLFW. Also, i assign xpos = 0 in the beginning, and this is the answer i get wherever i click. How am i supposed to use this function correctly, so that xpos and ypos gets the current location? All help appreciated!

Share this post


Link to post
Share on other sites

static GLuint x_pos(0), y_pos(0) ;

glfwGetMousePos( &x_pos, &y_pos ) ;
// variable 'x_pos' and 'y_pos' should hold the last known coordinates
// for the mouse position. There is another function in GLFW
// that determines whether or not a button has been clicked.
// Use that in conjunction from the above example to get
// the last mouse clicking position.



~Khaosifix

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this