From 574d767d54edbca6d4a01e6ab876a26f7478ff5f Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Fri, 14 Jan 2022 01:46:50 +0000 Subject: Process UI layers in reverse, so it's stack like --- ui/gameMainWindow.cpp | 3 ++- ui/window.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'ui') diff --git a/ui/gameMainWindow.cpp b/ui/gameMainWindow.cpp index 3f9ce8c..b559341 100644 --- a/ui/gameMainWindow.cpp +++ b/ui/gameMainWindow.cpp @@ -75,6 +75,7 @@ public: else { clicked.clear(); } + return true; } } return false; @@ -88,9 +89,9 @@ private: GameMainWindow::GameMainWindow(size_t w, size_t h) : Window {w, h, "I Like Trains"}, camera {{-1250.0F, -1250.0F, 35.0F}, quarter_pi, rdiv(w, h), 0.1F, 10000.0F} { + uiComponents.create(glm::vec2 {-1150, -1150}); uiComponents.create(&camera, glm::vec2 {w, h}); uiComponents.create(); - uiComponents.create(glm::vec2 {-1150, -1150}); shader.setUniform("lightDirection", glm::normalize(glm::vec3 {1, 0, -1})); shader.setUniform("lightColor", {.6, .6, .6}); diff --git a/ui/window.cpp b/ui/window.cpp index 74a3a2f..9ecc88c 100644 --- a/ui/window.cpp +++ b/ui/window.cpp @@ -63,7 +63,7 @@ Window::handleInput(const SDL_Event & e) eAdjusted.button.y = size.y - e.button.y; break; } - uiComponents.applyOne(&UIComponent::handleInput, eAdjusted, UIComponent::Position {{}, size}); + uiComponents.rapplyOne(&UIComponent::handleInput, eAdjusted, UIComponent::Position {{}, size}); return true; } return false; -- cgit v1.2.3