implement font deletion

This commit is contained in:
2026-03-26 21:01:43 +01:00
parent d2ab60c824
commit bc06a3fee8
5 changed files with 20 additions and 4 deletions
+1 -3
View File
@@ -7,9 +7,7 @@ constexpr const char* pColorYellow = "\033[33m";
constexpr const char* pColorRed = "\033[31m";
static LogLevel pFilter = LogLevel::Info;
PD_API void LogFilter(LogLevel lvl) {
pFilter = lvl;
}
PD_API void LogFilter(LogLevel lvl) { pFilter = lvl; }
PD_API void Log(const std::string& txt, LogLevel lvl) {
if ((int)lvl < (int)pFilter) return;
+10
View File
@@ -271,5 +271,15 @@ PD_API std::string Font::pShortText(const std::string& txt, float scale,
return "";
}
PD_API void Font::Delete() {
for (auto& it : Textures) {
// Creating a tmp fake Li tex for deletion
PD::Gfx::DeleteTexture(PD::Li::Texture(it, 0));
}
pCurrentTex = 0;
PixelHeight = 0;
pTMS.clear();
CodeMap.clear();
}
} // namespace Li
} // namespace PD