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

Add winit window access to eframe::Frame and CreationContext (#8205)

* Related: https://github.com/emilk/egui/issues/7798
This commit is contained in:
Emil Ernerfeldt
2026-05-26 15:46:42 +02:00
committed by GitHub
parent 8f370ca7a2
commit fd57895559
4 changed files with 33 additions and 2 deletions

View File

@@ -2,7 +2,7 @@
use web_time::Instant;
use std::path::PathBuf;
use std::{path::PathBuf, sync::Arc};
use winit::event_loop::ActiveEventLoop;
use raw_window_handle::{HasDisplayHandle as _, HasWindowHandle as _};
@@ -171,7 +171,7 @@ impl EpiIntegration {
#[allow(clippy::allow_attributes, clippy::too_many_arguments)]
pub fn new(
egui_ctx: egui::Context,
window: &winit::window::Window,
window: &Arc<winit::window::Window>,
app_name: &str,
native_options: &crate::NativeOptions,
storage: Option<Box<dyn epi::Storage>>,
@@ -192,6 +192,7 @@ impl EpiIntegration {
glow_register_native_texture,
#[cfg(feature = "wgpu_no_default_features")]
wgpu_render_state,
window: Some(Arc::clone(window)),
raw_display_handle: window.display_handle().map(|h| h.as_raw()),
raw_window_handle: window.window_handle().map(|h| h.as_raw()),
};

View File

@@ -314,6 +314,7 @@ impl<'app> GlowWinitApp<'app> {
get_proc_address: Some(Arc::new(get_proc_address)),
#[cfg(feature = "wgpu_no_default_features")]
wgpu_render_state: None,
window: Some(Arc::clone(&window)),
raw_display_handle: window.display_handle().map(|h| h.as_raw()),
raw_window_handle: window.window_handle().map(|h| h.as_raw()),
};

View File

@@ -300,6 +300,7 @@ impl<'app> WgpuWinitApp<'app> {
#[cfg(feature = "glow")]
get_proc_address: None,
wgpu_render_state,
window: Some(Arc::clone(&window)),
raw_display_handle: window.display_handle().map(|h| h.as_raw()),
raw_window_handle: window.window_handle().map(|h| h.as_raw()),
};