add syntax highlighting (WIP)

This commit is contained in:
MihailRis 2024-12-04 22:13:17 +03:00
parent ce1e9f76cf
commit ed3865964b
16 changed files with 168 additions and 43 deletions

View file

@ -12,7 +12,6 @@ class Batch3D;
class Camera;
struct FontStyle {
size_t n = -1;
bool bold = false;
bool italic = false;
glm::vec4 color {1, 1, 1, 1};
@ -20,6 +19,7 @@ struct FontStyle {
struct FontStylesScheme {
std::vector<FontStyle> palette;
std::vector<ubyte> map;
};
class Font {
@ -57,6 +57,7 @@ public:
int x,
int y,
const FontStylesScheme* styles,
size_t styleMapOffset,
float scale = 1
) const;
@ -64,6 +65,7 @@ public:
Batch3D& batch,
std::wstring_view text,
const FontStylesScheme* styles,
size_t styleMapOffset,
const glm::vec3& pos,
const glm::vec3& right={1, 0, 0},
const glm::vec3& up={0, 1, 0}