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 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 GlRequest::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 Robustness::TryRobustLoseContextOnReset.

vsync: bool

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

The default is false.

Implementations

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

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.