summaryrefslogtreecommitdiff
path: root/racer-tracer/src/error.rs
diff options
context:
space:
mode:
authorSakarias Johansson <sakarias.johansson@goodbyekansas.com>2023-01-13 19:09:10 +0100
committerSakarias Johansson <sakarias.johansson@goodbyekansas.com>2023-01-13 19:09:10 +0100
commit3167ec992f1f81b2252a2db3642fff943c4f14bf (patch)
tree8761e4f6eb0866ee41824289a59a4d22945d37fc /racer-tracer/src/error.rs
parent9d44f7ab04e6f6979e0eebc24f8fb439a23a3865 (diff)
downloadracer-tracer-3167ec992f1f81b2252a2db3642fff943c4f14bf.tar.gz
racer-tracer-3167ec992f1f81b2252a2db3642fff943c4f14bf.tar.xz
racer-tracer-3167ec992f1f81b2252a2db3642fff943c4f14bf.zip
✨ Add realtime preview
- Preview quality is crude but works good enough. - Add scaling to render function. This helps to make the preview faster because we can use the same result for several pixels. - You can move around the camera a bit with wasd, super basic. - Press R to start/stop rendering the scene.
Diffstat (limited to 'racer-tracer/src/error.rs')
-rw-r--r--racer-tracer/src/error.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/racer-tracer/src/error.rs b/racer-tracer/src/error.rs
index ac78c91..9254715 100644
--- a/racer-tracer/src/error.rs
+++ b/racer-tracer/src/error.rs
@@ -10,6 +10,9 @@ pub enum TracerError {
#[error("Failed to update window: {0}")]
FailedToUpdateWindow(String),
+
+ #[error("Resolution is not power of two.")]
+ ResolutionIsNotPowerOfTwo(),
}
impl From<TracerError> for i32 {
@@ -21,6 +24,7 @@ impl From<TracerError> for i32 {
} => exit_code,
TracerError::FailedToCreateWindow(_) => 2,
TracerError::FailedToUpdateWindow(_) => 3,
+ TracerError::ResolutionIsNotPowerOfTwo() => 4,
}
}
}