using the same glyph textures for the same fonts

This commit is contained in:
devZoGok
2025-07-19 11:59:10 +03:00
parent 0e76154324
commit 44a221d24b
3 changed files with 39 additions and 30 deletions
+4 -4
View File
@@ -4,13 +4,13 @@
#include <string>
#include <vector>
#include "fontAsset.h"
#include "attachable.h"
#include "vector.h"
#include "util.h"
namespace vb01{
class Node;
class Texture;
class Shader;
class Material;
@@ -18,7 +18,7 @@ namespace vb01{
public:
struct Glyph{
u16 ch;
Texture *texture = nullptr;
int texId;
u32 advance;
Vector2 size, bearing;
};
@@ -41,9 +41,9 @@ namespace vb01{
private:
void applyFont(std::string, u16, u16 = 256);
void clearFont();
void prepareGlyphs(Glyph, Vector2);
void renderGlyphs(Glyph, float[], u32);
void prepareGlyphs(Glyph, int, Vector2);
FontAsset *font = nullptr;
Material *material = nullptr;
std::wstring entry;
std::vector<Glyph> characters;