mirror of
https://github.com/libretro/RetroArch
synced 2025-03-28 19:20:35 +00:00
Merge pull request #1022 from heuripedes/frontend-drivers
(frontend) Add support for frontend specific video drivers
This commit is contained in:
commit
994c2d6db5
10
driver.c
10
driver.c
@ -638,6 +638,16 @@ static void find_video_driver(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
if (driver.frontend_ctx->get_video_driver)
|
||||
{
|
||||
driver.video = driver.frontend_ctx->get_video_driver();
|
||||
|
||||
if (driver.video)
|
||||
return;
|
||||
else
|
||||
RARCH_WARN("Frontend supports get_video_driver() but did not specify one.\n");
|
||||
}
|
||||
|
||||
int i = find_driver_index("video_driver", g_settings.video.driver);
|
||||
if (i >= 0)
|
||||
driver.video = video_drivers[i];
|
||||
|
@ -15,6 +15,7 @@
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "driver.h"
|
||||
#include "frontend.h"
|
||||
#include "../general.h"
|
||||
|
||||
|
@ -51,6 +51,9 @@ typedef void (*environment_get_t)(int *argc, char *argv[], void *args,
|
||||
void *params_data);
|
||||
typedef void (*process_args_t)(int *argc, char *argv[]);
|
||||
|
||||
/* avoid cyclic reference */
|
||||
typedef struct video_driver video_driver_t;
|
||||
|
||||
typedef struct frontend_ctx_driver
|
||||
{
|
||||
environment_get_t environment_get;
|
||||
@ -66,6 +69,8 @@ typedef struct frontend_ctx_driver
|
||||
int (*get_rating)(void);
|
||||
|
||||
const char *ident;
|
||||
|
||||
const video_driver_t *(*get_video_driver)(void);
|
||||
} frontend_ctx_driver_t;
|
||||
|
||||
extern const frontend_ctx_driver_t frontend_ctx_gx;
|
||||
|
Loading…
x
Reference in New Issue
Block a user