Struct glitter::shader::Shader [] [src]

pub struct Shader { /* fields omitted */ }

An OpenGL shader object.

A shader is a small program that runs on the GPU to compute a part of the rendering pipeline. There are two shaders that are necessary for rendering in OpenGL: the vertex shader and the fragment shader. The vertex shader translates geometry from world space into screen space, and the fragment shader determines the final color of each pixel (or 'fragment'). In order to use a shader, it should be linked with a Program to be used for drawing.

A shader will automatically be deleted after going out of scope.

See also

gl.build_fragment_shader, gl.build_vertex_shader, and gl.build_shader: Build and compile a new shader object.

gl.create_shader: Create a new, empty shader object.

Trait Implementations

impl Drop for Shader
[src]

[src]

Executes the destructor for this type. Read more

impl GLObject for Shader
[src]

The type of the object's internal ID.

[src]

Get a new object from an OpenGL ID. Read more

[src]

Get the object's ID.

[src]

Consume the object without cleaning up its resources, returning the object's ID. Read more