diff --git a/src/io.rs b/src/io.rs index d62dc47..8b69481 100644 --- a/src/io.rs +++ b/src/io.rs @@ -19,7 +19,7 @@ impl WindowBuilder { ..Default::default() } } - pub fn build(self) -> Result { + pub fn build(&self) -> Result { Ok(Window::new( self.name.unwrap_or_default(), self.width, @@ -47,17 +47,22 @@ impl Default for WindowBuilder { } } +#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct FrameBufferFormat { pub fg: u32, - pub bg: u32 + pub bg: u32, } impl Default for FrameBufferFormat { fn default() -> Self { - FrameBufferFormat { fg: 0x0011a434, bg: 0x001E2431 } + FrameBufferFormat { + fg: 0x0011a434, + bg: 0x001E2431, + } } } +#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct FrameBuffer { buffer: Vec, width: usize, @@ -93,6 +98,12 @@ impl FrameBuffer { } } +impl Default for FrameBuffer { + fn default() -> Self { + Self::new(64, 32) + } +} + pub fn identify_key(key: Key) -> usize { match key { Key::Key1 => 0x1,