Chaque fois que je lance ceci, la fenêtre s'ouvre et je vois cela. (When I run the game, I see this)LWJGL 3: Point aléatoire (0,0) dans OpenGL Quad
Cela peut être recréée si vous faites tout simplement un nouveau projet Java, OpenGL d'importation, GLFW et LWJGL, ainsi que des indigènes, puis copiez le code (remove paquet)
package net.nathanthesnooper.timetraveller;
import static org.lwjgl.glfw.GLFW.*;
import static org.lwjgl.opengl.GL11.*;
import org.lwjgl.opengl.GL;
public class Game {
public static void main (String[] args) {
if(glfwInit() != true) {
System.err.println("GLFW Failed to initialize!");
System.exit(1);
}
long window = glfwCreateWindow(640,480,"Game", 0, 0);
glfwShowWindow(window);
glfwMakeContextCurrent(window);
GL.createCapabilities();
while(!glfwWindowShouldClose(window)) {
glfwPollEvents();
glClear(GL_COLOR_BUFFER_BIT);
glBegin(GL_QUADS);
glVertex2d(-0.5,0.5);
glVertex2d(0.5,0.5);
glVertex2d(-0.5,-0.5);
glVertex2d(0.5,-0.5);
glEnd();
glfwSwapBuffers(window);
}
glfwTerminate();
}
}
Merci, cela m'a aidé! Je suppose que je pensais que ça se réglerait automatiquement :) – nathanthesnooper