pub struct WgpuBackend { /* private fields */ }Expand description
wgpu-based render backend. Works with WebGL2/WebGPU in browser, Vulkan/Metal/DX12 natively.
Implementations§
Trait Implementations§
Source§impl RenderBackend for WgpuBackend
impl RenderBackend for WgpuBackend
Source§fn begin_frame(&mut self, _clear_color: Color) -> Result<(), RenderError>
fn begin_frame(&mut self, _clear_color: Color) -> Result<(), RenderError>
Begin a new frame with the given clear color.
Source§fn submit(&mut self, commands: &[RenderCommand]) -> Result<(), RenderError>
fn submit(&mut self, commands: &[RenderCommand]) -> Result<(), RenderError>
Submit render commands for the current frame.
Source§fn load_texture(
&mut self,
width: u32,
height: u32,
data: &[u8],
) -> Result<u64, RenderError>
fn load_texture( &mut self, width: u32, height: u32, data: &[u8], ) -> Result<u64, RenderError>
Load a texture from RGBA bytes, returns a texture ID.
Source§fn scale_factor(&self) -> f32
fn scale_factor(&self) -> f32
Get the current scale factor.
Auto Trait Implementations§
impl !Freeze for WgpuBackend
impl !RefUnwindSafe for WgpuBackend
impl Send for WgpuBackend
impl Sync for WgpuBackend
impl Unpin for WgpuBackend
impl !UnwindSafe for WgpuBackend
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