Struct dunge::ActiveLayer

source ·
pub struct ActiveLayer<'l, S, T> { /* private fields */ }
Expand description

The frame’s active layer.

Can be created from the Frame instance by calling the layer function.

Implementations§

source§

impl<'l, S, T> ActiveLayer<'l, S, T>

source

pub fn bind_globals(&mut self, globals: &'l Globals<S>) -> &mut Self

Binds the globals.

source

pub fn bind_textures(&mut self, textures: &'l Textures<S>) -> &mut Self

Binds the textures.

source

pub fn bind_lights(&mut self, lights: &'l Lights<S>) -> &mut Self

Binds the light sources.

source

pub fn bind_spaces(&mut self, spaces: &'l Spaces<S>) -> &mut Self

Binds the light spaces.

source

pub fn bind_instance(&mut self, instance: &'l Instance) -> &mut Self

Binds the instance.

source

pub fn bind_default_instance(&mut self) -> &mut Self

Binds the default instance with a position at (0, 0, 0) in world coordinates.

After the layer starts, this instance is bound by default, so there is no need to additionally call this method.

source

pub fn bind_instance_color(&mut self, cols: &'l InstanceColor) -> &mut Selfwhere S: Shader,

Binds the color instance.

Panics

Panics if the shader has no instance colors.

source

pub fn draw(&mut self, mesh: &'l Mesh<S::Vertex, T>)where S: Shader, T: Topology,

Draws the mesh.

Panics
  • If globals is not set but required.
  • If textures is not set but required.
  • If light sources is not set but required.
  • If light spaces is not set but required.
  • If instance color is not set but required.
source

pub fn draw_limited(&mut self, mesh: &'l Mesh<S::Vertex, T>, limit: u32)where S: Shader, T: Topology,

Draws the mesh partially with a limit of drawn elements.

For example, pass the limit value of 2 to draw only two triangles (for a triangular mesh) instead of the entire mesh.

Panics

See draw method.

Auto Trait Implementations§

§

impl<'l, S, T> !RefUnwindSafe for ActiveLayer<'l, S, T>

§

impl<'l, S, T> Send for ActiveLayer<'l, S, T>where S: Send, T: Send,

§

impl<'l, S, T> Sync for ActiveLayer<'l, S, T>where S: Sync, T: Sync,

§

impl<'l, S, T> Unpin for ActiveLayer<'l, S, T>where S: Unpin, T: Unpin,

§

impl<'l, S, T> !UnwindSafe for ActiveLayer<'l, S, 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,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

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

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere 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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.
§

impl<T> Upcast<T> for T

§

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

§

impl<T> WasmNotSend for Twhere T: Send,

§

impl<T> WasmNotSync for Twhere T: Sync,