Struct mini_gl_fb::config::Config[][src]

#[non_exhaustive]pub struct Config {
    pub buffer_size: Option<LogicalSize<u32>>,
    pub resizable: bool,
    pub window_title: String,
    pub window_size: LogicalSize<f64>,
    pub invert_y: bool,
}

Configuration for "advanced" use cases, when gotta_go_fast isn't doing what you need.

The following pattern is recommended when creating a config:

use mini_gl_fb::config;
use mini_gl_fb::glutin::dpi::LogicalSize;

let config = config! {
    /* specify whichever fields you need to set, for example: */
    window_size: LogicalSize::new(100.0, 100.0),
    resizable: true,
};

Since Config is #[non_exhaustive], you cannot construct it directly, and can only obtain one from a trait like Default. The config! macro makes it much less tedious to construct custom configs. See its documentation for more information.

Alternatively, you can choose to use the builder pattern instead:

use mini_gl_fb::ConfigBuilder;

let config = ConfigBuilder::default()
    .invert_y(false)
    .build();

If there's a config option you want to see or think is missing, please open an issue!

Fields (Non-exhaustive)

Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct {{ .. }} syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
buffer_size: Option<LogicalSize<u32>>

Sets the pixel dimensions of the buffer. The buffer will automatically stretch to fill the whole window. By default this will be the same as the window_size.

resizable: bool

If this is true, the window created by mini_gl_fb will be set to resizable. This can be changed later. Please note that the buffer itself will not be automatically resized, only the viewport.

window_title: String

The title of the window that will be created.

window_size: LogicalSize<f64>

The logical size of the window that gets created. On HiDPI screens the actual size may be larger than this

invert_y: bool

By default, the origin of the buffer is the bottom-left. This is known as "inverted Y", as most screen-space coordinate systems begin from the top-left. By explicitly setting this option to false, you can switch to screen-space coordinates rather than OpenGL coordinates. Otherwise, you will have to invert all mouse events received from winit/glutin.

Trait Implementations

impl Clone for Config[src]

impl Debug for Config[src]

impl Default for Config[src]

impl PartialEq<Config> for Config[src]

impl StructuralPartialEq for Config[src]

Auto Trait Implementations

impl RefUnwindSafe for Config

impl Send for Config

impl Sync for Config

impl Unpin for Config

impl UnwindSafe for Config

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.