pub struct Shader { /* private fields */ }
Expand description
Shader
Implementations§
Source§impl Shader
impl Shader
Sourcepub fn locations_mut(&mut self) -> &mut [u32]
pub fn locations_mut(&mut self) -> &mut [u32]
Shader locations array
Sourcepub fn from_file(
vs_filename: Option<&str>,
fs_filename: Option<&str>,
) -> Option<Self>
pub fn from_file( vs_filename: Option<&str>, fs_filename: Option<&str>, ) -> Option<Self>
Load shader from files and bind default locations
Sourcepub fn from_memory(vs_code: Option<&str>, fs_code: Option<&str>) -> Option<Self>
pub fn from_memory(vs_code: Option<&str>, fs_code: Option<&str>) -> Option<Self>
Load shader from code strings and bind default locations
Sourcepub fn get_location(&self, uniform_name: &str) -> u32
pub fn get_location(&self, uniform_name: &str) -> u32
Get shader uniform location
Sourcepub fn get_location_attribute(&self, attribute_name: &str) -> u32
pub fn get_location_attribute(&self, attribute_name: &str) -> u32
Get shader attribute location
Sourcepub fn set_value<S: ShaderValue>(&mut self, loc_index: u32, value: S)
pub fn set_value<S: ShaderValue>(&mut self, loc_index: u32, value: S)
Set shader uniform value
Sourcepub fn set_value_vec<S: ShaderValue>(&mut self, loc_index: u32, values: &[S])
pub fn set_value_vec<S: ShaderValue>(&mut self, loc_index: u32, values: &[S])
Set shader uniform value vector
Sourcepub fn set_value_matrix(&mut self, loc_index: u32, mat: Matrix)
pub fn set_value_matrix(&mut self, loc_index: u32, mat: Matrix)
Set shader uniform value (matrix 4x4)
Sourcepub fn set_value_texture(&mut self, loc_index: u32, texture: &Texture2D)
pub fn set_value_texture(&mut self, loc_index: u32, texture: &Texture2D)
Set shader uniform value for texture (sampler2d)
Sourcepub fn as_raw(&self) -> &Shader
pub fn as_raw(&self) -> &Shader
Get the ‘raw’ ffi type Take caution when cloning so it doesn’t outlive the original
Sourcepub fn as_raw_mut(&mut self) -> &mut Shader
pub fn as_raw_mut(&mut self) -> &mut Shader
Get the ‘raw’ ffi type Take caution when cloning so it doesn’t outlive the original
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Shader
impl RefUnwindSafe for Shader
impl !Send for Shader
impl !Sync for Shader
impl Unpin for Shader
impl UnwindSafe for Shader
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more