[QUOTE=eratic-magician;1286171]I’m not quite sure how to use that, I did look through the API. I’ve tried this:
glfwSetMouseButtonCallback(window, GLFW_MOUSE_BUTTON_LEFT);
[/QUOTE]
look at the glfw documentation:
http://www.glfw.org/docs/latest/input_guide.html
you can find there everything you need for your application, like cursor position:
http://www.glfw.org/docs/latest/input_guide.html#cursor_pos
after you’ve created your window, call this function:
glfwSetCursorPosCallback(window, cursor_position_callback);
that sets a “function pointer” to a certain function YOU have to provide, that function has to look like this:
void cursor_position_callback(GLFWwindow* window, double xpos, double ypos)
{
}
that function will be invoked automatically when you move the cursor
take a look at my example “Main.cpp”, it’s very similar (easy to understand) to the glfw example:
https://sites.google.com/site/john87connor/home/1-1-creating-a-window
http://www.glfw.org/documentation.html
NOTE:
the “glfw window hints” i’ve set require a opengl 4.5 core profile context, so if your system doesnt support opengl 4.5, try setting them to 3.3 for example:
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
using that Main.cpp, you can detect framebuffer (= window) resize events key input, cursor moves, mouse button clicks, mouse scrolling and available joysticks (joystick inputs have to setup by querying pointers, explained here: GLFW: Input guide)