mirror of
https://github.com/libretro/RetroArch
synced 2025-02-28 22:13:51 +00:00
Create menu_display_texture_load and menu_display_texture_unload
This commit is contained in:
parent
1dab10ceda
commit
a4eb49430c
@ -34,8 +34,6 @@
|
|||||||
#include "../menu_hash.h"
|
#include "../menu_hash.h"
|
||||||
#include "../menu_display.h"
|
#include "../menu_display.h"
|
||||||
|
|
||||||
#include "../../gfx/video_texture.h"
|
|
||||||
|
|
||||||
#include "../../runloop_data.h"
|
#include "../../runloop_data.h"
|
||||||
|
|
||||||
enum
|
enum
|
||||||
@ -166,8 +164,8 @@ static void materialui_context_reset_textures(materialui_handle_t *materialui, c
|
|||||||
|
|
||||||
texture_image_load(&ti, path);
|
texture_image_load(&ti, path);
|
||||||
|
|
||||||
materialui->textures.list[i].id = video_texture_load(&ti,
|
materialui->textures.list[i].id = menu_display_texture_load(&ti,
|
||||||
TEXTURE_BACKEND_OPENGL, TEXTURE_FILTER_MIPMAP_LINEAR);
|
TEXTURE_FILTER_MIPMAP_LINEAR);
|
||||||
|
|
||||||
texture_image_free(&ti);
|
texture_image_free(&ti);
|
||||||
}
|
}
|
||||||
@ -912,8 +910,8 @@ static void materialui_allocate_white_texture(materialui_handle_t *materialui)
|
|||||||
ti.height = 1;
|
ti.height = 1;
|
||||||
ti.pixels = (uint32_t*)&white_data;
|
ti.pixels = (uint32_t*)&white_data;
|
||||||
|
|
||||||
materialui->textures.white = video_texture_load(&ti,
|
materialui->textures.white = menu_display_texture_load(&ti,
|
||||||
TEXTURE_BACKEND_OPENGL, TEXTURE_FILTER_NEAREST);
|
TEXTURE_FILTER_NEAREST);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void materialui_font(menu_handle_t *menu)
|
static void materialui_font(menu_handle_t *menu)
|
||||||
@ -1029,8 +1027,8 @@ static void materialui_context_bg_destroy(materialui_handle_t *materialui)
|
|||||||
if (!materialui)
|
if (!materialui)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
video_texture_unload((uintptr_t*)&materialui->textures.bg.id);
|
menu_display_texture_unload((uintptr_t*)&materialui->textures.bg.id);
|
||||||
video_texture_unload((uintptr_t*)&materialui->textures.white);
|
menu_display_texture_unload((uintptr_t*)&materialui->textures.white);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void materialui_context_destroy(void)
|
static void materialui_context_destroy(void)
|
||||||
@ -1048,7 +1046,7 @@ static void materialui_context_destroy(void)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
for (i = 0; i < GLUI_TEXTURE_LAST; i++)
|
for (i = 0; i < GLUI_TEXTURE_LAST; i++)
|
||||||
video_texture_unload((uintptr_t*)&materialui->textures.list[i].id);
|
menu_display_texture_unload((uintptr_t*)&materialui->textures.list[i].id);
|
||||||
|
|
||||||
menu_display_free_main_font();
|
menu_display_free_main_font();
|
||||||
|
|
||||||
@ -1072,8 +1070,8 @@ static bool materialui_load_image(void *data, menu_image_type_t type)
|
|||||||
case MENU_IMAGE_WALLPAPER:
|
case MENU_IMAGE_WALLPAPER:
|
||||||
materialui_context_bg_destroy(materialui);
|
materialui_context_bg_destroy(materialui);
|
||||||
|
|
||||||
materialui->textures.bg.id = video_texture_load(data,
|
materialui->textures.bg.id = menu_display_texture_load(data,
|
||||||
TEXTURE_BACKEND_OPENGL, TEXTURE_FILTER_MIPMAP_LINEAR);
|
TEXTURE_FILTER_MIPMAP_LINEAR);
|
||||||
materialui_allocate_white_texture(materialui);
|
materialui_allocate_white_texture(materialui);
|
||||||
break;
|
break;
|
||||||
case MENU_IMAGE_BOXART:
|
case MENU_IMAGE_BOXART:
|
||||||
|
@ -38,7 +38,6 @@
|
|||||||
#include "../menu_cbs.h"
|
#include "../menu_cbs.h"
|
||||||
|
|
||||||
#include "../../file_ext.h"
|
#include "../../file_ext.h"
|
||||||
#include "../../gfx/video_texture.h"
|
|
||||||
|
|
||||||
#include "../../runloop_data.h"
|
#include "../../runloop_data.h"
|
||||||
|
|
||||||
@ -1932,7 +1931,7 @@ static void xmb_context_bg_destroy(xmb_handle_t *xmb)
|
|||||||
if (!xmb)
|
if (!xmb)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
video_texture_unload((uintptr_t*)&xmb->textures.bg.id);
|
menu_display_texture_unload((uintptr_t*)&xmb->textures.bg.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool xmb_load_image(void *data, menu_image_type_t type)
|
static bool xmb_load_image(void *data, menu_image_type_t type)
|
||||||
@ -1954,12 +1953,12 @@ static bool xmb_load_image(void *data, menu_image_type_t type)
|
|||||||
break;
|
break;
|
||||||
case MENU_IMAGE_WALLPAPER:
|
case MENU_IMAGE_WALLPAPER:
|
||||||
xmb_context_bg_destroy(xmb);
|
xmb_context_bg_destroy(xmb);
|
||||||
xmb->textures.bg.id = video_texture_load(data,
|
xmb->textures.bg.id = menu_display_texture_load(data,
|
||||||
TEXTURE_BACKEND_OPENGL, TEXTURE_FILTER_MIPMAP_LINEAR);
|
TEXTURE_FILTER_MIPMAP_LINEAR);
|
||||||
break;
|
break;
|
||||||
case MENU_IMAGE_BOXART:
|
case MENU_IMAGE_BOXART:
|
||||||
xmb->boxart = video_texture_load(data,
|
xmb->boxart = menu_display_texture_load(data,
|
||||||
TEXTURE_BACKEND_OPENGL, TEXTURE_FILTER_MIPMAP_LINEAR);
|
TEXTURE_FILTER_MIPMAP_LINEAR);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2037,14 +2036,14 @@ static void xmb_context_reset_horizontal_list(xmb_handle_t *xmb,
|
|||||||
|
|
||||||
texture_image_load(&ti, texturepath);
|
texture_image_load(&ti, texturepath);
|
||||||
|
|
||||||
node->icon = video_texture_load(&ti,
|
node->icon = menu_display_texture_load(&ti,
|
||||||
TEXTURE_BACKEND_OPENGL, TEXTURE_FILTER_MIPMAP_LINEAR);
|
TEXTURE_FILTER_MIPMAP_LINEAR);
|
||||||
|
|
||||||
texture_image_free(&ti);
|
texture_image_free(&ti);
|
||||||
texture_image_load(&ti, content_texturepath);
|
texture_image_load(&ti, content_texturepath);
|
||||||
|
|
||||||
node->content_icon = video_texture_load(&ti,
|
node->content_icon = menu_display_texture_load(&ti,
|
||||||
TEXTURE_BACKEND_OPENGL, TEXTURE_FILTER_MIPMAP_LINEAR);
|
TEXTURE_FILTER_MIPMAP_LINEAR);
|
||||||
|
|
||||||
texture_image_free(&ti);
|
texture_image_free(&ti);
|
||||||
}
|
}
|
||||||
@ -2173,8 +2172,8 @@ static void xmb_context_reset_textures(xmb_handle_t *xmb, const char *iconpath)
|
|||||||
|
|
||||||
texture_image_load(&ti, path);
|
texture_image_load(&ti, path);
|
||||||
|
|
||||||
xmb->textures.list[i].id = video_texture_load(&ti,
|
xmb->textures.list[i].id = menu_display_texture_load(&ti,
|
||||||
TEXTURE_BACKEND_OPENGL, TEXTURE_FILTER_MIPMAP_LINEAR);
|
TEXTURE_FILTER_MIPMAP_LINEAR);
|
||||||
|
|
||||||
texture_image_free(&ti);
|
texture_image_free(&ti);
|
||||||
}
|
}
|
||||||
@ -2504,8 +2503,8 @@ static void xmb_context_destroy_horizontal_list(xmb_handle_t *xmb,
|
|||||||
if (!node)
|
if (!node)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
video_texture_unload((uintptr_t*)&node->icon);
|
menu_display_texture_unload((uintptr_t*)&node->icon);
|
||||||
video_texture_unload((uintptr_t*)&node->content_icon);
|
menu_display_texture_unload((uintptr_t*)&node->content_icon);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2524,7 +2523,7 @@ static void xmb_context_destroy(void)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
for (i = 0; i < XMB_TEXTURE_LAST; i++)
|
for (i = 0; i < XMB_TEXTURE_LAST; i++)
|
||||||
video_texture_unload((uintptr_t*)&xmb->textures.list[i].id);
|
menu_display_texture_unload((uintptr_t*)&xmb->textures.list[i].id);
|
||||||
|
|
||||||
xmb_context_destroy_horizontal_list(xmb, menu);
|
xmb_context_destroy_horizontal_list(xmb, menu);
|
||||||
|
|
||||||
|
@ -42,7 +42,6 @@
|
|||||||
#include "../../runloop_data.h"
|
#include "../../runloop_data.h"
|
||||||
|
|
||||||
#include "../../gfx/font_driver.h"
|
#include "../../gfx/font_driver.h"
|
||||||
#include "../../gfx/video_texture.h"
|
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
#define ZARCH_DEBUG
|
#define ZARCH_DEBUG
|
||||||
@ -1157,8 +1156,8 @@ static void zarch_free(void *data)
|
|||||||
|
|
||||||
static void zarch_context_bg_destroy(zui_t *zui)
|
static void zarch_context_bg_destroy(zui_t *zui)
|
||||||
{
|
{
|
||||||
video_texture_unload((uintptr_t*)&zui->textures.bg.id);
|
menu_display_texture_unload((uintptr_t*)&zui->textures.bg.id);
|
||||||
video_texture_unload((uintptr_t*)&zui->textures.white);
|
menu_display_texture_unload((uintptr_t*)&zui->textures.white);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void zarch_context_destroy(void)
|
static void zarch_context_destroy(void)
|
||||||
@ -1194,8 +1193,8 @@ static bool zarch_load_image(void *data, menu_image_type_t type)
|
|||||||
break;
|
break;
|
||||||
case MENU_IMAGE_WALLPAPER:
|
case MENU_IMAGE_WALLPAPER:
|
||||||
zarch_context_bg_destroy(zui);
|
zarch_context_bg_destroy(zui);
|
||||||
zui->textures.bg.id = video_texture_load(data,
|
zui->textures.bg.id = menu_display_texture_load(data,
|
||||||
TEXTURE_BACKEND_OPENGL, TEXTURE_FILTER_MIPMAP_LINEAR);
|
TEXTURE_FILTER_MIPMAP_LINEAR);
|
||||||
break;
|
break;
|
||||||
case MENU_IMAGE_BOXART:
|
case MENU_IMAGE_BOXART:
|
||||||
break;
|
break;
|
||||||
@ -1213,8 +1212,8 @@ static void zarch_allocate_white_texture(zui_t *zui)
|
|||||||
ti.height = 1;
|
ti.height = 1;
|
||||||
ti.pixels = (uint32_t*)&data;
|
ti.pixels = (uint32_t*)&data;
|
||||||
|
|
||||||
zui->textures.white = video_texture_load(&ti,
|
zui->textures.white = menu_display_texture_load(&ti,
|
||||||
TEXTURE_BACKEND_OPENGL, TEXTURE_FILTER_NEAREST);
|
TEXTURE_FILTER_NEAREST);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void zarch_context_reset(void)
|
static void zarch_context_reset(void)
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
#include "../gfx/font_renderer_driver.h"
|
#include "../gfx/font_renderer_driver.h"
|
||||||
#include "../gfx/video_context_driver.h"
|
#include "../gfx/video_context_driver.h"
|
||||||
#include "../gfx/video_thread_wrapper.h"
|
#include "../gfx/video_thread_wrapper.h"
|
||||||
|
#include "../gfx/video_texture.h"
|
||||||
|
|
||||||
#include "menu.h"
|
#include "menu.h"
|
||||||
#include "menu_animation.h"
|
#include "menu_animation.h"
|
||||||
@ -641,6 +642,18 @@ void menu_display_clear_color(float r, float g, float b, float a)
|
|||||||
glClearColor(r, g, b, a);
|
glClearColor(r, g, b, a);
|
||||||
glClear(GL_COLOR_BUFFER_BIT);
|
glClear(GL_COLOR_BUFFER_BIT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsigned menu_display_texture_load(void *data, enum texture_filter_type type)
|
||||||
|
{
|
||||||
|
return video_texture_load(data, TEXTURE_BACKEND_OPENGL, type);
|
||||||
|
}
|
||||||
|
|
||||||
|
void menu_display_texture_unload(uintptr_t *id)
|
||||||
|
{
|
||||||
|
if (!id)
|
||||||
|
return;
|
||||||
|
video_texture_unload(id);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool menu_display_check_compatibility(enum menu_display_driver_type type)
|
bool menu_display_check_compatibility(enum menu_display_driver_type type)
|
||||||
|
@ -20,6 +20,8 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <boolean.h>
|
#include <boolean.h>
|
||||||
|
|
||||||
|
#include "../gfx/video_texture.h"
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
@ -133,6 +135,11 @@ void menu_display_clear_color(float r, float g, float b, float a);
|
|||||||
void menu_display_matrix_4x4_rotate_z(void *data, float rotation,
|
void menu_display_matrix_4x4_rotate_z(void *data, float rotation,
|
||||||
float scale_x, float scale_y, float scale_z, bool scale_enable);
|
float scale_x, float scale_y, float scale_z, bool scale_enable);
|
||||||
|
|
||||||
|
unsigned menu_display_texture_load(void *data,
|
||||||
|
enum texture_filter_type filter_type);
|
||||||
|
|
||||||
|
void menu_display_texture_unload(uintptr_t *id);
|
||||||
|
|
||||||
bool menu_display_check_compatibility(enum menu_display_driver_type type);
|
bool menu_display_check_compatibility(enum menu_display_driver_type type);
|
||||||
|
|
||||||
const char *menu_video_get_ident(void);
|
const char *menu_video_get_ident(void);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user