diff options
Diffstat (limited to 'engine/src/renderer/mod.rs')
-rw-r--r-- | engine/src/renderer/mod.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/engine/src/renderer/mod.rs b/engine/src/renderer/mod.rs index aa828fe..4dcc075 100644 --- a/engine/src/renderer/mod.rs +++ b/engine/src/renderer/mod.rs @@ -16,7 +16,7 @@ use crate::opengl::buffer::{ use crate::opengl::debug::{MessageSeverity, MessageSource, MessageType}; use crate::opengl::shader::Program as ShaderProgram; use crate::opengl::vertex_array::{PrimitiveKind, VertexArray}; -use crate::opengl::{clear_buffers, BufferClearMask}; +use crate::opengl::{clear_buffers, enable, BufferClearMask, Capability}; use crate::projection::new_perspective; use crate::vector::Vec2; use crate::vertex::Vertex; @@ -59,6 +59,8 @@ pub fn initialize(window: &glfw::Window) -> Result<(), Error> set_viewport(&Vec2 { x: 0, y: 0 }, &window_size); + enable(Capability::DepthTest); + Ok(()) } @@ -107,7 +109,7 @@ pub fn render<'obj>( camera: &Camera, ) { - clear_buffers(BufferClearMask::COLOR); + clear_buffers(BufferClearMask::COLOR | BufferClearMask::DEPTH); for obj in objects { obj.renderable().shader_program.activate(); |