Struct opengl_graphics::GlGraphics [−][src]
pub struct GlGraphics { /* fields omitted */ }
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.
pub fn from_pieces(
colored: Colored,
textured: Textured,
textured_color: TexturedColor
) -> Self
pub fn from_pieces(
colored: Colored,
textured: Textured,
textured_color: TexturedColor
) -> Self
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.
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
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