diff --git a/Source/Core/DolphinWX/CMakeLists.txt b/Source/Core/DolphinWX/CMakeLists.txt
index 0cf9153142..6ae5be1752 100644
--- a/Source/Core/DolphinWX/CMakeLists.txt
+++ b/Source/Core/DolphinWX/CMakeLists.txt
@@ -8,10 +8,6 @@ set(LIBS core
${GTK2_LIBRARIES})
if(NOT ANDROID)
- if(USE_X11)
- set(LIBS ${LIBS} ${XRANDR_LIBRARIES})
- endif()
-
link_directories(${CMAKE_PREFIX_PATH}/lib)
else()
set(LIBS ${LIBS} png iconv)
@@ -76,31 +72,6 @@ set(WXLIBS ${wxWidgets_LIBRARIES} dl)
set(ANDROID_SRCS Android/ButtonManager.cpp
MainAndroid.cpp)
-if(USE_EGL)
- set(SRCS ${SRCS} GLInterface/EGL.cpp)
- if(ANDROID)
- set(SRCS ${SRCS} GLInterface/EGLAndroid.cpp)
- elseif(USE_X11)
- set(SRCS ${SRCS} GLInterface/EGLX11.cpp)
- endif()
-endif()
-
-if(WIN32)
- set(SRCS ${SRCS} GLInterface/WGL.cpp)
-elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
- set(SRCS ${SRCS} GLInterface/AGL.cpp)
-elseif(USE_X11)
- if (NOT USE_EGL)
- set(SRCS ${SRCS} GLInterface/GLX.cpp)
- # GLX has a hard dependency on libGL.
- # Make sure to link to it if using GLX.
- set(LIBS ${LIBS} ${OPENGL_LIBRARIES})
- endif()
- set(SRCS ${SRCS} GLInterface/X11_Util.cpp)
-endif()
-
-set(SRCS ${SRCS} GLInterface/GLInterface.cpp)
-
set(NOGUI_SRCS MainNoGUI.cpp)
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
@@ -125,8 +96,6 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
list(APPEND SRCS ${RESOURCES})
set_source_files_properties(${RESOURCES} PROPERTIES
MACOSX_PACKAGE_LOCATION Resources)
-elseif(USE_X11)
- set(SRCS ${SRCS} X11Utils.cpp)
endif()
if(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD" OR
@@ -156,7 +125,7 @@ endif()
if(ANDROID)
set(DOLPHIN_EXE main)
add_library(${DOLPHIN_EXE} SHARED ${SRCS} ${ANDROID_SRCS})
- target_link_libraries(${DOLPHIN_EXE}
+ target_link_libraries(${DOLPHIN_EXE}
log
android
"-Wl,--no-warn-mismatch"
diff --git a/Source/Core/DolphinWX/ConfigMain.h b/Source/Core/DolphinWX/ConfigMain.h
index 029a2a889a..02791a1c74 100644
--- a/Source/Core/DolphinWX/ConfigMain.h
+++ b/Source/Core/DolphinWX/ConfigMain.h
@@ -18,7 +18,7 @@
#include "Common/CommonTypes.h"
#if defined(HAVE_XRANDR) && HAVE_XRANDR
-#include "DolphinWX/X11Utils.h"
+#include "VideoBackends/OGL/GLInterface/X11Utils.h"
#endif
class wxBoxSizer;
diff --git a/Source/Core/DolphinWX/DolphinWX.vcxproj b/Source/Core/DolphinWX/DolphinWX.vcxproj
index 51026da88e..19adcf43ba 100644
--- a/Source/Core/DolphinWX/DolphinWX.vcxproj
+++ b/Source/Core/DolphinWX/DolphinWX.vcxproj
@@ -78,8 +78,6 @@
-
-
@@ -131,7 +129,6 @@
-
diff --git a/Source/Core/DolphinWX/DolphinWX.vcxproj.filters b/Source/Core/DolphinWX/DolphinWX.vcxproj.filters
index 8e46985a83..1f41f1582f 100644
--- a/Source/Core/DolphinWX/DolphinWX.vcxproj.filters
+++ b/Source/Core/DolphinWX/DolphinWX.vcxproj.filters
@@ -27,8 +27,6 @@
-
-
@@ -170,7 +168,6 @@
-
diff --git a/Source/Core/DolphinWX/Frame.cpp b/Source/Core/DolphinWX/Frame.cpp
index eb4ba24c3c..86264c8774 100644
--- a/Source/Core/DolphinWX/Frame.cpp
+++ b/Source/Core/DolphinWX/Frame.cpp
@@ -72,6 +72,23 @@ extern "C" {
int g_saveSlot = 1;
+#if defined(HAVE_X11) && HAVE_X11
+// X11Utils nastiness that's only used here
+namespace X11Utils {
+
+Window XWindowFromHandle(void *Handle)
+{
+ return GDK_WINDOW_XID(gtk_widget_get_window(GTK_WIDGET(Handle)));
+}
+
+Display *XDisplayFromHandle(void *Handle)
+{
+ return GDK_WINDOW_XDISPLAY(gtk_widget_get_window(GTK_WIDGET(Handle)));
+}
+
+}
+#endif
+
CRenderFrame::CRenderFrame(wxFrame* parent, wxWindowID id, const wxString& title,
const wxPoint& pos, const wxSize& size, long style)
: wxFrame(parent, id, title, pos, size, style)
diff --git a/Source/Core/DolphinWX/Frame.h b/Source/Core/DolphinWX/Frame.h
index 335adc6b39..65e62974ec 100644
--- a/Source/Core/DolphinWX/Frame.h
+++ b/Source/Core/DolphinWX/Frame.h
@@ -28,7 +28,7 @@
#include "InputCommon/GCPadStatus.h"
#if defined(HAVE_X11) && HAVE_X11
-#include "DolphinWX/X11Utils.h"
+#include "VideoBackends/OGL/GLInterface/X11Utils.h"
#endif
// Class declarations
diff --git a/Source/Core/DolphinWX/MainNoGUI.cpp b/Source/Core/DolphinWX/MainNoGUI.cpp
index ebe1d97c30..367353725e 100644
--- a/Source/Core/DolphinWX/MainNoGUI.cpp
+++ b/Source/Core/DolphinWX/MainNoGUI.cpp
@@ -129,7 +129,7 @@ void Host_ShowVideoConfig(void*, const std::string&, const std::string&) {}
#if HAVE_X11
#include
-#include "DolphinWX/X11Utils.h"
+#include "VideoBackends/OGL/GLInterface/X11Utils.h"
class PlatformX11 : public Platform
{
diff --git a/Source/Core/VideoBackends/OGL/CMakeLists.txt b/Source/Core/VideoBackends/OGL/CMakeLists.txt
index 431feb9d54..9aacc83773 100644
--- a/Source/Core/VideoBackends/OGL/CMakeLists.txt
+++ b/Source/Core/VideoBackends/OGL/CMakeLists.txt
@@ -14,14 +14,40 @@ set(SRCS GLExtensions/GLExtensions.cpp
TextureConverter.cpp
VertexManager.cpp)
-set(LIBS videocommon
+if(USE_EGL)
+ set(SRCS ${SRCS} GLInterface/EGL.cpp)
+ if(ANDROID)
+ set(SRCS ${SRCS} GLInterface/EGLAndroid.cpp)
+ elseif(USE_X11)
+ set(SRCS ${SRCS} GLInterface/EGLX11.cpp)
+ endif()
+endif()
+
+if(WIN32)
+ set(SRCS ${SRCS} GLInterface/WGL.cpp)
+elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
+ set(SRCS ${SRCS} GLInterface/AGL.cpp)
+elseif(USE_X11)
+ if (NOT USE_EGL)
+ set(SRCS ${SRCS} GLInterface/GLX.cpp)
+ # GLX has a hard dependency on libGL.
+ # Make sure to link to it if using GLX.
+ set(LIBS ${LIBS} ${OPENGL_LIBRARIES})
+ endif()
+ set(SRCS ${SRCS} GLInterface/X11_Util.cpp GLInterface/X11Utils.cpp)
+ set(LIBS ${LIBS} ${XRANDR_LIBRARIES})
+endif()
+
+set(SRCS ${SRCS} GLInterface/GLInterface.cpp)
+
+set(LIBS ${LIBS}
+ videocommon
SOIL
common
dl
${X11_LIBRARIES})
if(USE_EGL)
- set(LIBS ${LIBS}
- EGL)
+ set(LIBS ${LIBS} EGL)
endif()
if(wxWidgets_FOUND)
diff --git a/Source/Core/DolphinWX/GLInterface/AGL.cpp b/Source/Core/VideoBackends/OGL/GLInterface/AGL.cpp
similarity index 98%
rename from Source/Core/DolphinWX/GLInterface/AGL.cpp
rename to Source/Core/VideoBackends/OGL/GLInterface/AGL.cpp
index aa3a5a36f8..4ab1cdd565 100644
--- a/Source/Core/DolphinWX/GLInterface/AGL.cpp
+++ b/Source/Core/VideoBackends/OGL/GLInterface/AGL.cpp
@@ -2,7 +2,7 @@
// Licensed under GPLv2
// Refer to the license.txt file included.
-#include "DolphinWX/GLInterface/AGL.h"
+#include "VideoBackends/OGL/GLInterface/AGL.h"
#include "VideoCommon/RenderBase.h"
#include "VideoCommon/VertexShaderManager.h"
diff --git a/Source/Core/DolphinWX/GLInterface/AGL.h b/Source/Core/VideoBackends/OGL/GLInterface/AGL.h
similarity index 100%
rename from Source/Core/DolphinWX/GLInterface/AGL.h
rename to Source/Core/VideoBackends/OGL/GLInterface/AGL.h
diff --git a/Source/Core/DolphinWX/GLInterface/EGL.cpp b/Source/Core/VideoBackends/OGL/GLInterface/EGL.cpp
similarity index 99%
rename from Source/Core/DolphinWX/GLInterface/EGL.cpp
rename to Source/Core/VideoBackends/OGL/GLInterface/EGL.cpp
index c65759f736..0fdec471ef 100644
--- a/Source/Core/DolphinWX/GLInterface/EGL.cpp
+++ b/Source/Core/VideoBackends/OGL/GLInterface/EGL.cpp
@@ -2,8 +2,8 @@
// Licensed under GPLv2
// Refer to the license.txt file included.
-#include "DolphinWX/GLInterface/EGL.h"
#include "VideoBackends/OGL/GLInterfaceBase.h"
+#include "VideoBackends/OGL/GLInterface/EGL.h"
#include "VideoCommon/RenderBase.h"
// Show the current FPS
diff --git a/Source/Core/DolphinWX/GLInterface/EGL.h b/Source/Core/VideoBackends/OGL/GLInterface/EGL.h
similarity index 100%
rename from Source/Core/DolphinWX/GLInterface/EGL.h
rename to Source/Core/VideoBackends/OGL/GLInterface/EGL.h
diff --git a/Source/Core/DolphinWX/GLInterface/EGLAndroid.cpp b/Source/Core/VideoBackends/OGL/GLInterface/EGLAndroid.cpp
similarity index 92%
rename from Source/Core/DolphinWX/GLInterface/EGLAndroid.cpp
rename to Source/Core/VideoBackends/OGL/GLInterface/EGLAndroid.cpp
index f4989f6da4..f6c567ee6c 100644
--- a/Source/Core/DolphinWX/GLInterface/EGLAndroid.cpp
+++ b/Source/Core/VideoBackends/OGL/GLInterface/EGLAndroid.cpp
@@ -3,7 +3,7 @@
// Refer to the license.txt file included.
#include "Core/Host.h"
-#include "DolphinWX/GLInterface/EGLAndroid.h"
+#include "VideoBackends/OGL/GLInterface/EGLAndroid.h"
EGLDisplay cInterfaceEGLAndroid::OpenDisplay()
{
diff --git a/Source/Core/DolphinWX/GLInterface/EGLAndroid.h b/Source/Core/VideoBackends/OGL/GLInterface/EGLAndroid.h
similarity index 88%
rename from Source/Core/DolphinWX/GLInterface/EGLAndroid.h
rename to Source/Core/VideoBackends/OGL/GLInterface/EGLAndroid.h
index e79a5a5ec8..fe0b873759 100644
--- a/Source/Core/DolphinWX/GLInterface/EGLAndroid.h
+++ b/Source/Core/VideoBackends/OGL/GLInterface/EGLAndroid.h
@@ -4,7 +4,7 @@
#pragma once
-#include "DolphinWX/GLInterface/EGL.h"
+#include "VideoBackends/OGL/GLInterface/EGL.h"
class cInterfaceEGLAndroid : public cInterfaceEGL
{
diff --git a/Source/Core/DolphinWX/GLInterface/EGLX11.cpp b/Source/Core/VideoBackends/OGL/GLInterface/EGLX11.cpp
similarity index 95%
rename from Source/Core/DolphinWX/GLInterface/EGLX11.cpp
rename to Source/Core/VideoBackends/OGL/GLInterface/EGLX11.cpp
index ab5411604b..9b89d2fba2 100644
--- a/Source/Core/DolphinWX/GLInterface/EGLX11.cpp
+++ b/Source/Core/VideoBackends/OGL/GLInterface/EGLX11.cpp
@@ -2,7 +2,7 @@
// Licensed under GPLv2
// Refer to the license.txt file included.
-#include "DolphinWX/GLInterface/EGLX11.h"
+#include "VideoBackends/OGL/GLInterface/EGLX11.h"
EGLDisplay cInterfaceEGLX11::OpenDisplay()
{
diff --git a/Source/Core/DolphinWX/GLInterface/EGLX11.h b/Source/Core/VideoBackends/OGL/GLInterface/EGLX11.h
similarity index 81%
rename from Source/Core/DolphinWX/GLInterface/EGLX11.h
rename to Source/Core/VideoBackends/OGL/GLInterface/EGLX11.h
index be897d6b3a..f858046e0d 100644
--- a/Source/Core/DolphinWX/GLInterface/EGLX11.h
+++ b/Source/Core/VideoBackends/OGL/GLInterface/EGLX11.h
@@ -6,8 +6,8 @@
#include
-#include "DolphinWX/GLInterface/EGL.h"
-#include "DolphinWX/GLInterface/X11_Util.h"
+#include "VideoBackends/OGL/GLInterface/EGL.h"
+#include "VideoBackends/OGL/GLInterface/X11_Util.h"
class cInterfaceEGLX11 : public cInterfaceEGL
{
diff --git a/Source/Core/DolphinWX/GLInterface/GLInterface.cpp b/Source/Core/VideoBackends/OGL/GLInterface/GLInterface.cpp
similarity index 74%
rename from Source/Core/DolphinWX/GLInterface/GLInterface.cpp
rename to Source/Core/VideoBackends/OGL/GLInterface/GLInterface.cpp
index 0c8ea8673b..29af99fa41 100644
--- a/Source/Core/DolphinWX/GLInterface/GLInterface.cpp
+++ b/Source/Core/VideoBackends/OGL/GLInterface/GLInterface.cpp
@@ -5,16 +5,16 @@
#include "VideoBackends/OGL/GLInterfaceBase.h"
#ifdef ANDROID
-#include "DolphinWX/GLInterface/EGLAndroid.h"
+#include "VideoBackends/OGL/GLInterface/EGLAndroid.h"
#elif defined(__APPLE__)
-#include "DolphinWX/GLInterface/AGL.h"
+#include "VideoBackends/OGL/GLInterface/AGL.h"
#elif defined(_WIN32)
-#include "DolphinWX/GLInterface/WGL.h"
+#include "VideoBackends/OGL/GLInterface/WGL.h"
#elif HAVE_X11
#if defined(USE_EGL) && USE_EGL
-#include "DolphinWX/GLInterface/EGLX11.h"
+#include "VideoBackends/OGL/GLInterface/EGLX11.h"
#else
-#include "DolphinWX/GLInterface/GLX.h"
+#include "VideoBackends/OGL/GLInterface/GLX.h"
#endif
#else
#error Platform doesnt have a GLInterface
diff --git a/Source/Core/DolphinWX/GLInterface/GLX.cpp b/Source/Core/VideoBackends/OGL/GLInterface/GLX.cpp
similarity index 98%
rename from Source/Core/DolphinWX/GLInterface/GLX.cpp
rename to Source/Core/VideoBackends/OGL/GLInterface/GLX.cpp
index fa457eccfc..12912b0f5d 100644
--- a/Source/Core/DolphinWX/GLInterface/GLX.cpp
+++ b/Source/Core/VideoBackends/OGL/GLInterface/GLX.cpp
@@ -4,7 +4,7 @@
#include
-#include "DolphinWX/GLInterface/GLX.h"
+#include "VideoBackends/OGL/GLInterface/GLX.h"
#include "VideoCommon/RenderBase.h"
#include "VideoCommon/VideoConfig.h"
diff --git a/Source/Core/DolphinWX/GLInterface/GLX.h b/Source/Core/VideoBackends/OGL/GLInterface/GLX.h
similarity index 92%
rename from Source/Core/DolphinWX/GLInterface/GLX.h
rename to Source/Core/VideoBackends/OGL/GLInterface/GLX.h
index 0aa9c71a59..fa97efdabf 100644
--- a/Source/Core/DolphinWX/GLInterface/GLX.h
+++ b/Source/Core/VideoBackends/OGL/GLInterface/GLX.h
@@ -7,8 +7,8 @@
#include
#include
-#include "DolphinWX/GLInterface/X11_Util.h"
#include "VideoBackends/OGL/GLInterfaceBase.h"
+#include "VideoBackends/OGL/GLInterface/X11_Util.h"
class cInterfaceGLX : public cInterfaceBase
{
diff --git a/Source/Core/DolphinWX/GLInterface/WGL.cpp b/Source/Core/VideoBackends/OGL/GLInterface/WGL.cpp
similarity index 99%
rename from Source/Core/DolphinWX/GLInterface/WGL.cpp
rename to Source/Core/VideoBackends/OGL/GLInterface/WGL.cpp
index d33c5b5176..232eb7ec71 100644
--- a/Source/Core/DolphinWX/GLInterface/WGL.cpp
+++ b/Source/Core/VideoBackends/OGL/GLInterface/WGL.cpp
@@ -6,7 +6,7 @@
#include "Core/Host.h"
-#include "DolphinWX/GLInterface/WGL.h"
+#include "VideoBackends/OGL/GLInterface/WGL.h"
#include "VideoCommon/RenderBase.h"
#include "VideoCommon/VertexShaderManager.h"
diff --git a/Source/Core/DolphinWX/GLInterface/WGL.h b/Source/Core/VideoBackends/OGL/GLInterface/WGL.h
similarity index 100%
rename from Source/Core/DolphinWX/GLInterface/WGL.h
rename to Source/Core/VideoBackends/OGL/GLInterface/WGL.h
diff --git a/Source/Core/DolphinWX/X11Utils.cpp b/Source/Core/VideoBackends/OGL/GLInterface/X11Utils.cpp
similarity index 96%
rename from Source/Core/DolphinWX/X11Utils.cpp
rename to Source/Core/VideoBackends/OGL/GLInterface/X11Utils.cpp
index 924b85f0ed..7832269e27 100644
--- a/Source/Core/DolphinWX/X11Utils.cpp
+++ b/Source/Core/VideoBackends/OGL/GLInterface/X11Utils.cpp
@@ -10,7 +10,7 @@
#include "Core/ConfigManager.h"
#include "Core/Core.h"
#include "Core/CoreParameter.h"
-#include "DolphinWX/X11Utils.h"
+#include "VideoBackends/OGL/GLInterface/X11Utils.h"
extern char **environ;
@@ -41,19 +41,6 @@ void ToggleFullscreen(Display *dpy, Window win)
ERROR_LOG(VIDEO, "Failed to switch fullscreen/windowed mode.");
}
-
-#if defined(HAVE_WX) && HAVE_WX
-Window XWindowFromHandle(void *Handle)
-{
- return GDK_WINDOW_XID(gtk_widget_get_window(GTK_WIDGET(Handle)));
-}
-
-Display *XDisplayFromHandle(void *Handle)
-{
- return GDK_WINDOW_XDISPLAY(gtk_widget_get_window(GTK_WIDGET(Handle)));
-}
-#endif
-
void InhibitScreensaver(Display *dpy, Window win, bool suspend)
{
char id[11];
diff --git a/Source/Core/DolphinWX/X11Utils.h b/Source/Core/VideoBackends/OGL/GLInterface/X11Utils.h
similarity index 100%
rename from Source/Core/DolphinWX/X11Utils.h
rename to Source/Core/VideoBackends/OGL/GLInterface/X11Utils.h
diff --git a/Source/Core/DolphinWX/GLInterface/X11_Util.cpp b/Source/Core/VideoBackends/OGL/GLInterface/X11_Util.cpp
similarity index 96%
rename from Source/Core/DolphinWX/GLInterface/X11_Util.cpp
rename to Source/Core/VideoBackends/OGL/GLInterface/X11_Util.cpp
index e2f2bbadd6..ffc48550bb 100644
--- a/Source/Core/DolphinWX/GLInterface/X11_Util.cpp
+++ b/Source/Core/VideoBackends/OGL/GLInterface/X11_Util.cpp
@@ -4,8 +4,8 @@
#include "Common/Thread.h"
#include "Core/Host.h"
-#include "DolphinWX/GLInterface/X11_Util.h"
#include "VideoBackends/OGL/GLInterfaceBase.h"
+#include "VideoBackends/OGL/GLInterface/X11_Util.h"
#include "VideoCommon/VideoConfig.h"
void cX11Window::Initialize(Display *_dpy)
diff --git a/Source/Core/DolphinWX/GLInterface/X11_Util.h b/Source/Core/VideoBackends/OGL/GLInterface/X11_Util.h
similarity index 100%
rename from Source/Core/DolphinWX/GLInterface/X11_Util.h
rename to Source/Core/VideoBackends/OGL/GLInterface/X11_Util.h
diff --git a/Source/Core/VideoBackends/OGL/OGL.vcxproj b/Source/Core/VideoBackends/OGL/OGL.vcxproj
index d770fbfa05..b0318b243a 100644
--- a/Source/Core/VideoBackends/OGL/OGL.vcxproj
+++ b/Source/Core/VideoBackends/OGL/OGL.vcxproj
@@ -37,6 +37,8 @@
+
+
@@ -80,6 +82,7 @@
+
diff --git a/Source/Core/VideoBackends/OGL/OGL.vcxproj.filters b/Source/Core/VideoBackends/OGL/OGL.vcxproj.filters
index ad9ec897d5..901f30f9f6 100644
--- a/Source/Core/VideoBackends/OGL/OGL.vcxproj.filters
+++ b/Source/Core/VideoBackends/OGL/OGL.vcxproj.filters
@@ -16,6 +16,9 @@
{4366f285-ded5-48c9-9464-03fb46174526}
+
+ {1734a626-f6e2-41b1-8753-43447bed39af}
+
@@ -59,6 +62,12 @@
GLExtensions
+
+ GLInterface
+
+
+ GLInterface
+
@@ -178,6 +187,9 @@
GLExtensions
+
+ GLInterface
+