Support both X11 and Wayland in the same build. (#3360)

* Support both X11 and Wayland in the same build.

 - Works for both Vulkan and OpenGL.
 - Remove --with-wayland from genie options.
 - Vulkan loads all three extensions for surface creation instead of only one.
 - Add width and height parameter to GlContext::createSwapChain(), which is needed for EGL to create
   a SwapChain with the given window size.
 - Dirty-fix the example-22-windows to recreate the FrameBuffer by first destroying and then
   recreating to make sure the window is released of its swapchain.
 - Fix dbgText glitch in example-22-windows.
 - Remove old X11-related dependencies for GLFW3.

* Formatting.
This commit is contained in:
Martijn Courteaux
2024-10-05 23:33:22 +02:00
committed by GitHub
parent 3f9fe0d34e
commit e488a07f1b
21 changed files with 224 additions and 242 deletions

View File

@@ -79,12 +79,6 @@ project ("example-common")
}
end
if _OPTIONS["with-wayland"] then
defines {
"ENTRY_CONFIG_USE_WAYLAND=1",
}
end
configuration { "android-*" }
includedirs {
path.join(BGFX_DIR, "3rdparty/native_app_glue")

View File

@@ -20,11 +20,6 @@ newoption {
description = "Enable GLFW entry.",
}
newoption {
trigger = "with-wayland",
description = "Enable Wayland support.",
}
newoption {
trigger = "with-profiler",
description = "Enable build with intrusive profiler.",
@@ -187,10 +182,6 @@ end
function copyLib()
end
if _OPTIONS["with-wayland"] then
defines { "WL_EGL_PLATFORM=1" }
end
if _OPTIONS["with-sdl"] then
if os.is("windows") then
if not os.getenv("SDL2_DIR") then
@@ -245,15 +236,6 @@ function exampleProjectDefaults()
defines { "ENTRY_CONFIG_USE_GLFW=1" }
links { "glfw3" }
configuration { "linux or freebsd" }
links {
"Xrandr",
"Xinerama",
"Xi",
"Xxf86vm",
"Xcursor",
}
configuration { "osx*" }
linkoptions {
"-framework CoreVideo",

View File

@@ -35,13 +35,6 @@ project ("geometryv")
defines { "ENTRY_CONFIG_USE_SDL=1" }
links { "SDL2" }
configuration { "linux or freebsd" }
if _OPTIONS["with-wayland"] then
links {
"wayland-egl",
}
end
configuration { "x32", "windows" }
libdirs { "$(SDL2_DIR)/lib/x86" }
@@ -55,21 +48,6 @@ project ("geometryv")
defines { "ENTRY_CONFIG_USE_GLFW=1" }
links { "glfw3" }
configuration { "linux or freebsd" }
if _OPTIONS["with-wayland"] then
links {
"wayland-egl",
}
else
links {
"Xrandr",
"Xinerama",
"Xi",
"Xxf86vm",
"Xcursor",
}
end
configuration { "osx*" }
linkoptions {
"-framework CoreVideo",

View File

@@ -35,13 +35,6 @@ project "texturev"
defines { "ENTRY_CONFIG_USE_SDL=1" }
links { "SDL2" }
configuration { "linux or freebsd" }
if _OPTIONS["with-wayland"] then
links {
"wayland-egl",
}
end
configuration { "x32", "windows" }
libdirs { "$(SDL2_DIR)/lib/x86" }
@@ -55,21 +48,6 @@ project "texturev"
defines { "ENTRY_CONFIG_USE_GLFW=1" }
links { "glfw3" }
configuration { "linux or freebsd" }
if _OPTIONS["with-wayland"] then
links {
"wayland-egl",
}
else
links {
"Xrandr",
"Xinerama",
"Xi",
"Xxf86vm",
"Xcursor",
}
end
configuration { "osx*" }
linkoptions {
"-framework CoreVideo",