From d71f3c26c26c22ac6782944f5732274abe64f8f8 Mon Sep 17 00:00:00 2001 From: Riley Beckett Date: Sun, 12 Oct 2025 16:55:23 -0400 Subject: Create atlas for font rendering --- state.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'state.h') 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; -- cgit v1.2.3