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,6 +1,6 @@
use crate::{error::unwrap, GraphicsContextImpl, SwBufError};
use nix::sys::memfd::{memfd_create, MemFdCreateFlag};
use raw_window_handle::{HasRawWindowHandle, WaylandDisplayHandle, WaylandWindowHandle};
use raw_window_handle::{WaylandDisplayHandle, WaylandWindowHandle};
use std::{
ffi::CStr,
fs::File,
@ -40,10 +40,10 @@ impl Drop for WaylandBuffer {
}
impl WaylandImpl {
pub unsafe fn new<W: HasRawWindowHandle>(
pub unsafe fn new(
window_handle: WaylandWindowHandle,
display_handle: WaylandDisplayHandle,
) -> Result<Self, SwBufError<W>> {
) -> Result<Self, SwBufError> {
let conn = Connection::from_backend(Backend::from_foreign_display(
display_handle.display as *mut _,
));