pub struct WgpuConfiguration {
pub surface: SurfaceConfig,
pub wgpu_setup: WgpuSetup,
pub on_surface_status: Arc<dyn Fn(&CurrentSurfaceTexture) -> SurfaceErrorAction + Send + Sync>,
}Expand description
Configuration for using wgpu with eframe or the egui-wgpu winit feature.
Fields§
§surface: SurfaceConfigRuntime-mutable configuration for the surface (present mode, frame latency).
These are the fields exposed via RenderState::surface_config for live
reconfiguration at runtime.
wgpu_setup: WgpuSetupHow to create the wgpu adapter & device
on_surface_status: Arc<dyn Fn(&CurrentSurfaceTexture) -> SurfaceErrorAction + Send + Sync>Callback for surface status changes.
Called with the wgpu::CurrentSurfaceTexture result whenever acquiring a frame
does not return wgpu::CurrentSurfaceTexture::Success. For
wgpu::CurrentSurfaceTexture::Suboptimal, egui uses the frame as-is and
defers surface reconfiguration to the next frame — the callback is not invoked
in that case either.
Implementations§
Source§impl WgpuConfiguration
impl WgpuConfiguration
pub fn with_surface_config( self, surface_config: SurfaceConfig, ) -> WgpuConfiguration
Trait Implementations§
Source§impl Clone for WgpuConfiguration
impl Clone for WgpuConfiguration
Source§fn clone(&self) -> WgpuConfiguration
fn clone(&self) -> WgpuConfiguration
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for WgpuConfiguration
impl Debug for WgpuConfiguration
Source§impl Default for WgpuConfiguration
impl Default for WgpuConfiguration
Source§fn default() -> WgpuConfiguration
fn default() -> WgpuConfiguration
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for WgpuConfiguration
impl !UnwindSafe for WgpuConfiguration
impl Forget for WgpuConfiguration
impl Freeze for WgpuConfiguration
impl Move for WgpuConfiguration
impl Send for WgpuConfiguration
impl Sync for WgpuConfiguration
impl Unpin for WgpuConfiguration
impl UnsafeUnpin for WgpuConfiguration
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more