I\'m really stuck:
I have the mainWindow and in the main game loop I do:
// poll for input
glfwPollEvents();
this->controls->handleInput(windo
You can't pass a class's member function as a function. glfwSetCursorPosCallback
it's expecting a function and throwing the error because it gets a member function.
In other words your expected to provide a global function and pass that to glfwSetCursorPosCallback
.
If you really want the controls object to get the cursor position callback you could store an instance of Controls in a global variable and pass on the callback to that instance. Something like this:
static Controls* g_controls;
void mousePosWrapper( double x, double y )
{
if ( g_controls )
{
g_controls->handleMouse( x, y );
}
}
Then when you call glfwSetCursorPosCallback
you can pass the mousePosWrapper
function:
glfwSetCursorPosCallback( window, mousePosWrapper );