video_context_data only accessed now from one file

This commit is contained in:
twinaphex 2015-11-23 21:06:15 +01:00
parent 3ad52d0f08
commit f98cda3c33
8 changed files with 16 additions and 6 deletions

View File

@ -332,7 +332,7 @@ static bool gfx_ctx_cgl_init(void *data)
CGLSetCurrentContext(cgl->glCtx); CGLSetCurrentContext(cgl->glCtx);
driver->video_context_data = cgl; gfx_ctx_data_set(cgl);
return true; return true;

View File

@ -509,7 +509,7 @@ nextgpu:
dir_list_free(gpu_descriptors); dir_list_free(gpu_descriptors);
driver->video_context_data = drm; gfx_ctx_data_set(drm);
return true; return true;

View File

@ -261,7 +261,7 @@ static bool gfx_ctx_glx_init(void *data)
glx->g_fbc = fbcs[0]; glx->g_fbc = fbcs[0];
XFree(fbcs); XFree(fbcs);
driver->video_context_data = glx; gfx_ctx_data_set(glx);
return true; return true;

View File

@ -292,7 +292,7 @@ static bool gfx_ctx_ps3_init(void *data)
gfx_ctx_ps3_get_available_resolutions(); gfx_ctx_ps3_get_available_resolutions();
driver->video_context_data = ps3; gfx_ctx_data_set(ps3);
return true; return true;
} }

View File

@ -93,7 +93,7 @@ static bool sdl_ctx_init(void *data)
RARCH_LOG("[SDL_GL] SDL %i.%i.%i gfx context driver initialized.\n", RARCH_LOG("[SDL_GL] SDL %i.%i.%i gfx context driver initialized.\n",
SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL); SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL);
driver->video_context_data = sdl; gfx_ctx_data_set(sdl);
return true; return true;

View File

@ -337,7 +337,7 @@ static bool gfx_ctx_wl_init(void *data)
goto error; goto error;
} }
driver->video_context_data = wl; gfx_ctx_data_set(wl);
wl->g_registry = wl_display_get_registry(wl->g_dpy); wl->g_registry = wl_display_get_registry(wl->g_dpy);
wl_registry_add_listener(wl->g_registry, &registry_listener, NULL); wl_registry_add_listener(wl->g_registry, &registry_listener, NULL);

View File

@ -87,6 +87,14 @@ void *gfx_ctx_data_get_ptr(void)
return driver->video_context_data; return driver->video_context_data;
} }
void gfx_ctx_data_set(void *ptr)
{
driver_t *driver = driver_get_ptr();
if (!driver || !ptr)
return;
driver->video_context_data = ptr;
}
void gfx_ctx_free_data(void) void gfx_ctx_free_data(void)
{ {
driver_t *driver = driver_get_ptr(); driver_t *driver = driver_get_ptr();

View File

@ -256,6 +256,8 @@ retro_proc_address_t gfx_ctx_get_proc_address(const char *sym);
void *gfx_ctx_data_get_ptr(void); void *gfx_ctx_data_get_ptr(void);
void gfx_ctx_data_set(void *ptr);
void gfx_ctx_free_data(void); void gfx_ctx_free_data(void);
#ifdef __cplusplus #ifdef __cplusplus