pub struct VulkanoWindows { /* private fields */ }
Expand description
A struct organizing windows and their corresponding renderers. This makes it easy to handle multiple windows.
§Examples
use vulkano_util::{
context::{VulkanoConfig, VulkanoContext},
window::VulkanoWindows,
};
let context = VulkanoContext::new(VulkanoConfig::default());
let mut vulkano_windows = VulkanoWindows::default();
let _id1 = vulkano_windows.create_window(event_loop, &context, &Default::default(), |_| {});
let _id2 = vulkano_windows.create_window(event_loop, &context, &Default::default(), |_| {});
// You should now have two windows.
Implementations§
Source§impl VulkanoWindows
impl VulkanoWindows
Sourcepub fn create_window(
&mut self,
event_loop: &ActiveEventLoop,
vulkano_context: &VulkanoContext,
window_descriptor: &WindowDescriptor,
swapchain_create_info_modify: fn(&mut SwapchainCreateInfo),
) -> WindowId
pub fn create_window( &mut self, event_loop: &ActiveEventLoop, vulkano_context: &VulkanoContext, window_descriptor: &WindowDescriptor, swapchain_create_info_modify: fn(&mut SwapchainCreateInfo), ) -> WindowId
Creates a winit window with VulkanoWindowRenderer
based on the given
WindowDescriptor
input and swapchain creation modifications.
Sourcepub fn get_primary_renderer_mut(&mut self) -> Option<&mut VulkanoWindowRenderer>
pub fn get_primary_renderer_mut(&mut self) -> Option<&mut VulkanoWindowRenderer>
Get a mutable reference to the primary window’s renderer.
Sourcepub fn get_primary_renderer(&self) -> Option<&VulkanoWindowRenderer>
pub fn get_primary_renderer(&self) -> Option<&VulkanoWindowRenderer>
Get a reference to the primary window’s renderer.
Sourcepub fn get_primary_window(&self) -> Option<&Window>
pub fn get_primary_window(&self) -> Option<&Window>
Get a reference to the primary winit window.
Sourcepub fn get_renderer_mut(
&mut self,
id: WindowId,
) -> Option<&mut VulkanoWindowRenderer>
pub fn get_renderer_mut( &mut self, id: WindowId, ) -> Option<&mut VulkanoWindowRenderer>
Get a mutable reference to the renderer by winit window id.
Sourcepub fn get_renderer(&self, id: WindowId) -> Option<&VulkanoWindowRenderer>
pub fn get_renderer(&self, id: WindowId) -> Option<&VulkanoWindowRenderer>
Get a reference to the renderer by winit window id.
Sourcepub fn get_window(&self, id: WindowId) -> Option<&Window>
pub fn get_window(&self, id: WindowId) -> Option<&Window>
Get a reference to the winit window by winit window id.
Sourcepub fn primary_window_id(&self) -> Option<WindowId>
pub fn primary_window_id(&self) -> Option<WindowId>
Return primary window id.
Sourcepub fn remove_renderer(&mut self, id: WindowId)
pub fn remove_renderer(&mut self, id: WindowId)
Remove renderer by window id.
Sourcepub fn iter(&self) -> Iter<'_, WindowId, VulkanoWindowRenderer>
pub fn iter(&self) -> Iter<'_, WindowId, VulkanoWindowRenderer>
Return iterator over window renderers.
Sourcepub fn iter_mut(&mut self) -> IterMut<'_, WindowId, VulkanoWindowRenderer>
pub fn iter_mut(&mut self) -> IterMut<'_, WindowId, VulkanoWindowRenderer>
Return iterator over mutable window renderers.
Trait Implementations§
Source§impl Default for VulkanoWindows
impl Default for VulkanoWindows
Source§fn default() -> VulkanoWindows
fn default() -> VulkanoWindows
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for VulkanoWindows
impl !RefUnwindSafe for VulkanoWindows
impl !Send for VulkanoWindows
impl !Sync for VulkanoWindows
impl Unpin for VulkanoWindows
impl !UnwindSafe for VulkanoWindows
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
Mutably borrows from an owned value. Read more
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>
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
.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
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
.Source§fn as_any(&self) -> &(dyn Any + 'static)
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.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
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.