Skip to main content

Module offscreen

Module offscreen 

Source
Expand description

One egui pass drawn into an offscreen texture: the desktop loop’s captures while the window is not being drawn. Render one egui pass into an offscreen texture and read it back.

The desktop loop’s on-demand pass (desktop_loop) never presents to the window: a hidden Wayland surface gets no frame callbacks, and presenting to it can block. A capture asked for during such a pass is drawn here instead, with the window’s own egui_wgpu::RenderState: the same device, the same renderer (so its textures and the 3D viewport’s paint-callback resources are the ones the window draws with) and the same target format.

Functions§

apply_texture_frees
Free the textures the pass released, after anything that drew with them.
apply_texture_sets
Upload the pass’s new and changed textures to the shared renderer. The window’s next real frame never sees this pass’s texture delta, so the pass must apply it itself (a font atlas page added here is drawn there).
capture
Draw shapes at size_px (pixels_per_point) over clear and return the picture. Its texture delta must already be applied (apply_texture_sets).