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 committed 2021-02-01 19:05:10 -03:00
1 parent 510c747459
commit 506b950d02
6 files changed
+125 -5

No files matched your search

+12
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;