diff options
| author | raysan5 <[email protected]> | 2020-11-28 19:07:41 +0100 |
|---|---|---|
| committer | raysan5 <[email protected]> | 2020-11-28 19:07:41 +0100 |
| commit | 14c1ee268107b2de727c2820e56a333b85ebc500 (patch) | |
| tree | 60e391bc45c6ad69e0a9e177d1a21aca5c5d8667 /src/text.c | |
| parent | 28213c2a206a2d5c05add21d2a74545cd9f1634a (diff) | |
| download | raylib-14c1ee268107b2de727c2820e56a333b85ebc500.tar.gz raylib-14c1ee268107b2de727c2820e56a333b85ebc500.zip | |
ADDED: UnloadFontData()
Diffstat (limited to 'src/text.c')
| -rw-r--r-- | src/text.c | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -788,16 +788,22 @@ Image GenImageFontAtlas(const CharInfo *chars, Rectangle **charRecs, int charsCo } #endif +// Unload font chars info data (RAM) +void UnloadFontData(CharInfo *chars, int charsCount) +{ + for (int i = 0; i < charsCount; i++) UnloadImage(chars[i].image); + + RL_FREE(chars); +} + // Unload Font from GPU memory (VRAM) void UnloadFont(Font font) { // NOTE: Make sure font is not default font (fallback) if (font.texture.id != GetFontDefault().texture.id) { - for (int i = 0; i < font.charsCount; i++) UnloadImage(font.chars[i].image); - + UnloadFontData(font.chars, font.charsCount); UnloadTexture(font.texture); - RL_FREE(font.chars); RL_FREE(font.recs); TRACELOGD("FONT: Unloaded font data from RAM and VRAM"); |
