diff --git a/build.sh b/build.sh index f66f5a154f..38756f0156 100755 --- a/build.sh +++ b/build.sh @@ -57,7 +57,7 @@ for ARG in "$@"; do echo "** Developer option **" echo "--wx28 : Force wxWidget 2.8" echo "--glsl : Replace CG backend of ZZogl by GLSL" - echo "--egl : Replace GLX by EGL (ZZogl plugins only)" + echo "--egl : Replace GLX by EGL (ZZogl/GSdx plugins)" echo "--sdl2 : Build with SDL2 (crashes if wx is linked to SDL1.2)" echo "--cross-multilib: Build a 32bit PCSX2 on a 64bit machine using multilib." echo diff --git a/cmake/SelectPcsx2Plugins.cmake b/cmake/SelectPcsx2Plugins.cmake index 1b965f3cbc..b9c70c3256 100644 --- a/cmake/SelectPcsx2Plugins.cmake +++ b/cmake/SelectPcsx2Plugins.cmake @@ -144,7 +144,7 @@ endif() # requires: -OpenGL # -X11 #--------------------------------------- -if(OPENGL_FOUND AND X11_FOUND AND EGL_FOUND AND GTKn_FOUND) +if(OPENGL_FOUND AND X11_FOUND AND GTKn_FOUND AND (EGL_FOUND OR NOT EGL_API)) set(GSdx TRUE) elseif(NOT EXISTS "${CMAKE_SOURCE_DIR}/plugins/GSdx") set(GSdx FALSE) diff --git a/debian-packager/control b/debian-packager/control index 0b35e1a20a..9d8f37867c 100644 --- a/debian-packager/control +++ b/debian-packager/control @@ -8,7 +8,6 @@ Build-Depends: cmake (>= 2.8.5), libaio-dev, libasound2-dev, libbz2-dev, - libegl1-mesa-dev, libgl1-mesa-dev, libglew-dev, libglu1-mesa-dev, diff --git a/plugins/GSdx/CMakeLists.txt b/plugins/GSdx/CMakeLists.txt index 6a374ebded..41abfb1f2d 100644 --- a/plugins/GSdx/CMakeLists.txt +++ b/plugins/GSdx/CMakeLists.txt @@ -18,9 +18,7 @@ set(CommonFlags -Wunused-variable # __dummy variable need to be investigated ) -set(OptimizationFlags - -O2 - ) +set(OptimizationFlags -O2) if(CMAKE_BUILD_TYPE STREQUAL Debug) @@ -42,6 +40,10 @@ if(PNGPP_FOUND) set(GSdxFinalFlags ${GSdxFinalFlags} -DPNGPP_SUPPORTED) endif() +if(EGL_API AND EGL_FOUND) + set(GSdxFinalFlags ${GSdxFinalFlags} -DEGL_SUPPORTED) +endif() + #Clang doesn't support a few common flags that GCC does. if(NOT USE_CLANG) set(GSdxFinalFlags ${GSdxFinalFlags} -fabi-version=6) @@ -201,11 +203,16 @@ set(GSdxFinalLibs set(GSdxFinalLibs ${GSdxFinalLibs} ${OPENGL_LIBRARIES} - ${EGL_LIBRARIES} ${GTK2_LIBRARIES} ${LIBC_LIBRARIES} ) +if(EGL_API AND EGL_FOUND) + set(GSdxFinalLibs ${GSdxFinalLibs} + ${EGL_LIBRARIES} + ) +endif() + if(PNGPP_FOUND) set(GSdxFinalLibs ${GSdxFinalLibs} "-lpng") diff --git a/plugins/GSdx/GS.cpp b/plugins/GSdx/GS.cpp index 42fb028113..c5f46479e0 100644 --- a/plugins/GSdx/GS.cpp +++ b/plugins/GSdx/GS.cpp @@ -292,7 +292,11 @@ static int _GSopen(void** dsp, char* title, int renderer, int threads = -1) } #else wnd[0] = new GSWndOGL(); +#ifdef EGL_SUPPORTED wnd[1] = new GSWndEGL(); +#else + wnd[1] = NULL; +#endif #endif } } diff --git a/plugins/GSdx/GSWndEGL.cpp b/plugins/GSdx/GSWndEGL.cpp index be06f550e8..3e6de5ba8d 100644 --- a/plugins/GSdx/GSWndEGL.cpp +++ b/plugins/GSdx/GSWndEGL.cpp @@ -22,7 +22,7 @@ #include "stdafx.h" #include "GSWndEGL.h" -#if defined(__linux__) +#if defined(__linux__) && defined(EGL_SUPPORTED) GSWndEGL::GSWndEGL() : m_NativeWindow(0), m_NativeDisplay(NULL) diff --git a/plugins/GSdx/GSWndEGL.h b/plugins/GSdx/GSWndEGL.h index c5a2573724..17804bb726 100644 --- a/plugins/GSdx/GSWndEGL.h +++ b/plugins/GSdx/GSWndEGL.h @@ -21,30 +21,11 @@ #include "GSWnd.h" -#if defined(__linux__) +#if defined(__linux__) && defined(EGL_SUPPORTED) #include #include #include -// Need at least MESA 9.0 (plan for october/november 2012) -// So force the destiny to at least check the compilation -#ifndef EGL_KHR_create_context -#define EGL_KHR_create_context 1 -#define EGL_CONTEXT_MAJOR_VERSION_KHR EGL_CONTEXT_CLIENT_VERSION -#define EGL_CONTEXT_MINOR_VERSION_KHR 0x30FB -#define EGL_CONTEXT_FLAGS_KHR 0x30FC -#define EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR 0x30FD -#define EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_KHR 0x31BD -#define EGL_NO_RESET_NOTIFICATION_KHR 0x31BE -#define EGL_LOSE_CONTEXT_ON_RESET_KHR 0x31BF -#define EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR 0x00000001 -#define EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR 0x00000002 -#define EGL_CONTEXT_OPENGL_ROBUST_ACCESS_BIT_KHR 0x00000004 -#define EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR 0x00000001 -#define EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT_KHR 0x00000002 -#endif - - class GSWndEGL : public GSWndGL { EGLNativeWindowType m_NativeWindow;