veloren/voxygen/src/menu/title.rs

41 lines
831 B
Rust
Raw Normal View History

2019-01-02 22:08:13 +00:00
// Library
use vek::*;
// 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();
global_state.window.swap_buffers();
}
StateResult::Close
}
}