pub struct Render { /* private fields */ }
Implementations§
Source§impl Render
impl Render
pub fn new( device: Arc<Device>, queue: Arc<Queue>, surface_texture_format: TextureFormat, physical_size: UVec2, virtual_surface_size: UVec2, ) -> Self
pub const fn viewport(&self) -> URect
pub const fn virtual_surface_size(&self) -> UVec2
pub fn viewport_from_integer_scale( physical_size: UVec2, virtual_size: UVec2, ) -> URect
pub fn resize(&mut self, physical_size: UVec2)
pub fn render_sprite( &mut self, position: Vec3, material: &MaterialRef, params: SpriteParams, )
pub fn sprite_atlas( &mut self, position: Vec3, atlas_rect: URect, material_ref: &MaterialRef, )
pub fn set_clear_color(&mut self, color: Color)
pub const fn clear_color(&self) -> Color
pub fn prepare_render(&mut self)
pub fn render(&mut self, render_pass: &mut RenderPass<'_>)
Trait Implementations§
Source§impl Assets for Render
impl Assets for Render
fn material_png_raw(&mut self, png: &[u8], label: &str) -> MaterialRef
fn material_png(&mut self, name: &str) -> MaterialRef
fn set_prefix(&mut self, prefix: &str)
fn frame_fixed_grid_material_png( &mut self, name: &str, grid_size: UVec2, ) -> FixedAtlas
fn bm_font(&mut self, name: &str) -> FontAndMaterialRef
fn now(&self) -> Millis
Source§impl Gfx for Render
impl Gfx for Render
fn set_origin(&mut self, position: Vec2)
fn now(&self) -> Millis
fn text_draw( &mut self, position: Vec3, text: &str, font_ref: &FontAndMaterialRef, )
fn sprite_atlas( &mut self, position: Vec3, atlas_rect: URect, material: &MaterialRef, )
fn sprite_atlas_frame( &mut self, position: Vec3, frame: u16, atlas: &impl FrameLookup, )
fn text_glyphs( &self, position: Vec2, text: &str, font_ref: &FontAndMaterialRef, ) -> Vec<Glyph>
fn tilemap( &mut self, position: Vec3, tiles: &[u16], width: u16, atlas_ref: &FixedAtlas, )
fn tilemap_params( &mut self, position: Vec3, tiles: &[u16], width: u16, atlas_ref: &FixedAtlas, scale: u8, )
Auto Trait Implementations§
impl !Freeze for Render
impl !RefUnwindSafe for Render
impl !Send for Render
impl !Sync for Render
impl Unpin for Render
impl !UnwindSafe for Render
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
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