examples: Update to winapi 0.3 and winit 0.11
This commit is contained in:
parent
8e3e3b9e72
commit
91da74fca4
|
@ -4,10 +4,9 @@ version = "0.1.0"
|
|||
authors = ["maik klein <maikklein@googlemail.com>"]
|
||||
|
||||
[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"] }
|
||||
|
|
|
@ -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<E: EntryV1_0, I: InstanceV1_0>(
|
|||
instance: &I,
|
||||
window: &winit::Window,
|
||||
) -> Result<vk::SurfaceKHR, vk::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(),
|
||||
|
|
Loading…
Reference in a new issue