src/internal.h
1#ifndef INTERNAL_H
2#define INTERNAL_H
3
4#include "alba.h"
5
6#include "hashmap.h"
7
8// Atlas
9typedef struct
10{
11 struct hashmap* glyphs;
12 int dirty;
13 DynArray glyph_sizes; // in w, h order
14 uint32_t width;
15 uint32_t height;
16 uint8_t* image;
17} Atlas;
18
19Atlas atlas_new(uint32_t capacity);
20void atlas_reserve(Atlas* atlas, uint32_t capacity);
21void atlas_append(Atlas* atlas, FT_Face face, uint32_t character);
22void atlas_generate_image(Atlas* atlas);
23void atlas_release(const Atlas* atlas);
24
25// Helpers
26WGPUTexture create_texture(
27 const AlbaWindow* window,
28 const WGPUTextureUsage usage,
29 uint64_t width, uint64_t height,
30 WGPUTextureFormat format, uint8_t samples,
31 const void* data
32);
33
34#endif // INTERNAL_H