From 9c25099579df2c5b7053ab1daf524987bdf40eb9 Mon Sep 17 00:00:00 2001 From: Chris Warren-Smith Date: Wed, 3 Dec 2025 20:29:24 +1030 Subject: [PATCH 1/9] Build settings for inclusion in flatpak build --- configure.ac | 2 +- raylib/Makefile.am | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index a9f12a5..f3a23f0 100644 --- a/configure.ac +++ b/configure.ac @@ -70,7 +70,7 @@ case "${host_os}" in WEBSOCKET_LDFLAGS="" GTK_SERVER_LDFLAGS="`pkg-config --libs gtk+-3.0` -lXm -lXt" GTK_SERVER_CPPFLAGS="`pkg-config --cflags gtk+-3.0` -DGTK_SERVER_FFI -DGTK_SERVER_LIBRARY -DGTK_SERVER_UNIX -DGTK_SERVER_GTK3x" - RAYLIB_LDFLAGS="-lGL -lm -lpthread -ldl -lrt -lX11" + RAYLIB_LDFLAGS="-lGL -lm -lpthread -ldl -lrt -lX11 -lwayland-client -lwayland-cursor -lwayland-egl -lxkbcommon" JVM_CPPFLAGS="-I/usr/lib/jvm/java-1.8.0-openjdk-amd64/include -I/usr/lib/jvm/java-1.8.0-openjdk-amd64/include/linux" JVM_LDFLAGS="-L/usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/amd64/server -ljvm" NUKLEAR_CPPFLAGS="-D_GLFW_X11=1" diff --git a/raylib/Makefile.am b/raylib/Makefile.am index 60b17a4..875d5dc 100644 --- a/raylib/Makefile.am +++ b/raylib/Makefile.am @@ -25,8 +25,9 @@ gen: $(generated) README.md AM_CXXFLAGS=-fno-rtti -std=c++14 -fpermissive AM_CPPFLAGS = -Iraylib/src -Iraylib/src/external/glfw/include -Iraylib/src/external/glfw/deps/mingw \ + -Iraylib/src/external/glfw/src \ -DPLATFORM_DESKTOP=1 -DSUPPORT_BUSY_WAIT_LOOP=1 -DSUPPORT_SCREEN_CAPTURE=1 \ - -DSUPPORT_GIF_RECORDING=1 -DSUPPORT_COMPRESSION_API=1 -D_GLFW_BUILD_DLL=1 \ + -DSUPPORT_GIF_RECORDING=1 -DSUPPORT_COMPRESSION_API=1 -D_GLFW_WAYLAND=1 \ -Wall -Wextra -Wshadow -Wdouble-promotion -Wno-unused-parameter -fPIC lib_LTLIBRARIES = libraylib.la From e8500cfe9582b61b5c2cbe43af7a26361b0b2ae7 Mon Sep 17 00:00:00 2001 From: Chris Warren-Smith Date: Fri, 2 Jan 2026 08:25:40 +1030 Subject: [PATCH 2/9] RAYLIB: build with SDL3 platform backend --- configure.ac | 11 ++++++++++- raylib/Makefile.am | 8 +++----- raylib/main.cpp | 18 +++++++----------- 3 files changed, 20 insertions(+), 17 deletions(-) diff --git a/configure.ac b/configure.ac index f3a23f0..ed3c8a5 100644 --- a/configure.ac +++ b/configure.ac @@ -48,6 +48,13 @@ AC_ARG_WITH(ioio, [IOIO="yes"], [IOIO="no"]) +dnl configure SDL3 for raylib +PKG_CHECK_MODULES([SDL3], [sdl3]) +AC_MSG_CHECKING([for SDL3 library linking]) +SDL3_LIBS=`pkg-config sdl3 --libs --static` +SDL3_CFLAGS=`pkg-config sdl3 --cflags` +SDL3_INCLUDE=-I`pkg-config --variable=includedir sdl3`/SDL3 + case "${host_os}" in *mingw* | *msys*) AC_DEFINE(_WIN32, 1, [building for win32]) @@ -70,7 +77,8 @@ case "${host_os}" in WEBSOCKET_LDFLAGS="" GTK_SERVER_LDFLAGS="`pkg-config --libs gtk+-3.0` -lXm -lXt" GTK_SERVER_CPPFLAGS="`pkg-config --cflags gtk+-3.0` -DGTK_SERVER_FFI -DGTK_SERVER_LIBRARY -DGTK_SERVER_UNIX -DGTK_SERVER_GTK3x" - RAYLIB_LDFLAGS="-lGL -lm -lpthread -ldl -lrt -lX11 -lwayland-client -lwayland-cursor -lwayland-egl -lxkbcommon" + RAYLIB_CPPFLAGS="${SDL3_INCLUDE} ${SDL3_CFLAGS}" + RAYLIB_LDFLAGS="${SDL3_LIBS}" JVM_CPPFLAGS="-I/usr/lib/jvm/java-1.8.0-openjdk-amd64/include -I/usr/lib/jvm/java-1.8.0-openjdk-amd64/include/linux" JVM_LDFLAGS="-L/usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/amd64/server -ljvm" NUKLEAR_CPPFLAGS="-D_GLFW_X11=1" @@ -79,6 +87,7 @@ esac AC_SUBST(DEBUG_LDFLAGS) AC_SUBST(CLIPBOARD_LDFLAGS) AC_SUBST(RAYLIB_LDFLAGS) +AC_SUBST(RAYLIB_CPPFLAGS) AC_SUBST(NUKLEAR_LDFLAGS) AC_SUBST(WEBSOCKET_LDFLAGS) AC_SUBST(PLATFORM_LDFLAGS) diff --git a/raylib/Makefile.am b/raylib/Makefile.am index 875d5dc..ab155c1 100644 --- a/raylib/Makefile.am +++ b/raylib/Makefile.am @@ -24,16 +24,14 @@ $(generated): raylib/parser/raylib_api.json mkraylib.bas gen: $(generated) README.md AM_CXXFLAGS=-fno-rtti -std=c++14 -fpermissive -AM_CPPFLAGS = -Iraylib/src -Iraylib/src/external/glfw/include -Iraylib/src/external/glfw/deps/mingw \ - -Iraylib/src/external/glfw/src \ - -DPLATFORM_DESKTOP=1 -DSUPPORT_BUSY_WAIT_LOOP=1 -DSUPPORT_SCREEN_CAPTURE=1 \ - -DSUPPORT_GIF_RECORDING=1 -DSUPPORT_COMPRESSION_API=1 -D_GLFW_WAYLAND=1 \ +AM_CPPFLAGS = -Iraylib/src @RAYLIB_CPPFLAGS@ \ + -DPLATFORM_DESKTOP_SDL=1 -DPLATFORM_DESKTOP_SDL3=1 -DSUPPORT_BUSY_WAIT_LOOP=1 -DSUPPORT_SCREEN_CAPTURE=1 \ + -DSUPPORT_GIF_RECORDING=1 -DSUPPORT_COMPRESSION_API=1 \ -Wall -Wextra -Wshadow -Wdouble-promotion -Wno-unused-parameter -fPIC lib_LTLIBRARIES = libraylib.la libraylib_la_SOURCES = \ - raylib/src/rglfw.c \ raylib/src/rmodels.c \ raylib/src/raudio.c \ raylib/src/rcore.c \ diff --git a/raylib/main.cpp b/raylib/main.cpp index 8bed447..4d8a576 100644 --- a/raylib/main.cpp +++ b/raylib/main.cpp @@ -24,10 +24,10 @@ #pragma GCC diagnostic pop #pragma GCC diagnostic pop #include -#include #include #include "robin-hood-hashing/src/include/robin_hood.h" +#include "SDL_events.h" #include "include/var.h" #include "include/module.h" #include "include/param.h" @@ -1377,18 +1377,15 @@ static int cmd_guiunlock(int argc, slib_par_t *params, var_t *retval) { return 1; } -static int cmd_poll_events(int argc, slib_par_t *params, var_t *retval) { - glfwPollEvents(); - return 1; -} - static int cmd_wait_events(int argc, slib_par_t *params, var_t *retval) { - float waitMillis = get_param_int(argc, params, 0, -1); - if (waitMillis > 0) { - glfwWaitEventsTimeout(waitMillis / 1000); + auto timeoutMS = get_param_int(argc, params, 0, -1); + SDL_Event event; + if (timeoutMS > 0) { + SDL_WaitEventTimeout(&event, timeoutMS); } else { - glfwWaitEvents(); + SDL_WaitEvent(&event); } + SDL_PushEvent(&event); return 1; } @@ -1835,7 +1832,6 @@ static FUNC_SIG lib_proc[] = { {3, 3, "GUISETSTYLE", cmd_guisetstyle}, {2, 2, "GUISTATUSBAR", cmd_guistatusbar}, {0, 0, "GUIUNLOCK", cmd_guiunlock}, - {0, 0, "POLLEVENTS", cmd_poll_events}, {0, 1, "WAITEVENTS", cmd_wait_events}, {0, 0, "CLOSEPHYSICS", cmd_closephysics}, {1, 1, "DESTROYPHYSICSBODY", cmd_destroyphysicsbody}, From 4a59ea1621021ef6ee6748f8ecb2ca54df64ef82 Mon Sep 17 00:00:00 2001 From: Chris Warren-Smith Date: Fri, 2 Jan 2026 13:00:55 +1030 Subject: [PATCH 3/9] RAYLIB: add missing include for flatpak build --- raylib/main.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/raylib/main.cpp b/raylib/main.cpp index 4d8a576..ebc1759 100644 --- a/raylib/main.cpp +++ b/raylib/main.cpp @@ -25,6 +25,7 @@ #pragma GCC diagnostic pop #include #include +#include #include "robin-hood-hashing/src/include/robin_hood.h" #include "SDL_events.h" From c5ace4e9ed22c459ea259df6036a021a0e823440 Mon Sep 17 00:00:00 2001 From: Chris Warren-Smith Date: Mon, 5 Jan 2026 09:11:25 +1030 Subject: [PATCH 4/9] Revert "RAYLIB: build with SDL3 platform backend" This reverts commit e8500cfe9582b61b5c2cbe43af7a26361b0b2ae7. Switching to SDL from libgl doesn't completely solve running from the IDE --- configure.ac | 11 +---------- raylib/Makefile.am | 8 +++++--- raylib/main.cpp | 18 +++++++++++------- 3 files changed, 17 insertions(+), 20 deletions(-) diff --git a/configure.ac b/configure.ac index ed3c8a5..f3a23f0 100644 --- a/configure.ac +++ b/configure.ac @@ -48,13 +48,6 @@ AC_ARG_WITH(ioio, [IOIO="yes"], [IOIO="no"]) -dnl configure SDL3 for raylib -PKG_CHECK_MODULES([SDL3], [sdl3]) -AC_MSG_CHECKING([for SDL3 library linking]) -SDL3_LIBS=`pkg-config sdl3 --libs --static` -SDL3_CFLAGS=`pkg-config sdl3 --cflags` -SDL3_INCLUDE=-I`pkg-config --variable=includedir sdl3`/SDL3 - case "${host_os}" in *mingw* | *msys*) AC_DEFINE(_WIN32, 1, [building for win32]) @@ -77,8 +70,7 @@ case "${host_os}" in WEBSOCKET_LDFLAGS="" GTK_SERVER_LDFLAGS="`pkg-config --libs gtk+-3.0` -lXm -lXt" GTK_SERVER_CPPFLAGS="`pkg-config --cflags gtk+-3.0` -DGTK_SERVER_FFI -DGTK_SERVER_LIBRARY -DGTK_SERVER_UNIX -DGTK_SERVER_GTK3x" - RAYLIB_CPPFLAGS="${SDL3_INCLUDE} ${SDL3_CFLAGS}" - RAYLIB_LDFLAGS="${SDL3_LIBS}" + RAYLIB_LDFLAGS="-lGL -lm -lpthread -ldl -lrt -lX11 -lwayland-client -lwayland-cursor -lwayland-egl -lxkbcommon" JVM_CPPFLAGS="-I/usr/lib/jvm/java-1.8.0-openjdk-amd64/include -I/usr/lib/jvm/java-1.8.0-openjdk-amd64/include/linux" JVM_LDFLAGS="-L/usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/amd64/server -ljvm" NUKLEAR_CPPFLAGS="-D_GLFW_X11=1" @@ -87,7 +79,6 @@ esac AC_SUBST(DEBUG_LDFLAGS) AC_SUBST(CLIPBOARD_LDFLAGS) AC_SUBST(RAYLIB_LDFLAGS) -AC_SUBST(RAYLIB_CPPFLAGS) AC_SUBST(NUKLEAR_LDFLAGS) AC_SUBST(WEBSOCKET_LDFLAGS) AC_SUBST(PLATFORM_LDFLAGS) diff --git a/raylib/Makefile.am b/raylib/Makefile.am index ab155c1..875d5dc 100644 --- a/raylib/Makefile.am +++ b/raylib/Makefile.am @@ -24,14 +24,16 @@ $(generated): raylib/parser/raylib_api.json mkraylib.bas gen: $(generated) README.md AM_CXXFLAGS=-fno-rtti -std=c++14 -fpermissive -AM_CPPFLAGS = -Iraylib/src @RAYLIB_CPPFLAGS@ \ - -DPLATFORM_DESKTOP_SDL=1 -DPLATFORM_DESKTOP_SDL3=1 -DSUPPORT_BUSY_WAIT_LOOP=1 -DSUPPORT_SCREEN_CAPTURE=1 \ - -DSUPPORT_GIF_RECORDING=1 -DSUPPORT_COMPRESSION_API=1 \ +AM_CPPFLAGS = -Iraylib/src -Iraylib/src/external/glfw/include -Iraylib/src/external/glfw/deps/mingw \ + -Iraylib/src/external/glfw/src \ + -DPLATFORM_DESKTOP=1 -DSUPPORT_BUSY_WAIT_LOOP=1 -DSUPPORT_SCREEN_CAPTURE=1 \ + -DSUPPORT_GIF_RECORDING=1 -DSUPPORT_COMPRESSION_API=1 -D_GLFW_WAYLAND=1 \ -Wall -Wextra -Wshadow -Wdouble-promotion -Wno-unused-parameter -fPIC lib_LTLIBRARIES = libraylib.la libraylib_la_SOURCES = \ + raylib/src/rglfw.c \ raylib/src/rmodels.c \ raylib/src/raudio.c \ raylib/src/rcore.c \ diff --git a/raylib/main.cpp b/raylib/main.cpp index ebc1759..667f0dc 100644 --- a/raylib/main.cpp +++ b/raylib/main.cpp @@ -24,11 +24,11 @@ #pragma GCC diagnostic pop #pragma GCC diagnostic pop #include +#include #include #include #include "robin-hood-hashing/src/include/robin_hood.h" -#include "SDL_events.h" #include "include/var.h" #include "include/module.h" #include "include/param.h" @@ -1378,15 +1378,18 @@ static int cmd_guiunlock(int argc, slib_par_t *params, var_t *retval) { return 1; } +static int cmd_poll_events(int argc, slib_par_t *params, var_t *retval) { + glfwPollEvents(); + return 1; +} + static int cmd_wait_events(int argc, slib_par_t *params, var_t *retval) { - auto timeoutMS = get_param_int(argc, params, 0, -1); - SDL_Event event; - if (timeoutMS > 0) { - SDL_WaitEventTimeout(&event, timeoutMS); + float waitMillis = get_param_int(argc, params, 0, -1); + if (waitMillis > 0) { + glfwWaitEventsTimeout(waitMillis / 1000); } else { - SDL_WaitEvent(&event); + glfwWaitEvents(); } - SDL_PushEvent(&event); return 1; } @@ -1833,6 +1836,7 @@ static FUNC_SIG lib_proc[] = { {3, 3, "GUISETSTYLE", cmd_guisetstyle}, {2, 2, "GUISTATUSBAR", cmd_guistatusbar}, {0, 0, "GUIUNLOCK", cmd_guiunlock}, + {0, 0, "POLLEVENTS", cmd_poll_events}, {0, 1, "WAITEVENTS", cmd_wait_events}, {0, 0, "CLOSEPHYSICS", cmd_closephysics}, {1, 1, "DESTROYPHYSICSBODY", cmd_destroyphysicsbody}, From d9f64b1d968cc2f380109fcbe070eeed7c3d6fee Mon Sep 17 00:00:00 2001 From: Chris Warren-Smith Date: Mon, 5 Jan 2026 20:06:52 +1030 Subject: [PATCH 5/9] RAYLIB: programs must run in a separate thread or via the command line --- include/module.h | 11 ++++++++++- raylib/main.cpp | 8 +++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/include/module.h b/include/module.h index d27ea52..b9176aa 100644 --- a/include/module.h +++ b/include/module.h @@ -25,6 +25,15 @@ extern "C" { */ int sblib_init(const char *sourceFile); +/** + * @ingroup modstd + * + * Returns whether the module is compatible with IDE builds + * + * @return non-zero on success + */ +int sblib_is_ide_compatible(void); + /** * @ingroup modstd * @@ -116,7 +125,7 @@ int sblib_func_exec(int index, int param_count, slib_par_t *params, var_t *retva * @param cls_id the variable class identifier * @param id the variable instance identifier */ -void sblib_free(int cls_id, int id); +int sblib_free(int cls_id, int id); /** * @ingroup modlib diff --git a/raylib/main.cpp b/raylib/main.cpp index 667f0dc..98ad484 100644 --- a/raylib/main.cpp +++ b/raylib/main.cpp @@ -1938,7 +1938,7 @@ SBLIB_API int sblib_func_exec(int index, int argc, slib_par_t *params, var_t *re return result; } -SBLIB_API void sblib_free(int cls_id, int id) { +SBLIB_API int sblib_free(int cls_id, int id) { if (id != -1) { switch (cls_id) { case CLS_AUDIOSTREAM: @@ -2031,6 +2031,7 @@ SBLIB_API void sblib_free(int cls_id, int id) { break; } } + return 0; } SBLIB_API void sblib_close(void) { @@ -2095,3 +2096,8 @@ SBLIB_API void sblib_close(void) { _waveMap.clear(); } } + +SBLIB_API void sblib_is_ide_compatible(void) { + // when using the SQL build, programs must be run via a separate thread + return false; +} From 8c4a66facc1ed4bb306be16d67d62ae617bce3cc Mon Sep 17 00:00:00 2001 From: Chris Warren-Smith Date: Mon, 5 Jan 2026 20:09:23 +1030 Subject: [PATCH 6/9] RAYLIB: programs must run in a separate thread or via the command line --- raylib/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/raylib/main.cpp b/raylib/main.cpp index 98ad484..8238cb4 100644 --- a/raylib/main.cpp +++ b/raylib/main.cpp @@ -2097,7 +2097,7 @@ SBLIB_API void sblib_close(void) { } } -SBLIB_API void sblib_is_ide_compatible(void) { +SBLIB_API int sblib_is_ide_compatible(void) { // when using the SQL build, programs must be run via a separate thread - return false; + return 0; } From f615e24344adecb842741afdfc2d8ce85844c16d Mon Sep 17 00:00:00 2001 From: Chris Warren-Smith Date: Tue, 6 Jan 2026 21:22:39 +1030 Subject: [PATCH 7/9] RAYLIB: rename UI detection to sblib_has_window_ui() --- include/module.h | 2 +- raylib/main.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/module.h b/include/module.h index b9176aa..c7753b2 100644 --- a/include/module.h +++ b/include/module.h @@ -32,7 +32,7 @@ int sblib_init(const char *sourceFile); * * @return non-zero on success */ -int sblib_is_ide_compatible(void); +int sblib_has_window_ui(void); /** * @ingroup modstd diff --git a/raylib/main.cpp b/raylib/main.cpp index 8238cb4..18ee3cd 100644 --- a/raylib/main.cpp +++ b/raylib/main.cpp @@ -2097,7 +2097,7 @@ SBLIB_API void sblib_close(void) { } } -SBLIB_API int sblib_is_ide_compatible(void) { - // when using the SQL build, programs must be run via a separate thread - return 0; +SBLIB_API int sblib_has_window_ui(void) { + // raylib module creates a UI in a new window + return 1; } From 744b20036d98f67dcba9f9998df888fa99f546c7 Mon Sep 17 00:00:00 2001 From: Chris Warren-Smith Date: Thu, 15 Jan 2026 08:50:34 +1030 Subject: [PATCH 8/9] FLATPAK: implements sblib_has_window_ui() in UI based modules --- glfw/main.cpp | 4 ++++ nuklear/main.cpp | 4 ++++ raylib/main.cpp | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/glfw/main.cpp b/glfw/main.cpp index 2a49198..07f8872 100644 --- a/glfw/main.cpp +++ b/glfw/main.cpp @@ -404,3 +404,7 @@ SBLIB_API void sblib_ellipse(int xc, int yc, int xr, int yr, int fill) { glEnd(); } +SBLIB_API int sblib_has_window_ui(void) { + // module creates a UI in a new window + return 1; +} diff --git a/nuklear/main.cpp b/nuklear/main.cpp index 00ac348..9553b7c 100644 --- a/nuklear/main.cpp +++ b/nuklear/main.cpp @@ -1181,3 +1181,7 @@ SBLIB_API void sblib_ellipse(int xc, int yc, int xr, int yr, int fill) { drawEnd(); } +SBLIB_API int sblib_has_window_ui(void) { + // module creates a UI in a new window + return 1; +} diff --git a/raylib/main.cpp b/raylib/main.cpp index 18ee3cd..06598c9 100644 --- a/raylib/main.cpp +++ b/raylib/main.cpp @@ -2098,6 +2098,6 @@ SBLIB_API void sblib_close(void) { } SBLIB_API int sblib_has_window_ui(void) { - // raylib module creates a UI in a new window + // module creates a UI in a new window return 1; } From 5cf27c37cc948728ac11b15abdbe21b687f661c5 Mon Sep 17 00:00:00 2001 From: Chris Warren-Smith Date: Sun, 18 Jan 2026 15:18:09 +1030 Subject: [PATCH 9/9] FLATPAK: ui modules now target wayland in linux build --- configure.ac | 35 ++++++++++++++++++++++++++++++++--- glfw/Makefile.am | 1 + nuklear/Makefile.am | 1 + nuklear/main.cpp | 26 ++++++++++++++++---------- 4 files changed, 50 insertions(+), 13 deletions(-) diff --git a/configure.ac b/configure.ac index f3a23f0..e3f5f79 100644 --- a/configure.ac +++ b/configure.ac @@ -33,6 +33,27 @@ function checkDebugMode() { AC_SUBST(CFLAGS) } +function generate_wayland_protocols() { + RAYLIB_SRC_PATH="${srcdir}/raylib/raylib/src" + WL_PROTOCOLS_DIR="${RAYLIB_SRC_PATH}/external/glfw/deps/wayland" + AC_MSG_NOTICE([Generating Wayland protocol headers]) + wl_generate() { + protocol="$1" + basename="$2" + "$WAYLAND_SCANNER" client-header "$protocol" "$RAYLIB_SRC_PATH/$basename.h" || exit 1 + "$WAYLAND_SCANNER" private-code "$protocol" "$RAYLIB_SRC_PATH/$basename-code.h" || exit 1 + } + wl_generate "$WL_PROTOCOLS_DIR/wayland.xml" wayland-client-protocol + wl_generate "$WL_PROTOCOLS_DIR/xdg-shell.xml" xdg-shell-client-protocol + wl_generate "$WL_PROTOCOLS_DIR/xdg-decoration-unstable-v1.xml" xdg-decoration-unstable-v1-client-protocol + wl_generate "$WL_PROTOCOLS_DIR/viewporter.xml" viewporter-client-protocol + wl_generate "$WL_PROTOCOLS_DIR/relative-pointer-unstable-v1.xml" relative-pointer-unstable-v1-client-protocol + wl_generate "$WL_PROTOCOLS_DIR/pointer-constraints-unstable-v1.xml" pointer-constraints-unstable-v1-client-protocol + wl_generate "$WL_PROTOCOLS_DIR/fractional-scale-v1.xml" fractional-scale-v1-client-protocol + wl_generate "$WL_PROTOCOLS_DIR/xdg-activation-v1.xml" xdg-activation-v1-client-protocol + wl_generate "$WL_PROTOCOLS_DIR/idle-inhibit-unstable-v1.xml" idle-inhibit-unstable-v1-client-protocol +} + AC_ARG_WITH(mlpack, [AS_HELP_STRING([--with-mlpack], [Build the mlpack module])], [MLPACK="yes"], @@ -66,14 +87,22 @@ case "${host_os}" in *) PLATFORM_LDFLAGS="-Wl,--no-undefined -avoid-version" CLIPBOARD_LDFLAGS="`pkg-config xcb --libs` -lpthread" - NUKLEAR_LDFLAGS="-lGL -lm -lpthread -ldl -lrt -lX11" WEBSOCKET_LDFLAGS="" GTK_SERVER_LDFLAGS="`pkg-config --libs gtk+-3.0` -lXm -lXt" GTK_SERVER_CPPFLAGS="`pkg-config --cflags gtk+-3.0` -DGTK_SERVER_FFI -DGTK_SERVER_LIBRARY -DGTK_SERVER_UNIX -DGTK_SERVER_GTK3x" - RAYLIB_LDFLAGS="-lGL -lm -lpthread -ldl -lrt -lX11 -lwayland-client -lwayland-cursor -lwayland-egl -lxkbcommon" + RAYLIB_LDFLAGS="`pkg-config wayland-client wayland-cursor wayland-egl xkbcommon --libs`" JVM_CPPFLAGS="-I/usr/lib/jvm/java-1.8.0-openjdk-amd64/include -I/usr/lib/jvm/java-1.8.0-openjdk-amd64/include/linux" JVM_LDFLAGS="-L/usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/amd64/server -ljvm" - NUKLEAR_CPPFLAGS="-D_GLFW_X11=1" + NUKLEAR_CPPFLAGS="-D_GLFW_WAYLAND=1" + NUKLEAR_LDFLAGS="`pkg-config wayland-client wayland-cursor wayland-egl xkbcommon --libs`" + + AC_ARG_VAR([WAYLAND_SCANNER], [Path to wayland-scanner]) + AC_PATH_PROG([WAYLAND_SCANNER], [wayland-scanner]) + AS_IF([test -n "$WAYLAND_SCANNER"], [ + generate_wayland_protocols + ], [ + AC_MSG_WARN([wayland-scanner not found; Wayland support disabled]) + ]) esac AC_SUBST(DEBUG_LDFLAGS) diff --git a/glfw/Makefile.am b/glfw/Makefile.am index dc0dbaa..35ff783 100644 --- a/glfw/Makefile.am +++ b/glfw/Makefile.am @@ -7,6 +7,7 @@ AM_CXXFLAGS=-fno-rtti -std=c++14 AM_CPPFLAGS = \ + -I../raylib/raylib/src \ -I../raylib/raylib/src/external/glfw/include \ -I../raylib/raylib/src/external/glfw/deps \ -Wall -Wextra -Wshadow -Wdouble-promotion -Wno-unused-parameter -D_GLFW_BUILD_DLL=1 diff --git a/nuklear/Makefile.am b/nuklear/Makefile.am index 5b4f06f..d96ea60 100644 --- a/nuklear/Makefile.am +++ b/nuklear/Makefile.am @@ -7,6 +7,7 @@ AM_CXXFLAGS=-fno-rtti -std=c++14 AM_CPPFLAGS = -D_GLFW_BUILD_DLL=1 @NUKLEAR_CPPFLAGS@ \ + -I../raylib/raylib/src \ -I../raylib/raylib/src/external/glfw/include \ -I../raylib/raylib/src/external/glfw/deps lib_LTLIBRARIES = libnuklear.la diff --git a/nuklear/main.cpp b/nuklear/main.cpp index 9553b7c..f30a1f4 100644 --- a/nuklear/main.cpp +++ b/nuklear/main.cpp @@ -95,7 +95,7 @@ static void window_size_callback(GLFWwindow* window, int width, int height) { nk_context *nkp_create_window(const char *title, int width, int height) { if (!glfwInit()) { fprintf(stdout, "[GFLW] failed to init!\n"); - exit(1); + return nullptr; } glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 2); @@ -873,16 +873,22 @@ static int cmd_widgetishovered(int argc, slib_par_t *params, var_t *retval) { } static int cmd_windowbegin(int argc, slib_par_t *params, var_t *retval) { - nkp_process_events(); - nkbd_begin(_ctx); - const char *title = get_param_str(argc, params, 0, "Untitled"); - struct nk_rect rc = get_param_rect(argc, params, 1); - nk_flags flags = get_param_window_flags(argc, params, 5); - v_setint(retval, nk_begin(_ctx, title, rc, flags)); - if ((flags & NK_WINDOW_TITLE) == 0) { - nkp_set_window_title(title); + int result; + if (_ctx != nullptr) { + nkp_process_events(); + nkbd_begin(_ctx); + const char *title = get_param_str(argc, params, 0, "Untitled"); + struct nk_rect rc = get_param_rect(argc, params, 1); + nk_flags flags = get_param_window_flags(argc, params, 5); + v_setint(retval, nk_begin(_ctx, title, rc, flags)); + if ((flags & NK_WINDOW_TITLE) == 0) { + nkp_set_window_title(title); + } + result = 1; + } else { + result = 0; } - return 1; + return result; } static int cmd_windowend(int argc, slib_par_t *params, var_t *retval) {