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:
@@ -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.
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user