summaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2025-03-19 03:42:35 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2025-03-19 03:42:35 +0000
commit271d5c55260cc8a0198938f3259f793e3957e3e3 (patch)
tree9e4ffbb7a47bb7e027aee5b01cb2665532e2b391 /ui
parentRemove lots of stuff not required or superseded with ImGui use (diff)
downloadilt-271d5c55260cc8a0198938f3259f793e3957e3e3.tar.bz2
ilt-271d5c55260cc8a0198938f3259f793e3957e3e3.tar.xz
ilt-271d5c55260cc8a0198938f3259f793e3957e3e3.zip
Remove unrequired UIShader
Diffstat (limited to 'ui')
-rw-r--r--ui/editNetwork.cpp2
-rw-r--r--ui/editNetwork.h2
-rw-r--r--ui/gameMainSelector.cpp6
-rw-r--r--ui/gameMainSelector.h5
-rw-r--r--ui/gameMainWindow.cpp6
-rw-r--r--ui/manualCameraController.cpp2
-rw-r--r--ui/manualCameraController.h3
-rw-r--r--ui/queryTool.cpp2
-rw-r--r--ui/queryTool.h2
-rw-r--r--ui/uiComponent.h3
-rw-r--r--ui/windowContent.cpp2
-rw-r--r--ui/windowContent.h6
12 files changed, 16 insertions, 25 deletions
diff --git a/ui/editNetwork.cpp b/ui/editNetwork.cpp
index ac9aef9..3a28af7 100644
--- a/ui/editNetwork.cpp
+++ b/ui/editNetwork.cpp
@@ -65,7 +65,7 @@ EditNetwork::Builder::setHeightsFor(Network * network, const Link::CCollection &
}
void
-EditNetwork::render(const UIShader &)
+EditNetwork::render()
{
ImGui::Begin("Edit Network");
diff --git a/ui/editNetwork.h b/ui/editNetwork.h
index c25bef2..aa5676a 100644
--- a/ui/editNetwork.h
+++ b/ui/editNetwork.h
@@ -17,7 +17,7 @@ public:
bool move(const SDL_MouseMotionEvent & e, const Ray<GlobalPosition3D> &) override;
bool handleInput(const SDL_Event & e) override;
void render(const SceneShader &, const Frustum &) const override;
- void render(const UIShader & shader) override;
+ void render() override;
using NetworkClickPos = std::variant<GlobalPosition3D, Node::Ptr>;
diff --git a/ui/gameMainSelector.cpp b/ui/gameMainSelector.cpp
index 7878eb4..55d0ae0 100644
--- a/ui/gameMainSelector.cpp
+++ b/ui/gameMainSelector.cpp
@@ -13,10 +13,10 @@ GameMainSelector::GameMainSelector(const Camera * c) : camera {c} { }
constexpr ScreenAbsCoord TargetPos {5, 45};
void
-GameMainSelector::render(const UIShader & shader) const
+GameMainSelector::render() const
{
if (target) {
- target->render(shader);
+ target->render();
}
}
@@ -86,7 +86,7 @@ GameMainSelector::Component::handleInput(const SDL_Event &)
}
void
-GameMainSelector::Component::render(const UIShader &)
+GameMainSelector::Component::render()
{
}
diff --git a/ui/gameMainSelector.h b/ui/gameMainSelector.h
index 9560fc6..e6a86d2 100644
--- a/ui/gameMainSelector.h
+++ b/ui/gameMainSelector.h
@@ -9,7 +9,6 @@
class SceneShader;
template<typename> class Ray;
-class UIShader;
class Camera;
class GameMainSelector : public UIComponent, public WorldOverlay {
@@ -21,13 +20,13 @@ public:
virtual bool click(const SDL_MouseButtonEvent &, const Ray<GlobalPosition3D> &);
virtual bool move(const SDL_MouseMotionEvent &, const Ray<GlobalPosition3D> &);
virtual bool handleInput(const SDL_Event &);
- virtual void render(const UIShader & shader);
+ virtual void render();
virtual void render(const SceneShader &, const Frustum &) const;
};
GameMainSelector(const Camera * c);
- void render(const UIShader & shader) const override;
+ void render() const override;
void render(const SceneShader & shader, const Frustum &) const override;
bool handleInput(const SDL_Event & e) override;
diff --git a/ui/gameMainWindow.cpp b/ui/gameMainWindow.cpp
index 280d1a8..cfc64e3 100644
--- a/ui/gameMainWindow.cpp
+++ b/ui/gameMainWindow.cpp
@@ -25,7 +25,7 @@ public:
explicit GameMainToolbar(GameMainSelector * gms) : gms {gms} { }
void
- render(const UIShader &) const override
+ render() const override
{
if (IltGui::BeginToolbar("bottomBar", ImGuiDir_Down, TOOLBAR_HEIGHT)) {
if (ImGui::ImageButton("Build rails", *buildRailsIcon, TOOLBAR_ICON_SIZE)) {
@@ -49,7 +49,7 @@ private:
GameMainSelector * gms;
};
-GameMainWindow::GameMainWindow(size_t w, size_t h) : WindowContent {w, h}, SceneRenderer {{w, h}, 0}
+GameMainWindow::GameMainWindow(size_t w, size_t h) : SceneRenderer {{w, h}, 0}
{
uiComponents.create<ManualCameraController>(glm::vec2 {310'727'624, 494'018'810});
auto gms = uiComponents.create<GameMainSelector>(&camera);
@@ -90,7 +90,7 @@ GameMainWindow::render() const
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glDisable(GL_DEPTH_TEST);
- uiComponents.apply(&UIComponent::render, uiShader);
+ uiComponents.apply(&UIComponent::render);
}
void
diff --git a/ui/manualCameraController.cpp b/ui/manualCameraController.cpp
index 128701d..557945e 100644
--- a/ui/manualCameraController.cpp
+++ b/ui/manualCameraController.cpp
@@ -72,7 +72,7 @@ ManualCameraController::handleInput(const SDL_Event & e)
}
void
-ManualCameraController::render(const UIShader &) const
+ManualCameraController::render() const
{
}
diff --git a/ui/manualCameraController.h b/ui/manualCameraController.h
index 0cfa38c..d3bf0c4 100644
--- a/ui/manualCameraController.h
+++ b/ui/manualCameraController.h
@@ -6,7 +6,6 @@
#include <glm/glm.hpp>
#include <maths.h>
-class UIShader;
class Camera;
class ManualCameraController : public CameraController, public UIComponent {
@@ -14,7 +13,7 @@ public:
explicit ManualCameraController(GlobalPosition2D f) : focus {f} { }
bool handleInput(const SDL_Event & e) override;
- void render(const UIShader &) const override;
+ void render() const override;
void updateCamera(Camera * camera) const override;
diff --git a/ui/queryTool.cpp b/ui/queryTool.cpp
index e046084..d016afa 100644
--- a/ui/queryTool.cpp
+++ b/ui/queryTool.cpp
@@ -31,7 +31,7 @@ QueryTool::click(const SDL_MouseButtonEvent & event, const Ray<GlobalPosition3D>
}
void
-QueryTool::render(const UIShader &)
+QueryTool::render()
{
ImGui::Begin("Query Tool");
ImGui::TextUnformatted(clicked.c_str());
diff --git a/ui/queryTool.h b/ui/queryTool.h
index cef4b75..4d16960 100644
--- a/ui/queryTool.h
+++ b/ui/queryTool.h
@@ -7,7 +7,7 @@ protected:
using GameMainSelector::Component::render;
bool click(const SDL_MouseButtonEvent &, const Ray<GlobalPosition3D> &) override;
- void render(const UIShader & shader) override;
+ void render() override;
private:
std::string clicked;
diff --git a/ui/uiComponent.h b/ui/uiComponent.h
index 9178c6b..6ee347e 100644
--- a/ui/uiComponent.h
+++ b/ui/uiComponent.h
@@ -3,7 +3,6 @@
#include <glm/glm.hpp>
#include <special_members.h>
-class UIShader;
union SDL_Event;
class UIComponent {
@@ -14,6 +13,6 @@ public:
NO_MOVE(UIComponent);
NO_COPY(UIComponent);
- virtual void render(const UIShader &) const = 0;
+ virtual void render() const = 0;
virtual bool handleInput(const SDL_Event &) = 0;
};
diff --git a/ui/windowContent.cpp b/ui/windowContent.cpp
index f55a8d5..0f6dc04 100644
--- a/ui/windowContent.cpp
+++ b/ui/windowContent.cpp
@@ -1,8 +1,6 @@
#include "windowContent.h"
#include "SDL_events.h"
-WindowContent::WindowContent(size_t width, size_t height) : uiShader {width, height} { }
-
void
WindowContent::tick(TickDuration)
{
diff --git a/ui/windowContent.h b/ui/windowContent.h
index 474445a..d7fcad2 100644
--- a/ui/windowContent.h
+++ b/ui/windowContent.h
@@ -2,16 +2,13 @@
#include "chronology.h"
#include "collection.h"
-#include "gfx/gl/uiShader.h"
#include "special_members.h"
#include "stdTypeDefs.h"
#include "uiComponent.h" // IWYU pragma: keep
-#include <functional>
class WindowContent : public StdTypeDefs<WindowContent> {
public:
- using Factory = std::function<Ptr(size_t width, size_t height)>;
- WindowContent(size_t width, size_t height);
+ WindowContent() = default;
virtual ~WindowContent() = default;
NO_MOVE(WindowContent);
NO_COPY(WindowContent);
@@ -22,5 +19,4 @@ public:
protected:
::Collection<UIComponent> uiComponents;
- UIShader uiShader;
};