we don't call inputGamepad if there is no gamepad

This commit is contained in:
Léo 2021-05-24 19:24:57 +02:00
parent 5c48a88be4
commit 6262dd42d7

View File

@ -22,6 +22,8 @@ public class Engine {
private static long window;
private final List<ObjectGl> objectsGl;
private static boolean present = glfwJoystickPresent(GLFW_JOYSTICK_1);
private boolean running;
@ -56,7 +58,7 @@ public class Engine {
this.setWindow(glfwCreateWindow(width, height, "Boulevard Combattant", NULL, NULL));
assert getWindow() != NULL;
boolean present = glfwJoystickPresent(GLFW_JOYSTICK_1);
System.out.println(present);
// On récupère les informations du moniteur principal
@ -176,8 +178,11 @@ public class Engine {
while(engine.isRunning()){
lastFrame = System.currentTimeMillis();
// Game logic should fit here
// gamepadInput(zangief, speed);
if (present) {
gamepadInput(zangief, speed);
}
input(zangief, speed);
// input(smiley2, speed);