Struct opengl_graphics::GlGraphics[][src]

pub struct GlGraphics { /* fields omitted */ }

Contains OpenGL data.

Implementations

impl GlGraphics[src]

pub fn get_uniform<T: UniformType + ?Sized>(
    &self,
    name: &str
) -> Option<ShaderUniform<T>>
[src]

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

impl<'a> GlGraphics[src]

pub fn new(opengl: OpenGL) -> Self[src]

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
[src]

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.

pub fn get_current_program(&self) -> Option<GLuint>[src]

Returns the current program

pub fn use_program(&mut self, program: GLuint)[src]

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

pub fn clear_program(&mut self)[src]

Unset the current program.

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

pub fn use_draw_state(&mut self, draw_state: &DrawState)[src]

Sets the current draw state, by detecting changes.

pub fn clear_draw_state(&mut self)[src]

Unsets the current draw state.

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

pub fn draw_begin(&mut self, viewport: Viewport) -> Context[src]

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

pub fn draw_end(&mut self)[src]

Finalize the frame’s draw calls.

pub fn draw<F, U>(&mut self, viewport: Viewport, f: F) -> U where
    F: FnOnce(Context, &mut Self) -> U, 
[src]

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.

pub fn has_texture_alpha(&self, _texture: &Texture) -> bool[src]

Assume all textures has alpha channel for now.

Trait Implementations

impl Graphics for GlGraphics[src]

type Texture = Texture

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

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.