mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2025-06-28 09:59:41 -06:00
Allow toggling Wayland support (#1654)
This commit is contained in:
@ -15,7 +15,9 @@ Log_SetChannel(GL::Context);
|
|||||||
#elif defined(__APPLE__)
|
#elif defined(__APPLE__)
|
||||||
#include "context_agl.h"
|
#include "context_agl.h"
|
||||||
#else
|
#else
|
||||||
|
#ifdef WAYLAND_ENABLED
|
||||||
#include "context_egl_wayland.h"
|
#include "context_egl_wayland.h"
|
||||||
|
#endif
|
||||||
#include "context_egl_x11.h"
|
#include "context_egl_x11.h"
|
||||||
#include "context_glx.h"
|
#include "context_glx.h"
|
||||||
#endif
|
#endif
|
||||||
@ -80,8 +82,10 @@ std::unique_ptr<GL::Context> Context::Create(const WindowInfo& wi, const Version
|
|||||||
context = ContextGLX::Create(wi, versions_to_try, num_versions_to_try);
|
context = ContextGLX::Create(wi, versions_to_try, num_versions_to_try);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef WAYLAND_ENABLED
|
||||||
if (wi.type == WindowInfo::Type::Wayland)
|
if (wi.type == WindowInfo::Type::Wayland)
|
||||||
context = ContextEGLWayland::Create(wi, versions_to_try, num_versions_to_try);
|
context = ContextEGLWayland::Create(wi, versions_to_try, num_versions_to_try);
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!context)
|
if (!context)
|
||||||
|
@ -106,20 +106,30 @@ elseif (APPLE)
|
|||||||
../duckstation/gl/context_agl.mm
|
../duckstation/gl/context_agl.mm
|
||||||
)
|
)
|
||||||
else()
|
else()
|
||||||
|
find_package(X11 REQUIRED)
|
||||||
|
find_package(EGL REQUIRED)
|
||||||
|
|
||||||
|
option(ENABLE_WAYLAND "Enable Wayland support" ON)
|
||||||
|
|
||||||
|
if (ENABLE_WAYLAND)
|
||||||
# we only need ECM for Wayland
|
# we only need ECM for Wayland
|
||||||
# so we only require it from here
|
# so we only require it from here
|
||||||
find_package(ECM REQUIRED NO_MODULE)
|
find_package(ECM REQUIRED NO_MODULE)
|
||||||
list(APPEND CMAKE_MODULE_PATH "${ECM_MODULE_PATH}")
|
list(APPEND CMAKE_MODULE_PATH "${ECM_MODULE_PATH}")
|
||||||
|
|
||||||
find_package(X11 REQUIRED)
|
|
||||||
find_package(EGL REQUIRED)
|
|
||||||
find_package(Wayland REQUIRED Client)
|
find_package(Wayland REQUIRED Client)
|
||||||
|
|
||||||
|
target_compile_definitions(melonDS PRIVATE WAYLAND_ENABLED)
|
||||||
|
|
||||||
|
target_sources(melonDS PRIVATE
|
||||||
|
../duckstation/gl/context_egl_wayland.cpp
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
target_sources(melonDS PRIVATE
|
target_sources(melonDS PRIVATE
|
||||||
../duckstation/gl/context_egl.cpp
|
../duckstation/gl/context_egl.cpp
|
||||||
../duckstation/gl/context_egl_x11.cpp
|
../duckstation/gl/context_egl_x11.cpp
|
||||||
../duckstation/gl/context_glx.cpp
|
../duckstation/gl/context_glx.cpp
|
||||||
../duckstation/gl/context_egl_wayland.cpp
|
|
||||||
../duckstation/gl/x11_window.cpp
|
../duckstation/gl/x11_window.cpp
|
||||||
|
|
||||||
../glad/glad_egl.c
|
../glad/glad_egl.c
|
||||||
|
Reference in New Issue
Block a user