1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-31 05:40:03 -04:00

Expose Raw Window and Display Handles (#3073)

* Expose raw window and display handles in eframe

* Ensure that no one implements `Clone` in the future

* Cleanup

---------

Co-authored-by: Matti Virkkunen <mvirkkunen@gmail.com>
This commit is contained in:
τ
2023-06-11 22:18:28 +02:00
committed by GitHub
parent 5cd40f9685
commit 073f49682d
6 changed files with 75 additions and 2 deletions

View File

@@ -3,6 +3,7 @@
use std::time::Instant;
use raw_window_handle::{HasRawDisplayHandle as _, HasRawWindowHandle as _};
use winit::event_loop::{
ControlFlow, EventLoop, EventLoopBuilder, EventLoopProxy, EventLoopWindowTarget,
};
@@ -345,7 +346,6 @@ mod glow_integration {
prelude::{GlDisplay, NotCurrentGlContextSurfaceAccessor, PossiblyCurrentGlContext},
surface::GlSurface,
};
use raw_window_handle::HasRawWindowHandle;
use super::*;
@@ -756,6 +756,8 @@ mod glow_integration {
gl: Some(gl.clone()),
#[cfg(feature = "wgpu")]
wgpu_render_state: None,
raw_display_handle: gl_window.window().raw_display_handle(),
raw_window_handle: gl_window.window().raw_window_handle(),
});
if app.warm_up_enabled() {
@@ -1215,6 +1217,8 @@ mod wgpu_integration {
#[cfg(feature = "glow")]
gl: None,
wgpu_render_state,
raw_display_handle: window.raw_display_handle(),
raw_window_handle: window.raw_window_handle(),
});
if app.warm_up_enabled() {