pub struct EventLoopBuilder { /* private fields */ }
Expand description

Builder for EventLoop.

Implementations§

source§

impl EventLoopBuilder

source

pub fn available_monitors(&self) -> impl Iterator<Item = MonitorHandle>

Returns the list of all the monitors available on the system.

source

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.

source

pub fn desired_surface_format<F>(self, surface_format_fn: F) -> Self
where F: 'static + FnOnce(&[SurfaceFormatKHR]) -> SurfaceFormatKHR,

A function to select the desired swapchain surface image format.

By default linear color space will be selected unless it is not available.

source

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.

source

pub fn sync_display(self, sync_display: bool) -> Self

Set to true to enable vsync in exclusive fullscreen video modes.

source

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.

source

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.

source

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.

source

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.

source

pub fn window<WindowFn>(self, window_fn: WindowFn) -> Self
where WindowFn: FnOnce(WindowBuilder) -> WindowBuilder,

Allows deeper customization of the window, if needed.

source

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

source

pub fn build(self) -> Result<EventLoop, DriverError>

Builds a new EventLoop.

Trait Implementations§

source§

impl Debug for EventLoopBuilder

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for EventLoopBuilder

source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert 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.
§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more