[][src]Struct ggraphics::GlContext

pub struct GlContext {
    pub gl: Rc<Context>,
    pub passes: Vec<RenderPass>,
    // some fields omitted
}

A type that contains all the STUFF we need for displaying graphics and handling events on both desktop and web. Anything it contains is specialized to the correct type via cfg flags at compile time, rather than trying to use generics or such.

Fields

gl: Rc<Context>

The OpenGL context.

passes: Vec<RenderPass>

The list of render passes.

Methods

impl GlContext[src]

pub fn new(gl: Context) -> Self[src]

Create a new GlContext from the given glow::Context. Does basic setup and state setting.

pub fn default_shader(&self) -> Shader[src]

Get a copy of the default quad shader.

pub fn get_sampler(
    &mut self,
    spec: &SamplerSpec
) -> <Context as HasContext>::Sampler
[src]

Get a sampler given the given spec. Samplers are cached, and usually few in number, so you shouldn't free them and this handles caching them for you.

pub fn draw(&mut self)[src]

Draw all contained render passes, in order.

pub fn get_info(&self) -> (String, String, String, String)[src]

Returns OpenGL version info. Vendor, renderer, GL version, GLSL version

pub fn set_screen_viewport(&mut self, x: i32, y: i32, w: i32, h: i32)[src]

Sets the viewport for the final render-to-screen pass. Negative numbers are valid, see glViewport for the math behind it.

Panics if there is no such render pass.

Auto Trait Implementations

impl !Send for GlContext

impl !Sync for GlContext

impl Unpin for GlContext

impl !UnwindSafe for GlContext

impl !RefUnwindSafe for GlContext

Blanket Implementations

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

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

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

type Error = !

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.

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

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

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