Struct vulkano_util::window::VulkanoWindows
source · [−]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};
use winit::event_loop::EventLoop;
use vulkano_util::window::VulkanoWindows;
#[test]
fn test() {
let context = VulkanoContext::new(VulkanoConfig::default());
let event_loop = EventLoop::new();
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
sourceimpl VulkanoWindows
impl VulkanoWindows
sourcepub fn create_window(
&mut self,
event_loop: &EventLoopWindowTarget<()>,
vulkano_context: &VulkanoContext,
window_descriptor: &WindowDescriptor,
swapchain_create_info_modify: fn(_: &mut SwapchainCreateInfo)
) -> WindowId
pub fn create_window(
&mut self,
event_loop: &EventLoopWindowTarget<()>,
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
sourceimpl Default for VulkanoWindows
impl Default for VulkanoWindows
sourcefn default() -> VulkanoWindows
fn default() -> VulkanoWindows
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl !RefUnwindSafe for VulkanoWindows
impl !Send for VulkanoWindows
impl !Sync for VulkanoWindows
impl Unpin for VulkanoWindows
impl !UnwindSafe for VulkanoWindows
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more