Crates.io | voodoo |
lib.rs | voodoo |
version | 0.3.1 |
source | src |
created_at | 2017-09-17 16:37:55.542989 |
updated_at | 2018-03-12 00:26:02.321866 |
description | An intuitive, idiomatic, unopinionated, zero-overhead Vulkan API |
homepage | https://github.com/cogciprocate/voodoo |
repository | https://github.com/cogciprocate/voodoo |
max_upload_size | |
id | 32064 |
size | 1,841,918 |
Ensure that Vulkan drivers are installed for your device. Add the following to your project's Cargo.toml:
[dependencies]
voodoo = "0.3.1"
And add the following to your crate root (lib.rs or main.rs):
extern crate voodoo;
Create an instance:
extern crate voodoo;
use voodoo::{Result as VdResult, Instance, ApplicationInfo, Loader};
use std::ffi::CString;
/// Initializes and returns a new loader and instance with all available
/// extension function pointers loaded.
fn init_instance() -> VdResult<Instance> {
let app_name = CString::new("Hello!")?;
let app_info = ApplicationInfo::builder()
.application_name(&app_name)
.application_version((1, 0, 0))
.api_version((1, 0, 0))
.build();
let loader = Loader::new()?;
Instance::builder()
.application_info(&app_info)
.enabled_extensions(&loader.enumerate_instance_extension_properties()?)
.build(loader)
}
fn main() {
let _instance = init_instance().unwrap();
}
See hello.rs
for a complete, working example adapted from
https://vulkan-tutorial.com/.
hello.rs
screenshot:
For a higher level, more opinionated, easier to use Vulkan API that does more for you see the Vulkano project.
Other low-ish level Rust libraries include dacite and ash. See vks for a direct ffi interface.
“Vulkan and the Vulkan logo are registered trademarks of the Khronos Group Inc.”