adding multiple font support

This commit is contained in:
Kbz-8
2023-12-14 19:13:41 +01:00
parent c013237219
commit d08a97f55c
20 changed files with 131 additions and 86 deletions

View File

@@ -47,14 +47,7 @@ namespace mlx
void GraphicsSupport::texturePut(Texture* texture, int x, int y)
{
_textures_to_render.emplace_back(texture, x, y);
std::size_t hash = std::hash<TextureRenderData>{}(_textures_to_render.back());
_textures_to_render.back().hash = hash;
auto it = std::find_if(_textures_to_render.begin(), _textures_to_render.end() - 1, [=](const TextureRenderData& rhs)
{
return rhs.hash == hash;
});
auto it = std::find(_textures_to_render.begin(), _textures_to_render.end() - 1, _textures_to_render.back());
if(it != _textures_to_render.end() - 1)
_textures_to_render.erase(it);
}