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

window: fix build when opengl is not enabled

This commit is contained in:
Wez Furlong 2020-11-22 09:24:07 -08:00
parent ddc4c1b624
commit 9bebc811d0

View File

@ -4,9 +4,9 @@ use crate::bitmaps::*;
use crate::color::Color;
use crate::connection::ConnectionOps;
use crate::{
is_egl_preferred, Clipboard, Dimensions, KeyCode, KeyEvent, Modifiers, MouseButtons,
MouseCursor, MouseEvent, MouseEventKind, MousePress, Operator, PaintContext, Point, Rect,
ScreenPoint, WindowCallbacks, WindowOps, WindowOpsMut,
Clipboard, Dimensions, KeyCode, KeyEvent, Modifiers, MouseButtons, MouseCursor, MouseEvent,
MouseEventKind, MousePress, Operator, PaintContext, Point, Rect, ScreenPoint, WindowCallbacks,
WindowOps, WindowOpsMut,
};
use anyhow::{bail, Context};
use lazy_static::lazy_static;
@ -118,6 +118,7 @@ fn take_rc_from_pointer(lparam: LPVOID) -> Rc<RefCell<WindowInner>> {
unsafe { Rc::from_raw(std::mem::transmute(lparam)) }
}
#[cfg(feature = "opengl")]
fn callback_behavior() -> glium::debug::DebugCallbackBehavior {
if cfg!(debug_assertions) && false
/* https://github.com/glium/glium/issues/1885 */
@ -134,7 +135,7 @@ impl WindowInner {
let window = Window(self.hwnd);
let conn = Connection::get().unwrap();
let gl_state = if is_egl_preferred() {
let gl_state = if crate::is_egl_preferred() {
match conn.gl_connection.borrow().as_ref() {
None => crate::egl::GlState::create(None, self.hwnd.0),
Some(glconn) => {