pub struct Shader {
    pub name: &'static str,
    /* private fields */
}
Expand description

A program that is run on the GPU.

A Shader contains a Program, that can be bound and run on the GPU using WebGL.

Fields

name: &'static str

A name to refer to the shader with, and for debugging purposes.

Implementations

Create a new Shader Program with default Vertex and Fragment shaders.

Create a new Shader with default Fragment Shader and a custom Vertex Shader.

Create a fragment WebGlShader.

Create a vertex WebGlShader.

Create a new WebGlShader with a given ShaderType.

Create a new WebGlProgram with the given vertex and fragment shaders.

Get the location of a uniform on the Shader.

Get the location of an attribute on the Shader.

Trait Implementations

Bind the Shader

Optionally unbinds a struct implementing the Bind trait. This effectively resets the WebGL state.

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Formats the value using the given formatter. Read more

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more

Checks if self is actually part of its subset T (and can be converted to it).

Use with care! Same as self.to_subset but without any property checks. Always succeeds.

The inclusion map: converts self to the equivalent element of its superset.

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.