26 lines
788 B
C
26 lines
788 B
C
#ifndef TEXTURE_FONT_CACHE_h
|
|
#define TEXTURE_FONT_CACHE_h
|
|
|
|
#include <SDL2/SDL_rect.h>
|
|
#include <SDL2/SDL_render.h>
|
|
|
|
typedef struct {
|
|
unsigned short FontSize;
|
|
SDL_Rect TextSize;
|
|
SDL_Texture* Texture;
|
|
} TextureDetails;
|
|
|
|
typedef struct {
|
|
unsigned int Capacity;
|
|
unsigned int Size;
|
|
TextureDetails** Textures;
|
|
} TextureFontCache;
|
|
|
|
TextureFontCache* CreateTextureFontCache();
|
|
TextureDetails* AddTextureToCache(SDL_Texture* texture, unsigned short fontSize, SDL_Rect textSize, TextureFontCache* cache);
|
|
void UpdateTextureDetails(SDL_Texture* texture, unsigned short fontSize, SDL_Rect textSize, int index, TextureFontCache* cache);
|
|
TextureDetails* GetTextureFromCache(TextureFontCache* cache, unsigned int index);
|
|
void FreeTextureDetails(TextureDetails* details);
|
|
|
|
#endif
|