summaryrefslogtreecommitdiff
path: root/ui/gameMainWindow.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2024-07-02 18:20:22 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2024-07-02 18:20:22 +0100
commit9d6d2c0eb21b6295b2668c23f0ef386d5827a83f (patch)
treeec4bedce6f3a695aa75412f30259e0f791f46f82 /ui/gameMainWindow.cpp
parentAdd an InstanceVertices partition perf test (diff)
parentBuild ImGui as a static library (diff)
downloadilt-9d6d2c0eb21b6295b2668c23f0ef386d5827a83f.tar.bz2
ilt-9d6d2c0eb21b6295b2668c23f0ef386d5827a83f.tar.xz
ilt-9d6d2c0eb21b6295b2668c23f0ef386d5827a83f.zip
Psycho-rebased branch imgui on top of main
Diffstat (limited to 'ui/gameMainWindow.cpp')
-rw-r--r--ui/gameMainWindow.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/ui/gameMainWindow.cpp b/ui/gameMainWindow.cpp
index ccbcdba..6168504 100644
--- a/ui/gameMainWindow.cpp
+++ b/ui/gameMainWindow.cpp
@@ -27,14 +27,15 @@ public:
}
};
-GameMainWindow::GameMainWindow(size_t w, size_t h) :
- Window {w, h, "I Like Trains", SDL_WINDOW_OPENGL}, SceneRenderer {Window::size, 0}
+GameMainWindow::GameMainWindow(size_t w, size_t h) : WindowContent {w, h}, SceneRenderer {{w, h}, 0}
{
uiComponents.create<ManualCameraController>(glm::vec2 {310'727'624, 494'018'810});
auto gms = uiComponents.create<GameMainSelector>(&camera, ScreenAbsCoord {w, h});
uiComponents.create<GameMainToolbar>(gms.get());
}
+GameMainWindow::~GameMainWindow() { }
+
void
GameMainWindow::tick(TickDuration)
{
@@ -45,7 +46,10 @@ void
GameMainWindow::render() const
{
SceneRenderer::render(*this);
- Window::render();
+ glEnable(GL_BLEND);
+ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+ glDisable(GL_DEPTH_TEST);
+ uiComponents.apply(&UIComponent::render, uiShader, UIComponent::Position {});
}
void