mirror of
https://github.com/libretro/RetroArch
synced 2025-03-01 16:13:40 +00:00
Rewrite gfx_ctx_x_make_current a bit and turn it into a
static function
This commit is contained in:
parent
90a303050f
commit
12cfb3bfce
@ -258,7 +258,6 @@ const gfx_ctx_driver_t gfx_ctx_khr_display = {
|
||||
gfx_ctx_khr_display_set_flags,
|
||||
NULL,
|
||||
gfx_ctx_khr_display_get_context_data,
|
||||
NULL,
|
||||
NULL
|
||||
};
|
||||
|
||||
|
@ -917,19 +917,28 @@ static void gfx_ctx_x_set_flags(void *data, uint32_t flags)
|
||||
x->core_hw_context_enable = true;
|
||||
}
|
||||
|
||||
void gfx_ctx_x_make_current(bool release)
|
||||
static void gfx_ctx_x_make_current(bool release)
|
||||
{
|
||||
if (!current_context_data)
|
||||
return;
|
||||
|
||||
if (release)
|
||||
switch (x_api)
|
||||
{
|
||||
glXMakeContextCurrent(g_x11_dpy, None, None, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
glXMakeContextCurrent(g_x11_dpy,
|
||||
current_context_data->g_glx_win, current_context_data->g_glx_win, current_context_data->g_ctx);
|
||||
case GFX_CTX_OPENGL_API:
|
||||
case GFX_CTX_OPENGL_ES_API:
|
||||
#ifdef HAVE_OPENGL
|
||||
if (release)
|
||||
glXMakeContextCurrent(g_x11_dpy, None, None, NULL);
|
||||
else
|
||||
glXMakeContextCurrent(g_x11_dpy,
|
||||
current_context_data->g_glx_win,
|
||||
current_context_data->g_glx_win, current_context_data->g_ctx);
|
||||
#endif
|
||||
break;
|
||||
|
||||
case GFX_CTX_NONE:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -967,10 +976,6 @@ const gfx_ctx_driver_t gfx_ctx_x = {
|
||||
#else
|
||||
NULL,
|
||||
#endif
|
||||
#ifdef HAVE_OPENGL
|
||||
gfx_ctx_x_make_current
|
||||
#else
|
||||
NULL
|
||||
#endif
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user