From 3d00c80b6b5b54da5c1ccdad9f05534a48bca39f Mon Sep 17 00:00:00 2001 From: omniscient <17525998+omnisci3nce@users.noreply.github.com> Date: Sat, 3 Aug 2024 16:59:24 +1000 Subject: more work o nrust bindings --- bindgen/rust/src/shader.rs | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 bindgen/rust/src/shader.rs (limited to 'bindgen/rust/src/shader.rs') diff --git a/bindgen/rust/src/shader.rs b/bindgen/rust/src/shader.rs new file mode 100644 index 0000000..46db1f3 --- /dev/null +++ b/bindgen/rust/src/shader.rs @@ -0,0 +1,28 @@ +use std::{ffi::c_void, path::Path}; + +use celeritas_sys::ShaderData; + +use crate::ral::{Pipeline, ShaderBinding}; + +pub struct Shader { + pipeline: Pipeline, + binding_layouts: Vec, +} + +#[no_mangle] +pub unsafe extern "C" fn rust_function(data: *mut c_void) -> celeritas_sys::ShaderDataLayout { + todo!() +} + +impl Shader { + pub fn new(name: String, vs_path: &Path, fs_path: &Path) -> Self { + todo!() + } + pub fn add_layout(&mut self) -> &mut Self { + let sd = ShaderData { + get_layout: Some(rust_function), + data: std::ptr::null_mut(), + }; + self + } +} -- cgit v1.2.3-70-g09d2