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
sharing: Option<S>
An existing context with which some OpenGL objects get shared.
The default is None
.
version: GlRequest
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]
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>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<S: Debug> Debug for GlAttributes<S>
[src]
impl<S> Default for GlAttributes<S>
[src]
fn default() -> GlAttributes<S>
[src]
Auto Trait Implementations
impl<S> RefUnwindSafe for GlAttributes<S> where
S: RefUnwindSafe,
S: RefUnwindSafe,
impl<S> Send for GlAttributes<S> where
S: Send,
S: Send,
impl<S> Sync for GlAttributes<S> where
S: Sync,
S: Sync,
impl<S> Unpin for GlAttributes<S> where
S: Unpin,
S: Unpin,
impl<S> UnwindSafe for GlAttributes<S> where
S: UnwindSafe,
S: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,