Struct dunge::LayerBuilder

source ·
pub struct LayerBuilder<'l, 'd, V, T> { /* private fields */ }
Expand description

The layer builder. It creates a configured Layer.

Implementations§

source§

impl<'l, 'd, V, T> Builder<'l, 'd, V, T>

source

pub fn with_clear_color<C>(self, color: C) -> Selfwhere C: IntoLinear,

Sets clear color for the layer.

It takes a color parameter, which must implement the IntoLinear trait.

Don’t set this setting if you don’t want to fill the previous layer (or frame) with some color. Or set to clear the current buffer if a layer is already drawn into the frame by calling commit_in_frame.

Example
let color = Srgba([20, 30, 40, 255]);
let mut layer = frame
    .texture_layer()
    .with_clear_color(color)
    .start();

To clear a layer with a transparent color, it is enough to pass () as a parameter.

Example
let mut layer = frame
    .texture_layer()
    .with_clear_color(())
    .start();
source

pub fn with_clear_depth(self) -> Self

Sets the flag to clear the depth buffer or not for the layer.

source

pub fn start(self) -> Layer<'l, V, T>

Starts draw the layer.

Auto Trait Implementations§

§

impl<'l, 'd, V, T> !RefUnwindSafe for Builder<'l, 'd, V, T>

§

impl<'l, 'd, V, T> !Send for Builder<'l, 'd, V, T>

§

impl<'l, 'd, V, T> !Sync for Builder<'l, 'd, V, T>

§

impl<'l, 'd, V, T> Unpin for Builder<'l, 'd, V, T>where T: Unpin, V: Unpin, 'd: 'l,

§

impl<'l, 'd, V, T> !UnwindSafe for Builder<'l, 'd, V, T>

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
§

impl<T> Downcast<T> for T

§

fn downcast(&self) -> &T

source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

const: unstable · 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 Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
§

impl<T> Upcast<T> for T

§

fn upcast(&self) -> Option<&T>