adding texture atlas class

This commit is contained in:
2023-04-07 17:27:23 +02:00
parent 10ff1acd89
commit 77e8672754
9 changed files with 5230 additions and 22643 deletions

View File

@@ -6,7 +6,7 @@
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/04/06 16:24:11 by maldavid #+# #+# */
/* Updated: 2023/04/07 00:11:25 by maldavid ### ########.fr */
/* Updated: 2023/04/07 17:11:08 by maldavid ### ########.fr */
/* */
/* ************************************************************************** */
@@ -14,7 +14,7 @@
#define __MLX_TEXT_PIPELINE__
#include <renderer/renderer.h>
#include <renderer/images/texture.h>
#include <renderer/images/texture_atlas.h>
#include <string>
#include <stb_truetype.h>
#include <cstdint>
@@ -26,16 +26,16 @@ namespace mlx
public:
TextPutPipeline() = default;
void init(Renderer& renderer) noexcept;
void init(Renderer* renderer) noexcept;
void put(int x, int y, int color, std::string str);
void destroy() noexcept;
~TextPutPipeline() = default;
private:
uint8_t _ttf_buffer[1 << 20];
stbtt_bakedchar _cdata[96];
Texture _atlas;
TextureAtlas _atlas;
Renderer* _renderer = nullptr;
};
}