mirror of
https://github.com/emilk/egui.git
synced 2026-06-27 15:13:12 -04:00
Handle viewport commands in EguiGlow
This commit is contained in:
@@ -989,7 +989,7 @@ fn translate_cursor(cursor_icon: egui::CursorIcon) -> Option<winit::window::Curs
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
pub fn process_viewport_commands(
|
||||
commands: Vec<ViewportCommand>,
|
||||
commands: impl IntoIterator<Item = ViewportCommand>,
|
||||
window: &winit::window::Window,
|
||||
is_viewport_focused: bool,
|
||||
) {
|
||||
|
||||
@@ -50,13 +50,24 @@ impl EguiGlow {
|
||||
let raw_input = self
|
||||
.egui_winit
|
||||
.take_egui_input(window, ViewportIdPair::ROOT);
|
||||
|
||||
let egui::FullOutput {
|
||||
platform_output,
|
||||
textures_delta,
|
||||
shapes,
|
||||
..
|
||||
viewports,
|
||||
viewport_commands,
|
||||
} = self.egui_ctx.run(raw_input, run_ui);
|
||||
|
||||
if viewports.len() > 1 {
|
||||
log::warn!("Multiple viewports not yet supported by EguiGlow");
|
||||
}
|
||||
egui_winit::process_viewport_commands(
|
||||
viewport_commands.into_iter().map(|(_id, command)| command),
|
||||
window,
|
||||
true,
|
||||
);
|
||||
|
||||
self.egui_winit.handle_platform_output(
|
||||
window,
|
||||
ViewportId::ROOT,
|
||||
|
||||
Reference in New Issue
Block a user