Struct rin::gl::Program[][src]

pub struct Program { /* fields omitted */ }

A wrapper for a glsl program

Implementations

impl Program[src]

pub fn id(&self) -> u32[src]

GL id

pub fn unique_id(&self) -> usize[src]

Some drivers reuse program names when deleted This returns a unique id for this context for every program created during the application lifetime

pub fn attribute_location(&self, attr: &str) -> Option<u32>[src]

Bind fragment output data, Returns an attribute location if it exists

pub fn uniform_location(&self, name: &str) -> Option<u32>[src]

Returns an uniform location if it exists

pub fn uniform_block_index(&self, name: &str) -> Option<u32>[src]

Returns an uniform block index if it exists

pub fn shader_storage_block_index(&self, name: &str) -> Option<u32>[src]

Returns an uniform location if it exists

pub fn attribute_bindings(&self) -> &IndexMap<String, u32, RandomState>[src]

Returns the attribute bindings for this program

As a HashMap where the key is the attribute name and the value it’s location

pub fn attribute_bindings_hash(&self) -> u64[src]

pub fn uniform_locations(&self) -> &IndexMap<String, u32, RandomState>[src]

pub fn uniform_1f(&self, uniform: &str, value: f32) -> Result<(), Error>[src]

Sets a float uniform

pub fn uniform_2f<T>(&self, uniform: &str, value: T) -> Result<(), Error> where
    T: AsRef<[f32; 2]>, 
[src]

Sets a vec2 uniform

pub fn uniform_3f<T>(&self, uniform: &str, value: T) -> Result<(), Error> where
    T: AsRef<[f32; 3]>, 
[src]

Sets a vec3 uniform

pub fn uniform_4f<T>(&self, uniform: &str, value: T) -> Result<(), Error> where
    T: AsRef<[f32; 4]>, 
[src]

Sets a vec4 uniform

pub fn uniform_rgba<T>(&self, uniform: &str, value: T) -> Result<(), Error> where
    T: AsRef<[f32; 4]>, 
[src]

Sets a vec4 uniform

pub fn uniform_1i(&self, uniform: &str, value: i32) -> Result<(), Error>[src]

Sets an int uniform

pub fn uniform_2i(&self, uniform: &str, value: &[i32; 2]) -> Result<(), Error>[src]

Sets a ivec2 uniform

pub fn uniform_3i(&self, uniform: &str, value: &[i32; 3]) -> Result<(), Error>[src]

Sets a ivec3 uniform

pub fn uniform_4i(&self, uniform: &str, value: &[i32; 4]) -> Result<(), Error>[src]

Sets a ivec4 uniform

pub fn uniform_matrix_4f(
    &self,
    uniform: &str,
    value: &[f32; 16]
) -> Result<(), Error>
[src]

Sets a mat4 uniform

pub fn uniform_tex(
    &self,
    uniform: &str,
    tex: &Texture,
    location: u32
) -> Result<(), Error>
[src]

Sets a texture uniform

pub fn uniform(&self, location: u32, value: UniformValue)[src]

Sets a uniform value from a UniformValue

pub fn set_uniform(&self, uniform: &Uniform) -> Result<(), Error>[src]

Sets a uniform value from a Uniform

pub fn set_uniforms<U, I>(&self, uniforms: I) -> Result<(), Error> where
    I: IntoIterator<Item = U>,
    U: Borrow<Uniform>, 
[src]

Sets a group of uniforms values from a slice of Uniform

pub fn set_uniform_at(
    &self,
    array_name: &str,
    idx: usize,
    uniform: &Uniform
) -> Result<(), Error>
[src]

Sets a uniform array position

pub fn set_ubo<T, B>(
    &self,
    name: &str,
    buffer: &B,
    binding_point: u32
) -> Result<(), Error> where
    B: BufferRange<T>, 
[src]

pub fn uniform_block_size(&self, name: &str) -> Result<usize, Error>[src]

Trait Implementations

impl Bindings for Program[src]

impl Debug for Program[src]

impl Material for Program[src]

impl PartialEq<Program> for Program[src]

impl Eq for Program[src]

Auto Trait Implementations

impl !RefUnwindSafe for Program

impl !Send for Program

impl !Sync for Program

impl Unpin for Program

impl !UnwindSafe for Program

Blanket Implementations

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

impl<T> Any for T where
    T: Any
[src]

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

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

impl<T> Downcast for T where
    T: Any
[src]

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

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

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

impl<V> IntoPnt<V> for V[src]

impl<V> IntoVec<V> for V[src]

impl<T> Pointable for T[src]

type Init = T

The type for initializers.

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

type Output = T

Should always be Self

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 
[src]

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 
[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<V, T> VZip<V> for T where
    V: MultiLane<T>, 
[src]