Remove old LoadFont function.
This commit is contained in:
@@ -23,31 +23,6 @@ namespace JGL::Detail
|
||||
|
||||
std::vector<Font> fonts;
|
||||
|
||||
// TODO: Deprecating this in favor of class model of resource management.
|
||||
int LoadFont(const std::string &font_path) {
|
||||
if (ft == nullptr)
|
||||
return -1;
|
||||
|
||||
Font font;
|
||||
|
||||
if (FT_New_Face(ft, font_path.c_str(), 0, &font.face)) {
|
||||
std::cout << "Error::FREETYPE: Failed to load font!" << std::endl;
|
||||
return -1;
|
||||
}
|
||||
unsigned int newIndex = 0;
|
||||
for (const auto& f : fonts)
|
||||
if (f.index >= newIndex)
|
||||
newIndex = f.index + 1;
|
||||
|
||||
|
||||
font.index = newIndex;
|
||||
|
||||
fonts.push_back(font);
|
||||
|
||||
std::cout << "Loaded font from " << font_path << " with index " << newIndex << std::endl;
|
||||
return newIndex;
|
||||
}
|
||||
|
||||
bool InitTextEngine() {
|
||||
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, 1); // NOTE: This MUST be called for text rendering to work properly!!!
|
||||
|
Reference in New Issue
Block a user