mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-08 08:38:51 +00:00
improve WGPU / GLFW / Wayland story by weak linking and adjusting docs
This commit is contained in:
Vendored
+5
-4
@@ -3,11 +3,8 @@ package wgpu_glfw_glue
|
||||
import "vendor:glfw"
|
||||
import "vendor:wgpu"
|
||||
|
||||
// GLFW needs to be compiled with wayland support for this to work.
|
||||
SUPPORT_WAYLAND :: #config(WGPU_GFLW_GLUE_SUPPORT_WAYLAND, false)
|
||||
|
||||
GetSurface :: proc(instance: wgpu.Instance, window: glfw.WindowHandle) -> wgpu.Surface {
|
||||
when SUPPORT_WAYLAND {
|
||||
if glfw.GetPlatform != nil {
|
||||
if glfw.GetPlatform() == glfw.PLATFORM_WAYLAND {
|
||||
display := glfw.GetWaylandDisplay()
|
||||
surface := glfw.GetWaylandWindow(window)
|
||||
@@ -24,6 +21,10 @@ GetSurface :: proc(instance: wgpu.Instance, window: glfw.WindowHandle) -> wgpu.S
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
if glfw.GetPlatform() != glfw.PLATFORM_X11 {
|
||||
panic("wgpu glfw glue: unsupported platform, expected Wayland or X11")
|
||||
}
|
||||
}
|
||||
|
||||
display := glfw.GetX11Display()
|
||||
|
||||
Reference in New Issue
Block a user