Struct rust_raylib::shader::Shader
source · #[repr(C)]pub struct Shader { /* private fields */ }Expand description
Shader
Implementations§
source§impl Shader
impl Shader
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)
Trait Implementations§
Auto Trait Implementations§
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