2 #include <GLFW\glfw3.h>
4 class util_keyHandler {
6 GLFWwindow* windowHandle;
7 int* states_previous_frame = new int[GLFW_KEY_LAST]; // About a kb
11 bool getKeyDown(int key) {
13 if ((states_previous_frame[key] != GLFW_PRESS) && (glfwGetKey(this->windowHandle, key) == GLFW_PRESS)) {
14 states_previous_frame[key] = glfwGetKey(this->windowHandle, key);
18 states_previous_frame[key] = glfwGetKey(this->windowHandle, key);
23 bool getKey(int key) {
24 if (glfwGetKey(this->windowHandle, key) == GLFW_PRESS)
30 util_keyHandler(GLFWwindow* window) {
31 this->windowHandle = window;