[][src]Struct glin::Context

pub struct Context<'c, R: RenderSurface + 'c = Screen> { /* fields omitted */ }

Used to issue draw calls

Methods

impl Context<'static>
[src]

Create a new context from any window implementing GLWindow

Create a new context from any window implmenting GLWindow and a set of default properties

impl<'c, R: RenderSurface + 'c> Context<'c, R>
[src]

Draw the passed VaoDraw (VAO range + a mode)

The call will used the passed properties to set the GL state if it's not the same already the passed glsl program and the set of uniforms

Draw the passed VaoDraw (VAO range + a mode)

The call will used the passed properties to set the GL state if it's not the same already the passed glsl program and the set of uniforms

Instanced drawing, draws num_instances times the passed VaoDraw (VAO range + a mode)

The call will used the passed properties to set the GL state if it's not the same already the passed glsl program and the set of uniforms

Instanced drawing, draws num_instances times the passed VaoDraw (VAO range + a mode)

The call will used the passed properties to set the GL state if it's not the same already the passed glsl program and the set of uniforms

Instanced drawing, draws num_instances times the passed VaoDraw (VAO range + a mode)

The call will used the passed properties to set the GL state if it's not the same already the passed glsl program and the set of uniforms

Draw the passed VaoDraw (VAO range + a mode) using a draw command

The call will used the passed properties to set the GL state if it's not the same already the passed glsl program and the set of uniforms

Draw the passed VaoDraw (VAO range + a mode) using a draw command

The call will used the passed properties to set the GL state if it's not the same already the passed glsl program and the set of uniforms

Draw the passed VaoDraw (VAO range + a mode) using a draw command

The call will used the passed properties to set the GL state if it's not the same already the passed glsl program and the set of uniforms

Draw the passed VaoDraw (VAO range + a mode) using a draw command

The call will used the passed properties to set the GL state if it's not the same already the passed glsl program and the set of uniforms

Draw the passed VaoDraw (VAO range + a mode)

The call will use the passed properties to set the GL state if it's not the same already the passed glsl program and the set of uniforms

Instanced drawing, draws num_instances times the passed VaoDraw (VAO range + a mode)

The call will used the passed properties to set the GL state if it's not the same already the passed glsl program and the set of uniforms

Pass a set of properties to get a copy of this context with those properties

Every draw call issued over the new context will use the passed properties.

use std::mem;
struct Vertex{
    position: [f32; 4]
}

let gl: glin::Context = unsafe{ mem::uninitialized() };
let vao: glin::SimpleVao<Vertex> = unsafe{ mem::uninitialized() };
let program: glin::Program = unsafe{ mem::uninitialized() };

{
    let gl = gl.with(&[glin::Property::DepthTest(true)]);
    // All calls in this scope will have depth testing enabled
    gl.draw(&vao, &program, &[]);
    gl.draw(&vao, &program, &[]);
    gl.draw(&vao, &program, &[]);
}

Pass an fbo get a copy of this context that renders to the fbo

This call is mut to forbid the caller from using the original context while the new one is in scoepe for performance reasons

use std::mem;
struct Vertex{
    position: [f32; 4]
}

let gl: glin::Context = unsafe{ mem::uninitialized() };
let vao: glin::SimpleVao<Vertex> = unsafe{ mem::uninitialized() };
let program: glin::Program = unsafe{ mem::uninitialized() };
let fbo = gl.new_fbo().create(1920, 1080).unwrap();

{
    let gl = gl.with_fbo(&fbo);
    // All calls in this scope will render to the passed fbo
    gl.draw(&vao, &program, &[]);
    gl.draw(&vao, &program, &[]);
    gl.draw(&vao, &program, &[]);
}

Get a copy of the context State

Clear the draw buffer with the passed color

Clear the depth buffer

Clear the stencil buffer

Trait Implementations

impl<'c, R: RenderSurface> CreationContext for Context<'c, R>
[src]

impl<'c, R: RenderSurface> CreationContextMut for Context<'c, R>
[src]

impl<'c> SurfaceCreationContext for Context<'c>
[src]

impl<'c, R: RenderSurface> Clone for Context<'c, R>
[src]

Performs copy-assignment from source. Read more

Auto Trait Implementations

impl<'c, R = Screen> !Send for Context<'c, R>

impl<'c, R = Screen> !Sync for Context<'c, R>

Blanket Implementations

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

impl<T> ToOwned for T where
    T: Clone
[src]

impl<T> From for T
[src]

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

impl<T> Any for T where
    T: Any
[src]

impl<T> SetParameter for T
[src]

Sets value as a parameter of self.