adding stb_truetype

This commit is contained in:
2023-04-07 13:47:22 +02:00
parent bada255057
commit 10ff1acd89
4 changed files with 22638 additions and 5 deletions

View File

@@ -6,7 +6,7 @@
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/04/02 14:49:49 by maldavid #+# #+# */
/* Updated: 2023/04/06 16:38:50 by maldavid ### ########.fr */
/* Updated: 2023/04/06 19:01:12 by maldavid ### ########.fr */
/* */
/* ************************************************************************** */
@@ -22,6 +22,7 @@
#include <platform/window.h>
#include <renderer/renderer.h>
#include <renderer/pixel_put.h>
#include <renderer/text_pipeline.h>
#include <utils/non_copyable.h>
#include <renderer/images/texture.h>

View File

@@ -6,17 +6,20 @@
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/04/06 16:41:13 by maldavid #+# #+# */
/* Updated: 2023/04/06 16:42:10 by maldavid ### ########.fr */
/* Updated: 2023/04/07 00:13:50 by maldavid ### ########.fr */
/* */
/* ************************************************************************** */
#include <renderer/text_pipeline.h>
#define STB_TRUETYPE_IMPLEMENTATION
#include <std_truetype.h>
namespace mlx
{
void TextPutPipeline::init(Renderer& renderer) noexcept
{
}
void TextPutPipeline::put(int x, int y, int color, std::string str)

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/06 16:41:09 by maldavid ### ########.fr */
/* Updated: 2023/04/07 00:11:25 by maldavid ### ########.fr */
/* */
/* ************************************************************************** */
@@ -16,6 +16,8 @@
#include <renderer/renderer.h>
#include <renderer/images/texture.h>
#include <string>
#include <stb_truetype.h>
#include <cstdint>
namespace mlx
{
@@ -31,7 +33,9 @@ namespace mlx
~TextPutPipeline() = default;
private:
uint8_t _ttf_buffer[1 << 20];
stbtt_bakedchar _cdata[96];
Texture _atlas;
};
}