Struct screen_13::prelude::EventLoopBuilder
source · pub struct EventLoopBuilder { /* private fields */ }
Expand description
Builder for EventLoop
.
Implementations§
source§impl EventLoopBuilder
impl EventLoopBuilder
sourcepub fn available_monitors(&self) -> impl Iterator<Item = MonitorHandle>
pub fn available_monitors(&self) -> impl Iterator<Item = MonitorHandle>
Returns the list of all the monitors available on the system.
sourcepub fn command_buffer_count(self, cmd_buf_count: usize) -> Self
pub fn command_buffer_count(self, cmd_buf_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 desired_surface_format<F>(self, surface_format_fn: F) -> Self
pub fn desired_surface_format<F>(self, surface_format_fn: 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 desired_swapchain_image_count(
self,
desired_swapchain_image_count: u32
) -> Self
pub fn desired_swapchain_image_count( self, desired_swapchain_image_count: u32 ) -> Self
The desired, but not guaranteed, number of images that will be in the created swapchain.
More images introduces more display lag, but smoother animation.
sourcepub fn sync_display(self, sync_display: bool) -> Self
pub fn sync_display(self, sync_display: bool) -> Self
Set to true
to enable vsync in exclusive fullscreen video modes.
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 debug(self, debug: bool) -> Self
pub fn debug(self, debug: bool) -> Self
Enables Vulkan graphics debugging layers.
NOTE: Any valdation warnings or errors will cause the current thread to park itself after
describing the error using the log
crate. This makes it easy to attach a debugger and see
what is causing the issue directly.
§Platform-specific
macOS: Has no effect.
sourcepub fn primary_monitor(&self) -> Option<MonitorHandle>
pub fn primary_monitor(&self) -> Option<MonitorHandle>
Returns the primary monitor of the system.
Returns None
if it can’t identify any monitor as a primary one.
§Platform-specific
Wayland: Always returns None
.
sourcepub fn resolver_pool(self, pool: Box<dyn ResolverPool>) -> Self
pub fn resolver_pool(self, pool: Box<dyn ResolverPool>) -> Self
Allows for specification of a custom pool implementation.
This pool will hold leases for Vulkan objects needed by Display
.
sourcepub fn window<WindowFn>(self, window_fn: WindowFn) -> Self
pub fn window<WindowFn>(self, window_fn: 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.
source§impl EventLoopBuilder
impl EventLoopBuilder
sourcepub fn build(self) -> Result<EventLoop, DriverError>
pub fn build(self) -> Result<EventLoop, DriverError>
Builds a new EventLoop
.