[−][src]Struct luminance::shader::program::UniformBuilder
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]
T: Uniformable,
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]
T: Uniformable,
Get an unbound Uniform
.
Unbound Uniform
s are not any different from typical Uniform
s 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]
T: Uniformable,
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]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,