diff options
| author | Freya Murphy <freya@freyacat.org> | 2025-10-07 13:27:13 -0400 |
|---|---|---|
| committer | Freya Murphy <freya@freyacat.org> | 2025-10-08 19:37:16 -0400 |
| commit | 3c0ce13781240f52180c9846ed19c486499d4578 (patch) | |
| tree | 4b866bac36743192d182aa9fe53b9aa70a6d3870 /graphics | |
| parent | Proposal Template Created (diff) | |
| download | DungeonCrawl-3c0ce13781240f52180c9846ed19c486499d4578.tar.gz DungeonCrawl-3c0ce13781240f52180c9846ed19c486499d4578.tar.bz2 DungeonCrawl-3c0ce13781240f52180c9846ed19c486499d4578.zip | |
add some functionality to Pos
Diffstat (limited to 'graphics')
| -rw-r--r-- | graphics/src/lib.rs | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/graphics/src/lib.rs b/graphics/src/lib.rs index 982f092..1991c18 100644 --- a/graphics/src/lib.rs +++ b/graphics/src/lib.rs @@ -29,7 +29,12 @@ impl Window { /// Draws a frame provided with the game state `Dungeon` pub fn draw(&mut self, _dungeon: &Dungeon) { + let fps = self.handle.get_fps(); let mut draw = self.handle.begin_drawing(&self.thread); + draw.clear_background(Color::BLACK); + + let fps_str = format!("{fps}"); + draw.draw_text(&fps_str, 100, 100, 30, Color::YELLOW); // Clear the background to black draw.clear_background(Color::BLACK); @@ -39,16 +44,16 @@ impl Window { /// Draw game over screen pub fn game_over(&mut self) { - !unimplemented!() + unimplemented!() } /// Draw player sprites pub fn draw_player(&mut self, _dungeon: &Dungeon) { - !unimplemented!() + unimplemented!() } /// Draw dungeon tiles pub fn draw_tiles(&mut self, _dungeon: &Dungeon) { - !unimplemented!() + unimplemented!() } } |