Struct glutin::GlAttributes
source · pub struct GlAttributes<S> {
pub sharing: Option<S>,
pub version: GlRequest,
pub profile: Option<GlProfile>,
pub debug: bool,
pub robustness: Robustness,
pub vsync: bool,
}
Expand description
Attributes to use when creating an OpenGL context.
Fields§
§sharing: Option<S>
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
.
Implementations§
source§impl<S> GlAttributes<S>
impl<S> GlAttributes<S>
sourcepub fn map_sharing<F, T>(self, f: F) -> GlAttributes<T>where
F: FnOnce(S) -> T,
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§
source§impl<S: Clone> Clone for GlAttributes<S>
impl<S: Clone> Clone for GlAttributes<S>
source§fn clone(&self) -> GlAttributes<S>
fn clone(&self) -> GlAttributes<S>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more