feat: enable depth testing
This commit is contained in:
parent
c6a4cfa418
commit
c774045c92
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue