2019-01-02 22:08:13 +00:00
|
|
|
// Library
|
|
|
|
use vek::*;
|
|
|
|
|
2019-01-02 21:25:01 +00:00
|
|
|
// Crate
|
|
|
|
use crate::{
|
|
|
|
PlayState,
|
|
|
|
StateResult,
|
|
|
|
GlobalState,
|
|
|
|
window::Event,
|
|
|
|
};
|
|
|
|
|
|
|
|
pub struct TitleState;
|
|
|
|
|
|
|
|
impl TitleState {
|
|
|
|
pub fn new() -> Self {
|
|
|
|
Self
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl PlayState for TitleState {
|
|
|
|
fn play(&mut self, global_state: &mut GlobalState) -> StateResult {
|
|
|
|
let mut running = true;
|
|
|
|
while running {
|
|
|
|
global_state.window.poll_events(|event| match event {
|
|
|
|
Event::Close => running = false,
|
|
|
|
});
|
|
|
|
|
2019-01-02 22:08:13 +00:00
|
|
|
global_state.window.render_ctx_mut().clear(Rgba::new(
|
|
|
|
0.0,
|
|
|
|
0.3,
|
|
|
|
1.0,
|
|
|
|
1.0,
|
|
|
|
));
|
|
|
|
global_state.window.render_ctx_mut().flush_and_cleanup();
|
2019-01-02 21:25:01 +00:00
|
|
|
global_state.window.swap_buffers();
|
|
|
|
}
|
|
|
|
|
|
|
|
StateResult::Close
|
|
|
|
}
|
|
|
|
}
|