summaryrefslogtreecommitdiff
path: root/bindgen/rust/src/resources.rs
diff options
context:
space:
mode:
authoromniscient <17525998+omnisci3nce@users.noreply.github.com>2024-08-10 02:59:59 +1000
committeromniscient <17525998+omnisci3nce@users.noreply.github.com>2024-08-10 02:59:59 +1000
commitdcb9f65b25e59edb21c9c3cac7b32d70ca19eb72 (patch)
treece99b01a070c57ecc6f3f4073b8298608706f9a0 /bindgen/rust/src/resources.rs
parenta0592bdb9966b204373bc4a258da47a603c70969 (diff)
wip
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)
+}