Updated the list rendering function to just blindly take textures from the cache and relying on a new function to handle generating new textures if needed.
This commit is contained in:
+3
-2
@@ -10,14 +10,15 @@
|
||||
typedef struct {
|
||||
unsigned int Capacity;
|
||||
unsigned int Size;
|
||||
unsigned int MaxStringLength;
|
||||
char** Strings;
|
||||
SDL_Rect MaxTestSize;
|
||||
SDL_FRect BoundingBox;
|
||||
TextureFontCache* TextureCache;
|
||||
} List;
|
||||
|
||||
List* CreateList(SDL_FRect boundingBox);
|
||||
void AddStringToList(char* text, List* list);
|
||||
void RenderList(SDL_Renderer* renderer, SDL_Point motion, TTF_Font* font, unsigned short fontSize, List* list);
|
||||
void RenderList(SDL_Renderer* renderer, SDL_Point motion, List* list);
|
||||
void ListFontSizeHasChanged(SDL_Renderer* renderer, TTF_Font* font, List* list);
|
||||
|
||||
#endif
|
||||
@@ -17,8 +17,8 @@ typedef struct {
|
||||
} 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* AddTextureToCache(SDL_Texture* texture, SDL_Rect textSize, TextureFontCache* cache);
|
||||
void UpdateTextureDetails(SDL_Texture* texture, SDL_Rect textSize, int index, TextureFontCache* cache);
|
||||
TextureDetails* GetTextureFromCache(TextureFontCache* cache, unsigned int index);
|
||||
void FreeTextureDetails(TextureDetails* details);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user