an attempt to fix opengl initialization on windoze

This commit is contained in:
Alula 2021-07-07 11:41:14 +02:00
parent 4f65d42881
commit a52d095e45
No known key found for this signature in database
GPG Key ID: 3E00485503A1D8BA
1 changed files with 8 additions and 5 deletions

View File

@ -66,11 +66,14 @@ impl SDL2EventLoop {
pub fn new(sdl: &Sdl) -> GameResult<Box<dyn BackendEventLoop>> {
let event_pump = sdl.event_pump().map_err(|e| GameError::WindowError(e))?;
let video = sdl.video().map_err(|e| GameError::WindowError(e))?;
let window = video
.window("Cave Story (doukutsu-rs)", 640, 480)
.position_centered()
.resizable()
.build()
let mut window = video.window("Cave Story (doukutsu-rs)", 640, 480);
window.position_centered();
window.resizable();
#[cfg(feature = "render-opengl")]
window.opengl();
let window = window.build()
.map_err(|e| GameError::WindowError(e.to_string()))?;
let canvas = window