diff --git a/src/engine/Engine.java b/src/engine/Engine.java index 5673693..8bee48c 100644 --- a/src/engine/Engine.java +++ b/src/engine/Engine.java @@ -60,6 +60,7 @@ public class Engine { glfwSetFramebufferSizeCallback(window, resizeWindow); + glEnable(GL_DEPTH_TEST); // Z-Buffer glClearColor(0.2f, 0.3f, 0.3f, 1.0f); System.out.println("OpenGL: " + glGetString(GL_VERSION)); @@ -73,7 +74,7 @@ public class Engine { private void render(){ glClearColor(0.2f, 0.3f, 0.3f, 1.0f); - glClear(GL_COLOR_BUFFER_BIT); //SWAP avec le precedent + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); //SWAP avec le precedent scene.render(); int error = glGetError(); if (error != GL_NO_ERROR) System.out.println(error);