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
impl RendererBuilder
Sourcepub fn new() -> RendererBuilder
pub fn new() -> RendererBuilder
Creates a new RendererBuilder
with default values
Sourcepub fn real_3d(self, real_3d: bool) -> RendererBuilder
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
Sourcepub fn max_textures(self, max_textures: usize) -> RendererBuilder
pub fn max_textures(self, max_textures: usize) -> RendererBuilder
The allocation size of the texture pool.
Default: 1024
Sourcepub fn frames_in_flight(self, frames_in_flight: u32) -> RendererBuilder
pub fn frames_in_flight(self, frames_in_flight: u32) -> RendererBuilder
The number of frames that can be dispatched simultaneously
Default: 3
Sourcepub fn allocation_config(
self,
alloc_config: impl FnOnce(&DeviceProperties<'_>) -> Config + 'static,
) -> RendererBuilder
pub fn allocation_config( self, alloc_config: impl FnOnce(&DeviceProperties<'_>) -> Config + 'static, ) -> RendererBuilder
The memory allocator’s allocation strategy.
Default: default_memory_config
Sourcepub fn build_rc(self) -> Rc<Renderer>
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
impl Default for RendererBuilder
Source§fn default() -> RendererBuilder
fn default() -> RendererBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for RendererBuilder
impl !RefUnwindSafe for RendererBuilder
impl !Send for RendererBuilder
impl !Sync for RendererBuilder
impl Unpin for RendererBuilder
impl !UnwindSafe for RendererBuilder
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