summaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorandromeda <andromeda@lenovo>2026-01-17 10:55:18 +0100
committerandromeda <andromeda@lenovo>2026-01-17 10:55:18 +0100
commitc42ea43099e56040b6e9908ec8e76ff492362c93 (patch)
treeb374f79c643a71ff2849a0ba9fe2d0c8f9145ec8 /src/main.rs
parente901adf934fe3e48702924f7798496eb1f74971e (diff)
add zeno
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs
index 3b6518e..fb5f90d 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -9,6 +9,8 @@ use std::ffi::CString;
use vte::{Params, Parser, Perform};
+use zeno::{Join, Mask, Stroke};
+
// window stuff
const WIDTH: usize = 640;
const HEIGHT: usize = 360;
@@ -79,9 +81,21 @@ fn main() {
let mut buf = [0u8; 2048];
while window.is_open() && !window.is_key_down(Key::Escape) {
+
+ let mask = Mask::new("M 8,56 32,8 56,56 Z")
+ .size(WIDTH.try_into().unwrap(), HEIGHT.try_into().unwrap())
+ .style(Stroke::new(8.0).join(Join::Round))
+ .render()
+ .0;
+
// windowing stuff
- for i in buffer.iter_mut() {
- *i = 0;
+ for (p, a) in buffer.iter_mut().zip(mask.iter()) {
+ let a0 = *a as u32;
+ *p = a0 << 24 | 0x00FF0000;
+ *p =
+ if a0 > 0
+ { a0 << 16 | a0 << 8 | a0 }
+ else { 0x00000000 };
}
let keys = window.get_keys_pressed(KeyRepeat::No);
window.update_with_buffer(&buffer, WIDTH, HEIGHT).unwrap();