How can I access the class instance inside a GLFW3 input callback function, for example this one.
I want my instance do something when a specific event happens. Each instance might do something different for a specific event.
Specifically, my class has a std::map< int, std::function< void()>>, where a key is mapped to a function.
EDIT: I tried the following, but this gives me an error that it doesn't match the glfwSetKeyCallback function call.
glfwSetKeyCallback(window, [this](GLFWwindow * window, int key, int scancode, int action, int mods){
addCommand(m_events.at(key));
});