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

@ -23,6 +23,8 @@ public class Engine {
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
@ -177,7 +179,10 @@ public class Engine {
lastFrame = System.currentTimeMillis();
// Game logic should fit here
// gamepadInput(zangief, speed);
if (present) {
gamepadInput(zangief, speed);
}
input(zangief, speed);
// input(smiley2, speed);