Would someone mind showing an actual example about how to use the GFLWSetMousePosCallback? The example in the User's Guide and the Reference aren't helping me much, and I have a feeling once I see actual code I'll understand. Thanks!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
void GLFWCALL mouseposfun( int x, int y )
{
printf("Mouse pos = %d,%d\n", x, y);
}
int main(void)
{
glfwInit();
glfwOpenWindow(100,100,8,8,8,0,0,0,GLFW_WINDOW);
glfwSetMousePosCallback(mouseposfun);
do
{
glfwPollEvents(); // <- this is where mouseposfun is called
}
while( !glfwGetKey(GLFW_KEY_ESC) );
glfwTerminate();
}
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Would someone mind showing an actual example about how to use the GFLWSetMousePosCallback? The example in the User's Guide and the Reference aren't helping me much, and I have a feeling once I see actual code I'll understand. Thanks!
void GLFWCALL mouseposfun( int x, int y )
{
printf("Mouse pos = %d,%d\n", x, y);
}
int main(void)
{
glfwInit();
glfwOpenWindow(100,100,8,8,8,0,0,0,GLFW_WINDOW);
glfwSetMousePosCallback(mouseposfun);
do
{
glfwPollEvents(); // <- this is where mouseposfun is called
}
while( !glfwGetKey(GLFW_KEY_ESC) );
glfwTerminate();
}