pub struct UiRenderer { /* private fields */ }Expand description
Draws the quads of banished-ui with wgpu: one alpha-blended pipeline (and one for the logo
material), in batches split by texture and clip rectangle. It uploads each sprite sheet the
first time a quad uses it.
Implementations§
Source§impl UiRenderer
impl UiRenderer
Sourcepub fn new(device: &Device, format: TextureFormat, depth: TextureFormat) -> Self
pub fn new(device: &Device, format: TextureFormat, depth: TextureFormat) -> Self
A renderer for a colour target of format and a depth target of depth.
Sourcepub fn set_external(&mut self, device: &Device, id: u32, view: &TextureView)
pub fn set_external(&mut self, device: &Device, id: u32, view: &TextureView)
Register an application texture for Texture::External(id).
Sourcepub fn clear_sheets(&mut self)
pub fn clear_sheets(&mut self)
Forget the sprite sheets’ textures (the UI’s resources were made again, so its sheet numbers name other sheets now).
Auto Trait Implementations§
impl !RefUnwindSafe for UiRenderer
impl !UnwindSafe for UiRenderer
impl Freeze for UiRenderer
impl Send for UiRenderer
impl Sync for UiRenderer
impl Unpin for UiRenderer
impl UnsafeUnpin for UiRenderer
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