a bunch of minor changes combined:

- From instead of Into
- unsafe_data_ref for other payloads
- CByteSlice for returning memory spans
- send Packet instead of Into<Packet>
- expose packet layer to C/C#
This commit is contained in:
Vinzenz Schroeter 2024-05-15 20:34:51 +02:00
parent 5803b71f3a
commit 1dad113ca1
33 changed files with 462 additions and 733 deletions

View file

@ -30,13 +30,13 @@ fn main() {
let mut filled_grid = PixelGrid::max_sized();
filled_grid.fill(true);
connection
.send(BitmapLinearWin(Origin::top_left(), filled_grid))
.send(BitmapLinearWin(Origin::top_left(), filled_grid).into())
.unwrap();
}
// set all pixels to the same random brightness
let mut rng = rand::thread_rng();
connection.send(Brightness(rng.gen())).unwrap();
connection.send(Brightness(rng.gen()).into()).unwrap();
// continuously update random windows to new random brightness
loop {
@ -56,7 +56,7 @@ fn main() {
}
}
connection.send(CharBrightness(origin, luma)).unwrap();
connection.send(CharBrightness(origin, luma).into()).unwrap();
std::thread::sleep(wait_duration);
}
}