Trait maia_wasm::render::UniformType
source · pub trait UniformType {
// Required method
fn uniform(
&self,
gl: &WebGl2RenderingContext,
location: Option<&WebGlUniformLocation>
);
}Expand description
Trait that links native Rust types with WebGL2 uniform types.
Required Methods§
sourcefn uniform(
&self,
gl: &WebGl2RenderingContext,
location: Option<&WebGlUniformLocation>
)
fn uniform( &self, gl: &WebGl2RenderingContext, location: Option<&WebGlUniformLocation> )
Sets the value of the uniform.
This function sets the value of the WebGL2 uniform in location to the
value of self using one of the uniform{1,2,3,4}{f,i,ui} WebGL2
functions as appropriate.
Implementations on Foreign Types§
source§impl UniformType for (f32, f32)
impl UniformType for (f32, f32)
Uniform type corresponding to uniform2f.
fn uniform( &self, gl: &WebGl2RenderingContext, location: Option<&WebGlUniformLocation> )
source§impl UniformType for (f32, f32, f32)
impl UniformType for (f32, f32, f32)
Uniform type corresponding to uniform3f.
fn uniform( &self, gl: &WebGl2RenderingContext, location: Option<&WebGlUniformLocation> )
source§impl UniformType for (f32, f32, f32, f32)
impl UniformType for (f32, f32, f32, f32)
Uniform type corresponding to uniform4f.
fn uniform( &self, gl: &WebGl2RenderingContext, location: Option<&WebGlUniformLocation> )
source§impl UniformType for (i32, i32)
impl UniformType for (i32, i32)
Uniform type corresponding to uniform2i.
fn uniform( &self, gl: &WebGl2RenderingContext, location: Option<&WebGlUniformLocation> )
source§impl UniformType for (i32, i32, i32)
impl UniformType for (i32, i32, i32)
Uniform type corresponding to uniform3i.
fn uniform( &self, gl: &WebGl2RenderingContext, location: Option<&WebGlUniformLocation> )
source§impl UniformType for (i32, i32, i32, i32)
impl UniformType for (i32, i32, i32, i32)
Uniform type corresponding to uniform4i.
fn uniform( &self, gl: &WebGl2RenderingContext, location: Option<&WebGlUniformLocation> )
source§impl UniformType for (u32, u32)
impl UniformType for (u32, u32)
Uniform type corresponding to uniform2ui.
fn uniform( &self, gl: &WebGl2RenderingContext, location: Option<&WebGlUniformLocation> )
source§impl UniformType for (u32, u32, u32)
impl UniformType for (u32, u32, u32)
Uniform type corresponding to uniform3ui.
fn uniform( &self, gl: &WebGl2RenderingContext, location: Option<&WebGlUniformLocation> )
source§impl UniformType for (u32, u32, u32, u32)
impl UniformType for (u32, u32, u32, u32)
Uniform type corresponding to uniform4ui.
fn uniform( &self, gl: &WebGl2RenderingContext, location: Option<&WebGlUniformLocation> )
source§impl UniformType for f32
impl UniformType for f32
Uniform type corresponding to uniform1f.
fn uniform( &self, gl: &WebGl2RenderingContext, location: Option<&WebGlUniformLocation> )
source§impl UniformType for i32
impl UniformType for i32
Uniform type corresponding to uniform1i.
fn uniform( &self, gl: &WebGl2RenderingContext, location: Option<&WebGlUniformLocation> )
source§impl UniformType for u32
impl UniformType for u32
Uniform type corresponding to uniform1ui.