mirror of
https://github.com/libretro/RetroArch.git
synced 2024-11-26 01:30:51 +00:00
Support cached contexts on Win32.
Only tested on Wine, but works.
This commit is contained in:
parent
e18af77412
commit
feebb78f75
@ -83,7 +83,14 @@ static void create_gl_context(HWND hwnd)
|
||||
g_hdc = GetDC(hwnd);
|
||||
setup_pixel_format(g_hdc);
|
||||
|
||||
g_hrc = wglCreateContext(g_hdc);
|
||||
if (!g_hrc)
|
||||
g_hrc = wglCreateContext(g_hdc);
|
||||
else
|
||||
{
|
||||
RARCH_LOG("[WGL]: Using cached GL context.\n");
|
||||
driver.video_cache_context_ack = true;
|
||||
}
|
||||
|
||||
if (g_hrc)
|
||||
{
|
||||
if (wglMakeCurrent(g_hdc, g_hrc))
|
||||
@ -484,8 +491,12 @@ static void gfx_ctx_destroy(void)
|
||||
if (g_hrc)
|
||||
{
|
||||
wglMakeCurrent(NULL, NULL);
|
||||
wglDeleteContext(g_hrc);
|
||||
g_hrc = NULL;
|
||||
|
||||
if (!driver.video_cache_context)
|
||||
{
|
||||
wglDeleteContext(g_hrc);
|
||||
g_hrc = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
if (g_hwnd && g_hdc)
|
||||
@ -514,6 +525,7 @@ static void gfx_ctx_destroy(void)
|
||||
|
||||
g_inited = false;
|
||||
g_major = g_minor = 0;
|
||||
p_swap_interval = NULL;
|
||||
}
|
||||
|
||||
static void gfx_ctx_input_driver(const input_driver_t **input, void **input_data)
|
||||
|
Loading…
Reference in New Issue
Block a user