1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
pub mod winit;
use Basalt;

use std::sync::Arc;
use vulkano::{instance::Instance, swapchain::Surface};
use Options as BasaltOptions;

pub trait BasaltWindow {
	fn capture_cursor(&self);
	fn release_cursor(&self);
	fn cursor_captured(&self) -> bool;
	fn attach_basalt(&self, basalt: Arc<Basalt>);
	fn enable_fullscreen(&self);
	fn disable_fullscreen(&self);
	fn toggle_fullscreen(&self);
	fn request_resize(&self, width: u32, height: u32);
	fn inner_dimensions(&self) -> [u32; 2];
}

pub fn open_surface(
	ops: BasaltOptions,
	instance: Arc<Instance>,
	result_fn: Box<
		dyn Fn(Result<Arc<Surface<Arc<dyn BasaltWindow + Send + Sync>>>, String>) + Send + Sync,
	>,
) {
	winit::open_surface(ops, instance, result_fn)
}