Move GLInterface to the OGL VideoBackend's directory.

This commit is contained in:
Augustin Cavalier 2014-11-01 10:33:02 -04:00
parent 089e32ba7d
commit 29593d403b
27 changed files with 82 additions and 74 deletions

View File

@ -8,10 +8,6 @@ set(LIBS core
${GTK2_LIBRARIES}) ${GTK2_LIBRARIES})
if(NOT ANDROID) if(NOT ANDROID)
if(USE_X11)
set(LIBS ${LIBS} ${XRANDR_LIBRARIES})
endif()
link_directories(${CMAKE_PREFIX_PATH}/lib) link_directories(${CMAKE_PREFIX_PATH}/lib)
else() else()
set(LIBS ${LIBS} png iconv) set(LIBS ${LIBS} png iconv)
@ -76,31 +72,6 @@ set(WXLIBS ${wxWidgets_LIBRARIES} dl)
set(ANDROID_SRCS Android/ButtonManager.cpp set(ANDROID_SRCS Android/ButtonManager.cpp
MainAndroid.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) set(NOGUI_SRCS MainNoGUI.cpp)
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
@ -125,8 +96,6 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
list(APPEND SRCS ${RESOURCES}) list(APPEND SRCS ${RESOURCES})
set_source_files_properties(${RESOURCES} PROPERTIES set_source_files_properties(${RESOURCES} PROPERTIES
MACOSX_PACKAGE_LOCATION Resources) MACOSX_PACKAGE_LOCATION Resources)
elseif(USE_X11)
set(SRCS ${SRCS} X11Utils.cpp)
endif() endif()
if(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD" OR if(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD" OR

View File

@ -18,7 +18,7 @@
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#if defined(HAVE_XRANDR) && HAVE_XRANDR #if defined(HAVE_XRANDR) && HAVE_XRANDR
#include "DolphinWX/X11Utils.h" #include "VideoBackends/OGL/GLInterface/X11Utils.h"
#endif #endif
class wxBoxSizer; class wxBoxSizer;

View File

@ -78,8 +78,6 @@
<ClCompile Include="FrameAui.cpp" /> <ClCompile Include="FrameAui.cpp" />
<ClCompile Include="FrameTools.cpp" /> <ClCompile Include="FrameTools.cpp" />
<ClCompile Include="GameListCtrl.cpp" /> <ClCompile Include="GameListCtrl.cpp" />
<ClCompile Include="GLInterface\GLInterface.cpp" />
<ClCompile Include="GLInterface\WGL.cpp" />
<ClCompile Include="HotkeyDlg.cpp" /> <ClCompile Include="HotkeyDlg.cpp" />
<ClCompile Include="InputConfigDiag.cpp" /> <ClCompile Include="InputConfigDiag.cpp" />
<ClCompile Include="InputConfigDiagBitmaps.cpp" /> <ClCompile Include="InputConfigDiagBitmaps.cpp" />
@ -131,7 +129,6 @@
<ClInclude Include="FifoPlayerDlg.h" /> <ClInclude Include="FifoPlayerDlg.h" />
<ClInclude Include="Frame.h" /> <ClInclude Include="Frame.h" />
<ClInclude Include="GameListCtrl.h" /> <ClInclude Include="GameListCtrl.h" />
<ClInclude Include="GLInterface\WGL.h" />
<ClInclude Include="Globals.h" /> <ClInclude Include="Globals.h" />
<ClInclude Include="HotkeyDlg.h" /> <ClInclude Include="HotkeyDlg.h" />
<ClInclude Include="InputConfigDiag.h" /> <ClInclude Include="InputConfigDiag.h" />

View File

@ -27,8 +27,6 @@
</Filter> </Filter>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClCompile Include="GLInterface\GLInterface.cpp" />
<ClCompile Include="GLInterface\WGL.cpp" />
<ClCompile Include="Main.cpp" /> <ClCompile Include="Main.cpp" />
<ClCompile Include="MainNoGUI.cpp" /> <ClCompile Include="MainNoGUI.cpp" />
<ClCompile Include="WXInputBase.cpp" /> <ClCompile Include="WXInputBase.cpp" />
@ -170,7 +168,6 @@
</ClCompile> </ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="GLInterface\WGL.h" />
<ClInclude Include="Main.h" /> <ClInclude Include="Main.h" />
<ClInclude Include="WXInputBase.h" /> <ClInclude Include="WXInputBase.h" />
<ClInclude Include="WxUtils.h" /> <ClInclude Include="WxUtils.h" />

View File

@ -72,6 +72,23 @@ extern "C" {
int g_saveSlot = 1; 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, CRenderFrame::CRenderFrame(wxFrame* parent, wxWindowID id, const wxString& title,
const wxPoint& pos, const wxSize& size, long style) const wxPoint& pos, const wxSize& size, long style)
: wxFrame(parent, id, title, pos, size, style) : wxFrame(parent, id, title, pos, size, style)

View File

@ -28,7 +28,7 @@
#include "InputCommon/GCPadStatus.h" #include "InputCommon/GCPadStatus.h"
#if defined(HAVE_X11) && HAVE_X11 #if defined(HAVE_X11) && HAVE_X11
#include "DolphinWX/X11Utils.h" #include "VideoBackends/OGL/GLInterface/X11Utils.h"
#endif #endif
// Class declarations // Class declarations

View File

@ -129,7 +129,7 @@ void Host_ShowVideoConfig(void*, const std::string&, const std::string&) {}
#if HAVE_X11 #if HAVE_X11
#include <X11/keysym.h> #include <X11/keysym.h>
#include "DolphinWX/X11Utils.h" #include "VideoBackends/OGL/GLInterface/X11Utils.h"
class PlatformX11 : public Platform class PlatformX11 : public Platform
{ {

View File

@ -14,14 +14,40 @@ set(SRCS GLExtensions/GLExtensions.cpp
TextureConverter.cpp TextureConverter.cpp
VertexManager.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 SOIL
common common
dl dl
${X11_LIBRARIES}) ${X11_LIBRARIES})
if(USE_EGL) if(USE_EGL)
set(LIBS ${LIBS} set(LIBS ${LIBS} EGL)
EGL)
endif() endif()
if(wxWidgets_FOUND) if(wxWidgets_FOUND)

View File

@ -2,7 +2,7 @@
// Licensed under GPLv2 // Licensed under GPLv2
// Refer to the license.txt file included. // Refer to the license.txt file included.
#include "DolphinWX/GLInterface/AGL.h" #include "VideoBackends/OGL/GLInterface/AGL.h"
#include "VideoCommon/RenderBase.h" #include "VideoCommon/RenderBase.h"
#include "VideoCommon/VertexShaderManager.h" #include "VideoCommon/VertexShaderManager.h"

View File

@ -2,8 +2,8 @@
// Licensed under GPLv2 // Licensed under GPLv2
// Refer to the license.txt file included. // Refer to the license.txt file included.
#include "DolphinWX/GLInterface/EGL.h"
#include "VideoBackends/OGL/GLInterfaceBase.h" #include "VideoBackends/OGL/GLInterfaceBase.h"
#include "VideoBackends/OGL/GLInterface/EGL.h"
#include "VideoCommon/RenderBase.h" #include "VideoCommon/RenderBase.h"
// Show the current FPS // Show the current FPS

View File

@ -3,7 +3,7 @@
// Refer to the license.txt file included. // Refer to the license.txt file included.
#include "Core/Host.h" #include "Core/Host.h"
#include "DolphinWX/GLInterface/EGLAndroid.h" #include "VideoBackends/OGL/GLInterface/EGLAndroid.h"
EGLDisplay cInterfaceEGLAndroid::OpenDisplay() EGLDisplay cInterfaceEGLAndroid::OpenDisplay()
{ {

View File

@ -4,7 +4,7 @@
#pragma once #pragma once
#include "DolphinWX/GLInterface/EGL.h" #include "VideoBackends/OGL/GLInterface/EGL.h"
class cInterfaceEGLAndroid : public cInterfaceEGL class cInterfaceEGLAndroid : public cInterfaceEGL
{ {

View File

@ -2,7 +2,7 @@
// Licensed under GPLv2 // Licensed under GPLv2
// Refer to the license.txt file included. // Refer to the license.txt file included.
#include "DolphinWX/GLInterface/EGLX11.h" #include "VideoBackends/OGL/GLInterface/EGLX11.h"
EGLDisplay cInterfaceEGLX11::OpenDisplay() EGLDisplay cInterfaceEGLX11::OpenDisplay()
{ {

View File

@ -6,8 +6,8 @@
#include <X11/Xlib.h> #include <X11/Xlib.h>
#include "DolphinWX/GLInterface/EGL.h" #include "VideoBackends/OGL/GLInterface/EGL.h"
#include "DolphinWX/GLInterface/X11_Util.h" #include "VideoBackends/OGL/GLInterface/X11_Util.h"
class cInterfaceEGLX11 : public cInterfaceEGL class cInterfaceEGLX11 : public cInterfaceEGL
{ {

View File

@ -5,16 +5,16 @@
#include "VideoBackends/OGL/GLInterfaceBase.h" #include "VideoBackends/OGL/GLInterfaceBase.h"
#ifdef ANDROID #ifdef ANDROID
#include "DolphinWX/GLInterface/EGLAndroid.h" #include "VideoBackends/OGL/GLInterface/EGLAndroid.h"
#elif defined(__APPLE__) #elif defined(__APPLE__)
#include "DolphinWX/GLInterface/AGL.h" #include "VideoBackends/OGL/GLInterface/AGL.h"
#elif defined(_WIN32) #elif defined(_WIN32)
#include "DolphinWX/GLInterface/WGL.h" #include "VideoBackends/OGL/GLInterface/WGL.h"
#elif HAVE_X11 #elif HAVE_X11
#if defined(USE_EGL) && USE_EGL #if defined(USE_EGL) && USE_EGL
#include "DolphinWX/GLInterface/EGLX11.h" #include "VideoBackends/OGL/GLInterface/EGLX11.h"
#else #else
#include "DolphinWX/GLInterface/GLX.h" #include "VideoBackends/OGL/GLInterface/GLX.h"
#endif #endif
#else #else
#error Platform doesnt have a GLInterface #error Platform doesnt have a GLInterface

View File

@ -4,7 +4,7 @@
#include <string> #include <string>
#include "DolphinWX/GLInterface/GLX.h" #include "VideoBackends/OGL/GLInterface/GLX.h"
#include "VideoCommon/RenderBase.h" #include "VideoCommon/RenderBase.h"
#include "VideoCommon/VideoConfig.h" #include "VideoCommon/VideoConfig.h"

View File

@ -7,8 +7,8 @@
#include <string> #include <string>
#include <GL/glx.h> #include <GL/glx.h>
#include "DolphinWX/GLInterface/X11_Util.h"
#include "VideoBackends/OGL/GLInterfaceBase.h" #include "VideoBackends/OGL/GLInterfaceBase.h"
#include "VideoBackends/OGL/GLInterface/X11_Util.h"
class cInterfaceGLX : public cInterfaceBase class cInterfaceGLX : public cInterfaceBase
{ {

View File

@ -6,7 +6,7 @@
#include "Core/Host.h" #include "Core/Host.h"
#include "DolphinWX/GLInterface/WGL.h" #include "VideoBackends/OGL/GLInterface/WGL.h"
#include "VideoCommon/RenderBase.h" #include "VideoCommon/RenderBase.h"
#include "VideoCommon/VertexShaderManager.h" #include "VideoCommon/VertexShaderManager.h"

View File

@ -10,7 +10,7 @@
#include "Core/ConfigManager.h" #include "Core/ConfigManager.h"
#include "Core/Core.h" #include "Core/Core.h"
#include "Core/CoreParameter.h" #include "Core/CoreParameter.h"
#include "DolphinWX/X11Utils.h" #include "VideoBackends/OGL/GLInterface/X11Utils.h"
extern char **environ; extern char **environ;
@ -41,19 +41,6 @@ void ToggleFullscreen(Display *dpy, Window win)
ERROR_LOG(VIDEO, "Failed to switch fullscreen/windowed mode."); 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) void InhibitScreensaver(Display *dpy, Window win, bool suspend)
{ {
char id[11]; char id[11];

View File

@ -4,8 +4,8 @@
#include "Common/Thread.h" #include "Common/Thread.h"
#include "Core/Host.h" #include "Core/Host.h"
#include "DolphinWX/GLInterface/X11_Util.h"
#include "VideoBackends/OGL/GLInterfaceBase.h" #include "VideoBackends/OGL/GLInterfaceBase.h"
#include "VideoBackends/OGL/GLInterface/X11_Util.h"
#include "VideoCommon/VideoConfig.h" #include "VideoCommon/VideoConfig.h"
void cX11Window::Initialize(Display *_dpy) void cX11Window::Initialize(Display *_dpy)

View File

@ -37,6 +37,8 @@
<ItemGroup> <ItemGroup>
<ClCompile Include="FramebufferManager.cpp" /> <ClCompile Include="FramebufferManager.cpp" />
<ClCompile Include="GLExtensions\GLExtensions.cpp" /> <ClCompile Include="GLExtensions\GLExtensions.cpp" />
<ClCompile Include="GLInterface\GLInterface.cpp" />
<ClCompile Include="GLInterface\WGL.cpp" />
<ClCompile Include="GLUtil.cpp" /> <ClCompile Include="GLUtil.cpp" />
<ClCompile Include="main.cpp" /> <ClCompile Include="main.cpp" />
<ClCompile Include="NativeVertexFormat.cpp" /> <ClCompile Include="NativeVertexFormat.cpp" />
@ -80,6 +82,7 @@
<ClInclude Include="GLExtensions\gl_common.h" /> <ClInclude Include="GLExtensions\gl_common.h" />
<ClInclude Include="GLExtensions\KHR_debug.h" /> <ClInclude Include="GLExtensions\KHR_debug.h" />
<ClInclude Include="GLExtensions\NV_primitive_restart.h" /> <ClInclude Include="GLExtensions\NV_primitive_restart.h" />
<ClInclude Include="GLInterface\WGL.h" />
<ClInclude Include="GLUtil.h" /> <ClInclude Include="GLUtil.h" />
<ClInclude Include="main.h" /> <ClInclude Include="main.h" />
<ClInclude Include="PerfQuery.h" /> <ClInclude Include="PerfQuery.h" />

View File

@ -16,6 +16,9 @@
<Filter Include="GLExtensions"> <Filter Include="GLExtensions">
<UniqueIdentifier>{4366f285-ded5-48c9-9464-03fb46174526}</UniqueIdentifier> <UniqueIdentifier>{4366f285-ded5-48c9-9464-03fb46174526}</UniqueIdentifier>
</Filter> </Filter>
<Filter Include="GLInterface">
<UniqueIdentifier>{1734a626-f6e2-41b1-8753-43447bed39af}</UniqueIdentifier>
</Filter>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClCompile Include="NativeVertexFormat.cpp"> <ClCompile Include="NativeVertexFormat.cpp">
@ -59,6 +62,12 @@
<ClCompile Include="GLExtensions\GLExtensions.cpp"> <ClCompile Include="GLExtensions\GLExtensions.cpp">
<Filter>GLExtensions</Filter> <Filter>GLExtensions</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="GLInterface\GLInterface.cpp">
<Filter>GLInterface</Filter>
</ClCompile>
<ClCompile Include="GLInterface\WGL.cpp">
<Filter>GLInterface</Filter>
</ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="VertexManager.h"> <ClInclude Include="VertexManager.h">
@ -178,6 +187,9 @@
<ClInclude Include="GLExtensions\KHR_debug.h"> <ClInclude Include="GLExtensions\KHR_debug.h">
<Filter>GLExtensions</Filter> <Filter>GLExtensions</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="GLInterface\WGL.h">
<Filter>GLInterface</Filter>
</ClInclude>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Text Include="CMakeLists.txt" /> <Text Include="CMakeLists.txt" />