servicepoint-binding-ruby/examples/moving_line/src/main.rs

18 lines
593 B
Rust
Raw Normal View History

2024-05-10 01:00:30 +02:00
use servicepoint2::{Connection, Origin, PIXEL_HEIGHT, PIXEL_WIDTH, PixelGrid, Size, TILE_WIDTH, Window};
use servicepoint2::Command::BitmapLinearWin;
fn main() {
let connection = Connection::open("localhost:2342").unwrap();
for x_offset in 0..usize::MAX {
2024-05-10 01:35:24 +02:00
let mut pixels = PixelGrid::max_sized();
2024-05-10 01:00:30 +02:00
for y in 0..PIXEL_HEIGHT as usize {
pixels.set((y + x_offset) % PIXEL_WIDTH as usize, y, true);
}
let window = Window(Origin(0, 0), Size(TILE_WIDTH, PIXEL_HEIGHT));
connection.send(BitmapLinearWin(window, pixels)).unwrap();
}
}