libobs: Introduce the concept of a Unix platform

This is a Unix-specific code. The only available platforms
at this point are the X11/GLX and X11/EGL platforms.

The concept of a platform display is also introduced. Again,
the only display that is set right now is the X11 display.
This commit is contained in:
Georges Basile Stavracas Neto 2020-03-06 17:50:41 -03:00
commit 506b950d02
6 changed files with 125 additions and 5 deletions

View file

@ -58,6 +58,11 @@
#include <pthread.h>
#endif
#if !defined(_WIN32) && !defined(__APPLE__)
#include <obs-nix-platform.h>
#include <QX11Info>
#endif
#include <iostream>
#include "ui-config.h"
@ -1384,6 +1389,13 @@ bool OBSApp::OBSInit()
qRegisterMetaType<VoidFunc>();
#if !defined(_WIN32) && !defined(__APPLE__)
obs_set_nix_platform(OBS_NIX_PLATFORM_X11_GLX);
if (QApplication::platformName() == "xcb") {
obs_set_nix_platform_display(QX11Info::display());
}
#endif
if (!StartupOBS(locale.c_str(), GetProfilerNameStore()))
return false;