mirror of
https://github.com/thepigeongenerator/mcaselector-lite
synced 2026-02-08 07:33:35 +01:00
rename input callback to something more appropriate.
This commit is contained in:
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
#include <GLFW/glfw3.h>
|
#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
|
(void)win, (void)key, (void)scancode, (void)action, (void)mods; // make the compiler shut up as this is fine
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS)
|
if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS)
|
||||||
|
|||||||
@@ -4,4 +4,6 @@
|
|||||||
|
|
||||||
#include <GLFW/glfw3.h>
|
#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);
|
||||||
|
|||||||
@@ -41,8 +41,7 @@ int window_init(void) {
|
|||||||
if (!gladLoadGL(glfwGetProcAddress)) return 1;
|
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)
|
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, input_callback);
|
||||||
glfwSetKeyCallback(win, key_callback);
|
|
||||||
|
|
||||||
// print the OpenGL version information
|
// print the OpenGL version information
|
||||||
debug(
|
debug(
|
||||||
|
|||||||
Reference in New Issue
Block a user