Take a reference to a window in GraphicsContext::new, like glutin and wgpu

This commit is contained in:
Jeremy Soller 2022-12-20 08:43:26 -07:00
parent 85b4f189bd
commit 99d63063b6
13 changed files with 40 additions and 78 deletions

View file

@ -1,5 +1,5 @@
use crate::{GraphicsContextImpl, SwBufError};
use raw_window_handle::{HasRawWindowHandle, Win32WindowHandle};
use raw_window_handle::Win32WindowHandle;
use std::os::raw::c_int;
use windows_sys::Win32::Foundation::HWND;
@ -22,7 +22,7 @@ struct BitmapInfo {
}
impl Win32Impl {
pub unsafe fn new<W: HasRawWindowHandle>(handle: &Win32WindowHandle) -> Result<Self, crate::SwBufError<W>> {
pub unsafe fn new(handle: &Win32WindowHandle) -> Result<Self, crate::SwBufError> {
let dc = GetDC(handle.hwnd as HWND);
if dc == 0 {