[][src]Struct rustbatch::render::program::Program

pub struct Program { /* fields omitted */ }

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

impl Drop for Program[src]

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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,