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

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
/.idea/
/.gitignore
/jeu-de-combat.iml
/target/

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;
}
}