mirror of
https://github.com/wez/wezterm.git
synced 2024-11-10 15:04:32 +03:00
allow compiling on win and linux
This commit is contained in:
parent
c6ce005b2a
commit
f57b5deb80
@ -276,6 +276,27 @@ impl WindowOps for Window {
|
||||
func(inner.callbacks.borrow_mut().as_any(), &window);
|
||||
});
|
||||
}
|
||||
|
||||
#[cfg(feature = "opengl")]
|
||||
fn enable_opengl<
|
||||
F: Send
|
||||
+ 'static
|
||||
+ Fn(&mut dyn Any, &dyn WindowOps, failure::Fallible<std::rc::Rc<glium::backend::Context>>),
|
||||
>(
|
||||
&self,
|
||||
func: F,
|
||||
) where
|
||||
Self: Sized,
|
||||
{
|
||||
Connection::with_window_inner(self.0, move |inner| {
|
||||
let window = Window(inner.hwnd);
|
||||
func(
|
||||
inner.callbacks.borrow_mut().as_any(),
|
||||
&window,
|
||||
Err(failure::err_msg("opengl not supported in this build")),
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/// Set up bidirectional pointers:
|
||||
|
@ -487,4 +487,25 @@ impl WindowOps for Window {
|
||||
func(inner.callbacks.as_any(), &window);
|
||||
});
|
||||
}
|
||||
|
||||
#[cfg(feature = "opengl")]
|
||||
fn enable_opengl<
|
||||
F: Send
|
||||
+ 'static
|
||||
+ Fn(&mut dyn Any, &dyn WindowOps, failure::Fallible<std::rc::Rc<glium::backend::Context>>),
|
||||
>(
|
||||
&self,
|
||||
func: F,
|
||||
) where
|
||||
Self: Sized,
|
||||
{
|
||||
Connection::with_window_inner(self.0, move |inner| {
|
||||
let window = Window(inner.window_id);
|
||||
func(
|
||||
inner.callbacks.as_any(),
|
||||
&window,
|
||||
Err(failure::err_msg("opengl not supported in this build")),
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user