feat ✨ added working text renderer
This commit is contained in:
15
src/game/systems/FontManager.hpp
Normal file
15
src/game/systems/FontManager.hpp
Normal file
@ -0,0 +1,15 @@
|
||||
#pragma once
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
#include "stb_truetype.h"
|
||||
|
||||
class FontManager {
|
||||
public:
|
||||
bool LoadFont(const std::string& id, const std::string& path);
|
||||
stbtt_fontinfo* GetFont(const std::string& id);
|
||||
|
||||
private:
|
||||
std::unordered_map<std::string, std::vector<unsigned char>> fontBuffers;
|
||||
std::unordered_map<std::string, stbtt_fontinfo> fonts;
|
||||
};
|
||||
Reference in New Issue
Block a user