we don't call inputGamepad if there is no gamepad
This commit is contained in:
parent
5c48a88be4
commit
6262dd42d7
@ -23,6 +23,8 @@ public class Engine {
|
|||||||
|
|
||||||
private final List<ObjectGl> objectsGl;
|
private final List<ObjectGl> objectsGl;
|
||||||
|
|
||||||
|
private static boolean present = glfwJoystickPresent(GLFW_JOYSTICK_1);
|
||||||
|
|
||||||
private boolean running;
|
private boolean running;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -56,7 +58,7 @@ public class Engine {
|
|||||||
this.setWindow(glfwCreateWindow(width, height, "Boulevard Combattant", NULL, NULL));
|
this.setWindow(glfwCreateWindow(width, height, "Boulevard Combattant", NULL, NULL));
|
||||||
assert getWindow() != NULL;
|
assert getWindow() != NULL;
|
||||||
|
|
||||||
boolean present = glfwJoystickPresent(GLFW_JOYSTICK_1);
|
|
||||||
System.out.println(present);
|
System.out.println(present);
|
||||||
|
|
||||||
// On récupère les informations du moniteur principal
|
// On récupère les informations du moniteur principal
|
||||||
@ -177,7 +179,10 @@ public class Engine {
|
|||||||
lastFrame = System.currentTimeMillis();
|
lastFrame = System.currentTimeMillis();
|
||||||
// Game logic should fit here
|
// Game logic should fit here
|
||||||
|
|
||||||
// gamepadInput(zangief, speed);
|
if (present) {
|
||||||
|
gamepadInput(zangief, speed);
|
||||||
|
}
|
||||||
|
|
||||||
input(zangief, speed);
|
input(zangief, speed);
|
||||||
// input(smiley2, speed);
|
// input(smiley2, speed);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user