Common: Add DRM display helper class and GBM GL context

This commit is contained in:
Connor McLaughlin
2021-01-31 02:25:05 +10:00
parent b267020d07
commit b09da307b5
15 changed files with 946 additions and 12 deletions

View File

@ -11,18 +11,21 @@ Log_SetChannel(GL::Context);
#if defined(WIN32) && !defined(_M_ARM64)
#include "context_wgl.h"
#elif defined(__APPLE__)
#elif defined(__APPLE__) && !defined(LIBERTRO)
#include "context_agl.h"
#endif
#ifdef USE_EGL
#if defined(USE_X11) || defined(USE_WAYLAND)
#if defined(USE_X11) || defined(USE_WAYLAND) || defined(USE_GBM)
#if defined(USE_X11)
#include "context_egl_x11.h"
#endif
#if defined(USE_WAYLAND)
#include "context_egl_wayland.h"
#endif
#if defined(USE_GBM)
#include "context_egl_gbm.h"
#endif
#elif defined(ANDROID)
#include "context_egl_android.h"
#else
@ -77,7 +80,7 @@ std::unique_ptr<GL::Context> Context::Create(const WindowInfo& wi, const Version
std::unique_ptr<Context> context;
#if defined(WIN32) && !defined(_M_ARM64)
context = ContextWGL::Create(wi, versions_to_try, num_versions_to_try);
#elif defined(__APPLE__)
#elif defined(__APPLE__) && !defined(LIBRETRO)
context = ContextAGL::Create(wi, versions_to_try, num_versions_to_try);
#elif defined(ANDROID)
#ifdef USE_EGL
@ -105,6 +108,11 @@ std::unique_ptr<GL::Context> Context::Create(const WindowInfo& wi, const Version
context = ContextEGLWayland::Create(wi, versions_to_try, num_versions_to_try);
#endif
#if defined(USE_GBM)
if (wi.type == WindowInfo::Type::DRM)
context = ContextEGLGBM::Create(wi, versions_to_try, num_versions_to_try);
#endif
if (!context)
return nullptr;