From 4130502a2a3f668e06b69e1b948c3e8fd17b67d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Frosteg=C3=A5rd?= Date: Sat, 26 Nov 2022 14:38:17 +0100 Subject: [PATCH] X11 GlContext::create: change display arg to *mut xlib::XDisplay --- src/gl/x11.rs | 4 +--- src/x11/window.rs | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/gl/x11.rs b/src/gl/x11.rs index df7ce0c..5e90f8d 100644 --- a/src/gl/x11.rs +++ b/src/gl/x11.rs @@ -78,14 +78,12 @@ impl GlContext { /// /// Use [Self::get_fb_config_and_visual] to create both of these things. pub unsafe fn create( - window: c_ulong, display: *mut c_void, config: FbConfig, + window: c_ulong, display: *mut xlib::_XDisplay, config: FbConfig, ) -> Result { if display.is_null() { return Err(GlError::InvalidWindowHandle); } - let display = display as *mut xlib::_XDisplay; - errors::XErrorHandler::handle(display, |error_handler| { #[allow(non_snake_case)] let glXCreateContextAttribsARB: GlXCreateContextAttribsARB = { diff --git a/src/x11/window.rs b/src/x11/window.rs index e644442..f080d4b 100644 --- a/src/x11/window.rs +++ b/src/x11/window.rs @@ -324,7 +324,7 @@ impl Window { #[cfg(feature = "opengl")] let gl_context = fb_config.map(|fb_config| { let window = window_id as c_ulong; - let display = xcb_connection.conn.get_raw_dpy() as *mut c_void; + let display = xcb_connection.conn.get_raw_dpy(); // Because of the visual negotation we had to take some extra steps to create this context let context = unsafe { platform::GlContext::create(window, display, fb_config) }