mirror of
https://github.com/szymon-jozef/checkers.git
synced 2026-10-27 19:20:44 +01:00
feat: first draft at window
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
use checkers::ui::{macroquad::main_menu::draw_main_menu, state::GuiState};
|
||||
use macroquad::{
|
||||
color::BLACK,
|
||||
color::{BLUE, RED},
|
||||
miniquad::{self, conf::LinuxBackend::WaylandWithX11Fallback},
|
||||
window::{Conf, clear_background, next_frame},
|
||||
};
|
||||
@@ -18,8 +19,28 @@ fn window_conf() -> Conf {
|
||||
|
||||
#[macroquad::main(window_conf)]
|
||||
pub async fn main() {
|
||||
env_logger::init();
|
||||
|
||||
let mut state = Default::default();
|
||||
|
||||
loop {
|
||||
clear_background(BLACK);
|
||||
next_frame().await;
|
||||
match state {
|
||||
GuiState::MainMenu => {
|
||||
draw_main_menu(&mut state).await;
|
||||
}
|
||||
|
||||
GuiState::Settings => {
|
||||
clear_background(RED);
|
||||
next_frame().await;
|
||||
}
|
||||
GuiState::Game => {
|
||||
clear_background(BLUE);
|
||||
next_frame().await;
|
||||
}
|
||||
|
||||
GuiState::Exit => {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user