summaryrefslogtreecommitdiff
path: root/Runtime/GUI/TextGenerator.h
blob: eacc99cb391836edcbc3f0ebbc1a24457e8ee4bf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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);

};