summaryrefslogtreecommitdiff
path: root/bindgen/rust/src/resources.rs
diff options
context:
space:
mode:
Diffstat (limited to 'bindgen/rust/src/resources.rs')
-rw-r--r--bindgen/rust/src/resources.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/bindgen/rust/src/resources.rs b/bindgen/rust/src/resources.rs
new file mode 100644
index 0000000..89cf6d7
--- /dev/null
+++ b/bindgen/rust/src/resources.rs
@@ -0,0 +1,10 @@
+use std::{ffi::CString, path::Path};
+
+use celeritas_sys::{ModelHandle, ModelLoad, ModelLoad_gltf};
+
+/// Load a gltf from disk
+pub fn model_load_gltf(path: &str) -> Option<ModelHandle> {
+ let path_str = CString::new(path).unwrap();
+ let handle = unsafe { ModelLoad_gltf(path_str.as_ptr() as *const _, false) };
+ Some(handle)
+}