From 91da74fca4c06491f3947019bae262d6eed3ef58 Mon Sep 17 00:00:00 2001 From: Lucien Greathouse Date: Sat, 3 Mar 2018 00:02:43 -0800 Subject: [PATCH] examples: Update to winapi 0.3 and winit 0.11 --- examples/Cargo.toml | 5 ++--- examples/src/lib.rs | 9 +++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/examples/Cargo.toml b/examples/Cargo.toml index fd51f40..3ad5c47 100644 --- a/examples/Cargo.toml +++ b/examples/Cargo.toml @@ -4,10 +4,9 @@ version = "0.1.0" authors = ["maik klein "] [dependencies] -winit = "0.9.0" +winit = "0.11.1" image = "0.10.4" ash = { path = "../ash" } [target.'cfg(windows)'.dependencies] -user32-sys = "0.2.0" -winapi = "0.2.8" +winapi = { version = "0.3.4", features = ["windef", "winuser"] } diff --git a/examples/src/lib.rs b/examples/src/lib.rs index 218caa3..55c4862 100644 --- a/examples/src/lib.rs +++ b/examples/src/lib.rs @@ -1,8 +1,6 @@ #[macro_use] extern crate ash; #[cfg(windows)] -extern crate user32; -#[cfg(windows)] extern crate winapi; extern crate winit; @@ -117,9 +115,12 @@ unsafe fn create_surface( instance: &I, window: &winit::Window, ) -> Result { + use winapi::shared::windef::HWND; + use winapi::um::winuser::GetWindow; use winit::os::windows::WindowExt; - let hwnd = window.get_hwnd() as *mut winapi::windef::HWND__; - let hinstance = user32::GetWindow(hwnd, 0) as *const vk::c_void; + + let hwnd = window.get_hwnd() as HWND; + let hinstance = GetWindow(hwnd, 0) as *const vk::c_void; let win32_create_info = vk::Win32SurfaceCreateInfoKHR { s_type: vk::StructureType::Win32SurfaceCreateInfoKhr, p_next: ptr::null(),