mirror of
https://github.com/libretro/RetroArch
synced 2025-03-27 23:37:39 +00:00
Create x11_connect
This commit is contained in:
parent
95a5818ccb
commit
f364ff0649
@ -503,3 +503,19 @@ void x11_install_sighandlers(void)
|
||||
sigaction(SIGINT, &sa, NULL);
|
||||
sigaction(SIGTERM, &sa, NULL);
|
||||
}
|
||||
|
||||
bool x11_connect(void)
|
||||
{
|
||||
g_x11_quit = 0;
|
||||
|
||||
/* Keep one g_x11_dpy alive the entire process lifetime.
|
||||
* This is necessary for nVidia's EGL implementation for now. */
|
||||
if (!g_x11_dpy)
|
||||
{
|
||||
g_x11_dpy = XOpenDisplay(NULL);
|
||||
if (!g_x11_dpy)
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -79,5 +79,7 @@ bool x11_alive(void *data);
|
||||
|
||||
void x11_install_sighandlers(void);
|
||||
|
||||
bool x11_connect(void);
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -260,12 +260,7 @@ static bool gfx_ctx_glx_init(void *data)
|
||||
|
||||
XInitThreads();
|
||||
|
||||
g_x11_quit = 0;
|
||||
|
||||
if (!g_x11_dpy)
|
||||
g_x11_dpy = XOpenDisplay(NULL);
|
||||
|
||||
if (!g_x11_dpy)
|
||||
if (!x11_connect())
|
||||
goto error;
|
||||
|
||||
glXQueryVersion(g_x11_dpy, &major, &minor);
|
||||
|
@ -215,16 +215,8 @@ static bool gfx_ctx_xegl_init(void *data)
|
||||
attrib_ptr = NULL;
|
||||
}
|
||||
|
||||
g_x11_quit = 0;
|
||||
|
||||
/* Keep one g_x11_dpy alive the entire process lifetime.
|
||||
* This is necessary for nVidia's EGL implementation for now. */
|
||||
if (!g_x11_dpy)
|
||||
{
|
||||
g_x11_dpy = XOpenDisplay(NULL);
|
||||
if (!g_x11_dpy)
|
||||
goto error;
|
||||
}
|
||||
if (!x11_connect())
|
||||
goto error;
|
||||
|
||||
g_egl_dpy = eglGetDisplay((EGLNativeDisplayType)g_x11_dpy);
|
||||
if (g_egl_dpy == EGL_NO_DISPLAY)
|
||||
|
Loading…
x
Reference in New Issue
Block a user