-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
22 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
use crate::resources::screen_server::ScreenServer; | ||
|
||
pub trait App { | ||
fn start(&mut self); | ||
fn start(&mut self, screen_server: &mut ScreenServer); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,28 @@ | ||
use winit::keyboard::KeyCode; | ||
use wxpg::{resources::commands::Commands, run, screens::screen::Screen}; | ||
use wxpg::{app::App, resources::{commands::Commands, screen_server::{GameState, ScreenServer}}, run, screens::screen::Screen}; | ||
|
||
#[derive(Default)] | ||
pub struct TestScreen {} | ||
impl Screen for TestScreen { | ||
fn start(&mut self, commands: &mut Commands) { | ||
println!("HI"); | ||
println!("HI2"); | ||
} | ||
|
||
fn update(&mut self, commands: &mut Commands) { | ||
|
||
} | ||
} | ||
|
||
#[derive(Default)] | ||
pub struct AppTest {} | ||
impl App for AppTest { | ||
fn start(&mut self, screen_server: &mut ScreenServer) { | ||
let test = TestScreen::default(); | ||
screen_server.register_screen(test, GameState::Menu); | ||
} | ||
} | ||
|
||
fn main() { | ||
let screen = TestScreen::default(); | ||
wxpg::run(screen); | ||
let mut app = AppTest::default(); | ||
wxpg::run(&mut app); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters