diff --git a/src/hello.cpp b/src/hello.cpp index c9cd849..83d59ea 100644 --- a/src/hello.cpp +++ b/src/hello.cpp @@ -151,11 +151,13 @@ int main() GLuint shaderProgram = compileShaderProgram(); Icosphere sphere(2); + glEnable(GL_DEPTH_TEST); + // Main loop while (!glfwWindowShouldClose(window)) { glClearColor(0.2, 0.3, 0.3, 1.0); - glClear(GL_COLOR_BUFFER_BIT); + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // Render everything with the same shaders glUseProgram(shaderProgram);