Struct mini_gl_fb::config::Config [−][src]
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)
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]
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>,