Added a basic font cache and got some basic text scaling on the go.

This commit is contained in:
2022-10-30 13:53:46 -05:00
parent 897186928e
commit 6b5b45322f
3 changed files with 98 additions and 7 deletions
+17
View File
@@ -0,0 +1,17 @@
#ifndef FONTCACHE_H
#define FONTCACHE_H
#include <SDL2/SDL_ttf.h>
typedef struct {
unsigned int Capcity;
unsigned int Size;
char* FontFilePath;
TTF_Font** Fonts;
} FontCache;
FontCache* CreateFontCache(char* fontFilePath);
TTF_Font* GetFont(unsigned short fontSize, FontCache* cache);
void FreeFontCache(FontCache* cache);
#endif