mirror of https://github.com/E-Almqvist/hsf
parent
09c9bef16d
commit
06d2976347
@ -0,0 +1,17 @@ |
||||
extern crate sdl2; |
||||
|
||||
use sdl2::pixels::Color; |
||||
use sdl2::event::Event; |
||||
use sdl2::keyboard::Keycode; |
||||
use std::time::Duration; |
||||
|
||||
pub fn create_window(title: &str, width: u32, height: u32) -> (sdl2::video::Window, sdl2::Sdl, sdl2::VideoSubsystem) { |
||||
let ctx = sdl2::init().unwrap(); |
||||
let vid_sys = ctx.video().unwrap(); |
||||
|
||||
let window = vid_sys.window(title, width, height) |
||||
.position_centered() |
||||
.build() |
||||
.unwrap(); |
||||
return (window, ctx, vid_sys); |
||||
} |
Loading…
Reference in new issue