improve WGPU / GLFW / Wayland story by weak linking and adjusting docs

This commit is contained in:
Laytan
2024-07-18 19:28:15 +02:00
parent 0bb4cc6ce5
commit 7134015f56
4 changed files with 25 additions and 7 deletions
+5
View File
@@ -197,7 +197,12 @@ foreign glfw {
SetErrorCallback :: proc(cbfun: ErrorProc) -> ErrorProc ---
// Functions added in 3.4, Linux links against system glfw so we define these as weak to be able
// to check at runtime if they are available.
@(linkage="weak")
GetPlatform :: proc() -> c.int ---
@(linkage="weak")
PlatformSupported :: proc(platform: c.int) -> b32 ---
}
+6
View File
@@ -13,7 +13,13 @@ foreign {
SetX11SelectionString :: proc(string: cstring) ---
GetX11SelectionString :: proc() -> cstring ---
// Functions added in 3.4, Linux links against system glfw so we define these as weak to be able
// to check at runtime if they are available.
@(linkage="weak")
GetWaylandDisplay :: proc() -> rawptr /* struct wl_display* */ ---
@(linkage="weak")
GetWaylandWindow :: proc(window: WindowHandle) -> rawptr /* struct wl_surface* */ ---
@(linkage="weak")
GetWaylandMonitor :: proc(monitor: MonitorHandle) -> rawptr /* struct wl_output* */ ---
}