pub struct State {Show 14 fields
pub window_surface: Surface<'static>,
pub device: Arc<Device>,
pub queue: Arc<Queue>,
pub config: SurfaceConfiguration,
pub is_surface_configuration: bool,
pub render_pipeline: RenderPipeline,
pub texture_bind_group_layout: Arc<BindGroupLayout>,
pub depth_texture: Texture,
pub last_render_time: Instant,
pub camera: CameraRig,
pub light: LightRig,
pub wind: WindRig,
pub shadow: ShadowRig,
pub sky: SkyRig,
/* private fields */
}Fields§
§window_surface: Surface<'static>§device: Arc<Device>§queue: Arc<Queue>§config: SurfaceConfiguration§is_surface_configuration: bool§render_pipeline: RenderPipeline§texture_bind_group_layout: Arc<BindGroupLayout>§depth_texture: Texture§last_render_time: Instant§camera: CameraRig§light: LightRig§wind: WindRig§shadow: ShadowRig§sky: SkyRigImplementations§
Source§impl State
impl State
pub async fn new( target: impl HasWindowHandle + HasDisplayHandle + WasmNotSendSync + 'static, window_size: WindowSize, ) -> Result<Self>
pub fn resize(&mut self, height: u32, width: u32)
pub fn render(&mut self) -> Result<(), SurfaceError>
pub fn render_with_overlay( &mut self, overlay: &mut dyn FnMut(&Device, &Queue, &mut CommandEncoder, &TextureView), ) -> Result<(), SurfaceError>
pub fn spawn_model(&mut self, model_desc: ModelDesc<'_>) -> Ingot<Model>
pub fn light_handle(&mut self) -> Light
Auto Trait Implementations§
impl !Freeze for State
impl !RefUnwindSafe for State
impl !Sync for State
impl !UnwindSafe for State
impl Send for State
impl Unpin for State
impl UnsafeUnpin for State
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.