Move billboard state into LabelDrawableSettings

This commit is contained in:
Georg Hagen
2025-01-05 23:44:01 +01:00
parent 92b9fb597f
commit 6cfd760034
3 changed files with 13 additions and 15 deletions

View File

@@ -68,8 +68,8 @@ namespace OpenVulkano::Scene
}
}
LabelDrawable::LabelDrawable(const std::shared_ptr<AtlasData>& atlasData, const LabelDrawableSettings& settings, const bool isBillboard)
: Drawable(DrawEncoder::GetDrawEncoder<LabelDrawable>(), DrawPhase::MAIN), m_atlasData(atlasData), m_isBillboard(isBillboard)
LabelDrawable::LabelDrawable(const std::shared_ptr<AtlasData>& atlasData, const LabelDrawableSettings& settings)
: Drawable(DrawEncoder::GetDrawEncoder<LabelDrawable>(), DrawPhase::MAIN), m_atlasData(atlasData)
{
if (atlasData->glyphs.empty() || !atlasData->texture.size)
{
@@ -99,7 +99,7 @@ namespace OpenVulkano::Scene
textDrawable.GetConfig().backgroundColor.a = 0; // do not render glyph's background
double lineHeight = m_atlasData->meta.lineHeight;
textDrawable.GenerateText(text, m_position);
textDrawable.SetShader(GetTextShader(m_atlasData->meta.atlasType, m_isBillboard));
textDrawable.SetShader(GetTextShader(m_atlasData->meta.atlasType, IsBillboard()));
m_bbox.Grow(textDrawable.GetBoundingBox());
// update position for next text entry
m_position.y = m_bbox.GetMin().y - lineHeight;