diff options
Diffstat (limited to 'engine-ocean/Graphics/font.h')
-rw-r--r-- | engine-ocean/Graphics/font.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/engine-ocean/Graphics/font.h b/engine-ocean/Graphics/font.h new file mode 100644 index 0000000..ea42a29 --- /dev/null +++ b/engine-ocean/Graphics/font.h @@ -0,0 +1,29 @@ +#pragma once + +// Credit to https://learnopengl.com/In-Practice/Text-Rendering + +#include "ft2build.h" +#include "freetype/freetype.h" +#include <GL/glew.h> +#include "glm/glm.hpp" +#include <map> +#include <string> + +struct Character { + GLuint textureID; + glm::ivec2 size; + glm::ivec2 bearing; + unsigned int advance; +}; + +class Font { +public: + Font(const std::string filepath); + ~Font(); + + Character& getCharacter(char c); + +private: + void createGlyphTexture(unsigned char c, FT_Face &face); + std::map<char, Character> m_characters; +};
\ No newline at end of file |