Petite correction invoke in GLFWFramebufferSizeCallback

This commit is contained in:
Antoine 2021-06-02 17:30:43 +02:00
parent 80ab5fb99b
commit b5319de940
2 changed files with 11 additions and 10 deletions

View File

@ -5,7 +5,6 @@ import engine.math.*;
import engine.object.*;
import engine.sound.*;
import org.lwjgl.glfw.GLFWFramebufferSizeCallback;
import org.lwjgl.glfw.GLFWVidMode;
import org.lwjgl.opengl.GL;
@ -64,7 +63,7 @@ public class Engine {
assert getWindow() != NULL;
boolean present = glfwJoystickPresent(GLFW_JOYSTICK_1);
System.out.println("Manette détectée : " + present);
System.out.println("Manette détectée : " + present);
// On récupère les informations du moniteur principal
GLFWVidMode vidmode = glfwGetVideoMode(glfwGetPrimaryMonitor());
@ -153,14 +152,14 @@ public class Engine {
}
/**
* Est appelé àa chaque modification de la taille de la fenêtre, et modifie la taille de la zone de rendu
* Est appelé à chaque modification de la taille de la fenêtre, et modifie la taille de la zone de rendu
* pour quelle corresponde à la taille de la fenêtre
*/
private static final GLFWFramebufferSizeCallback resizeWindow = new GLFWFramebufferSizeCallback() {
@Override
public void invoke(long window, int width, int height) {
int heightViewport, widthViewport, x, y;
if (width >= height){
if (width >= height * 4.0f/3.0f){
heightViewport = height;
widthViewport = (int) (height * 4.0f/3.0f);
y = 0;
@ -173,6 +172,7 @@ public class Engine {
}
glScissor(x, y, widthViewport, heightViewport);
glViewport(x, y, widthViewport, heightViewport);
}
};
@ -198,7 +198,7 @@ public class Engine {
Engine Init
*/
Engine engine = new Engine(800, 600, 3.0f / 4.0f);
int speed = 10; //vitesse déplacement Object
int speed = 10; //vitesse d<EFBFBD>placement Object
engine.init();
// Add objects to render
@ -225,7 +225,7 @@ public class Engine {
boolean Joystick1Present = glfwJoystickPresent(GLFW_JOYSTICK_1);
/*
* Création des manettes / action
* Cr<EFBFBD>ation des manettes / action
*/
GamepadInput gamepad1 = null;
@ -251,17 +251,17 @@ public class Engine {
if (Joystick1Present) {
gamepad1.inputRefresh();
System.out.println(gamepad1.getAxisDiscreet(GLFW_GAMEPAD_AXIS_LEFT_X));
// System.out.println(gamepad1.getAxisDiscreet(GLFW_GAMEPAD_AXIS_LEFT_X));
// Check si le personnage a sauté
// Check si le personnage a sauté
if (jump.isButtonPressed()){
// Le personnage saute
System.out.println(" JE SAUTE ");
}
}
// Input.keyboardInput(zangief, speed);
// input(smiley2, speed);
KeyboardInput.keyboardInput(zangief, speed);
// input(smiley2, speed); //Code pas à jour
/*
********************

View File

@ -13,6 +13,7 @@ public class Vector3f {
public Vector3f(float x, float y){
this.x = x;
this.y = y;
this.z = 0.0f;
}
public Vector3f(float x, float y, float z){