Prepare GL renderchains

This commit is contained in:
twinaphex 2017-11-07 07:56:18 +01:00
parent 814f18b7a8
commit f681cb455c
2 changed files with 42 additions and 4 deletions

View File

@ -407,7 +407,7 @@ static const shader_backend_t *shader_ctx_drivers[] = {
NULL
};
static const d3d_renderchain_driver_t *renderchain_drivers[] = {
static const d3d_renderchain_driver_t *renderchain_d3d_drivers[] = {
#if defined(_WIN32) && defined(HAVE_D3D9) && defined(HAVE_CG)
&cg_d3d9_renderchain,
#endif
@ -421,6 +421,13 @@ static const d3d_renderchain_driver_t *renderchain_drivers[] = {
NULL
};
static const gl_renderchain_driver_t *renderchain_gl_drivers[] = {
#if defined(HAVE_OPENGL)
&gl2_renderchain,
#endif
NULL
};
/* Stub functions */
static void update_window_title_null(void *data, void *data2)
@ -3414,14 +3421,39 @@ bool renderchain_d3d_init_first(const d3d_renderchain_driver_t **renderchain_dri
{
unsigned i;
for (i = 0; renderchain_drivers[i]; i++)
for (i = 0; renderchain_d3d_drivers[i]; i++)
{
void *data = renderchain_drivers[i]->chain_new();
void *data = renderchain_d3d_drivers[i]->chain_new();
if (!data)
continue;
*renderchain_driver = renderchain_drivers[i];
*renderchain_driver = renderchain_d3d_drivers[i];
*renderchain_handle = data;
return true;
}
return false;
}
bool renderchain_gl_init_first(
const gl_renderchain_driver_t **renderchain_driver,
void **renderchain_handle)
{
unsigned i;
for (i = 0; renderchain_gl_drivers[i]; i++)
{
#if 0
void *data = renderchain_gl_drivers[i]->chain_new();
#else
void *data = NULL;
#endif
if (!data)
continue;
*renderchain_driver = renderchain_gl_drivers[i];
*renderchain_handle = data;
return true;
}

View File

@ -1261,6 +1261,10 @@ bool renderchain_d3d_init_first(
const d3d_renderchain_driver_t **renderchain_driver,
void **renderchain_handle);
bool renderchain_gl_init_first(
const gl_renderchain_driver_t **renderchain_driver,
void **renderchain_handle);
extern bool (*video_driver_cb_has_focus)(void);
extern shader_backend_t *current_shader;
@ -1323,6 +1327,8 @@ extern d3d_renderchain_driver_t cg_d3d9_renderchain;
extern d3d_renderchain_driver_t hlsl_d3d9_renderchain;
extern d3d_renderchain_driver_t null_renderchain;
extern gl_renderchain_driver_t gl2_renderchain;
RETRO_END_DECLS
#endif