diff --git a/wgpu-hal/src/dx12/instance.rs b/wgpu-hal/src/dx12/instance.rs index 5476eb1412..50a3b62edd 100644 --- a/wgpu-hal/src/dx12/instance.rs +++ b/wgpu-hal/src/dx12/instance.rs @@ -93,7 +93,7 @@ impl crate::Instance for super::Instance { raw_window_handle::RawWindowHandle::Win32(handle) => Ok(super::Surface { factory: self.factory.clone(), factory_media: self.factory_media.clone(), - target: SurfaceTarget::WndHandle(handle.hwnd as *mut _), + target: SurfaceTarget::WndHandle(handle.hwnd.get() as *mut _), supports_allow_tearing: self.supports_allow_tearing, swap_chain: None, }), diff --git a/wgpu-hal/src/gles/wgl.rs b/wgpu-hal/src/gles/wgl.rs index 677b7c55cc..f0c2f4ce7a 100644 --- a/wgpu-hal/src/gles/wgl.rs +++ b/wgpu-hal/src/gles/wgl.rs @@ -441,7 +441,7 @@ impl crate::Instance for Instance { ))); }; Ok(Surface { - window: window.hwnd as *mut _, + window: window.hwnd.get() as *mut _, presentable: true, swapchain: None, srgb_capable: self.srgb_capable, diff --git a/wgpu-hal/src/vulkan/instance.rs b/wgpu-hal/src/vulkan/instance.rs index 59efada01b..8e55c5badf 100644 --- a/wgpu-hal/src/vulkan/instance.rs +++ b/wgpu-hal/src/vulkan/instance.rs @@ -758,7 +758,7 @@ impl crate::Instance for super::Instance { use winapi::um::libloaderapi::GetModuleHandleW; let hinstance = unsafe { GetModuleHandleW(std::ptr::null()) }; - self.create_surface_from_hwnd(hinstance as *mut _, handle.hwnd) + self.create_surface_from_hwnd(hinstance as *mut _, handle.hwnd.get() as *mut _) } #[cfg(target_os = "macos")] (Rwh::AppKit(handle), _)