Struct rin::gl::Program [−][src]
pub struct Program { /* fields omitted */ }
A wrapper for a glsl program
Implementations
impl Program
[src]
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]
T: AsRef<[f32; 2]>,
Sets a vec2 uniform
pub fn uniform_3f<T>(&self, uniform: &str, value: T) -> Result<(), Error> where
T: AsRef<[f32; 3]>,
[src]
T: AsRef<[f32; 3]>,
Sets a vec3 uniform
pub fn uniform_4f<T>(&self, uniform: &str, value: T) -> Result<(), Error> where
T: AsRef<[f32; 4]>,
[src]
T: AsRef<[f32; 4]>,
Sets a vec4 uniform
pub fn uniform_rgba<T>(&self, uniform: &str, value: T) -> Result<(), Error> where
T: AsRef<[f32; 4]>,
[src]
T: AsRef<[f32; 4]>,
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]
&self,
uniform: &str,
value: &[f32; 16]
) -> Result<(), Error>
Sets a mat4 uniform
pub fn uniform_tex(
&self,
uniform: &str,
tex: &Texture,
location: u32
) -> Result<(), Error>
[src]
&self,
uniform: &str,
tex: &Texture,
location: u32
) -> Result<(), Error>
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]
I: IntoIterator<Item = U>,
U: Borrow<Uniform>,
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]
&self,
array_name: &str,
idx: usize,
uniform: &Uniform
) -> Result<(), Error>
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]
&self,
name: &str,
buffer: &B,
binding_point: u32
) -> Result<(), Error> where
B: BufferRange<T>,
pub fn uniform_block_size(&self, name: &str) -> Result<usize, Error>
[src]
Trait Implementations
impl Bindings for Program
[src]
impl Bindings for Program
[src]pub fn attribute_location(&self, name: &str) -> Option<u32>
[src]
pub fn attribute_bindings(&self) -> Iter<'_, String, u32>
[src]
impl Material for Program
[src]
impl Material 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<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]pub fn equivalent(&self, key: &K) -> bool
[src]
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
[src]
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
[src]pub fn to_subset(&self) -> Option<SS>
[src]
pub fn is_in_subset(&self) -> bool
[src]
pub fn to_subset_unchecked(&self) -> SS
[src]
pub fn from_subset(element: &SS) -> SP
[src]
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
[src]
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
[src]