aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/api/Camera.h
diff options
context:
space:
mode:
authorheavydemon21 <nielsstunnebrink1@gmail.com>2024-11-18 20:12:31 +0100
committerheavydemon21 <nielsstunnebrink1@gmail.com>2024-11-18 20:12:31 +0100
commit88f613cbb2e4aaf3ed55ac0c6490706dd6f6f19d (patch)
tree8db09f0a0f27dc552356a6c5513589245e9ff7b7 /src/crepe/api/Camera.h
parent9288e4964526f1ce6b7d0aca0f075a04f56ede32 (diff)
rendering based on world unites instead of pixels
Diffstat (limited to 'src/crepe/api/Camera.h')
-rw-r--r--src/crepe/api/Camera.h39
1 files changed, 16 insertions, 23 deletions
diff --git a/src/crepe/api/Camera.h b/src/crepe/api/Camera.h
index 73d4ef4..dfccd24 100644
--- a/src/crepe/api/Camera.h
+++ b/src/crepe/api/Camera.h
@@ -28,32 +28,25 @@ public:
//! Background color of the camera view.
Color bg_color;
- Vector2 pos = {0,0};
-
- Vector2 screen = {640,480};
-
- Vector2 viewport = {500,500};
-
- /*
- //! screen width in pixel coordinates
- double screen_w = 480;
-
- //! screen height in pixel coordinates
- double screen_h = 640;
-
- //! screen widht in world units
- double viewport_w = 500.0f;
-
- //! screen height in world units
- double viewport_h = 500.0f;
+ /**
+ * \pos The position of the camera in world units
+ */
+ Vector2 pos = {0, 0};
- //! X-coordinate of the camera position. in world space
- double x = 0.0;
+ /**
+ * \screen the display size in pixels ( output resolution )
+ */
+ Vector2 screen = {640, 480};
- //! Y-coordinate of the camera position. in world space
- double y = 0.0;
+ /**
+ * \viewport is the area of the world visible through the camera (in world units)
+ */
+ Vector2 viewport = {500, 500};
- */
+ /**
+ * \scale scaling factor from world units to pixel coordinates
+ */
+ Vector2 scale = {0,0};
//! Zoom level of the camera view.
double zoom = 1.0f;