Skip to main content

Renderer

Struct Renderer 

Source
pub struct Renderer { /* private fields */ }

Implementations§

Source§

impl Renderer

Source

pub fn render_text(&mut self, text: &TextLayout, pos: Vec2, scale_factor: f32)

Source

pub fn render_text_rotated( &mut self, text: &TextLayout, pos: Vec2, origin: Vec2, rotation: f32, scale_factor: f32, )

Source

pub fn render_text_raw( &mut self, layout: &Layout<()>, real_size: Vec2, color: Color, pos: Vec2, scale_factor: f32, )

Source

pub fn render_text_raw_rotated( &mut self, layout: &Layout<()>, real_size: Vec2, color: Color, pos: Vec2, origin: Vec2, rotation: f32, scale_factor: f32, )

Source§

impl Renderer

Source

pub fn new_with_str_loader<F>( viewport: Vec2, scale_factor: f32, debug_logs: bool, loader_function: F, ) -> Self
where F: FnMut(&str) -> *const c_void,

Source

pub fn new_with_cstr_loader<F>( viewport: Vec2, scale_factor: f32, debug_logs: bool, loader_function: F, ) -> Self
where F: FnMut(&CStr) -> *const c_void,

Source

pub fn clear_textures(&mut self)

Source

pub fn upload_texture(&self, image: RawImage<'_>) -> TextureHandle

Source

pub fn upload_texture_with_interp( &self, image: RawImage<'_>, interpolation: TextureInterpolation, ) -> TextureHandle

Source

pub fn delete_texture(&self, texture: TextureHandle)

Source

pub fn glyph_atlas_debug_view(&mut self, pos_offset: Vec2, quad_size: Vec2)

Source

pub fn glyph_atlas_debug_glyph_priorities( &mut self, pos_offset: Vec2, quad_size: Vec2, )

Source

pub fn reupload_glyph_atlas_texture(&mut self)

Source

pub fn glyph_atlas_texture(&self) -> (TextureHandle, u32)

Returns the texture handle of the glyph atlas, along with its size in pixels (it’s a square, so only one number is returned).

Source

pub fn clear_glyph_atlas(&mut self)

Source

pub fn resize_glyph_atlas_using_window_size(&mut self, width: u32, height: u32)

Source

pub fn create_debug_strip( &mut self, points: &[DebugStripVertex], ) -> DebugStripId

Source

pub fn update_debug_strip( &mut self, id: DebugStripId, points: &[DebugStripVertex], )

Source

pub fn delete_debug_strip(&mut self, debug_strip_id: DebugStripId)

Source

pub fn push_draw_command(&mut self, cmd: DrawCommand)

Source

pub fn push_draw_commands(&mut self, cmds: &[DrawCommand])

Source

pub fn draw_command_count(&self) -> usize

Source

pub fn draw(&mut self)

Source

pub fn resize(&mut self, width: i32, height: i32, scale_factor: f32)

Source

pub fn draw_calls_in_prev_frame(&self) -> usize

Source

pub fn set_clear_color(&mut self, r: f32, g: f32, b: f32, a: f32)

Trait Implementations§

Source§

impl Drop for Renderer

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,