Log which SwapInterval implementation is used.

This commit is contained in:
Themaister 2013-02-24 02:08:20 +01:00
parent c2f2377f7b
commit a2f4639ed8

View File

@ -361,14 +361,22 @@ static bool gfx_ctx_set_video_mode(
g_is_double = val; g_is_double = val;
if (g_is_double) if (g_is_double)
{ {
const char *swap_func = NULL;
g_pglSwapInterval = (int (*)(int))glXGetProcAddress((const GLubyte*)"glXSwapIntervalMESA");
if (g_pglSwapInterval)
swap_func = "glXSwapIntervalMESA";
if (!g_pglSwapInterval) if (!g_pglSwapInterval)
g_pglSwapInterval = (int (*)(int))glXGetProcAddress((const GLubyte*)"glXSwapInterval"); {
if (!g_pglSwapInterval)
g_pglSwapInterval = (int (*)(int))glXGetProcAddress((const GLubyte*)"glXSwapIntervalMESA");
if (!g_pglSwapInterval)
g_pglSwapInterval = (int (*)(int))glXGetProcAddress((const GLubyte*)"glXSwapIntervalSGI"); g_pglSwapInterval = (int (*)(int))glXGetProcAddress((const GLubyte*)"glXSwapIntervalSGI");
if (g_pglSwapInterval)
swap_func = "glXSwapIntervalSGI";
}
if (!g_pglSwapInterval) if (!g_pglSwapInterval)
RARCH_WARN("[GLX]: Cannot find swap interval call.\n"); RARCH_WARN("[GLX]: Cannot find swap interval call.\n");
else
RARCH_LOG("[GLX]: Found swap function: %s.\n", swap_func);
} }
else else
RARCH_WARN("[GLX]: Context is not double buffered!.\n"); RARCH_WARN("[GLX]: Context is not double buffered!.\n");
@ -454,6 +462,7 @@ static void gfx_ctx_destroy(void)
} }
g_inited = false; g_inited = false;
g_pglSwapInterval = NULL;
} }
static void gfx_ctx_input_driver(const input_driver_t **input, void **input_data) static void gfx_ctx_input_driver(const input_driver_t **input, void **input_data)