mirror of
https://github.com/libretro/RetroArch.git
synced 2024-11-24 16:39:43 +00:00
Create video_texture_unload
This commit is contained in:
parent
74b7e13ba9
commit
5bd555ca50
@ -121,3 +121,10 @@ unsigned video_texture_load(void *data,
|
||||
|
||||
return video_texture_png_load(data, type, filter_type);
|
||||
}
|
||||
|
||||
void video_texture_unload(uintptr_t *id)
|
||||
{
|
||||
if (id)
|
||||
glDeleteTextures(1, (const GLuint*)id);
|
||||
*id = 0;
|
||||
}
|
||||
|
@ -33,6 +33,8 @@ unsigned video_texture_load(void *data,
|
||||
enum texture_backend_type type,
|
||||
enum texture_filter_type filter_type);
|
||||
|
||||
void video_texture_unload(uintptr_t *id);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@ -680,16 +680,11 @@ static void glui_free(void *data)
|
||||
|
||||
static void glui_context_bg_destroy(glui_handle_t *glui)
|
||||
{
|
||||
if (glui)
|
||||
{
|
||||
if (glui->textures.bg.id)
|
||||
glDeleteTextures(1, (const GLuint*)&glui->textures.bg.id);
|
||||
if (glui->textures.white)
|
||||
glDeleteTextures(1, (const GLuint*)&glui->textures.white);
|
||||
if (!glui)
|
||||
return;
|
||||
|
||||
glui->textures.bg.id = 0;
|
||||
glui->textures.white = 0;
|
||||
}
|
||||
video_texture_unload((uintptr_t*)&glui->textures.bg.id);
|
||||
video_texture_unload((uintptr_t*)&glui->textures.white);
|
||||
}
|
||||
|
||||
static void glui_context_destroy(void)
|
||||
|
@ -1971,8 +1971,7 @@ static void xmb_free(void *data)
|
||||
|
||||
static void xmb_context_bg_destroy(xmb_handle_t *xmb)
|
||||
{
|
||||
if (xmb->textures.bg.id)
|
||||
glDeleteTextures(1, (const GLuint*)&xmb->textures.bg.id);
|
||||
video_texture_unload((uintptr_t*)&xmb->textures.bg.id);
|
||||
}
|
||||
|
||||
static bool xmb_load_image(void *data, menu_image_type_t type)
|
||||
@ -2547,8 +2546,8 @@ static void xmb_context_destroy_horizontal_list(xmb_handle_t *xmb,
|
||||
if (!node)
|
||||
continue;
|
||||
|
||||
glDeleteTextures(1, (const GLuint*)&node->icon);
|
||||
glDeleteTextures(1, (const GLuint*)&node->content_icon);
|
||||
video_texture_unload((uintptr_t*)&node->icon);
|
||||
video_texture_unload((uintptr_t*)&node->content_icon);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2567,7 +2566,7 @@ static void xmb_context_destroy(void)
|
||||
return;
|
||||
|
||||
for (i = 0; i < XMB_TEXTURE_LAST; i++)
|
||||
glDeleteTextures(1, (const GLuint*)&xmb->textures.list[i].id);
|
||||
video_texture_unload((uintptr_t*)&xmb->textures.list[i].id);
|
||||
|
||||
xmb_context_destroy_horizontal_list(xmb, menu);
|
||||
|
||||
|
@ -1023,14 +1023,8 @@ static void zarch_free(void *data)
|
||||
|
||||
static void zarch_context_bg_destroy(zui_t *zarch)
|
||||
{
|
||||
if (zarch->textures.bg.id)
|
||||
glDeleteTextures(1, (const GLuint*)&zarch->textures.bg.id);
|
||||
|
||||
if (zarch->textures.white)
|
||||
glDeleteTextures(1, (const GLuint*)&zarch->textures.white);
|
||||
|
||||
zarch->textures.bg.id = 0;
|
||||
zarch->textures.white = 0;
|
||||
video_texture_unload((uintptr_t*)&zarch->textures.bg.id);
|
||||
video_texture_unload((uintptr_t*)&zarch->textures.white);
|
||||
}
|
||||
|
||||
static void zarch_context_destroy(void)
|
||||
|
Loading…
Reference in New Issue
Block a user