Struct glutin::GlAttributes
[−]
[src]
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
An existing context to share the new the context with.
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
.
Methods
impl<S> GlAttributes<S>
[src]
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(&self) -> GlAttributes<S>
[−]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[−]
Performs copy-assignment from source
. Read more
impl<S> Default for GlAttributes<S>
[src]
fn default() -> GlAttributes<S>
[−]
Returns the "default value" for a type. Read more