Struct nannou::ui::backend::glium::glium::program::Program[][src]

pub struct Program { /* fields omitted */ }

A combination of shaders linked together.

Methods

impl Program
[src]

Builds a new program.

Builds a new program from GLSL source code.

A program is a group of shaders linked together.

Parameters

  • vertex_shader: Source code of the vertex shader.
  • fragment_shader: Source code of the fragment shader.
  • geometry_shader: Source code of the geometry shader.

Example

let program = glium::Program::from_source(&display, vertex_source, fragment_source,
    Some(geometry_source));

Returns the program's compiled binary.

You can store the result in a file, then reload it later. This avoids having to compile the source code every time.

Returns the location of an output fragment, if it exists.

The location is low-level information that is used internally by glium. You probably don't need to call this function.

You can declare output fragments in your shaders by writing:

out vec4 foo;

Returns informations about a uniform variable, if it exists.

Important traits for Iter<'a, K, V>

Returns an iterator to the list of uniforms.

Example

for (name, uniform) in program.uniforms() {
    println!("Name: {} - Type: {:?}", name, uniform.ty);
}

Returns a list of uniform blocks.

Example

for (name, uniform) in program.get_uniform_blocks() {
    println!("Name: {}", name);
}

Important traits for &'a [u8]

Returns the list of transform feedback varyings.

True if the transform feedback output of this program matches the specified VertexFormat and stride.

The stride is the number of bytes between two vertices.

Returns the type of geometry that transform feedback would generate, or None if it depends on the vertex/index data passed when drawing.

This corresponds to GL_GEOMETRY_OUTPUT_TYPE or GL_TESS_GEN_MODE. If the program doesn't contain either a geometry shader or a tessellation evaluation shader, returns None.

Returns true if the program contains a tessellation stage.

Returns true if the program contains a tessellation control stage.

Returns true if the program contains a tessellation evaluation stage.

Returns true if the program contains a geometry shader.

Returns informations about an attribute, if it exists.

Important traits for Iter<'a, K, V>

Returns an iterator to the list of attributes.

Example

for (name, attribute) in program.attributes() {
    println!("Name: {} - Type: {:?}", name, attribute.ty);
}

Returns true if the program has been configured to output sRGB instead of RGB.

Returns the list of shader storage blocks.

Example

for (name, uniform) in program.get_shader_storage_blocks() {
    println!("Name: {}", name);
}

Returns the subroutine uniforms of this program.

Since subroutine uniforms are unique per shader and not per program, the keys of the HashMap are in the format ("subroutine_name", ShaderStage).

Example

for (&(ref name, shader), uniform) in program.get_subroutine_uniforms() {
    println!("Name: {}", name);
}

Returns true if the program has been configured to use the gl_PointSize variable.

If the program uses gl_PointSize without having been configured appropriately, then setting the value of gl_PointSize will have no effect.

Trait Implementations

impl Debug for Program
[src]

Formats the value using the given formatter. Read more

impl GlObject for Program
[src]

The type of identifier for this object.

Returns the id of the object.

Auto Trait Implementations

impl !Send for Program

impl !Sync for Program