aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/api/Camera.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/crepe/api/Camera.h')
-rw-r--r--src/crepe/api/Camera.h19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/crepe/api/Camera.h b/src/crepe/api/Camera.h
index e466d36..f626379 100644
--- a/src/crepe/api/Camera.h
+++ b/src/crepe/api/Camera.h
@@ -17,16 +17,10 @@ class Camera : public Component {
public:
struct Data {
//! Background color of the camera view.
- const Color bg_color;
-
- //! screen the display size in pixels ( output resolution )
- const ivec2 screen;
-
- //! viewport is the area of the world visible through the camera (in world units)
- const vec2 viewport_size;
+ const Color bg_color = Color::WHITE;
//! Zoom level of the camera view.
- double zoom;
+ double zoom = 1;
//! offset postion from the game object transform component
vec2 offset;
@@ -38,12 +32,19 @@ public:
* \param id Unique identifier for the camera component.
* \param ctx the camera component data
*/
- Camera(game_object_id_t id, const Data & ctx);
+ Camera(game_object_id_t id, const ivec2 & screen, const vec2 & viewport_size,
+ const Data & ctx);
~Camera(); // dbg_trace only
public:
Camera::Data data;
+ //! screen the display size in pixels ( output resolution )
+ const ivec2 screen;
+
+ //! viewport is the area of the world visible through the camera (in world units)
+ const vec2 viewport_size;
+
public:
/**
* \brief Gets the maximum number of camera instances allowed.