Trait rfw_backend::Backend [−][src]
pub trait Backend {}Show methods
fn set_2d_mesh(&mut self, id: usize, data: MeshData2D<'_>); fn set_2d_instances(&mut self, mesh: usize, instances: InstancesData2D<'_>); fn set_3d_mesh(&mut self, id: usize, data: MeshData3D<'_>); fn unload_3d_meshes(&mut self, ids: &[usize]); fn set_3d_instances(&mut self, mesh: usize, instances: InstancesData3D<'_>); fn set_materials(
&mut self,
materials: &[DeviceMaterial],
changed: &BitSlice
); fn set_textures(&mut self, textures: &[TextureData<'_>], changed: &BitSlice); fn synchronize(&mut self); fn render(
&mut self,
view_2d: CameraView2D,
view_3d: CameraView3D,
mode: RenderMode
); fn resize(&mut self, window_size: (u32, u32), scale_factor: f64); fn set_point_lights(&mut self, lights: &[PointLight], changed: &BitSlice); fn set_spot_lights(&mut self, lights: &[SpotLight], changed: &BitSlice); fn set_area_lights(&mut self, lights: &[AreaLight], changed: &BitSlice); fn set_directional_lights(
&mut self,
lights: &[DirectionalLight],
changed: &BitSlice
); fn set_skybox(&mut self, skybox: TextureData<'_>); fn set_skins(&mut self, skins: &[SkinData<'_>], changed: &BitSlice);
Required methods
fn set_2d_mesh(&mut self, id: usize, data: MeshData2D<'_>)
fn set_2d_instances(&mut self, mesh: usize, instances: InstancesData2D<'_>)
fn set_2d_instances(&mut self, mesh: usize, instances: InstancesData2D<'_>)
Sets an instance with a 4x4 transformation matrix in column-major format
fn set_3d_mesh(&mut self, id: usize, data: MeshData3D<'_>)
fn unload_3d_meshes(&mut self, ids: &[usize])
fn set_3d_instances(&mut self, mesh: usize, instances: InstancesData3D<'_>)
fn set_3d_instances(&mut self, mesh: usize, instances: InstancesData3D<'_>)
Sets an instance with a 4x4 transformation matrix in column-major format
fn set_materials(&mut self, materials: &[DeviceMaterial], changed: &BitSlice)
fn set_materials(&mut self, materials: &[DeviceMaterial], changed: &BitSlice)
Updates materials
fn set_textures(&mut self, textures: &[TextureData<'_>], changed: &BitSlice)
fn set_textures(&mut self, textures: &[TextureData<'_>], changed: &BitSlice)
Updates textures Textures in BGRA format, 8 bytes per channel, 32 bytes per texel.
fn synchronize(&mut self)
fn synchronize(&mut self)
Synchronizes scene after updating meshes, instances, materials and lights This is an expensive step as it can involve operations such as acceleration structure rebuilds
fn render(
&mut self,
view_2d: CameraView2D,
view_3d: CameraView3D,
mode: RenderMode
)
fn render(
&mut self,
view_2d: CameraView2D,
view_3d: CameraView3D,
mode: RenderMode
)
Renders an image to the window surface
Resizes framebuffer, uses scale factor provided in init function.
fn set_point_lights(&mut self, lights: &[PointLight], changed: &BitSlice)
fn set_point_lights(&mut self, lights: &[PointLight], changed: &BitSlice)
Updates point lights, only lights with their ‘changed’ flag set to true have changed
Updates spot lights, only lights with their ‘changed’ flag set to true have changed
Updates area lights, only lights with their ‘changed’ flag set to true have changed
fn set_directional_lights(
&mut self,
lights: &[DirectionalLight],
changed: &BitSlice
)
fn set_directional_lights(
&mut self,
lights: &[DirectionalLight],
changed: &BitSlice
)
Updates directional lights, only lights with their ‘changed’ flag set to true have changed
fn set_skybox(&mut self, skybox: TextureData<'_>)