z-buffer
This commit is contained in:
parent
5f4b2aa56e
commit
2aa23512be
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user