pub struct GlGraphics { /* private fields */ }
Expand description

Contains OpenGL data.

Implementations

Try to get uniform from the current shader of a given name.

Creates a new OpenGL back-end.

Panics

If the OpenGL function pointers have not been loaded yet. See https://github.com/PistonDevelopers/opengl_graphics/issues/103 for more info.

Create a new OpenGL back-end with Colored, Textured and TexturedColor structs to describe how to render objects.

Panics

If the OpenGL function pointers have not been loaded yet. See https://github.com/PistonDevelopers/opengl_graphics/issues/103 for more info.

Returns the current program

Sets the current program only if the program is not in use.

Unset the current program.

This forces the current program to be set on next drawing call.

Sets the current draw state, by detecting changes.

Unsets the current draw state.

This forces the current draw state to be set on next drawing call.

Setup that should be called at the start of a frame’s draw call.

Finalize the frame’s draw calls.

Convenience for wrapping draw calls with the begin and end methods.

This is preferred over using the draw_begin & draw_end methods explicitly but may be less flexible.

Assume all textures has alpha channel for now.

Trait Implementations

The texture type associated with the back-end. Read more

Clears background with a color. Read more

Clears stencil buffer with a value, usually 0. Read more

Renders list of 2d triangles using a solid color. Read more

Same as tri_list, but with individual vertex colors. Read more

Renders list of 2d triangles using a color and a texture. Read more

Same as tri_list_uv, but with individual vertex colors. Read more

Draws a rectangle. Read more

Draws a polygon. Read more

Draws a tweened polygon using linear interpolation. Read more

Draws image. Read more

Draws ellipse. Read more

Draws line. Read more

Draws circle arc. 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.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. 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.