pub struct Shader {
pub id: u32,
/* private fields */
}
Fields§
§id: u32
Implementations§
Source§impl Shader
impl Shader
pub fn new(vertex_path: &str, fragment_path: &str, defines: &[String]) -> Shader
pub fn from_source( vertex_code: &str, fragment_code: &str, defines: &[String], ) -> Shader
Sourcepub unsafe fn use_program(&self)
pub unsafe fn use_program(&self)
§activate the shader
Sourcepub unsafe fn set_vector3(&self, location: i32, value: &Vector3<f32>)
pub unsafe fn set_vector3(&self, location: i32, value: &Vector3<f32>)
Sourcepub unsafe fn set_vector4(&self, location: i32, value: &Vector4<f32>)
pub unsafe fn set_vector4(&self, location: i32, value: &Vector4<f32>)
Sourcepub unsafe fn uniform_location(&mut self, name: &'static str) -> i32
pub unsafe fn uniform_location(&mut self, name: &'static str) -> i32
get uniform location with caching
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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<Trait>
(where Trait: Downcast
) to Box<Any>
. Box<Any>
can then be
further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.