static void keyboard_input_callback_reloader(GLFWwindow* window, int key, int scancode, int action, int mods)
{
auto app = reinterpret_cast<InexorApplication*>(glfwGetWindowUserPointer(window));
app->keyboard_input_callback(window, key, scancode, action, mods);
}
// Store the current InexorApplication instance in the GLFW window user pointer.
// Since GLFW is a C-style API, we can't use a class method as callback for window resize!
// TODO: Refactor! Don't use callback functions! use manual polling in the render loop instead.
glfwSetWindowUserPointer(window, this);
// Setup callback for window resize.
// Since GLFW is a C-style API, we can't use a class method as callback for window resize!
glfwSetFramebufferSizeCallback(window, frame_buffer_resize_callback);
This is such an unnecessary ugly hack. I don't like it. Not at all. We will be using glfwGetKey
instead.