veloren/voxygen/src/menu/title.rs

42 lines
923 B
Rust
Raw Normal View History

2019-01-02 22:08:13 +00:00
// Library
use vek::*;
// Crate
use crate::{
PlayState,
2019-01-07 21:10:31 +00:00
PlayStateResult,
GlobalState,
window::Event,
};
pub struct TitleState;
impl TitleState {
pub fn new() -> Self {
Self
}
}
impl PlayState for TitleState {
2019-01-07 21:10:31 +00:00
fn play(&mut self, global_state: &mut GlobalState) -> PlayStateResult {
'eventloop: loop {
// Process window events
for event in global_state.window.fetch_events() {
match event {
Event::Close => break 'eventloop PlayStateResult::Shutdown,
}
}
2019-01-07 21:10:31 +00:00
global_state.window.renderer_mut().clear(Rgba::new(
2019-01-02 22:08:13 +00:00
0.0,
0.3,
1.0,
1.0,
));
2019-01-07 21:10:31 +00:00
global_state.window.renderer_mut().flush();
2019-01-11 17:30:13 +00:00
global_state.window.display()
.expect("Failed to display window");
}
}
}