mirror of
https://github.com/griffi-gh/hUI.git
synced 2025-04-10 01:46:28 -05:00
wip hui-euc
This commit is contained in:
parent
a84697422e
commit
1049ec1268
hui-euc
|
@ -5,7 +5,7 @@ edition = "2024"
|
||||||
publish = false
|
publish = false
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
euc = { version = "0.5", default-features = false, features = ["libm"] }
|
euc = { version = "0.5", default-features = false }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = [ "std" ]
|
default = [ "std" ]
|
||||||
|
|
|
@ -1,3 +1,34 @@
|
||||||
#![no_std]
|
#![cfg_attr(not(feature = "std"), no_std)]
|
||||||
|
|
||||||
// TODO
|
// 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,
|
||||||
|
// );
|
||||||
|
// }
|
||||||
|
|
Loading…
Reference in a new issue