From c3665eb9abf8a426feb76c5e4d02c1b63fc7e482 Mon Sep 17 00:00:00 2001 From: Milan Nikolic Date: Tue, 27 Feb 2024 12:46:48 +0100 Subject: [PATCH] Add x11 build tag --- README.md | 1 + raylib/cgo_linux.go | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5dfaafd..d391fcd 100644 --- a/README.md +++ b/README.md @@ -61,6 +61,7 @@ It is also possible build the dll yourself. You can find more infos at [raylib's * `opengl11` - uses OpenGL 1.1 backend (pseudo OpenGL 1.1 style) * `es2` - uses OpenGL ES 2.0 backend (can be used to link against [Google's ANGLE](https://github.com/google/angle)) * `es3` - experimental support for OpenGL ES 3.0 +* `x11` - force X11 compatibility mode on Wayland ### Documentation diff --git a/raylib/cgo_linux.go b/raylib/cgo_linux.go index cfaabaf..9c8a507 100644 --- a/raylib/cgo_linux.go +++ b/raylib/cgo_linux.go @@ -34,9 +34,12 @@ GLFWbool _glfwConnectNull(int platformID, _GLFWplatform* platform) { return GLFW_TRUE; } -#cgo linux CFLAGS: -Iexternal/glfw/include -DPLATFORM_DESKTOP -D_GLFW_WAYLAND -D_GLFW_X11 -Wno-stringop-overflow +#cgo linux CFLAGS: -Iexternal/glfw/include -DPLATFORM_DESKTOP -Wno-stringop-overflow #cgo linux LDFLAGS: -lm -pthread -ldl -lrt -lwayland-client -lwayland-cursor -lwayland-egl -lxkbcommon +#cgo linux,x11 CFLAGS: -D_GLFW_X11 +#cgo linux,!x11 CFLAGS: -D_GLFW_X11 -D_GLFW_WAYLAND + #cgo linux,!es2,!es3 LDFLAGS: -lGL #cgo linux,opengl11,!es2,!es3 CFLAGS: -DGRAPHICS_API_OPENGL_11