feat: enable depth testing

This commit is contained in:
Cat Flynn 2023-08-03 10:28:14 +02:00 committed by ktyl
parent c6a4cfa418
commit c774045c92
1 changed files with 3 additions and 1 deletions

View File

@ -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);