Skip to content

Commit

Permalink
[vent-window] Fix compile on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Snowiiii committed Jun 23, 2024
1 parent 659f9d7 commit 4355300
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 5 additions & 1 deletion crates/vent-rendering/src/surface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use std::os::raw::c_char;

use ash::{
khr::{surface},
khr::surface,
prelude::*,
vk, Entry, Instance,
};
Expand All @@ -19,6 +19,8 @@ pub unsafe fn create_surface(
match (display_handle.as_raw(), window_handle.as_raw()) {
#[cfg(target_os = "windows")]
(RawDisplayHandle::Windows(_), RawWindowHandle::Win32(window)) => {
use ash::khr::win32_surface;

let surface_desc = vk::Win32SurfaceCreateInfoKHR::default()
.hwnd(window.hwnd.get())
.hinstance(
Expand Down Expand Up @@ -118,6 +120,8 @@ pub fn enumerate_required_extensions(
let extensions = match display_handle {
#[cfg(target_os = "windows")]
RawDisplayHandle::Windows(_) => {
use ash::khr::win32_surface;

const WINDOWS_EXTS: [*const c_char; 2] =
[surface::NAME.as_ptr(), win32_surface::NAME.as_ptr()];
&WINDOWS_EXTS
Expand Down
6 changes: 3 additions & 3 deletions crates/vent-window/src/platform/windows/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pub struct PlatformWindow {
}

impl PlatformWindow {
pub fn create_window(attribs: &crate::WindowAttribs) -> Self {
pub fn create_window(attribs: crate::WindowAttribs) -> Self {
let app_name = windows_sys::core::w!("WinAPIApp");

let h_instance = unsafe { GetModuleHandleW(null_mut()) };
Expand Down Expand Up @@ -66,8 +66,8 @@ impl PlatformWindow {

Self {
hwnd,
width: attribs.width,
height: attribs.height,
width: attribs.width.into(),
height: attribs.height.into(),
}
}

Expand Down

0 comments on commit 4355300

Please sign in to comment.