rename input callback to something more appropriate.

This commit is contained in:
2025-09-15 14:12:18 +02:00
parent 41d944ac21
commit 1e10fec9c6
3 changed files with 5 additions and 4 deletions

View File

@@ -4,7 +4,7 @@
#include <GLFW/glfw3.h>
void key_callback(GLFWwindow *win, int key, int scancode, int action, int mods) {
void input_callback(GLFWwindow *win, int key, int scancode, int action, int mods) {
(void)win, (void)key, (void)scancode, (void)action, (void)mods; // make the compiler shut up as this is fine
#ifndef NDEBUG
if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS)

View File

@@ -4,4 +4,6 @@
#include <GLFW/glfw3.h>
void key_callback(GLFWwindow *win, int key, int scancode, int action, int mods);
/* Handles incoming key inputs for `win`.
* Intended to be given as an argument to `glfwSetKeyCallback`. */
void input_callback(GLFWwindow *win, int key, int scancode, int action, int mods);

View File

@@ -41,8 +41,7 @@ int window_init(void) {
if (!gladLoadGL(glfwGetProcAddress)) return 1;
glfwSwapInterval(1); // wait 1 screen update for a redraw a.k.a. "vsync". (not really applicable in this case but eh)
// configure callbacks
glfwSetKeyCallback(win, key_callback);
glfwSetKeyCallback(win, input_callback);
// print the OpenGL version information
debug(