Struct opengl_graphics::shader_uniforms::ShaderUniform
source · pub struct ShaderUniform<T: ?Sized> { /* private fields */ }
Expand description
Describes a shader uniform of a given type.
Implementations§
source§impl ShaderUniform<SUFloat>
impl ShaderUniform<SUFloat>
sourcepub fn set(&self, gl: &GlGraphics, value: f32)
pub fn set(&self, gl: &GlGraphics, value: f32)
Set the value of the float uniform.
source§impl ShaderUniform<SUInt>
impl ShaderUniform<SUInt>
sourcepub fn set(&self, gl: &GlGraphics, value: i32)
pub fn set(&self, gl: &GlGraphics, value: i32)
Set the value of the integer uniform.
source§impl ShaderUniform<SUVec2>
impl ShaderUniform<SUVec2>
sourcepub fn set(&self, gl: &GlGraphics, value: &[f32; 2])
pub fn set(&self, gl: &GlGraphics, value: &[f32; 2])
Set the value of the vector 2 uniform.
source§impl ShaderUniform<SUVec3>
impl ShaderUniform<SUVec3>
sourcepub fn set(&self, gl: &GlGraphics, value: &[f32; 3])
pub fn set(&self, gl: &GlGraphics, value: &[f32; 3])
Set the value of the vector 3 uniform.
source§impl ShaderUniform<SUVec4>
impl ShaderUniform<SUVec4>
sourcepub fn set(&self, gl: &GlGraphics, value: &[f32; 4])
pub fn set(&self, gl: &GlGraphics, value: &[f32; 4])
Set the value of the vector 4 uniform.
source§impl ShaderUniform<SUMat2x2>
impl ShaderUniform<SUMat2x2>
sourcepub fn set(&self, gl: &GlGraphics, values: &[f32; 4])
pub fn set(&self, gl: &GlGraphics, values: &[f32; 4])
Set the value of the 2x2 matrix uniform.
source§impl ShaderUniform<SUMat3x3>
impl ShaderUniform<SUMat3x3>
sourcepub fn set(&self, gl: &GlGraphics, values: &[f32; 9])
pub fn set(&self, gl: &GlGraphics, values: &[f32; 9])
Set the value of the 3x3 matrix uniform.
source§impl ShaderUniform<SUMat4x4>
impl ShaderUniform<SUMat4x4>
sourcepub fn set(&self, gl: &GlGraphics, values: &[f32; 16])
pub fn set(&self, gl: &GlGraphics, values: &[f32; 16])
Set the value of the 4x4 matrix uniform.
Trait Implementations§
source§impl<T: Clone + ?Sized> Clone for ShaderUniform<T>
impl<T: Clone + ?Sized> Clone for ShaderUniform<T>
source§fn clone(&self) -> ShaderUniform<T>
fn clone(&self) -> ShaderUniform<T>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more