start menu

This commit is contained in:
2023-01-21 12:13:59 +01:00
parent 8a93d29021
commit 1fdcc41801
6 changed files with 78 additions and 20 deletions
+3 -2
View File
@@ -13,14 +13,15 @@ typedef struct FontCacheObject {
TTF_Font* font;
} FontCacheObject_t;
FontCacheObject_t fontCache[FONT_CACHE_SIZE];
unsigned fontCacheSize = 0;
static FontCacheObject_t fontCache[FONT_CACHE_SIZE];
static unsigned fontCacheSize = 0;
void text_freeFontCache(void){
for(unsigned i = 0; i < fontCacheSize; ++i){
free(fontCache[i].file);
TTF_CloseFont(fontCache[i].font);
}
fontCacheSize = 0;
}
int text_renderText(RenderObject_t* renderObject, float x, float y, int z, float scale, SDL_Color color, const char* fontFilename, int fontSize, char* format, ...){