1
1
mirror of https://github.com/wez/wezterm.git synced 2024-12-24 22:01:47 +03:00

allow compiling on win and linux

This commit is contained in:
Wez Furlong 2019-10-24 10:37:40 -07:00
parent c6ce005b2a
commit f57b5deb80
2 changed files with 42 additions and 0 deletions

View File

@ -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:

View File

@ -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")),
);
});
}
}