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]
impl GLObject for Shader
[src]
type Id = GLuint
The type of the object's internal ID.
unsafe fn from_raw(id: Self::Id) -> Self
[src]
Get a new object from an OpenGL ID. Read more
fn id(&self) -> Self::Id
[src]
Get the object's ID.
fn into_raw(self) -> Self::Id where
Self: Sized,
[src]
Self: Sized,
Consume the object without cleaning up its resources, returning the object's ID. Read more