summaryrefslogtreecommitdiff
path: root/graphics
diff options
context:
space:
mode:
authoralf9310 <alf9310@rit.edu>2025-10-07 12:35:45 -0400
committerFreya Murphy <freya@freyacat.org>2025-10-08 19:37:16 -0400
commit7a62b8e86bc52cdac42c2ad1a5f79766b7bed8f9 (patch)
tree4369bc1551f01b58a2f3b7e58bb871a2a99e9876 /graphics
parentadd more default impls (diff)
downloadDungeonCrawl-7a62b8e86bc52cdac42c2ad1a5f79766b7bed8f9.tar.gz
DungeonCrawl-7a62b8e86bc52cdac42c2ad1a5f79766b7bed8f9.tar.bz2
DungeonCrawl-7a62b8e86bc52cdac42c2ad1a5f79766b7bed8f9.zip
Stubbed out some draw functions
Diffstat (limited to 'graphics')
-rw-r--r--graphics/src/lib.rs22
1 files changed, 21 insertions, 1 deletions
diff --git a/graphics/src/lib.rs b/graphics/src/lib.rs
index bba46c2..4187e6b 100644
--- a/graphics/src/lib.rs
+++ b/graphics/src/lib.rs
@@ -9,12 +9,14 @@ impl Window {
/// Instantiates a new window provided with the default
/// window `width`, `height`, and `title`.
pub fn new(width: i32, height: i32, title: &str) -> Self {
- let (handle, thread) = raylib::init()
+ let (mut handle, thread) = raylib::init()
.size(width, height)
.title(title)
.resizable()
.log_level(TraceLogLevel::LOG_WARNING)
.build();
+ // Set the target FPS (TODO: modify based on target system)
+ handle.set_target_fps(60);
Self { handle, thread }
}
@@ -28,6 +30,24 @@ impl Window {
pub fn draw(&mut self, _dungeon: &Dungeon) {
let mut draw = self.handle.begin_drawing(&self.thread);
+ // Clear the background to black
+ draw.clear_background(Color::BLACK);
+
draw.draw_text("test", 10, 10, 20, Color::GREEN);
}
+
+ /// Draw game over screen
+ pub fn game_over(&mut self) {
+ !unimplemented!()
+ }
+
+ /// Draw player sprites
+ pub fn draw_player(&mut self, _dungeon: &Dungeon) {
+ !unimplemented!()
+ }
+
+ /// Draw dungeon tiles
+ pub fn draw_tiles(&mut self, _dungeon: &Dungeon) {
+ !unimplemented!()
+ }
}