Another const cast && importing Win32Surface

This commit is contained in:
maik klein 2016-12-26 02:28:22 +01:00
parent d638849eca
commit 150e32a7c6

View file

@ -9,7 +9,7 @@ use ash::vk;
use std::default::Default; use std::default::Default;
use ash::entry::Entry; use ash::entry::Entry;
use ash::instance::Instance; use ash::instance::Instance;
use ash::extensions::{Swapchain, XlibSurface, Surface, DebugReport}; use ash::extensions::{Swapchain, XlibSurface, Surface, DebugReport, Win32Surface};
use ash::device::Device; use ash::device::Device;
use std::ptr; use std::ptr;
use std::ffi::{CStr, CString}; use std::ffi::{CStr, CString};
@ -102,7 +102,7 @@ fn create_surface(instance: &Instance,
-> Result<vk::SurfaceKHR, vk::Result> { -> Result<vk::SurfaceKHR, vk::Result> {
use winit::os::windows::WindowExt; use winit::os::windows::WindowExt;
let hwnd = window.get_hwnd() as *const (); let hwnd = window.get_hwnd() as *const ();
let hinstance = user32::GetWindow(hwnd, 0); let hinstance = user32::GetWindow(hwnd, 0) as *const ();
let win32_create_info = vk::Win32SurfaceCreateInfoKHR { let win32_create_info = vk::Win32SurfaceCreateInfoKHR {
s_type: vk::StructureType::Win32SurfaceCreateInfoKhr, s_type: vk::StructureType::Win32SurfaceCreateInfoKhr,
p_next: ptr::null(), p_next: ptr::null(),