[][src]Struct glutin::GlAttributes

pub struct GlAttributes<S> {
    pub sharing: Option<S>,
    pub version: GlRequest,
    pub profile: Option<GlProfile>,
    pub debug: bool,
    pub robustness: Robustness,
    pub vsync: bool,
}

Attributes to use when creating an OpenGL Context.

Fields

sharing: Option<S>

An existing context with which some OpenGL objects get shared.

The default is None.

version: GlRequest

Version to try create. See GlRequest for more infos.

The default is Latest.

profile: Option<GlProfile>

OpenGL profile to use.

The default is None.

debug: bool

Whether to enable the debug flag of the context.

Debug contexts are usually slower but give better error reporting.

The default is true in debug mode and false in release mode.

robustness: Robustness

How the OpenGL Context should detect errors.

The default is NotRobust because this is what is typically expected when you create an OpenGL Context. However for safety you should consider TryRobustLoseContextOnReset.

vsync: bool

Whether to use vsync. If vsync is enabled, calling swap_buffers will block until the screen refreshes. This is typically used to prevent screen tearing.

The default is false.

Implementations

impl<S> GlAttributes<S>[src]

pub fn map_sharing<F, T>(self, f: F) -> GlAttributes<T> where
    F: FnOnce(S) -> T, 
[src]

Turns the sharing parameter into another type by calling a closure.

Trait Implementations

impl<S: Clone> Clone for GlAttributes<S>[src]

impl<S: Debug> Debug for GlAttributes<S>[src]

impl<S> Default for GlAttributes<S>[src]

Auto Trait Implementations

impl<S> RefUnwindSafe for GlAttributes<S> where
    S: RefUnwindSafe

impl<S> Send for GlAttributes<S> where
    S: Send

impl<S> Sync for GlAttributes<S> where
    S: Sync

impl<S> Unpin for GlAttributes<S> where
    S: Unpin

impl<S> UnwindSafe for GlAttributes<S> where
    S: UnwindSafe

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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.