diff options
Diffstat (limited to 'ui/gameMainWindow.cpp')
-rw-r--r-- | ui/gameMainWindow.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/ui/gameMainWindow.cpp b/ui/gameMainWindow.cpp index ccbcdba..c53300b 100644 --- a/ui/gameMainWindow.cpp +++ b/ui/gameMainWindow.cpp @@ -1,16 +1,17 @@ #include "gameMainWindow.h" #include "editNetwork.h" #include "gameMainSelector.h" -#include "gfx/camera_controller.h" #include "manualCameraController.h" #include "modeHelper.h" #include "toolbar.h" #include "window.h" #include <SDL2/SDL.h> #include <collection.h> +#include <game/environment.h> #include <game/gamestate.h> #include <game/network/rail.h> #include <game/worldobject.h> // IWYU pragma: keep +#include <gfx/camera_controller.h> #include <gfx/renderable.h> #include <glad/gl.h> #include <glm/glm.hpp> @@ -27,14 +28,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 +47,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 @@ -61,10 +66,9 @@ GameMainWindow::content(const SceneShader & shader) const } void -GameMainWindow::environment(const SceneShader & s, const SceneRenderer & r) const +GameMainWindow::environment(const SceneShader &, const SceneRenderer & r) const { - // default for now - SceneProvider::environment(s, r); + gameState->environment->render(r, *this); } void |