small fixes

This commit is contained in:
ohyzha
2024-08-22 13:29:03 +03:00
parent 42e35e6a54
commit f7f4897aff
9 changed files with 35 additions and 18 deletions

View File

@@ -38,6 +38,8 @@ namespace OpenVulkano
using namespace Math;
namespace fs = std::filesystem;
//#define CREATE_NEW_ATLAS 1
class TextExampleAppImpl final : public TextExampleApp
{
public:
@@ -68,12 +70,12 @@ namespace OpenVulkano
m_nodesPool.resize(N * 2);
m_drawablesPool.resize(N * 2);
#ifdef MSDFGEN_AVAILABLE
#if defined(MSDFGEN_AVAILABLE) && defined(CREATE_NEW_ATLAS)
msdf_atlas::Charset charset = SdfFontAtlasGenerator::LoadAllGlyphs(fontPath);
m_atlasGenerator.GenerateAtlas(fontPath, charset);
m_msdfAtlasGenerator.GenerateAtlas(fontPath, charset);
#else
auto sdfMetadataInfo = resourceLoader.GetResource("sdf_atlas_packed");
auto sdfMetadataInfo = resourceLoader.GetResource("sdf_atlas_packed.png");
auto msdfMetadataInfo = resourceLoader.GetResource("msdf_atlas_packed.png");
#endif
@@ -81,7 +83,7 @@ namespace OpenVulkano
{
int textIdx = i % texts.size();
TextDrawable* t = nullptr;
#ifdef MSDFGEN_AVAILABLE
#if defined(MSDFGEN_AVAILABLE) && defined(CREATE_NEW_ATLAS)
if (i < texts.size())
{
t = new TextDrawable(&m_atlasGenerator, texts[textIdx].second);