Refactor FontAtlas class

This commit is contained in:
Georg Hagen
2025-01-11 01:25:52 +01:00
parent 6a3c31346f
commit 9cb3d4de85
14 changed files with 246 additions and 247 deletions

View File

@@ -7,10 +7,10 @@
#include "TextExampleApp.hpp"
#include "Scene/Scene.hpp"
#include "Scene/Shader/Shader.hpp"
#include "Scene/Geometry.hpp"
#include "Scene/TextDrawable.hpp"
#include "Scene/Vertex.hpp"
#include "Scene/UI/PerformanceInfo.hpp"
#include "Scene/Text/FontAtlas.hpp"
#include "Input/InputManager.hpp"
#include "Host/GraphicsAppManager.hpp"
#include "Host/GLFW/WindowGLFW.hpp"
@@ -68,15 +68,15 @@ namespace OpenVulkano
std::set<uint32_t> s = BitmapFontAtlasGenerator::LoadAllGlyphs(fontPath);
BitmapFontAtlasGenerator generator;
generator.GenerateAtlas(fontPath, s);
generator.SaveAtlasMetadataInfo("bitmap_atlas");
generator.GetAtlas()->Save("bitmap_atlas_packed.png");
}
#if defined(MSDFGEN_AVAILABLE) && CREATE_NEW_ATLAS
std::set<uint32_t> s = SdfFontAtlasGenerator::LoadAllGlyphs(fontPath);
m_atlasGenerator.GenerateAtlas(fontPath, s);
m_msdfAtlasGenerator.GenerateAtlas(fontPath, s);
m_atlasGenerator.SaveAtlasMetadataInfo("sdf_atlas.png");
m_msdfAtlasGenerator.SaveAtlasMetadataInfo("msdf_atlas");
m_atlasGenerator.GetAtlas()->Save("sdf_atlas_packed.png");
m_msdfAtlasGenerator.GetAtlas()->Save("msdf_atlas_packed.png");
#else
auto sdfMetadataInfo = resourceLoader.GetResource("sdf_atlas_packed.png");
auto msdfMetadataInfo = resourceLoader.GetResource("msdf_atlas_packed.png");