summaryrefslogtreecommitdiff
path: root/Runtime/GUI/TextGenerator.h
diff options
context:
space:
mode:
Diffstat (limited to 'Runtime/GUI/TextGenerator.h')
-rw-r--r--Runtime/GUI/TextGenerator.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/Runtime/GUI/TextGenerator.h b/Runtime/GUI/TextGenerator.h
index 8bd9dc8..eacc99c 100644
--- a/Runtime/GUI/TextGenerator.h
+++ b/Runtime/GUI/TextGenerator.h
@@ -1,10 +1,32 @@
#pragma once
#include "Runtime/Utilities/Singleton.h"
+#include <string>
+#include <unordered_map>
+
+//https://learnopengl.com/In-Practice/Text-Rendering
+
+struct Character {
+ unsigned int textureID; // ID handle of the glyph texture
+ Internal::Vector2 size; // Size of glyph
+ Internal::Vector2 bearing; // Offset from baseline to left/top of glyph
+ unsigned int advance; // Offset to advance to next glyph
+};
+
+namespace character
+{
+ typedef wchar_t unicode;
+ typedef unsigned int hash;
+}
class TextGenerator : public Singleton<TextGenerator>
{
public:
+private:
+ std::unordered_map<character::hash, Character> m_Characters;
+
+ character::hash GetCharacterHash(character::unicode unicode, int pixelSize);
+
};