pub struct Frame { /* private fields */ }
Expand description
Represents the surroundings of your app.
It provides methods to inspect the surroundings (are we on the web?), allocate textures, and change settings (e.g. window size).
Implementations§
source§impl Frame
impl Frame
sourcepub fn is_web(&self) -> bool
pub fn is_web(&self) -> bool
True if you are in a web environment.
Equivalent to cfg!(target_arch = "wasm32")
sourcepub fn info(&self) -> IntegrationInfo
pub fn info(&self) -> IntegrationInfo
Information about the integration.
sourcepub fn storage(&self) -> Option<&dyn Storage>
pub fn storage(&self) -> Option<&dyn Storage>
A place where you can store custom data in a way that persists when you restart the app.
sourcepub fn storage_mut(&mut self) -> Option<&mut (dyn Storage + 'static)>
pub fn storage_mut(&mut self) -> Option<&mut (dyn Storage + 'static)>
A place where you can store custom data in a way that persists when you restart the app.
sourcepub fn gl(&self) -> Option<&Arc<Context>>
pub fn gl(&self) -> Option<&Arc<Context>>
A reference to the underlying glow
(OpenGL) context.
This can be used, for instance, to:
- Render things to offscreen buffers.
- Read the pixel buffer from the previous frame (
glow::Context::read_pixels
). - Render things behind the egui windows.
Note that all egui painting is deferred to after the call to App::update
(egui
only collects [egui::Shape
]s and then eframe paints them all in one go later on).
To get a glow
context you need to compile with the glow
feature flag,
and run eframe using Renderer::Glow
.
sourcepub fn wgpu_render_state(&self) -> Option<&RenderState>
pub fn wgpu_render_state(&self) -> Option<&RenderState>
The underlying WGPU render state.
Only available when compiling with the wgpu
feature and using Renderer::Wgpu
.
Can be used to manage GPU resources for custom rendering with WGPU using [egui::PaintCallback
]s.