summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2025-04-08 02:14:41 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2025-04-08 02:14:41 +0100
commit0255a421906b9b3a77d9b51eb7d0126f16a9f0db (patch)
tree0bb5f7e2824603a4c8ad4f5f8c854d0394250674
parentUpdate the SceneShader's view port on sceneRenderer resize (diff)
downloadilt-0255a421906b9b3a77d9b51eb7d0126f16a9f0db.tar.bz2
ilt-0255a421906b9b3a77d9b51eb7d0126f16a9f0db.tar.xz
ilt-0255a421906b9b3a77d9b51eb7d0126f16a9f0db.zip
Create WindowContent with a size object
Not individual width/height parameters.
-rw-r--r--ui/gameMainWindow.cpp2
-rw-r--r--ui/gameMainWindow.h2
-rw-r--r--ui/window.h2
3 files changed, 3 insertions, 3 deletions
diff --git a/ui/gameMainWindow.cpp b/ui/gameMainWindow.cpp
index afb7a2e..e87009f 100644
--- a/ui/gameMainWindow.cpp
+++ b/ui/gameMainWindow.cpp
@@ -50,7 +50,7 @@ private:
GameMainSelector * gms;
};
-GameMainWindow::GameMainWindow(size_t w, size_t h) : SceneRenderer {{w, h}, 0}
+GameMainWindow::GameMainWindow(ScreenAbsCoord size) : SceneRenderer {size, 0}
{
uiComponents.create<ManualCameraController>(glm::vec2 {310'727'624, 494'018'810});
auto gms = uiComponents.create<GameMainSelector>(&camera);
diff --git a/ui/gameMainWindow.h b/ui/gameMainWindow.h
index 14e099c..41163d0 100644
--- a/ui/gameMainWindow.h
+++ b/ui/gameMainWindow.h
@@ -7,7 +7,7 @@
class GameMainWindow : public WindowContent, SceneRenderer, public SceneProvider {
public:
- GameMainWindow(size_t w, size_t h);
+ GameMainWindow(ScreenAbsCoord size);
~GameMainWindow() override;
NO_MOVE(GameMainWindow);
diff --git a/ui/window.h b/ui/window.h
index 0316a1f..1c3d09c 100644
--- a/ui/window.h
+++ b/ui/window.h
@@ -27,7 +27,7 @@ public:
{
glm::ivec2 size {};
SDL_GetWindowSizeInPixels(m_window, &size.x, &size.y);
- content = std::make_unique<C>(size.x, size.y, std::forward<P>(p)...);
+ content = std::make_unique<C>(ScreenAbsCoord {size.x, size.y}, std::forward<P>(p)...);
}
void tick(TickDuration elapsed);