Struct glin::Program[][src]

pub struct Program { /* fields omitted */ }

A wrapper for a glsl program

Implementations

impl Program[src]

pub fn id(&self) -> GLuint[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) -> &HashMap<String, u32>[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) -> &HashMap<String, u32>[src]

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

Sets a float uniform

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

Sets a vec2 uniform

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

Sets a vec3 uniform

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

Sets a vec4 uniform

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

Sets a vec4 uniform

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

Sets an int uniform

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

Sets a ivec2 uniform

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

Sets a ivec3 uniform

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

Sets a ivec4 uniform

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

Sets a mat4 uniform

pub fn uniform_tex(
    &self,
    uniform: &str,
    tex: &Texture,
    location: u32
) -> Result<()>
[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<()>[src]

Sets a uniform value from a Uniform

pub fn set_uniforms<U: Borrow<Uniform>, I: IntoIterator<Item = U>>(
    &self,
    uniforms: I
) -> Result<()>
[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<()>
[src]

Sets a uniform array position

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

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

Trait Implementations

impl Bindings for Program[src]

impl Debug 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<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<T> Pointable for T[src]

type Init = T

The type for initializers.

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.