Skip to content

Commit

Permalink
Fix build on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Rexagon committed Feb 4, 2024
1 parent 3b30169 commit f914a5a
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions vulkanalia/src/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,17 @@ pub unsafe fn create_surface(
#[cfg(target_os = "windows")]
(Ok(RawDisplayHandle::Windows(_)), Ok(RawWindowHandle::Win32(window))) => {
use vk::KhrWin32SurfaceExtension;

let hinstance_ptr = window
.hinstance
.map(|hinstance| hinstance.get() as vk::HINSTANCE)
.unwrap_or(std::ptr::null_mut());
let hwnd_ptr = window.hwnd.get() as vk::HWND;

let info = vk::Win32SurfaceCreateInfoKHR::builder()
.hinstance(window.hinstance)
.hwnd(window.hwnd);
.hinstance(hinstance_ptr)
.hwnd(hwnd_ptr);

instance.create_win32_surface_khr(&info, None)
}
// Unsupported (currently)
Expand Down

0 comments on commit f914a5a

Please sign in to comment.