[][src]Struct beryllium::GLContext

#[repr(transparent)]
pub struct GLContext<'sdl, 'win> { /* fields omitted */ }

Handle for an OpenGL context.

General Safety

The context must be current when you call any method here.

Methods

impl<'sdl, 'win> GLContext<'sdl, 'win>[src]

pub unsafe fn extension_supported(&self, name: &str) -> bool[src]

Checks if the given extension is available in this context.

pub unsafe fn get_attribute(&self, attr: GLattr) -> Result<i32, String>[src]

Obtains the actual value of the attribute for this context.

Note that the context you request and the context that you get might not match, because yay.

pub unsafe fn swap_interval(&self) -> i32[src]

Determines the swap interval of the video display.

  • 0: No vsync
  • 1: Vsync
  • -1: "adaptive vsync", late swaps will happen immediately

If the swap interval can't be determined this returns 0 as a "safe default". You can also call get_error to potentially find out more.

pub unsafe fn set_swap_interval(&self, interval: i32) -> Result<(), String>[src]

Attempts to set the swap interval value.

The values work as per swap_interval.

Note that if you request adaptive vsync and get an error it is likely that standard vsync might still be available as a fallback.

pub fn is_current(&self) -> bool[src]

Checks if this context is current.

Trait Implementations

impl<'sdl, 'win> Drop for GLContext<'sdl, 'win>[src]

impl<'sdl, 'win> Debug for GLContext<'sdl, 'win>[src]

Auto Trait Implementations

impl<'sdl, 'win> !Send for GLContext<'sdl, 'win>

impl<'sdl, 'win> !Sync for GLContext<'sdl, 'win>

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

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

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

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