mirror of
https://github.com/seekrs/MacroLibX.git
synced 2026-01-11 22:53:34 +00:00
begenning the refactor
This commit is contained in:
48
runtime/Includes/Renderer/Texts/TextLibrary.h
git.filemode.normal_file
48
runtime/Includes/Renderer/Texts/TextLibrary.h
git.filemode.normal_file
@@ -0,0 +1,48 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* text_library.h :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2023/04/10 11:52:30 by maldavid #+# #+# */
|
||||
/* Updated: 2024/03/25 19:08:03 by maldavid ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifndef __MLX_TEXT_LIBRARY__
|
||||
#define __MLX_TEXT_LIBRARY__
|
||||
|
||||
#include <renderer/buffers/vk_vbo.h>
|
||||
#include <renderer/buffers/vk_ibo.h>
|
||||
#include <renderer/texts/font.h>
|
||||
#include <renderer/core/render_core.h>
|
||||
#include <utils/singleton.h>
|
||||
|
||||
namespace mlx
|
||||
{
|
||||
using TextID = std::uint32_t;
|
||||
constexpr TextID nulltext = 0;
|
||||
|
||||
class TextLibrary : public Singleton<TextLibrary>
|
||||
{
|
||||
friend class Singleton<TextLibrary>;
|
||||
|
||||
public:
|
||||
std::shared_ptr<class Text> getTextData(TextID id);
|
||||
TextID addTextToLibrary(std::shared_ptr<Text> text);
|
||||
void removeTextFromLibrary(TextID id);
|
||||
|
||||
void clearLibrary();
|
||||
|
||||
private:
|
||||
TextLibrary() = default;
|
||||
~TextLibrary() = default;
|
||||
|
||||
private:
|
||||
std::unordered_map<TextID, std::shared_ptr<class Text>> _cache;
|
||||
TextID _current_id = 1;
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user