mirror of
https://github.com/libretro/RetroArch
synced 2025-03-29 22:20:21 +00:00
Graceful switch between video drivers.
This commit is contained in:
parent
fffc7597fd
commit
453781af9c
@ -85,6 +85,8 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
static void gfx_ctx_wgl_destroy(void *data);
|
||||
|
||||
#if defined(HAVE_OPENGL) || defined(HAVE_OPENGL1) || defined(HAVE_OPENGL_CORE)
|
||||
typedef HGLRC (APIENTRY *wglCreateContextAttribsProc)(HDC, HGLRC, const int*);
|
||||
static wglCreateContextAttribsProc pcreate_context;
|
||||
@ -563,7 +565,7 @@ static void *gfx_ctx_wgl_init(video_frame_info_t *video_info, void *video_driver
|
||||
return NULL;
|
||||
|
||||
if (g_win32_inited)
|
||||
goto error;
|
||||
gfx_ctx_wgl_destroy(NULL);
|
||||
|
||||
#ifdef HAVE_DYNAMIC
|
||||
dll_handle = dylib_load("OpenGL32.dll");
|
||||
|
37
retroarch.c
37
retroarch.c
@ -7189,39 +7189,6 @@ static bool dynamic_request_hw_context(enum retro_hw_context_type type,
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool dynamic_verify_hw_context(enum retro_hw_context_type type,
|
||||
unsigned minor, unsigned major)
|
||||
{
|
||||
const char *video_ident = (current_video) ? current_video->ident : NULL;
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case RETRO_HW_CONTEXT_VULKAN:
|
||||
if (!string_is_equal(video_ident, "vulkan"))
|
||||
return false;
|
||||
break;
|
||||
case RETRO_HW_CONTEXT_OPENGLES2:
|
||||
case RETRO_HW_CONTEXT_OPENGLES3:
|
||||
case RETRO_HW_CONTEXT_OPENGLES_VERSION:
|
||||
case RETRO_HW_CONTEXT_OPENGL:
|
||||
case RETRO_HW_CONTEXT_OPENGL_CORE:
|
||||
if (!string_is_equal(video_ident, "gl") &&
|
||||
!string_is_equal(video_ident, "glcore"))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case RETRO_HW_CONTEXT_DIRECT3D:
|
||||
if (!(string_is_equal(video_ident, "d3d11") && major == 11))
|
||||
return false;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static void rarch_log_libretro(enum retro_log_level level,
|
||||
const char *fmt, ...)
|
||||
{
|
||||
@ -7788,10 +7755,6 @@ static bool rarch_environment_cb(unsigned cmd, void *data)
|
||||
cb->context_type, cb->version_minor, cb->version_major))
|
||||
return false;
|
||||
|
||||
if (!dynamic_verify_hw_context(
|
||||
cb->context_type, cb->version_minor, cb->version_major))
|
||||
return false;
|
||||
|
||||
#if defined(HAVE_OPENGL) || defined(HAVE_OPENGL_CORE)
|
||||
if (!gl_set_core_context(cb->context_type)) { }
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user