diff options
author | Aki <please@ignore.pl> | 2023-02-04 01:04:03 +0100 |
---|---|---|
committer | Aki <please@ignore.pl> | 2023-02-04 01:04:03 +0100 |
commit | fb1d3eda51cd9d89083130cf9932c7bde758756c (patch) | |
tree | 6924eaaf8847cd8046e4ff3b37ee7c86380551e8 /engine/src | |
parent | ff51d69ede2e6e9393e3a9d349ea645ae65c5bb7 (diff) | |
download | kurator-fb1d3eda51cd9d89083130cf9932c7bde758756c.zip kurator-fb1d3eda51cd9d89083130cf9932c7bde758756c.tar.gz kurator-fb1d3eda51cd9d89083130cf9932c7bde758756c.tar.bz2 |
Full grid is now drawn
Diffstat (limited to 'engine/src')
-rw-r--r-- | engine/src/Camera.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/engine/src/Camera.cpp b/engine/src/Camera.cpp index 41cc5ab..4a95ad8 100644 --- a/engine/src/Camera.cpp +++ b/engine/src/Camera.cpp @@ -29,6 +29,27 @@ Camera::to_screen(const Point& world) const Point +Camera::top_left() const +{ + return to_world({0.0, 0.0}); +} + + +Point +Camera::center() const +{ + return to_world(viewport().scale(0.5)); +} + + +Point +Camera::bottom_right() const +{ + return to_world(viewport()); +} + + +Point viewport() { return {static_cast<double>(GetScreenWidth()), static_cast<double>(GetScreenHeight())}; |