Basic texture support
This commit is contained in:
@@ -246,7 +246,7 @@ bottom_right_of_text :: proc(text_string: string, font_id: Font_Id, font_size: u
|
||||
// After calling this, subsequent text draws with an `id` will re-create their cache entries.
|
||||
clear_text_cache :: proc() {
|
||||
for _, sdl_text in GLOB.text_cache.cache {
|
||||
sdl_ttf.DestroyText(sdl_text)
|
||||
append(&GLOB.pending_text_releases, sdl_text)
|
||||
}
|
||||
clear(&GLOB.text_cache.cache)
|
||||
}
|
||||
@@ -259,7 +259,7 @@ clear_text_cache_entry :: proc(id: u32) {
|
||||
key := Cache_Key{id, .Custom}
|
||||
sdl_text, ok := GLOB.text_cache.cache[key]
|
||||
if ok {
|
||||
sdl_ttf.DestroyText(sdl_text)
|
||||
append(&GLOB.pending_text_releases, sdl_text)
|
||||
delete_key(&GLOB.text_cache.cache, key)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user