added isKeyDown Class for keyboard input

This commit is contained in:
Léo
2021-05-20 16:26:13 +02:00
parent 69cfdadf85
commit 282a8b0283
2 changed files with 5 additions and 0 deletions

View File

@ -19,4 +19,8 @@ public class Input extends GLFWKeyCallback {
if (glGetInteger(GL_POLYGON_MODE) == GL_FILL) glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
else glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
}
public static boolean isKeyDown(int keyCode) {
return glfwGetKey(Engine.getWindow(), keyCode) == 1;
}
}