code refactoring

This commit is contained in:
ohyzha
2024-12-30 12:05:46 +02:00
parent 503e31947f
commit e8289c643b
10 changed files with 111 additions and 110 deletions

View File

@@ -149,6 +149,10 @@ namespace OpenVulkano::Scene
m_cfg = config;
m_uniBuffer.Init(sizeof(TextConfig), &m_cfg, 3);
m_uniBuffer.binding.stageFlags = ShaderProgramType::FRAGMENT;
if (m_atlasData->meta.atlasType == FontAtlasType::BITMAP)
{
m_material.texture->m_samplerConfig = &SamplerConfig::NEAREST;
}
}
TextDrawable::TextDrawable(const std::shared_ptr<AtlasData>& atlasData, const TextConfig& config)
@@ -268,10 +272,6 @@ namespace OpenVulkano::Scene
++i;
}
m_bbox.Init(bmin, bmax);
if (m_atlasData->meta.atlasType == FontAtlasType::BITMAP)
{
m_material.texture->m_samplerConfig = &SamplerConfig::NEAREST;
}
SimpleDrawable::Init(m_shader, &m_geometry, &m_material, &m_uniBuffer);
}