From dcb9f65b25e59edb21c9c3cac7b32d70ca19eb72 Mon Sep 17 00:00:00 2001 From: omniscient <17525998+omnisci3nce@users.noreply.github.com> Date: Sat, 10 Aug 2024 02:59:59 +1000 Subject: wip --- bindgen/rust/src/resources.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 bindgen/rust/src/resources.rs (limited to 'bindgen/rust/src/resources.rs') 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 { + let path_str = CString::new(path).unwrap(); + let handle = unsafe { ModelLoad_gltf(path_str.as_ptr() as *const _, false) }; + Some(handle) +} -- cgit v1.2.3-70-g09d2