aboutsummaryrefslogtreecommitdiff
path: root/state.h
diff options
context:
space:
mode:
authorRiley Beckett <rbeckettvt@gmail.com>2025-10-12 16:55:23 -0400
committerRiley Beckett <rbeckettvt@gmail.com>2025-10-12 16:55:23 -0400
commitd71f3c26c26c22ac6782944f5732274abe64f8f8 (patch)
tree3ff3c5e0a4df4b7f365004a0c4ecb25d65085eba /state.h
parent91759767b0c7793060f447fd545b639cf91b7ae3 (diff)
Create atlas for font rendering
Diffstat (limited to 'state.h')
-rw-r--r--state.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/state.h b/state.h
index 465e9b6..1929cad 100644
--- a/state.h
+++ b/state.h
@@ -16,6 +16,20 @@
#include "./glad/glad.h"
+#define MAX(a, b) (((a) > (b)) ? (a) : (b))
+
+typedef struct {
+ float advance_x, advance_y;
+ uint32_t bitmap_width, bitmap_height;
+ uint32_t texture_offset;
+} metrics_t;
+
+typedef struct {
+ uint32_t width, height;
+ GLuint texture;
+ metrics_t metrics[128];
+} atlas_t;
+
typedef struct {
// wayland
struct wl_display* display;
@@ -53,6 +67,8 @@ typedef struct {
FT_Library ft_library;
FT_Face ft_face;
+ atlas_t atlas;
+
bool running;
} client_state;