feat: enable depth testing
This commit is contained in:
		
							parent
							
								
									c6a4cfa418
								
							
						
					
					
						commit
						c774045c92
					
				@ -151,11 +151,13 @@ int main()
 | 
				
			|||||||
    GLuint shaderProgram = compileShaderProgram();
 | 
					    GLuint shaderProgram = compileShaderProgram();
 | 
				
			||||||
    Icosphere sphere(2);
 | 
					    Icosphere sphere(2);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    glEnable(GL_DEPTH_TEST);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // Main loop
 | 
					    // Main loop
 | 
				
			||||||
    while (!glfwWindowShouldClose(window))
 | 
					    while (!glfwWindowShouldClose(window))
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        glClearColor(0.2, 0.3, 0.3, 1.0);
 | 
					        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
 | 
					        // Render everything with the same shaders
 | 
				
			||||||
        glUseProgram(shaderProgram);
 | 
					        glUseProgram(shaderProgram);
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user