[−][src]Struct rustbatch::render::program::Program
Program is opengl shader program wrapper main feature is setting uniforms. There are some predefined functions for setting them but you can also define new ones because there is lot of variants. Already defined setters should guid you. Note that even though you can clone Program you are just cloning pointer to program.
Implementations
impl Program
[src]
pub fn new(paths: &[&str]) -> Result<Program, String>
[src]
new creates shadre program from path of vertex and fragment shader files
pub fn from_shaders(shaders: &[Shader]) -> Result<Program, String>
[src]
from_shaders is same as new it just uses already loaded shaders
pub fn default() -> Program
[src]
default returns rustbatch default program
pub fn no_texture() -> Program
[src]
pub fn id(&self) -> GLuint
[src]
id returns id of program. its simply pointer to shader object
pub fn bind(&self)
[src]
bind uses shader program
pub fn get_ptr(&self, name: &str) -> i32
[src]
get_ptr returns pointer to uniform var of shader by name
pub fn set_mat4(&self, address: &str, mat: &Mat)
[src]
pub fn set_vec2(&self, address: &str, vec: Vect)
[src]
pub fn set_color(&self, address: &str, col: &RGBA)
[src]
pub fn set_float(&self, address: &str, value: f32)
[src]
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Program
impl Send for Program
impl Sync for Program
impl Unpin for Program
impl UnwindSafe for Program
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,