From ff13e730bbee91fa523ad603324640dd6dbc6929 Mon Sep 17 00:00:00 2001 From: mooz Date: Sat, 9 Mar 2019 10:53:14 +0100 Subject: [PATCH] Renamed BGFX_USE_WAYLAND to ENTRY_CONFIG_USE_WAYLAND. --- examples/common/entry/entry_glfw.cpp | 8 ++++---- examples/common/entry/entry_p.h | 4 ++++ examples/common/entry/entry_sdl.cpp | 8 ++++---- scripts/example-common.lua | 6 ++++++ scripts/genie.lua | 4 +--- src/glcontext_egl.h | 4 ---- 6 files changed, 19 insertions(+), 15 deletions(-) diff --git a/examples/common/entry/entry_glfw.cpp b/examples/common/entry/entry_glfw.cpp index fe001ed31..c78ac0570 100644 --- a/examples/common/entry/entry_glfw.cpp +++ b/examples/common/entry/entry_glfw.cpp @@ -15,7 +15,7 @@ #endif // GLFW_VERSION_MINOR < 2 #if BX_PLATFORM_LINUX || BX_PLATFORM_BSD -# if BGFX_USE_WAYLAND +# if ENTRY_CONFIG_USE_WAYLAND # include # define GLFW_EXPOSE_NATIVE_WAYLAND # else @@ -45,7 +45,7 @@ namespace entry static void* glfwNativeWindowHandle(GLFWwindow* _window) { # if BX_PLATFORM_LINUX || BX_PLATFORM_BSD -# if BGFX_USE_WAYLAND +# if ENTRY_CONFIG_USE_WAYLAND wl_egl_window *win_impl = (wl_egl_window*)glfwGetWindowUserPointer(_window); if(!win_impl) { @@ -73,7 +73,7 @@ namespace entry if(!_window) return; # if BX_PLATFORM_LINUX || BX_PLATFORM_BSD -# if BGFX_USE_WAYLAND +# if ENTRY_CONFIG_USE_WAYLAND wl_egl_window *win_impl = (wl_egl_window*)glfwGetWindowUserPointer(_window); if(win_impl) { @@ -89,7 +89,7 @@ namespace entry { bgfx::PlatformData pd; # if BX_PLATFORM_LINUX || BX_PLATFORM_BSD -# if BGFX_USE_WAYLAND +# if ENTRY_CONFIG_USE_WAYLAND pd.ndt = glfwGetWaylandDisplay(); # else pd.ndt = glfwGetX11Display(); diff --git a/examples/common/entry/entry_p.h b/examples/common/entry/entry_p.h index 765da280f..d1706d4df 100644 --- a/examples/common/entry/entry_p.h +++ b/examples/common/entry/entry_p.h @@ -25,6 +25,10 @@ # define ENTRY_CONFIG_USE_GLFW 0 #endif // ENTRY_CONFIG_USE_GLFW +#ifndef ENTRY_CONFIG_USE_WAYLAND +# define ENTRY_CONFIG_USE_WAYLAND 0 +#endif // ENTRY_CONFIG_USE_WAYLAND + #if !defined(ENTRY_CONFIG_USE_NATIVE) \ && !ENTRY_CONFIG_USE_NOOP \ && !ENTRY_CONFIG_USE_SDL \ diff --git a/examples/common/entry/entry_sdl.cpp b/examples/common/entry/entry_sdl.cpp index 7bd149525..96aa49149 100644 --- a/examples/common/entry/entry_sdl.cpp +++ b/examples/common/entry/entry_sdl.cpp @@ -8,7 +8,7 @@ #if ENTRY_CONFIG_USE_SDL #if BX_PLATFORM_LINUX || BX_PLATFORM_BSD -# if BGFX_USE_WAYLAND +# if ENTRY_CONFIG_USE_WAYLAND # include # endif #elif BX_PLATFORM_WINDOWS @@ -49,7 +49,7 @@ namespace entry } # if BX_PLATFORM_LINUX || BX_PLATFORM_BSD -# if BGFX_USE_WAYLAND +# if ENTRY_CONFIG_USE_WAYLAND wl_egl_window *win_impl = (wl_egl_window*)SDL_GetWindowData(_window, "wl_egl_window"); if(!win_impl) { @@ -85,7 +85,7 @@ namespace entry bgfx::PlatformData pd; # if BX_PLATFORM_LINUX || BX_PLATFORM_BSD -# if BGFX_USE_WAYLAND +# if ENTRY_CONFIG_USE_WAYLAND pd.ndt = wmi.info.wl.display; # else pd.ndt = wmi.info.x11.display; @@ -112,7 +112,7 @@ namespace entry if(!_window) return; # if BX_PLATFORM_LINUX || BX_PLATFORM_BSD -# if BGFX_USE_WAYLAND +# if ENTRY_CONFIG_USE_WAYLAND wl_egl_window *win_impl = (wl_egl_window*)SDL_GetWindowData(_window, "wl_egl_window"); if(win_impl) { diff --git a/scripts/example-common.lua b/scripts/example-common.lua index 3b8016792..c81e6b190 100644 --- a/scripts/example-common.lua +++ b/scripts/example-common.lua @@ -88,6 +88,12 @@ project ("example-common") } end + if _OPTIONS["with-wayland"] then + defines { + "ENTRY_CONFIG_USE_WAYLAND=1", + } + end + configuration { "linux-steamlink" } defines { "EGL_API_FB", diff --git a/scripts/genie.lua b/scripts/genie.lua index b8864f97c..ff7c78280 100644 --- a/scripts/genie.lua +++ b/scripts/genie.lua @@ -121,9 +121,7 @@ function copyLib() end if _OPTIONS["with-wayland"] then - defines { "BGFX_USE_WAYLAND=1" } -else - defines { "BGFX_USE_WAYLAND=0" } + defines { "WL_EGL_PLATFORM=1" } end if _OPTIONS["with-sdl"] then diff --git a/src/glcontext_egl.h b/src/glcontext_egl.h index c92aabbb1..245cd7ad3 100644 --- a/src/glcontext_egl.h +++ b/src/glcontext_egl.h @@ -8,10 +8,6 @@ #if BGFX_USE_EGL -#if BGFX_USE_WAYLAND -#include -#endif - #include #include #if defined(Success)