implement input and rework window implementation

moved the window variable as a constant in the window module, and
implement more of GLFW logic, including some basic input handling.
This commit is contained in:
Quinn
2025-04-14 16:20:45 +02:00
committed by Quinn
parent 9ade61e006
commit 8c78ffdca5
5 changed files with 58 additions and 19 deletions

13
src/io/input.c Normal file
View File

@@ -0,0 +1,13 @@
// Copyright (c) 2025 Quinn
// Licensed under the MIT Licence. See LICENSE for details
#include "input.h"
#include <GLFW/glfw3.h>
void key_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)
glfwSetWindowShouldClose(win, 1);
#endif
}