1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-13 07:22:52 +03:00

window: fixup tests for opengl init changes

This commit is contained in:
Wez Furlong 2020-06-15 12:33:30 -07:00
parent aa93008935
commit 6744a0235d

View File

@ -23,6 +23,19 @@ impl WindowCallbacks for MyWindow {
frame.clear_color_srgb(0.15, 0.15, 0.15, 1.0);
}
#[cfg(feature = "opengl")]
fn opengl_initialize(
&mut self,
_window: &dyn WindowOps,
context: anyhow::Result<std::rc::Rc<glium::backend::Context>>,
) -> anyhow::Result<()> {
match context {
Ok(_ctx) => eprintln!("opengl enabled!"),
Err(err) => eprintln!("opengl fail: {}", err),
};
Ok(())
}
fn as_any(&mut self) -> &mut dyn Any {
self
}
@ -41,13 +54,7 @@ fn spawn_window() -> anyhow::Result<()> {
)?;
#[cfg(feature = "opengl")]
win.enable_opengl(|_any, _window, maybe_ctx| {
match maybe_ctx {
Ok(_ctx) => eprintln!("opengl enabled!"),
Err(err) => eprintln!("opengl fail: {}", err),
};
Ok(())
});
win.enable_opengl();
#[cfg(not(feature = "opengl"))]
eprintln!(