1mod base;
9
10pub use self::base::*;
11
12#[cfg(any(
13 target_os="macos", target_os="android", target_os="linux",
14 target_os="windows", target_os="nintendo_switch"
15))] mod vulkan;
16
17#[cfg(any(
18 target_os="android", target_os="linux", target_os="windows",
19 target_os="web"
20))] mod opengl;
21
22pub fn new_display() -> Result<Box<Display>, String> {
24 let mut err = "".to_string();
25
26 #[cfg(any(
28 target_os="macos", target_os="android", target_os="linux",
29 target_os="windows", target_os="nintendo_switch"
30 ))]
31 {
32 match vulkan::new() {
33 Ok(vulkan) => return Ok(vulkan),
34 Err(vulkan) => err.push_str(&vulkan),
35 }
36 err.push('\n');
37 }
38
39 #[cfg(any(
41 target_os="android", target_os="linux", target_os="windows",
42 ))]
43 {
44 match opengl::new() {
45 Ok(opengl) => return Ok(opengl),
46 Err(opengl) => err.push_str(opengl),
47 }
48 err.push('\n');
49 }
50
51 err.push_str("No more backend options");
53 Err(err)
54}