diff options
Diffstat (limited to 'engine/src/renderer/mod.rs')
-rw-r--r-- | engine/src/renderer/mod.rs | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/engine/src/renderer/mod.rs b/engine/src/renderer/mod.rs index c34441c..9cd379d 100644 --- a/engine/src/renderer/mod.rs +++ b/engine/src/renderer/mod.rs @@ -1,6 +1,8 @@ use std::ffi::{c_void, CString}; use std::process::abort; +use glfw::WindowSize; + use crate::vector::Vec2; pub fn initialize(window: &glfw::Window) -> Result<(), Error> @@ -35,15 +37,7 @@ pub fn render() } } -/// Renderer error. -#[derive(Debug, thiserror::Error)] -pub enum Error -{ - #[error("Failed to get window size")] - GetWindowSizeFailed(#[source] glfw::Error), -} - -fn set_viewport(position: &Vec2<u32>, size: &crate::WindowSize) +pub fn set_viewport(position: &Vec2<u32>, size: &WindowSize) { unsafe { #[allow(clippy::cast_possible_wrap)] @@ -55,3 +49,11 @@ fn set_viewport(position: &Vec2<u32>, size: &crate::WindowSize) ); } } + +/// Renderer error. +#[derive(Debug, thiserror::Error)] +pub enum Error +{ + #[error("Failed to get window size")] + GetWindowSizeFailed(#[source] glfw::Error), +} |