diff options
author | omniscient <17525998+omnisci3nce@users.noreply.github.com> | 2024-10-19 13:24:31 +1100 |
---|---|---|
committer | omniscient <17525998+omnisci3nce@users.noreply.github.com> | 2024-10-19 13:24:31 +1100 |
commit | 6182860f1b1aba4128b4f66eda7977600e60d1a0 (patch) | |
tree | 388d9aff8ca19ef324633ac1bea43f1548675150 /bindgen/rust | |
parent | 5d1750d9adfc45b53c75310c58e31dfdbd8a6e15 (diff) | |
parent | d6d742f8a24490f885e4a1ae3fea7ec46b01f58c (diff) |
fix merge
Diffstat (limited to 'bindgen/rust')
-rw-r--r-- | bindgen/rust/celeritas-sys/src/lib.rs | 53 | ||||
-rw-r--r-- | bindgen/rust/src/prelude.rs | 30 |
2 files changed, 42 insertions, 41 deletions
diff --git a/bindgen/rust/celeritas-sys/src/lib.rs b/bindgen/rust/celeritas-sys/src/lib.rs index 9ea3e47..5b65f5e 100644 --- a/bindgen/rust/celeritas-sys/src/lib.rs +++ b/bindgen/rust/celeritas-sys/src/lib.rs @@ -6,28 +6,29 @@ use serde::{Deserialize, Serialize}; include!(concat!(env!("OUT_DIR"), "/bindings.rs")); -// // --- Conversions -// pub mod conversions { -// use crate::{Mat4, Vec3, Vec4}; +// --- Conversions +pub mod conversions { + use crate::{mat4, vec3, vec4}; -// impl From<Vec3> for glam::Vec3 { -// fn from(v: Vec3) -> Self { -// Self { -// x: v.x, -// y: v.y, -// z: v.z, -// } -// } -// } -// impl From<glam::Vec3> for Vec3 { -// fn from(v: glam::Vec3) -> Self { -// Self { -// x: v.x, -// y: v.y, -// z: v.z, -// } -// } -// } + impl From<vec3> for glam::Vec3 { + fn from(v: vec3) -> Self { + Self { + x: v.x, + y: v.y, + z: v.z, + } + } + } + impl From<glam::Vec3> for vec3 { + fn from(v: glam::Vec3) -> Self { + Self { + x: v.x, + y: v.y, + z: v.z, + } + } + } +} // impl From<Vec4> for glam::Vec4 { // fn from(v: Vec4) -> Self { @@ -102,14 +103,14 @@ include!(concat!(env!("OUT_DIR"), "/bindings.rs")); // }; // } -impl Default for ShaderBinding { +impl Default for shader_binding { fn default() -> Self { Self { label: "static".as_ptr() as *const _, - kind: ShaderBindingKind_BINDING_COUNT, - vis: ShaderVisibility_VISIBILITY_VERTEX, - data: ShaderBinding__bindgen_ty_1 { - bytes: ShaderBinding__bindgen_ty_1__bindgen_ty_1 { + binding_type: shader_binding_type_BINDING_BUFFER, + visibility: shader_stage_STAGE_VERTEX, + data: shader_binding__bindgen_ty_1 { + bytes: shader_binding__bindgen_ty_1__bindgen_ty_1 { size: 0, data: std::ptr::null_mut(), }, diff --git a/bindgen/rust/src/prelude.rs b/bindgen/rust/src/prelude.rs index 7adf11b..240b13a 100644 --- a/bindgen/rust/src/prelude.rs +++ b/bindgen/rust/src/prelude.rs @@ -1,20 +1,20 @@ -pub use celeritas_sys::Mat4; -pub use celeritas_sys::Quat; -pub use celeritas_sys::Transform; -/// --- maths types -pub use celeritas_sys::Vec2; -pub use celeritas_sys::Vec3; -pub use celeritas_sys::Vec4; +// --- maths types +pub use celeritas_sys::mat4; +pub use celeritas_sys::quat; +pub use celeritas_sys::transform; +pub use celeritas_sys::vec2; +pub use celeritas_sys::vec3; +pub use celeritas_sys::vec4; // --- handles -pub use celeritas_sys::BufHandle; -pub use celeritas_sys::MaterialHandle; -pub use celeritas_sys::MeshHandle; -pub use celeritas_sys::ModelHandle; -pub use celeritas_sys::PipelineHandle; -pub use celeritas_sys::TexHandle; -// pub use celeritas_sys::PipelineLayoutHandle; -// pub use celeritas_sys::RenderpassHandle; +pub type BufHandle = celeritas_sys::buf_handle; +pub type TexHandle = celeritas_sys::tex_handle; +// pub type MaterialHandle = celeritas_sys::material_handle; +// pub type MeshHandle = celeritas_sys::mesh_handle; +pub type ModelHandle = celeritas_sys::model_handle; +pub type PipelineHandle = celeritas_sys::pipeline_handle; +// pub type PipelineLayoutHandle = celeritas_sys::pipeline_layout_handle; +// pub type RenderpassHandle = celeritas_sys::renderpass_handle; // // --- conversions // pub use celeritas_sys::conversions; |