Add GFX_CTL_SET

This commit is contained in:
twinaphex 2016-02-13 18:27:05 +01:00
parent 6a697ef2e1
commit 8721c857e9
5 changed files with 10 additions and 12 deletions

View File

@ -1121,7 +1121,7 @@ static void *d3d_init(const video_info_t *info,
#endif
#endif
gfx_ctx_set(ctx_driver);
gfx_ctx_ctl(GFX_CTL_SET, ctx_driver);
if (!d3d_construct(d3d, info, input, input_data))
{

View File

@ -2464,7 +2464,7 @@ static void *gl_init(const video_info_t *video, const input_driver_t **input, vo
if (!gl || !ctx_driver)
goto error;
gfx_ctx_set(ctx_driver);
gfx_ctx_ctl(GFX_CTL_SET, ctx_driver);
gl->video_info = *video;

View File

@ -94,7 +94,7 @@ static void *vg_init(const video_info_t *video, const input_driver_t **input, vo
if (!vg || !ctx)
goto error;
gfx_ctx_set(ctx);
gfx_ctx_ctl(GFX_CTL_SET, ctx);
gfx_ctx_get_video_size(&temp_width, &temp_height);
RARCH_LOG("Detecting screen resolution %ux%u.\n", temp_width, temp_height);

View File

@ -83,12 +83,6 @@ static const gfx_ctx_driver_t *gfx_ctx_drivers[] = {
static const gfx_ctx_driver_t *current_video_context;
static void *video_context_data;
void gfx_ctx_set(const gfx_ctx_driver_t *ctx_driver)
{
if (!ctx_driver)
return;
current_video_context = ctx_driver;
}
const char *gfx_ctx_get_ident(void)
{
@ -407,6 +401,11 @@ bool gfx_ctx_ctl(enum gfx_ctx_ctl_state state, void *data)
{
switch (state)
{
case GFX_CTL_SET:
if (!data)
return false;
current_video_context = (const gfx_ctx_driver_t*)data;
break;
case GFX_CTL_DESTROY:
current_video_context = NULL;
break;

View File

@ -60,7 +60,8 @@ enum gfx_ctx_ctl_state
GFX_CTL_SWAP_BUFFERS,
GFX_CTL_HAS_WINDOWED,
GFX_CTL_UPDATE_WINDOW_TITLE,
GFX_CTL_SHOW_MOUSE
GFX_CTL_SHOW_MOUSE,
GFX_CTL_SET
};
typedef void (*gfx_ctx_proc_t)(void);
@ -250,8 +251,6 @@ void gfx_ctx_input_driver(
retro_proc_address_t gfx_ctx_get_proc_address(const char *sym);
void gfx_ctx_set(const gfx_ctx_driver_t *ctx_driver);
bool gfx_ctx_ctl(enum gfx_ctx_ctl_state state, void *data);
#ifdef __cplusplus