Proper fix for winit / cpal conflict

This commit is contained in:
Imbris 2020-07-12 23:11:48 -04:00
parent 29c877cff3
commit 8cd2207495

View File

@ -496,14 +496,19 @@ impl Window {
let size = settings.graphics.window_size;
let win_builder = glutin::window::WindowBuilder::new()
let win_builder = winit::window::WindowBuilder::new()
.with_title("Veloren")
.with_inner_size(glutin::dpi::LogicalSize::new(
size[0] as f64,
size[1] as f64,
))
.with_inner_size(winit::dpi::LogicalSize::new(size[0] as f64, size[1] as f64))
.with_maximized(true);
// Avoid cpal / winit OleInitialize conflict
// See: https://github.com/rust-windowing/winit/pull/1524
#[cfg(target_os = "windows")]
let win_builder = winit::platform::windows::WindowBuilderExtWindows::with_drag_and_drop(
win_builder,
false,
);
let (window, device, factory, win_color_view, win_depth_view) =
glutin::ContextBuilder::new()
.with_gl(glutin::GlRequest::Specific(glutin::Api::OpenGl, (3, 2)))