1
0
mirror of https://github.com/emilk/egui.git synced 2026-06-27 15:13:12 -04:00

eframe::App::post_rendering (#1591)

This commit is contained in:
René Rössler
2022-05-29 20:33:04 +02:00
committed by GitHub
parent abff2dcae2
commit 4a7a2d6430
8 changed files with 143 additions and 0 deletions

View File

@@ -141,6 +141,11 @@ pub trait App {
fn warm_up_enabled(&self) -> bool {
false
}
/// Called each time after the rendering the UI.
///
/// Can be used to access pixel data with `get_pixels`
fn post_rendering(&mut self, _window_size_px: [u32; 2], _frame: &Frame) {}
}
/// Options controlling the behavior of a native window.

View File

@@ -299,6 +299,13 @@ impl EpiIntegration {
full_output
}
pub fn post_rendering(&mut self, app: &mut dyn epi::App, window: &winit::window::Window) {
let inner_size = window.inner_size();
let window_size_px = [inner_size.width, inner_size.height];
app.post_rendering(window_size_px, &self.frame);
}
pub fn handle_platform_output(
&mut self,
window: &winit::window::Window,

View File

@@ -126,6 +126,8 @@ pub fn run_glow(
&textures_delta,
);
integration.post_rendering(app.as_mut(), window);
{
crate::profile_scope!("swap_buffers");
gl_window.swap_buffers().unwrap();