summaryrefslogtreecommitdiff
path: root/bindgen
diff options
context:
space:
mode:
Diffstat (limited to 'bindgen')
-rw-r--r--bindgen/rust/Cargo.toml2
-rw-r--r--bindgen/rust/celeritas-sys/src/lib.rs2
-rw-r--r--bindgen/rust/src/lib.rs2
-rw-r--r--bindgen/rust/src/prelude.rs6
-rw-r--r--bindgen/rust/src/ral.rs23
5 files changed, 19 insertions, 16 deletions
diff --git a/bindgen/rust/Cargo.toml b/bindgen/rust/Cargo.toml
index 8f9da64..4ca1432 100644
--- a/bindgen/rust/Cargo.toml
+++ b/bindgen/rust/Cargo.toml
@@ -10,4 +10,4 @@ serde_json = "1.0.120"
egui = "0.27.1"
egui_glfw = { git = "https://github.com/omnisci3nce/egui_glfw.git", rev = "67b432695433feb59761f3ae984b966ca3da31db" }
-gl = "0.14.0" \ No newline at end of file
+gl = "0.14.0"
diff --git a/bindgen/rust/celeritas-sys/src/lib.rs b/bindgen/rust/celeritas-sys/src/lib.rs
index 3a96f59..676e7c2 100644
--- a/bindgen/rust/celeritas-sys/src/lib.rs
+++ b/bindgen/rust/celeritas-sys/src/lib.rs
@@ -4,4 +4,4 @@
use serde::{Deserialize, Serialize};
-include!(concat!(env!("OUT_DIR"), "/bindings.rs"));
+include!(concat!(env!("OUT_DIR"), "/bindings.rs")); \ No newline at end of file
diff --git a/bindgen/rust/src/lib.rs b/bindgen/rust/src/lib.rs
index cfb999c..f65b031 100644
--- a/bindgen/rust/src/lib.rs
+++ b/bindgen/rust/src/lib.rs
@@ -63,4 +63,4 @@ pub enum Light {
Point(ffi::PointLight),
Directional(ffi::DirectionalLight),
// Spot(ffi::Spotlight)
-} \ No newline at end of file
+}
diff --git a/bindgen/rust/src/prelude.rs b/bindgen/rust/src/prelude.rs
index c81fbe0..b78f364 100644
--- a/bindgen/rust/src/prelude.rs
+++ b/bindgen/rust/src/prelude.rs
@@ -6,10 +6,10 @@ pub use celeritas_sys::Vec4;
// --- handles
pub use celeritas_sys::BufferHandle;
-pub use celeritas_sys::TextureHandle;
-pub use celeritas_sys::MeshHandle;
pub use celeritas_sys::MaterialHandle;
+pub use celeritas_sys::MeshHandle;
pub use celeritas_sys::ModelHandle;
pub use celeritas_sys::PipelineHandle;
+pub use celeritas_sys::PipelineLayoutHandle;
pub use celeritas_sys::RenderpassHandle;
-pub use celeritas_sys::PipelineLayoutHandle; \ No newline at end of file
+pub use celeritas_sys::TextureHandle;
diff --git a/bindgen/rust/src/ral.rs b/bindgen/rust/src/ral.rs
index 5568954..775335a 100644
--- a/bindgen/rust/src/ral.rs
+++ b/bindgen/rust/src/ral.rs
@@ -1,7 +1,8 @@
//! Wrapper around the RAL code in celeritas-core
use celeritas_sys::{
- BufferHandle, GPU_CmdEncoder, GPU_CmdEncoder_BeginRender, GPU_CmdEncoder_EndRender, GPU_GetDefaultEncoder
+ BufferHandle, GPU_CmdEncoder, GPU_CmdEncoder_BeginRender, GPU_CmdEncoder_EndRender,
+ GPU_GetDefaultEncoder,
};
pub struct FrameRenderEncoder(*mut GPU_CmdEncoder);
@@ -30,13 +31,13 @@ impl Drop for FrameRenderEncoder {
impl FrameRenderEncoder {
pub fn set_vertex_buffer(&self, buf: BufferHandle) {
- // TODO: Get buffer ptr from handle
- // TODO: assert that buffer type is vertex
+ // TODO: Get buffer ptr from handle
+ // TODO: assert that buffer type is vertex
todo!()
}
pub fn set_index_buffer(&self, buf: BufferHandle) {
- // TODO: Get buffer ptr from handle
- // TODO: assert that buffer type is index
+ // TODO: Get buffer ptr from handle
+ // TODO: assert that buffer type is index
todo!()
}
}
@@ -52,10 +53,12 @@ pub enum PrimitiveTopology {
impl From<celeritas_sys::PrimitiveTopology> for PrimitiveTopology {
fn from(value: celeritas_sys::PrimitiveTopology) -> Self {
match value {
- celeritas_sys::PrimitiveTopology_PRIMITIVE_TOPOLOGY_POINT => PrimitiveTopology::Point,
- celeritas_sys::PrimitiveTopology_PRIMITIVE_TOPOLOGY_LINE => PrimitiveTopology::Line,
- celeritas_sys::PrimitiveTopology_PRIMITIVE_TOPOLOGY_TRIANGLE => PrimitiveTopology::Triangle,
- _ => unreachable!("enum conversion should be infallible")
+ celeritas_sys::PrimitiveTopology_PRIMITIVE_TOPOLOGY_POINT => PrimitiveTopology::Point,
+ celeritas_sys::PrimitiveTopology_PRIMITIVE_TOPOLOGY_LINE => PrimitiveTopology::Line,
+ celeritas_sys::PrimitiveTopology_PRIMITIVE_TOPOLOGY_TRIANGLE => {
+ PrimitiveTopology::Triangle
+ }
+ _ => unreachable!("enum conversion should be infallible"),
}
}
-} \ No newline at end of file
+}