[−][src]Struct ggraphics::GlContext
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]
&mut self,
spec: &SamplerSpec
) -> <Context as HasContext>::Sampler
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]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,