This commit is contained in:
2024-04-21 18:10:36 +02:00
parent 6bbf1e196d
commit 215a0dc2c3
28 changed files with 558 additions and 375 deletions

View File

@@ -1,21 +1,21 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* font_library.h :+: :+: :+: */
/* FontLibrary.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/01/18 09:26:03 by maldavid #+# #+# */
/* Updated: 2024/03/25 19:08:18 by maldavid ### ########.fr */
/* Updated: 2024/03/28 22:21:53 by maldavid ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef __MLX_FONT_LIBRARY__
#define __MLX_FONT_LIBRARY__
#include <renderer/texts/font.h>
#include <renderer/core/render_core.h>
#include <utils/singleton.h>
#include <Renderer/Texts/Font.h>
#include <Renderer/Core/RenderCore.h>
#include <Utils/Singleton.h>
namespace mlx
{
@@ -27,20 +27,20 @@ namespace mlx
friend class Singleton<FontLibrary>;
public:
std::shared_ptr<class Font> getFontData(FontID id);
FontID addFontToLibrary(std::shared_ptr<Font> font);
void removeFontFromLibrary(FontID id);
std::shared_ptr<class Font> GetFontData(FontID id);
FontID AddFontToLibrary(std::shared_ptr<Font> font);
void RemoveFontFromLibrary(FontID id);
void clearLibrary();
void ClearLibrary();
private:
FontLibrary() = default;
~FontLibrary() = default;
private:
std::unordered_map<FontID, std::shared_ptr<class Font>> _cache;
std::vector<FontID> _invalid_ids;
FontID _current_id = 1;
std::unordered_map<FontID, std::shared_ptr<class Font>> m_cache;
std::vector<FontID> m_invalid_ids;
FontID m_current_id = 1;
};
}