summaryrefslogtreecommitdiff
path: root/engine/src/renderer/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'engine/src/renderer/mod.rs')
-rw-r--r--engine/src/renderer/mod.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/engine/src/renderer/mod.rs b/engine/src/renderer/mod.rs
index 617c60f..3052969 100644
--- a/engine/src/renderer/mod.rs
+++ b/engine/src/renderer/mod.rs
@@ -35,7 +35,7 @@ use crate::opengl::vertex_array::{
VertexArray,
};
use crate::opengl::{clear_buffers, enable, BufferClearMask, Capability};
-use crate::projection::new_perspective;
+use crate::projection::{new_perspective_matrix, Projection};
use crate::shader::Program as ShaderProgram;
use crate::texture::{Id as TextureId, List as TextureMap, Texture};
use crate::transform::Transform;
@@ -321,12 +321,12 @@ fn apply_transformation_matrices(
gl_shader_program.set_uniform_matrix_4fv(cstr!("view"), &view);
#[allow(clippy::cast_precision_loss)]
- let projection = new_perspective(
- 80.0f32.to_radians(),
- window_size.width as f32 / window_size.height as f32,
- 100.0,
- 0.1,
- );
+ let projection = match &camera.projection {
+ Projection::Perspective(perspective) => new_perspective_matrix(
+ perspective,
+ window_size.width as f32 / window_size.height as f32,
+ ),
+ };
gl_shader_program.set_uniform_matrix_4fv(cstr!("projection"), &projection);
}