aboutsummaryrefslogtreecommitdiff
path: root/src/display/mod.rs
diff options
context:
space:
mode:
authorlamp2024-01-21 13:44:51 +0000
committerlamp2024-01-21 13:44:51 +0000
commitc0fc3926e06acddcc02ef086fbda688d4709e5ba (patch)
treee9f752758a49bedf1936003a7a2cd883e7d8e3cf /src/display/mod.rs
parent78ddaff5855bf8446adef9e18eb0d7b7ddcee52a (diff)
refactor display backends, add pixelflut backend
Diffstat (limited to 'src/display/mod.rs')
-rw-r--r--src/display/mod.rs17
1 files changed, 17 insertions, 0 deletions
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);
+}