diff options
Diffstat (limited to 'graphics/src/lib.rs')
| -rw-r--r-- | graphics/src/lib.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/graphics/src/lib.rs b/graphics/src/lib.rs index 8dccd63..43bf3ac 100644 --- a/graphics/src/lib.rs +++ b/graphics/src/lib.rs @@ -1,6 +1,8 @@ //! The `graphics` crate contains the core functionality for //! rendering using the `raylib` library. +use std::time::Duration; + use dungeon::Dungeon; use raylib::prelude::*; @@ -9,6 +11,7 @@ use crate::render::Renderer; mod audio; mod render; +mod timer; /// The `Error` type used within this crate pub type Error = Box<dyn std::error::Error>; @@ -77,7 +80,6 @@ impl From<Key> for KeyboardKey { } /// The `WindowBuilder` type allows setting partial options for the window -#[derive(Debug)] pub struct WindowBuilder<'a> { title: &'a str, width: u16, @@ -182,7 +184,6 @@ impl Default for WindowBuilder<'_> { } /// The `Window` type represents the game window -#[derive(Debug)] pub struct Window { // persistant renderer renderer: Renderer, @@ -211,8 +212,8 @@ impl Window { } /// Returns the per frame delta time - pub fn delta_time(&self) -> f32 { - self.handle.get_frame_time() + pub fn delta_time(&self) -> Duration { + self.renderer.delta_time() } /// Returns if the provided `Key` has just been pressed |