mirror of
https://github.com/seekrs/MacroLibX.git
synced 2026-01-11 22:53:34 +00:00
yes
This commit is contained in:
@@ -50,17 +50,17 @@ namespace mlx
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
m_atlas.Init(vulkan_bitmap, RANGE, RANGE, VK_FORMAT_R8G8B8A8_SRGB, false, m_name + "_font_atlas");
|
||||
m_atlas.Init(vulkan_bitmap, RANGE, RANGE, VK_FORMAT_R8G8B8A8_SRGB, false, m_name + "_font_atlas_" + std::to_string(m_scale));
|
||||
#else
|
||||
m_atlas.Init(vulkan_bitmap, RANGE, RANGE, VK_FORMAT_R8G8B8A8_SRGB, false, {});
|
||||
#endif
|
||||
|
||||
DebugLog("Font: loaded %", m_name);
|
||||
DebugLog("Font: loaded % with a scale of %", m_name, m_scale);
|
||||
}
|
||||
|
||||
void Font::Destroy()
|
||||
{
|
||||
m_atlas.Destroy();
|
||||
DebugLog("Font: unloaded %", m_name);
|
||||
DebugLog("Font: unloaded % with a scale of %", m_name, m_scale);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,13 +19,14 @@ namespace mlx
|
||||
float stb_x = 0.0f;
|
||||
float stb_y = 0.0f;
|
||||
|
||||
auto char_data = font->GetCharData();
|
||||
for(char c : text)
|
||||
{
|
||||
if(c < 32)
|
||||
continue;
|
||||
|
||||
stbtt_aligned_quad q;
|
||||
stbtt_GetPackedQuad(font->GetCharData().data(), RANGE, RANGE, c - 32, &stb_x, &stb_y, &q, 1);
|
||||
stbtt_GetPackedQuad(char_data.data(), RANGE, RANGE, c - 32, &stb_x, &stb_y, &q, 1);
|
||||
|
||||
std::size_t index = vertex_data.size();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user