Struct glin::program::Program [−][src]
pub struct Program { /* fields omitted */ }
A wrapper for a glsl program
Implementations
impl Program
[src]
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]
&self,
uniform: &str,
value: T
) -> Result<()>
Sets a vec2 uniform
pub fn uniform_3f<T: AsRef<[f32; 3]>>(
&self,
uniform: &str,
value: T
) -> Result<()>
[src]
&self,
uniform: &str,
value: T
) -> Result<()>
Sets a vec3 uniform
pub fn uniform_4f<T: AsRef<[f32; 4]>>(
&self,
uniform: &str,
value: T
) -> Result<()>
[src]
&self,
uniform: &str,
value: T
) -> Result<()>
Sets a vec4 uniform
pub fn uniform_rgba<T: AsRef<[f32; 4]>>(
&self,
uniform: &str,
value: T
) -> Result<()>
[src]
&self,
uniform: &str,
value: T
) -> Result<()>
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]
&self,
uniform: &str,
tex: &Texture,
location: u32
) -> Result<()>
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]
&self,
uniforms: I
) -> Result<()>
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]
&self,
array_name: &str,
idx: usize,
uniform: &Uniform
) -> Result<()>
Sets a uniform array position
pub fn set_ubo<T, B: BufferRange<T>>(
&self,
name: &str,
buffer: &B,
binding_point: u32
) -> Result<()>
[src]
&self,
name: &str,
buffer: &B,
binding_point: u32
) -> Result<()>
pub fn uniform_block_size(&self, name: &str) -> Result<usize>
[src]
Trait Implementations
impl Bindings for Program
[src]
impl Bindings for Program
[src]