From 2c9c5bbbe5246af1c3ac5fb8a0eb9856ed1d1d80 Mon Sep 17 00:00:00 2001 From: i509VCB Date: Sun, 29 May 2022 02:05:57 -0500 Subject: [PATCH] expose egl display in gles (#2670) --- wgpu-hal/src/gles/egl.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/wgpu-hal/src/gles/egl.rs b/wgpu-hal/src/gles/egl.rs index 9539fe211..06167ec84 100644 --- a/wgpu-hal/src/gles/egl.rs +++ b/wgpu-hal/src/gles/egl.rs @@ -580,6 +580,24 @@ pub struct Instance { inner: Mutex, } +impl Instance { + pub fn raw_display(&self) -> egl::Display { + self.inner + .try_lock() + .expect("Could not lock instance. This is most-likely a deadlock.") + .egl + .display + } + + /// Returns the version of the EGL display. + pub fn egl_version(&self) -> (i32, i32) { + self.inner + .try_lock() + .expect("Could not lock instance. This is most-likely a deadlock.") + .version + } +} + unsafe impl Send for Instance {} unsafe impl Sync for Instance {}