This commit is contained in:
Pcornat 2026-09-24 19:20:35 +02:00
commit 25278cb496
Signed by: Pcornat
GPG key ID: E0326CC678A00BDD

View file

@ -24,7 +24,9 @@ namespace gui {
glfwMakeContextCurrent(wwindow.get()); glfwMakeContextCurrent(wwindow.get());
glfwSetFramebufferSizeCallback(wwindow.get(), glfwSetFramebufferSizeCallback(wwindow.get(),
framebufferCallback != nullptr ? framebufferCallback : internalFramebufferCallback); framebufferCallback != nullptr
? framebufferCallback
: internalFramebufferCallback);
glfwSwapInterval(1); // VSync on glfwSwapInterval(1); // VSync on
glfwSetKeyCallback(wwindow.get(), key_callback); glfwSetKeyCallback(wwindow.get(), key_callback);
@ -50,7 +52,9 @@ namespace gui {
void Window::key_callback(GLFWwindow *window, const int key, const int scancode, const int action, const int mods) { void Window::key_callback(GLFWwindow *window, const int key, const int scancode, const int action, const int mods) {
auto *modules = static_cast<modulesType *>(glfwGetWindowUserPointer(window)); auto *modules = static_cast<modulesType *>(glfwGetWindowUserPointer(window));
std::ranges::for_each(*modules, std::ranges::for_each(*modules,
[=](modulesType::reference item) { item.second->key_callback(key, scancode, action, mods); }); [=](modulesType::reference item) {
item.second->key_callback(key, scancode, action, mods);
});
} }
void Window::cursor_position_callback(GLFWwindow *window, const double xpos, const double ypos) { void Window::cursor_position_callback(GLFWwindow *window, const double xpos, const double ypos) {