diff --git a/hui-euc/Cargo.toml b/hui-euc/Cargo.toml index 7e6ce8f..6a1496e 100644 --- a/hui-euc/Cargo.toml +++ b/hui-euc/Cargo.toml @@ -5,7 +5,7 @@ edition = "2024" publish = false [dependencies] -euc = { version = "0.5", default-features = false, features = ["libm"] } +euc = { version = "0.5", default-features = false } [features] default = [ "std" ] diff --git a/hui-euc/src/lib.rs b/hui-euc/src/lib.rs index b76e8f4..e354c3b 100644 --- a/hui-euc/src/lib.rs +++ b/hui-euc/src/lib.rs @@ -1,3 +1,34 @@ -#![no_std] +#![cfg_attr(not(feature = "std"), no_std)] -// TODO \ No newline at end of file +// TODO + +use euc::Pipeline; + +struct UiPipeline; + +impl Pipeline for UiPipeline { + type Vertex = [f32; 2]; + type VsOut = (); + type Pixel = [u8; 4]; + + // Vertex shader + fn vert(&self, pos: &Self::Vertex) -> ([f32; 4], Self::VsOut) { + ([pos[0], pos[1], 0.0, 1.0], ()) + } + + // Fragment shader + fn frag(&self, _: &Self::VsOut) -> Self::Pixel { + [0, 0, 0, 255] + } +} + +// fn main() { +// let mut color = Buffer2d::new([640, 480], [0; 4]); +// let mut depth = Buffer2d::new([640, 480], 1.0); + +// Example.draw::<Triangles<_>, _>( +// &[[-1.0, -1.0], [1.0, -1.0], [0.0, 1.0]], +// &mut color, +// &mut depth, +// ); +// }