(WGL) Fix

This commit is contained in:
twinaphex 2015-11-17 23:14:59 +01:00
parent 50c00b5172
commit 73990929e5
3 changed files with 10 additions and 14 deletions

View File

@ -195,8 +195,7 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
case WM_CREATE:
if (!strcmp(video_driver, "gl"))
{
if (create_gl_context(hwnd))
g_quit = true;
create_gl_context(hwnd, &g_quit);
}
else if (!strcmp(video_driver, "d3d"))
{

View File

@ -49,7 +49,7 @@ void win32_monitor_get_info(void);
void win32_monitor_info(void *data, void *hm_data, unsigned *mon_id);
bool create_gl_context(HWND hwnd);
void create_gl_context(HWND hwnd, bool *quit);
#endif
void win32_monitor_from_window(HWND data, bool destroy);

View File

@ -100,9 +100,8 @@ static void setup_pixel_format(HDC hdc)
SetPixelFormat(hdc, ChoosePixelFormat(hdc, &pfd), &pfd);
}
bool create_gl_context(HWND hwnd)
void create_gl_context(HWND hwnd, bool *quit)
{
bool quit;
bool core_context;
const struct retro_hw_render_callback *hw_render =
(const struct retro_hw_render_callback*)video_driver_callback();
@ -139,11 +138,11 @@ bool create_gl_context(HWND hwnd)
if (!wglShareLists(g_hrc, g_hw_hrc))
{
RARCH_LOG("[WGL]: Failed to share contexts.\n");
quit = true;
*quit = true;
}
}
else
quit = true;
*quit = true;
}
}
@ -152,12 +151,12 @@ bool create_gl_context(HWND hwnd)
if (wglMakeCurrent(g_hdc, g_hrc))
g_inited = true;
else
quit = true;
*quit = true;
}
else
{
quit = true;
return true;
*quit = true;
return;
}
if (core_context || debug)
@ -205,7 +204,7 @@ bool create_gl_context(HWND hwnd)
wglDeleteContext(g_hrc);
g_hrc = context;
if (!wglMakeCurrent(g_hdc, g_hrc))
quit = true;
*quit = true;
}
else
RARCH_ERR("[WGL]: Failed to create core context. Falling back to legacy context.\n");
@ -216,15 +215,13 @@ bool create_gl_context(HWND hwnd)
if (!g_hw_hrc)
{
RARCH_ERR("[WGL]: Failed to create shared context.\n");
quit = true;
*quit = true;
}
}
}
else
RARCH_ERR("[WGL]: wglCreateContextAttribsARB not supported.\n");
}
return quit;
}
void *dinput_wgl;