From c0fc3926e06acddcc02ef086fbda688d4709e5ba Mon Sep 17 00:00:00 2001 From: lamp Date: Sun, 21 Jan 2024 13:44:51 +0000 Subject: refactor display backends, add pixelflut backend --- src/display/mod.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/display/mod.rs (limited to 'src/display/mod.rs') diff --git a/src/display/mod.rs b/src/display/mod.rs new file mode 100644 index 0000000..0a18e48 --- /dev/null +++ b/src/display/mod.rs @@ -0,0 +1,17 @@ +mod image; +pub use image::Image; +mod pixelflut; +pub use pixelflut::Pixelflut; + +mod pixel; +use pixel::Pixel; + +use std::io::Write; + +use crate::vec3::Color; + +pub trait Display { + fn add_sample(&mut self, x: usize, y: usize, color: Color); + fn maybe_write(&self, output: &mut impl Write); + fn maybe_update(&mut self); +} -- cgit v1.2.3