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, }
Expand description
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)
This struct is marked as non-exhaustive
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
Auto Trait Implementations
impl RefUnwindSafe for Config
impl UnwindSafe for Config
Blanket Implementations
Mutably borrows from an owned value. Read more