Enable depth test
This commit is contained in:
parent
aa441eefe7
commit
386a4488a4
|
@ -82,6 +82,8 @@ int main(int argc, char** argv)
|
|||
ImVec4 clear_color = ImVec4(0.45f, 0.55f, 0.60f, 1.00f);
|
||||
float fov = 45.0;
|
||||
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
glDepthFunc(GL_LESS);
|
||||
// Required before OpenGL Calls.
|
||||
GLuint vertex_array;
|
||||
glGenVertexArrays(1, &vertex_array);
|
||||
|
@ -164,7 +166,7 @@ int main(int argc, char** argv)
|
|||
|
||||
// Clear GL buffers
|
||||
glClearColor(clear_color.x, clear_color.y, clear_color.z, clear_color.w);
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
|
||||
// Render game geometries
|
||||
glfwGetWindowSize(window, &window_width, &window_height);
|
||||
|
|
Loading…
Reference in New Issue