Fix RGUI fallback - if threaded video wrapper was enabled,

we could not grab an ident resembling 'd3d' or 'gl'
This commit is contained in:
twinaphex 2015-08-17 20:51:12 +02:00
parent 49d048fde2
commit 0bf8a36d50
5 changed files with 26 additions and 1 deletions

View File

@ -1132,3 +1132,14 @@ void *rarch_threaded_video_get_ptr(const video_driver_t **drv)
return NULL;
return thr->driver_data;
}
const char *rarch_threaded_video_get_ident(void)
{
driver_t *driver = driver_get_ptr();
const thread_video_t *thr = (const thread_video_t*)
driver->video_data;
if (!thr)
return NULL;
return thr->driver->ident;
}

View File

@ -254,5 +254,7 @@ bool rarch_threaded_video_init(
**/
void *rarch_threaded_video_get_ptr(const video_driver_t **drv);
const char *rarch_threaded_video_get_ident(void);
#endif

View File

@ -173,7 +173,7 @@ void init_menu(void)
find_menu_driver();
video_driver = video_driver_get_ident();
video_driver = menu_video_get_ident();
switch (driver->menu_ctx->type)
{

View File

@ -21,6 +21,7 @@
#include "menu_video.h"
#include "../gfx/video_common.h"
#include "../gfx/video_thread_wrapper.h"
#ifdef HAVE_OPENGL
void menu_video_draw_frame(
@ -140,3 +141,12 @@ void menu_video_frame_background(
gl->coords.color = gl->white_color_ptr;
}
#endif
const char *menu_video_get_ident(void)
{
settings_t *settings = config_get_ptr();
if (settings->video.threaded)
return rarch_threaded_video_get_ident();
return video_driver_get_ident();
}

View File

@ -44,6 +44,8 @@ void menu_video_frame_background(
bool force_transparency);
#endif
const char *menu_video_get_ident(void);
#ifdef __cplusplus
}
#endif