[][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.


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.


impl<S> GlAttributes<S>[src]

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

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

Trait Implementations

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

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

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

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

Auto Trait Implementations

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

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

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 

impl<T> From for T[src]

impl<T> ToOwned for T where
    T: Clone

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized

impl<T> BorrowMut for T where
    T: ?Sized

impl<T, U> TryInto for T where
    U: TryFrom<T>, 

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

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

impl<T> SetParameter for T

fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
    T: Parameter<Self>, 

Sets value as a parameter of self.

impl<T> Erased for T