summaryrefslogtreecommitdiff
path: root/ui/editNetwork.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2024-01-26 17:48:11 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2024-01-26 17:48:11 +0000
commit30f58cc3832bd1b5a5cadf4b0a4a9d47d024f9f7 (patch)
tree0e347320e8295f03efb3d12bd85e76f838bf51d3 /ui/editNetwork.cpp
parentAlways set pixel unpack alignment before generating font texture content (diff)
downloadilt-30f58cc3832bd1b5a5cadf4b0a4a9d47d024f9f7.tar.bz2
ilt-30f58cc3832bd1b5a5cadf4b0a4a9d47d024f9f7.tar.xz
ilt-30f58cc3832bd1b5a5cadf4b0a4a9d47d024f9f7.zip
Remove the static font cache
Each thing can own/share a font rendering itself
Diffstat (limited to 'ui/editNetwork.cpp')
-rw-r--r--ui/editNetwork.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/ui/editNetwork.cpp b/ui/editNetwork.cpp
index 7fbde32..ac2d93d 100644
--- a/ui/editNetwork.cpp
+++ b/ui/editNetwork.cpp
@@ -8,6 +8,7 @@
#include <gfx/gl/sceneShader.h>
#include <gfx/models/texture.h>
+const std::filesystem::path fontpath {"/usr/share/fonts/hack/Hack-Regular.ttf"};
constexpr const glm::u8vec4 TRANSPARENT_BLUE {30, 50, 255, 200};
EditNetwork::EditNetwork(Network * n) :
@@ -17,7 +18,7 @@ EditNetwork::EditNetwork(Network * n) :
{"ui/icon/network.png", mode.toggle<BuilderJoin>()},
{"ui/icon/network.png", mode.toggle<BuilderFreeExtend>()},
},
- blue {1, 1, &TRANSPARENT_BLUE}
+ blue {1, 1, &TRANSPARENT_BLUE}, font {fontpath, 15}
{
}
@@ -66,7 +67,7 @@ void
EditNetwork::render(const UIShader & shader, const UIComponent::Position & parentPos) const
{
if (builder) {
- Text {builder->hint(), {{50, 10}, {0, 15}}, {1, 1, 0}}.render(shader, parentPos);
+ Text {builder->hint(), font, {{50, 10}, {0, 15}}, {1, 1, 0}}.render(shader, parentPos);
}
builderToolbar.render(shader, parentPos);
}