[][src]Struct golem::Context

pub struct Context(_);

The context required to interact with the GPU

Methods

impl Context[src]

pub fn from_glow(gl: Context) -> Result<Context, GolemError>[src]

Create an instance from an OpenGL context

pub fn set_viewport(&self, x: u32, y: u32, width: u32, height: u32)[src]

Set the section of the framebuffer that will be rendered to

By default, this is the entire internal area of the window. When switching to a Surface, it's generally important to set the viewport to its area.

pub fn set_clear_color(&self, r: f32, g: f32, b: f32, a: f32)[src]

Set the color the render target will be cleared to by clear

pub fn clear(&self)[src]

Clear the current render target to the render color (see set_clear_color)

pub fn set_blend_mode(&self, blend_state: Option<BlendMode>)[src]

Set the blend mode, with None disabling blending

By default, this is None

See the documentation for BlendMode for the various blending options

Auto Trait Implementations

impl !RefUnwindSafe for Context

impl !Send for Context

impl !Sync for Context

impl Unpin for Context

impl !UnwindSafe for Context

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, 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.