[][src]Struct luminance::shader::program::UniformBuilder

pub struct UniformBuilder<'a> { /* fields omitted */ }

Build uniforms to fold them to a uniform interface.

Methods

impl<'a> UniformBuilder<'a>[src]

pub fn ask<T>(&self, name: &str) -> Result<Uniform<T>, UniformWarning> where
    T: Uniformable
[src]

Have the builder hand you a Uniform of the type of your choice.

Keep in mind that it’s possible that this function fails if you ask for a type for which the one defined in the shader doesn’t type match. If you don’t want a failure but an unbound uniform, head over to the ask_unbound function.

pub fn ask_unbound<T>(&mut self, name: &str) -> Uniform<T> where
    T: Uniformable
[src]

Get an unbound Uniform.

Unbound Uniforms are not any different from typical Uniforms but when resolving mapping in the shader program, if the Uniform is found inactive or doesn’t exist, instead of returning an error, this function will return an unbound uniform, which is a uniform that does nothing interesting.

That function is useful if you don’t really care about silently sending values down a shader program and getting them ignored. It might be the case for optional uniforms, for instance.

pub fn unbound<T>(&self) -> Uniform<T> where
    T: Uniformable
[src]

Special uniform that won’t do anything.

Use that function when you need a uniform to complete a uniform interface but you’re sure you won’t use it.

Auto Trait Implementations

impl<'a> Send for UniformBuilder<'a>

impl<'a> Unpin for UniformBuilder<'a>

impl<'a> Sync for UniformBuilder<'a>

impl<'a> UnwindSafe for UniformBuilder<'a>

impl<'a> RefUnwindSafe for UniformBuilder<'a>

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]