mod base;
pub use self::base::*;
#[cfg(any(
target_os="macos", target_os="android", target_os="linux",
target_os="windows", target_os="nintendo_switch"
))] mod vulkan;
#[cfg(any(
target_os="android", target_os="linux", target_os="windows",
target_os="web"
))] mod opengl;
pub fn new_display() -> Result<Box<Display>, String> {
let mut err = "".to_string();
#[cfg(any(
target_os="macos", target_os="android", target_os="linux",
target_os="windows", target_os="nintendo_switch"
))]
{
match vulkan::new() {
Ok(vulkan) => return Ok(vulkan),
Err(vulkan) => err.push_str(&vulkan),
}
err.push('\n');
}
#[cfg(any(
target_os="android", target_os="linux", target_os="windows",
))]
{
match opengl::new() {
Ok(opengl) => return Ok(opengl),
Err(opengl) => err.push_str(opengl),
}
err.push('\n');
}
err.push_str("No more backend options");
Err(err)
}