From c71f9262045cdf39bb317dc24542b6b09eb669ee Mon Sep 17 00:00:00 2001 From: travisthomp Date: Mon, 21 Oct 2024 00:12:25 -0400 Subject: [PATCH] add access to buffered data --- src/mode/graphics.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/mode/graphics.rs b/src/mode/graphics.rs index 5669321..e7b9d3b 100644 --- a/src/mode/graphics.rs +++ b/src/mode/graphics.rs @@ -44,6 +44,15 @@ where max_y: u16::MIN, } } + + pub fn buffer(&self) -> &D::Buffer { + &self.buffer + } + + /// Get a mutable reference to the current buffer + pub fn buffer_mut(&mut self) -> &mut D::Buffer { + &mut self.buffer + } } impl DisplayConfiguration for Gc9a01> @@ -239,6 +248,15 @@ where *color = value; } } + + pub fn buffer(&self) -> &D::Buffer { + self.mode.buffer() + } + + /// Get a mutable reference to the current buffer + pub fn buffer_mut(&mut self) -> &mut D::Buffer { + self.mode.buffer_mut() + } } #[cfg(feature = "graphics")]