Kickstart a new rewrite of the raidillon engine
Endless refactors, refactor everyday, refactor relentlessly, refactor every morning, every day, every hour.
This commit is contained in:
commit
f7d5c14caf
19 changed files with 4391 additions and 0 deletions
31
raidillon_glium/src/platform.rs
Normal file
31
raidillon_glium/src/platform.rs
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
use raidillon_platform::Platform;
|
||||
use glium::winit::event_loop::EventLoop;
|
||||
use glium::winit::window::Window;
|
||||
use glium::backend::glutin::Display;
|
||||
use glium::glutin::surface::WindowSurface;
|
||||
use glium::backend::glutin::SimpleWindowBuilder;
|
||||
|
||||
pub struct GliumPlatform {
|
||||
event_loop: EventLoop<()>,
|
||||
window: Window,
|
||||
display: Display<WindowSurface>,
|
||||
}
|
||||
|
||||
impl Platform for GliumPlatform {
|
||||
fn initialize(title: String, width: u32, height: u32) -> Self {
|
||||
let event_loop = glium::winit::event_loop::EventLoop::builder()
|
||||
.build()
|
||||
.expect("create event-loop");
|
||||
|
||||
let (window, display) = SimpleWindowBuilder::new()
|
||||
.with_title(title.as_str())
|
||||
.with_inner_size(width, height)
|
||||
.build(&event_loop);
|
||||
|
||||
Self {
|
||||
event_loop,
|
||||
window,
|
||||
display
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue