From 72a8c9a341bc6037425ebda94e5b59f69edd0e6b Mon Sep 17 00:00:00 2001 From: Gabriel Majeri Date: Wed, 29 Aug 2018 14:44:55 +0300 Subject: [PATCH] Fix Windows surface creation --- examples/Cargo.toml | 2 +- examples/src/lib.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/Cargo.toml b/examples/Cargo.toml index 8873048..786954d 100644 --- a/examples/Cargo.toml +++ b/examples/Cargo.toml @@ -9,4 +9,4 @@ image = "0.10.4" ash = { path = "../ash" } [target.'cfg(windows)'.dependencies] -winapi = { version = "0.3.4", features = ["windef", "winuser"] } +winapi = { version = "0.3.4", features = ["windef", "libloaderapi"] } diff --git a/examples/src/lib.rs b/examples/src/lib.rs index f60dae7..0209cb2 100644 --- a/examples/src/lib.rs +++ b/examples/src/lib.rs @@ -118,11 +118,11 @@ unsafe fn create_surface( window: &winit::Window, ) -> Result { use winapi::shared::windef::HWND; - use winapi::um::winuser::GetWindow; + use winapi::um::libloaderapi::GetModuleHandleW; use winit::os::windows::WindowExt; let hwnd = window.get_hwnd() as HWND; - let hinstance = GetWindow(hwnd, 0) as *const c_void; + let hinstance = GetModuleHandleW(ptr::null()) as *const c_void; let win32_create_info = vk::Win32SurfaceCreateInfoKHR { s_type: vk::StructureType::WIN32_SURFACE_CREATE_INFO_KHR, p_next: ptr::null(),