diff options
| author | Ryan Houdek <Sonicadvance1@gmail.com> | 2016-01-30 11:15:07 -0500 |
|---|---|---|
| committer | Ryan Houdek <Sonicadvance1@gmail.com> | 2016-01-30 11:15:07 -0500 |
| commit | 31523b7e80846256a3eeb34be69ba1a0ffc8ef19 (patch) | |
| tree | 90e7ffcde198a9d38107ff44103cd44b562d70bd /Source/Core | |
| parent | 8e8e6f3234ef6bf4b0ecedd304e47ca73b702ea8 (diff) | |
| parent | 628e9bad92673c27a974649ee18c48483003347a (diff) | |
Merge pull request #3572 from Sonicadvance1/egl_support_headless
Egl support headless
Diffstat (limited to 'Source/Core')
| -rw-r--r-- | Source/Core/Common/GL/GLInterface/EGL.h | 2 | ||||
| -rw-r--r-- | Source/Core/Common/GL/GLInterface/GLInterface.cpp | 4 | ||||
| -rw-r--r-- | Source/Core/DolphinWX/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | Source/Core/DolphinWX/MainNoGUI.cpp | 16 |
4 files changed, 15 insertions, 9 deletions
diff --git a/Source/Core/Common/GL/GLInterface/EGL.h b/Source/Core/Common/GL/GLInterface/EGL.h index 570844f954..05f07aea5c 100644 --- a/Source/Core/Common/GL/GLInterface/EGL.h +++ b/Source/Core/Common/GL/GLInterface/EGL.h @@ -27,7 +27,7 @@ protected: EGLContext egl_ctx; EGLDisplay egl_dpy; - virtual EGLDisplay OpenDisplay() { return EGL_NO_DISPLAY; } + virtual EGLDisplay OpenDisplay() { return eglGetDisplay(EGL_DEFAULT_DISPLAY); } virtual EGLNativeWindowType InitializePlatform(EGLNativeWindowType host_window, EGLConfig config) { return (EGLNativeWindowType)EGL_DEFAULT_DISPLAY; } virtual void ShutdownPlatform() {} diff --git a/Source/Core/Common/GL/GLInterface/GLInterface.cpp b/Source/Core/Common/GL/GLInterface/GLInterface.cpp index b9a05fd30a..6d4345e5c1 100644 --- a/Source/Core/Common/GL/GLInterface/GLInterface.cpp +++ b/Source/Core/Common/GL/GLInterface/GLInterface.cpp @@ -18,6 +18,8 @@ #else #include "Common/GL/GLInterface/GLX.h" #endif +#elif defined(USE_EGL) && USE_EGL && defined(USE_HEADLESS) +#include "Common/GL/GLInterface/EGL.h" #else #error Platform doesnt have a GLInterface #endif @@ -30,6 +32,8 @@ std::unique_ptr<cInterfaceBase> HostGL_CreateGLInterface() return std::make_unique<cInterfaceAGL>(); #elif defined(_WIN32) return std::make_unique<cInterfaceWGL>(); + #elif defined(USE_EGL) && defined(USE_HEADLESS) + return std::make_unique<cInterfaceEGL>(); #elif defined(HAVE_X11) && HAVE_X11 #if defined(USE_EGL) && USE_EGL return std::make_unique<cInterfaceEGLX11>(); diff --git a/Source/Core/DolphinWX/CMakeLists.txt b/Source/Core/DolphinWX/CMakeLists.txt index 6cfd187380..c67834889b 100644 --- a/Source/Core/DolphinWX/CMakeLists.txt +++ b/Source/Core/DolphinWX/CMakeLists.txt @@ -194,7 +194,7 @@ if(wxWidgets_FOUND) set(CPACK_PACKAGE_EXECUTABLES ${CPACK_PACKAGE_EXECUTABLES} ${DOLPHIN_EXE}) endif() -if(USE_X11) +if(USE_X11 OR ENABLE_HEADLESS) set(DOLPHIN_NOGUI_EXE ${DOLPHIN_EXE_BASE}-nogui) add_executable(${DOLPHIN_NOGUI_EXE} ${SRCS} ${NOGUI_SRCS}) target_link_libraries(${DOLPHIN_NOGUI_EXE} ${LIBS}) diff --git a/Source/Core/DolphinWX/MainNoGUI.cpp b/Source/Core/DolphinWX/MainNoGUI.cpp index 70f099deb7..180af3ffe2 100644 --- a/Source/Core/DolphinWX/MainNoGUI.cpp +++ b/Source/Core/DolphinWX/MainNoGUI.cpp @@ -35,11 +35,11 @@ static bool running = true; class Platform { public: - virtual void Init() = 0; - virtual void SetTitle(const std::string &title) = 0; - virtual void MainLoop() = 0; - virtual void Shutdown() = 0; - virtual ~Platform() {}; + virtual void Init() {} + virtual void SetTitle(const std::string &title) {} + virtual void MainLoop() { while(running) {} } + virtual void Shutdown() {} + virtual ~Platform() {} }; static Platform* platform; @@ -54,7 +54,7 @@ void Host_Message(int Id) running = false; } -static void* s_window_handle; +static void* s_window_handle = nullptr; void* Host_GetRenderHandle() { return s_window_handle; @@ -291,7 +291,9 @@ class PlatformX11 : public Platform static Platform* GetPlatform() { -#if HAVE_X11 +#if defined(USE_EGL) && defined(USE_HEADLESS) + return new Platform(); +#elif HAVE_X11 return new PlatformX11(); #endif return nullptr; |
