Enum glfw::WindowHint

source ·
pub enum WindowHint {
Show 43 variants RedBits(Option<u32>), GreenBits(Option<u32>), BlueBits(Option<u32>), AlphaBits(Option<u32>), DepthBits(Option<u32>), StencilBits(Option<u32>), AccumRedBits(Option<u32>), AccumGreenBits(Option<u32>), AccumBlueBits(Option<u32>), AccumAlphaBits(Option<u32>), AuxBuffers(Option<u32>), Stereo(bool), Samples(Option<u32>), SRgbCapable(bool), RefreshRate(Option<u32>), ClientApi(ClientApiHint), ContextVersionMajor(u32), ContextVersionMinor(u32), ContextVersion(u32, u32), ContextRobustness(ContextRobustnessHint), OpenGlForwardCompat(bool), OpenGlDebugContext(bool), OpenGlProfile(OpenGlProfileHint), Resizable(bool), Visible(bool), Decorated(bool), AutoIconify(bool), Floating(bool), Focused(bool), Maximized(bool), ContextNoError(bool), ContextCreationApi(ContextCreationApi), ContextReleaseBehavior(ContextReleaseBehavior), DoubleBuffer(bool), CenterCursor(bool), TransparentFramebuffer(bool), FocusOnShow(bool), ScaleToMonitor(bool), CocoaRetinaFramebuffer(bool), CocoaFrameName(Option<String>), CocoaGraphicsSwitching(bool), X11ClassName(Option<String>), X11InstanceName(Option<String>),
}
Expand description

Window hints that can be set using the window_hint function.

Variants§

§

RedBits(Option<u32>)

Specifies the desired bit depth of the red component of the default framebuffer.

§

GreenBits(Option<u32>)

Specifies the desired bit depth of the green component of the default framebuffer.

§

BlueBits(Option<u32>)

Specifies the desired bit depth of the blue component of the default framebuffer.

§

AlphaBits(Option<u32>)

Specifies the desired bit depth of the alpha component of the default framebuffer.

§

DepthBits(Option<u32>)

Specifies the desired bit depth of the depth component of the default framebuffer.

§

StencilBits(Option<u32>)

Specifies the desired bit depth of the stencil component of the default framebuffer.

§

AccumRedBits(Option<u32>)

Specifies the desired bit depth of the red component of the accumulation framebuffer.

§

AccumGreenBits(Option<u32>)

Specifies the desired bit depth of the green component of the accumulation framebuffer.

§

AccumBlueBits(Option<u32>)

Specifies the desired bit depth of the blue component of the accumulation framebuffer.

§

AccumAlphaBits(Option<u32>)

Specifies the desired bit depth of the alpha component of the accumulation framebuffer.

§

AuxBuffers(Option<u32>)

Specifies the desired number of auxiliary buffers.

§

Stereo(bool)

Specifies whether to use stereoscopic rendering.

§

Samples(Option<u32>)

Specifies the desired number of samples to use for multisampling. Zero disables multisampling.

§

SRgbCapable(bool)

Specifies whether the framebuffer should be sRGB capable.

§

RefreshRate(Option<u32>)

Specifies the desired refresh rate for full screen windows. If set to None, the highest available refresh rate will be used.

This hint is ignored for windowed mode windows.

§

ClientApi(ClientApiHint)

Specifies which ClientApi to create the context for.

§

ContextVersionMajor(u32)

Specifies the major client API version that the created context must be compatible with.

Window creation will fail if the resulting OpenGL version is less than the one requested.

§

ContextVersionMinor(u32)

Specifies the minor client API version that the created context must be compatible with.

Window creation will fail if the resulting OpenGL version is less than the one requested.

§

ContextVersion(u32, u32)

Specifies the client API version that the created context must be compatible with. This is the same as successive calls to window_hint function with the ContextVersionMajor and ContextVersionMinor hints.

Window creation will fail if the resulting OpenGL version is less than the one requested.

If ContextVersion(1, 0) is requested, most drivers will provide the highest available context.

§

ContextRobustness(ContextRobustnessHint)

Specifies the ContextRobustness strategy to be used.

§

OpenGlForwardCompat(bool)

Specifies whether the OpenGL context should be forward-compatible, i.e. one where all functionality deprecated in the requested version of OpenGL is removed. This may only be used if the requested OpenGL version is 3.0 or above.

If another client API is requested, this hint is ignored.

§

OpenGlDebugContext(bool)

Specifies whether to create a debug OpenGL context, which may have additional error and performance issue reporting functionality.

If another client API is requested, this hint is ignored.

§

OpenGlProfile(OpenGlProfileHint)

Specifies which OpenGL profile to create the context for. If requesting an OpenGL version below 3.2, OpenGlAnyProfile must be used.

If another client API is requested, this hint is ignored.

§

Resizable(bool)

Specifies whether the window will be resizable by the user. Even if this is set to false, the window can still be resized using the Window::set_size function.

This hint is ignored for fullscreen windows.

§

Visible(bool)

Specifies whether the window will be visible on creation.

This hint is ignored for fullscreen windows.

§

Decorated(bool)

Specifies whether the window will have platform-specific decorations such as a border, a close widget, etc.

This hint is ignored for full screen windows.

§

AutoIconify(bool)

Specifies whether the (full screen) window will automatically iconify and restore the previous video mode on input focus loss.

This hint is ignored for windowed mode windows.

§

Floating(bool)

Specifies whether the window will be floating above other regular windows, also called topmost or always-on-top.

This hint is ignored for full screen windows.

§

Focused(bool)

Specifies whether the windowed mode window will be given input focus when created.

This hint is ignored for full screen and initially hidden windows.

§

Maximized(bool)

Specifies whether the windowed mode window will be maximized when created.

This hint is ignored for full screen windows.

§

ContextNoError(bool)

Specifies whether the OpenGL or OpenGL ES contexts do not emit errors, allowing for better performance in some situations.

§

ContextCreationApi(ContextCreationApi)

Specifies which context creation API to use to create the context.

§

ContextReleaseBehavior(ContextReleaseBehavior)

Specifies the behavior of the OpenGL pipeline when a context is transferred between threads

§

DoubleBuffer(bool)

Specifies whether the framebuffer should be double buffered.

You nearly always want to use double buffering.

Note that setting this to false will make swap_buffers do nothing useful, and your scene will have to be displayed some other way.

§

CenterCursor(bool)

Speficies whether the cursor should be centered over newly created full screen windows.

This hint is ignored for windowed mode windows.

§

TransparentFramebuffer(bool)

Specifies whether the window framebuffer will be transparent.

If enabled and supported by the system, the window framebuffer alpha channel will be used to combine the framebuffer with the background. This does not affect window decorations.

§

FocusOnShow(bool)

Specifies whether the window will be given input focus when Window::show is called.

§

ScaleToMonitor(bool)

Specifies whether the window content area should be resized based on the monitor current scale of any monitor it is placed on.

This includes the initial placement when the window is created.

§

CocoaRetinaFramebuffer(bool)

Specifies whether to use full resolution framebuffers on Retina displays.

This is ignored on platforms besides macOS.

§

CocoaFrameName(Option<String>)

Specifies the UTF-8 encoded name to use for autosaving the window frame, or if empty disables frame autosaving for the window.

This is ignored on platforms besides macOS.

§

CocoaGraphicsSwitching(bool)

Specifies whether to in participate in Automatic Graphics Switching, i.e. to allow the system to choose the integrated GPU for the OpenGL context and move it between GPUs if necessary or whether to force it to always run on the discrete GPU.

Simpler programs and tools may want to enable this to save power, while games and other applications performing advanced rendering will want to leave it disabled.

This only affects systems with both integrated and discrete GPUs. This is ignored on platforms besides macOS.

§

X11ClassName(Option<String>)

Specifies the desired ASCII-encoded class part of the ICCCM WM_CLASS window property.

§

X11InstanceName(Option<String>)

Specifies the desired ASCII-encoded instance part of the ICCCM WM_CLASS window property.

Trait Implementations§

source§

impl Clone for WindowHint

source§

fn clone(&self) -> WindowHint

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl Debug for WindowHint

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Hash for WindowHint

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Ord for WindowHint

source§

fn cmp(&self, other: &WindowHint) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for WindowHint

source§

fn eq(&self, other: &WindowHint) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for WindowHint

source§

fn partial_cmp(&self, other: &WindowHint) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl Eq for WindowHint

source§

impl StructuralPartialEq for WindowHint

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.