Struct luminance::shader::program::Program [] [src]

pub struct Program<C, T> where C: HasProgram {
    pub repr: C::Program,
    pub uniform_interface: T,
}

A shader program with uniform interface.

Fields

repr: C::Program uniform_interface: T

Methods

impl<C, T> Program<C, T> where C: HasProgram
[src]

fn new<GetUni>(tess: Option<(&Stage<C, TessellationControlShader>, &Stage<C, TessellationEvaluationShader>)>, vertex: &Stage<C, VertexShader>, geometry: Option<&Stage<C, GeometryShader>>, fragment: &Stage<C, FragmentShader>, get_uni: GetUni) -> Result<Self, ProgramError> where GetUni: Fn(ProgramProxy<C>) -> Result<T, ProgramError>

Create a new Program by linking it with shader stages and by providing a function to build its uniform interface, which the Program will hold for you.

The uniform interface is any type you want. The idea is to bake Uniform<_> in your type so that you can access them later. To do so, you’re given an object of type ProgramProxy, which has a function uniform. That function can be used to lookup uniforms so that you can build your uniform interface.

Use the update function to access the uniform interface back.

fn update<F>(&self, f: F) where F: Fn(&T)

Trait Implementations

impl<C: Debug, T: Debug> Debug for Program<C, T> where C: HasProgram, C::Program: Debug
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.

impl<C, T> Drop for Program<C, T> where C: HasProgram
[src]

fn drop(&mut self)

A method called when the value goes out of scope. Read more