Correctly free atlas
Francesco Pasa 10 months ago
Francesco Pasa 10 months ago
src/internal.h M +8
3
4 #include "alba.h"
5
6+#include <pthread.h>
7+
8 #include "hashmap.h"
9
10 #define NO_TEXTURE {-1, -1}
86 uint32_t* indices
87 );
88
89+// Globals
90+static FT_Library freetype = NULL;
91+static FT_Face roboto = NULL;
92+static AlbaAtlas atlas;
93+static pthread_mutex_t freetype_mutex = PTHREAD_MUTEX_INITIALIZER;
94+
95 #endif // INTERNAL_H
src/text.c M +1 -8
1 #include "alba.h"
2 #include "internal.h"
3
4-#include <pthread.h>
5-
6 #include "freetype/ftglyph.h"
7
8 extern char _binary_Roboto_Regular_ttf_start[];
9 extern char _binary_Roboto_Regular_ttf_end[];
10
11-static FT_Library freetype = NULL;
12-static FT_Face roboto = NULL;
13-AlbaAtlas atlas;
14-pthread_mutex_t freetype_mutex = PTHREAD_MUTEX_INITIALIZER;
15-
16 void initialize_freetype()
17 {
18 // already initialized
57 void atlas_generate_text_geometry(
58 const AlbaAtlas* atlas,
59 const AlbaVector pos, const AlbaColor color,
60- uint64_t length, const char* text,
61+ const uint64_t length, const char* text,
62 AlbaDynArray* vertices, AlbaDynArray* attributes, AlbaDynArray* indices
63 )
64 {
src/window.c M +4 -1