summaryrefslogtreecommitdiffstats
path: root/src/main.rs
diff options
context:
space:
mode:
authorNao Pross <naopross@thearcway.org>2018-12-17 18:39:19 +0100
committerNao Pross <naopross@thearcway.org>2018-12-17 18:39:19 +0100
commit5e8139c883fd5ac08608bddd1b3efd0a6f26409a (patch)
treea13fca9d6d6fd17a96d06e75c9ef284ce4b9b339 /src/main.rs
parentImplement rendering (drawing) of tiles (diff)
downloadSubconscious-rs-5e8139c883fd5ac08608bddd1b3efd0a6f26409a.tar.gz
Subconscious-rs-5e8139c883fd5ac08608bddd1b3efd0a6f26409a.zip
Encapsulate graphics functions to share a state with loaded resources
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main.rs b/src/main.rs
index b5190bf..7b2809c 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -32,17 +32,17 @@ fn main() {
let game_state = game_state_mutex.clone();
let graphics_thread = thread::spawn(move || {
- let mut window = graphics::start();
+ let mut graphics = graphics::Graphics::new();
- while window.is_open() {
+ while graphics.is_running() {
// aquire state resource
let game_state = match game_state.lock() {
Ok(game_state) => game_state,
Err(poisoned) => poisoned.into_inner(),
};
- graphics::render(&mut window, &game_state);
- graphics::update(&mut window);
+ graphics.render(&game_state);
+ graphics.update();
}
{