From b45bf8d2d0d9ae15ee39bbb51e8bcd28c91650e5 Mon Sep 17 00:00:00 2001 From: "Michael H. Gimle" Date: Tue, 8 Sep 2020 06:44:49 +0200 Subject: [PATCH] Added depth buffer handling This was originally supposed to be in there. --- src/main.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 2839b55..a641ab2 100644 --- a/src/main.rs +++ b/src/main.rs @@ -77,6 +77,8 @@ fn main() { // Set up openGL unsafe { + gl::Enable(gl::DEPTH); + gl::DepthFunc(gl::LESS); gl::Enable(gl::CULL_FACE); gl::Disable(gl::MULTISAMPLE); gl::Enable(gl::BLEND); @@ -141,7 +143,7 @@ fn main() { unsafe { gl::ClearColor(0.163, 0.163, 0.163, 1.0); - gl::Clear(gl::COLOR_BUFFER_BIT); + gl::Clear(gl::COLOR_BUFFER_BIT | gl::DEPTH_BUFFER_BIT); // Issue the necessary commands to draw your scene here