From 3167ec992f1f81b2252a2db3642fff943c4f14bf Mon Sep 17 00:00:00 2001 From: Sakarias Johansson Date: Fri, 13 Jan 2023 19:09:10 +0100 Subject: =?UTF-8?q?=E2=9C=A8=20Add=20realtime=20preview?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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. --- racer-tracer/src/error.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'racer-tracer/src/error.rs') 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 for i32 { @@ -21,6 +24,7 @@ impl From for i32 { } => exit_code, TracerError::FailedToCreateWindow(_) => 2, TracerError::FailedToUpdateWindow(_) => 3, + TracerError::ResolutionIsNotPowerOfTwo() => 4, } } } -- cgit v1.2.3