From 4250ef35134b9a090cd14ca85c560b2c966b553e Mon Sep 17 00:00:00 2001 From: Rosyid Haryadi Date: Wed, 26 Feb 2025 13:25:47 +0700 Subject: refactor: files separation --- src/global.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/global.rs (limited to 'src/global.rs') diff --git a/src/global.rs b/src/global.rs new file mode 100644 index 0000000..cb616b1 --- /dev/null +++ b/src/global.rs @@ -0,0 +1,17 @@ +pub const IMG_WIDTH: usize = 256; +pub const IMG_HEIGHT: usize = 256; + +#[derive(Debug, Copy, Clone)] +pub struct Pixel { + pub r: u8, + pub g: u8, + pub b: u8, +} + +impl Default for Pixel { + fn default() -> Self { + Pixel { r:0, g:0, b:0 } + } +} + +pub type DisplayBuffer = [[Pixel; IMG_WIDTH]; IMG_HEIGHT]; -- cgit v1.2.3-70-g09d2