Struct RendererBuilder

Source
pub struct RendererBuilder { /* private fields */ }
Expand description

Customization options for building a Renderer. Options are detailed on builder methods.

let renderer = RendererBuilder::new()
    .real_3d(true)
    .max_textures(2048)
    .build();

Implementations§

Source§

impl RendererBuilder

Source

pub fn new() -> RendererBuilder

Creates a new RendererBuilder with default values

Source

pub fn real_3d(self, real_3d: bool) -> RendererBuilder

If true, allows transform matrices to affect sprite depth. This clamps the depth between 0.0 and 1.0

Default: false

Source

pub fn max_textures(self, max_textures: usize) -> RendererBuilder

The allocation size of the texture pool.

Default: 1024

Source

pub fn frames_in_flight(self, frames_in_flight: u32) -> RendererBuilder

The number of frames that can be dispatched simultaneously

Default: 3

Source

pub fn allocation_config( self, alloc_config: impl FnOnce(&DeviceProperties<'_>) -> Config + 'static, ) -> RendererBuilder

The memory allocator’s allocation strategy.

Default: default_memory_config

Source

pub fn build(self) -> Renderer

Builds the renderer, initialising the gfx_hal backend.

Source

pub fn build_rc(self) -> Rc<Renderer>

Builds the renderer, initialising the gfx_hal backend, returning a Rc<Renderer> which can be used more easily with the rest of the API.

See also Renderer::wrap

Trait Implementations§

Source§

impl Default for RendererBuilder

Source§

fn default() -> RendererBuilder

Returns the “default value” for a type. 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, 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.