pub struct WindowBuilder { /* private fields */ }Expand description
Builder for configuring and constructing a Window.
Implementations§
Source§impl WindowBuilder
impl WindowBuilder
Sourcepub fn build(self) -> Result<Window, WindowError>
pub fn build(self) -> Result<Window, WindowError>
Builds the window, event loop, and compatible vk-graph device.
Sourcepub fn command_buffer_count(self, count: usize) -> Self
pub fn command_buffer_count(self, count: usize) -> Self
Specifies the number of in-flight command buffers, which should be greater than or equal to the desired swapchain image count.
More command buffers mean less time waiting for previously submitted frames to complete, but more memory in use.
Generally a value of one or two greater than desired image count produces the smoothest animation.
Sourcepub fn debug(self, enabled: bool) -> Self
pub fn debug(self, enabled: bool) -> Self
Enables Vulkan graphics debugging layers.
NOTE: Validation errors will only park the current thread for debugger attach when the process is attached to an interactive terminal. Otherwise they continue after logging.
§Platform-specific
macOS: Has no effect.
Sourcepub fn desired_surface_format<F>(self, f: F) -> Self
pub fn desired_surface_format<F>(self, f: F) -> Self
A function to select the desired swapchain surface image format.
By default linear color space will be selected unless it is not available.
Sourcepub fn min_image_count(self, count: u32) -> Self
pub fn min_image_count(self, count: u32) -> Self
The minimum number of presentable images that the application needs. The implementation will either create the swapchain with at least that many images, or it will fail to create the swapchain.
More images introduce more display lag, but smoother animation.
Sourcepub fn fullscreen_mode(self, mode: FullscreenMode) -> Self
pub fn fullscreen_mode(self, mode: FullscreenMode) -> Self
Sets up fullscreen mode. In addition, decorations are set to false and maximized is set to
true.
§Note
There are additional options offered by winit which can be accessed using the window
function.
Sourcepub fn v_sync(self, enabled: bool) -> Self
pub fn v_sync(self, enabled: bool) -> Self
When true, requests presentation synchronized to the display refresh.
§Note
Applies only to exclusive fullscreen mode.
Sourcepub fn window<WindowFn>(self, f: WindowFn) -> Self
pub fn window<WindowFn>(self, f: WindowFn) -> Self
Allows deeper customization of the window, if needed.
Sourcepub fn window_mode(self) -> Self
pub fn window_mode(self) -> Self
Sets up “windowed” mode, which is the opposite of fullscreen.
§Note
There are additional options offered by winit which can be accessed using the window
function.
Trait Implementations§
Source§impl Debug for WindowBuilder
impl Debug for WindowBuilder
Auto Trait Implementations§
impl !RefUnwindSafe for WindowBuilder
impl !Send for WindowBuilder
impl !Sync for WindowBuilder
impl !UnwindSafe for WindowBuilder
impl Freeze for WindowBuilder
impl Unpin for WindowBuilder
impl UnsafeUnpin for WindowBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.