mirror of
https://github.com/emilk/egui.git
synced 2026-08-30 13:20:05 -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:
@@ -3,6 +3,8 @@ use winit::event_loop::EventLoopWindowTarget;
|
||||
#[cfg(target_os = "macos")]
|
||||
use winit::platform::macos::WindowBuilderExtMacOS as _;
|
||||
|
||||
use raw_window_handle::{HasRawDisplayHandle as _, HasRawWindowHandle as _};
|
||||
|
||||
#[cfg(feature = "accesskit")]
|
||||
use egui::accesskit;
|
||||
use egui::NumExt as _;
|
||||
@@ -380,6 +382,8 @@ impl EpiIntegration {
|
||||
#[cfg(feature = "wgpu")]
|
||||
wgpu_render_state,
|
||||
screenshot: std::cell::Cell::new(None),
|
||||
raw_display_handle: window.raw_display_handle(),
|
||||
raw_window_handle: window.raw_window_handle(),
|
||||
};
|
||||
|
||||
let mut egui_winit = egui_winit::State::new(event_loop);
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user