Skip to content

Commit 6fdf149

Browse files
Merge remote-tracking branch 'upstream/master' into fix-arm32-raster-rlsw
2 parents e192cec + b48933b commit 6fdf149

26 files changed

Lines changed: 332 additions & 218 deletions

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ src/external/SDL3
6565
# Emscripten
6666
emsdk
6767

68-
# Ignore wasm data in examples/
68+
# Ignore binaries generated in examples/
6969
examples/**/*
7070
!examples/**/*.*
7171
!examples/**/*/

BINDINGS.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Some people ported raylib to other languages in the form of bindings or wrappers
3737
| [raylib-freebasic](https://github.com/WIITD/raylib-freebasic) | **5.0** | [FreeBASIC](https://www.freebasic.net) | MIT |
3838
| [raylib.f](https://github.com/cthulhuology/raylib.f) | **5.5** | [Forth](https://forth.com) | Zlib |
3939
| [fortran-raylib](https://github.com/interkosmos/fortran-raylib) | **5.5** | [Fortran](https://fortran-lang.org) | ISC |
40-
| [raylib-go](https://github.com/gen2brain/raylib-go) | **5.5** | [Go](https://golang.org) | Zlib |
40+
| [raylib-go](https://github.com/gen2brain/raylib-go) | **6.0** | [Go](https://golang.org) | Zlib |
4141
| [raylib-guile](https://github.com/petelliott/raylib-guile) | **auto** | [Guile](https://www.gnu.org/software/guile) | Zlib |
4242
| [gforth-raylib](https://github.com/ArnautDaniel/gforth-raylib) | 3.5 | [Gforth](https://gforth.org) | **???** |
4343
| [h-raylib](https://github.com/Anut-py/h-raylib) | **5.5-dev** | [Haskell](https://haskell.org) | Apache-2.0 |
@@ -105,7 +105,8 @@ Some people ported raylib to other languages in the form of bindings or wrappers
105105
| [raylib-jai](https://github.com/ahmedqarmout2/raylib-jai) | **5.5** | [Jai](https://github.com/BSVino/JaiPrimer/blob/master/JaiPrimer.md) | MIT |
106106
| [fnl-raylib](https://github.com/0riginaln0/fnl-raylib) | **5.5** | [Fennel](https://fennel-lang.org/) | MIT |
107107
| [Rayua](https://github.com/uiua-lang/rayua) | **5.5** | [Uiua](https://www.uiua.org/) | **???** |
108-
| [Target](https://github.com/FinnDemonCat/Target/tree/main/libs/raylib) | **5.5** | [Dart](https://dart.dev/) | Apache-2.0 license |
108+
| [Target](https://github.com/FinnDemonCat/Target/tree/main/libs/raylib) | **5.5** | [Dart](https://dart.dev/) | Apache-2.0 license |
109+
| [gclang-raylib](https://github.com/gnuchanos/gcLang_Compiler/tree/main/windows_version/raylib_version)| **6.0** | [gclang](https://github.com/gnuchanos/gcLang_Compiler) | AGPL-3.0 |
109110

110111

111112
### Utility Wrapers

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ include(CompilerFlags)
2929
# Registers build options that are exposed to cmake
3030
include(CMakeOptions.txt)
3131

32-
if (UNIX AND NOT APPLE AND NOT "${PLATFORM}" MATCHES "DRM" AND NOT "${PLATFORM}" MATCHES "Web")
32+
if (UNIX AND NOT APPLE AND NOT "${PLATFORM}" MATCHES "DRM" AND NOT "${PLATFORM}" MATCHES "Web" AND NOT "${PLATFORM}" MATCHES "SDL")
3333
if (NOT GLFW_BUILD_WAYLAND AND NOT GLFW_BUILD_X11)
3434
message(FATAL_ERROR "Cannot disable both Wayland and X11")
3535
endif()

CMakeOptions.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ if(EMSCRIPTEN)
66
# When configuring web builds with "emcmake cmake -B build -S .", set PLATFORM to Web by default
77
SET(PLATFORM Web CACHE STRING "Platform to build for.")
88
endif()
9-
enum_option(PLATFORM "Desktop;Web;WebRGFW;Android;Raspberry Pi;DRM;SDL;RGFW;Memory" "Platform to build for.")
9+
enum_option(PLATFORM "Desktop;Win32;Web;WebRGFW;Android;Raspberry Pi;DRM;SDL;RGFW;Memory" "Platform to build for.")
1010

1111
enum_option(OPENGL_VERSION "OFF;4.3;3.3;2.1;1.1;ES 2.0;ES 3.0;Software" "Force a specific OpenGL Version?")
1212

build.zig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -739,7 +739,6 @@ fn addExamples(
739739
.root_module = exe_mod,
740740
.use_lld = target.result.os.tag == .windows,
741741
});
742-
b.installArtifact(exe);
743742

744743
const install_cmd = b.addInstallArtifact(exe, .{ .dest_sub_path = b.fmt("{s}/{s}", .{ module, filename }) });
745744

cmake/LibraryConfigurations.cmake

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,30 @@ if(POLICY CMP0072)
77
cmake_policy(SET CMP0072 NEW)
88
endif()
99

10+
include(CheckCSourceCompiles)
11+
include(CMakePushCheckState)
12+
13+
function(raylib_check_libatomic_required result)
14+
set(_atomic_test_source "
15+
int main(void)
16+
{
17+
volatile long long value = 0;
18+
return (int)__atomic_fetch_add(&value, 1, __ATOMIC_SEQ_CST);
19+
}")
20+
21+
check_c_source_compiles("${_atomic_test_source}" RAYLIB_ATOMICS_WITHOUT_LIBATOMIC)
22+
23+
if (RAYLIB_ATOMICS_WITHOUT_LIBATOMIC)
24+
set(${result} FALSE PARENT_SCOPE)
25+
else ()
26+
cmake_push_check_state()
27+
list(APPEND CMAKE_REQUIRED_LIBRARIES atomic)
28+
check_c_source_compiles("${_atomic_test_source}" RAYLIB_ATOMICS_WITH_LIBATOMIC)
29+
cmake_pop_check_state()
30+
set(${result} ${RAYLIB_ATOMICS_WITH_LIBATOMIC} PARENT_SCOPE)
31+
endif ()
32+
endfunction()
33+
1034
set(RAYLIB_DEPENDENCIES "include(CMakeFindDependencyMacro)")
1135

1236
if (${PLATFORM} STREQUAL "Desktop")
@@ -67,6 +91,21 @@ if (${PLATFORM} STREQUAL "Desktop")
6791
endif ()
6892
endif ()
6993

94+
elseif (${PLATFORM} STREQUAL "Win32")
95+
if ((NOT WIN32) AND (NOT CMAKE_C_COMPILER MATCHES "mingw|mingw32|mingw64"))
96+
message(FATAL_ERROR "Win32 platform requires Windows or a cross compiler.")
97+
endif ()
98+
99+
set(PLATFORM_CPP "PLATFORM_DESKTOP_WIN32")
100+
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
101+
102+
if (${OPENGL_VERSION} MATCHES "Software")
103+
set(GRAPHICS "GRAPHICS_API_OPENGL_SOFTWARE")
104+
endif ()
105+
106+
find_package(OpenGL QUIET)
107+
set(LIBS_PRIVATE ${OPENGL_LIBRARIES} winmm)
108+
70109
elseif (${PLATFORM} STREQUAL "Web")
71110
set(PLATFORM_CPP "PLATFORM_WEB")
72111
if(NOT GRAPHICS)
@@ -222,6 +261,14 @@ endif ()
222261

223262
set(LIBS_PRIVATE ${LIBS_PRIVATE} ${OPENAL_LIBRARY})
224263

264+
if (SUPPORT_MODULE_RAUDIO AND UNIX AND NOT APPLE)
265+
raylib_check_libatomic_required(RAYLIB_LIBATOMIC_REQUIRED)
266+
if (RAYLIB_LIBATOMIC_REQUIRED)
267+
message(STATUS "64-bit atomics require libatomic")
268+
list(APPEND LIBS_PRIVATE atomic)
269+
endif ()
270+
endif ()
271+
225272
if (${PLATFORM} MATCHES "Desktop")
226273
set(LIBS_PRIVATE ${LIBS_PRIVATE} glfw)
227274
endif ()

examples/Makefile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
# - Linux (X11 desktop mode)
2121
# - macOS/OSX (x64, arm64 (not tested))
2222
# - Others (not tested)
23+
# > PLATFORM_DESKTOP_WIN32 (native Win32):
24+
# - Windows (Win32, Win64)
2325
# > PLATFORM_WEB_RGFW:
2426
# - HTML5 (WebAssembly)
2527
# > PLATFORM_WEB:
@@ -794,6 +796,23 @@ ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_GLFW)
794796
rm -f *.o
795797
endif
796798
endif
799+
ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_WIN32)
800+
ifeq ($(PLATFORM_OS),WINDOWS)
801+
del *.o *.exe /s
802+
endif
803+
ifeq ($(PLATFORM_OS),BSD)
804+
find . -type f -perm -ugo+x -delete
805+
rm -fv *.o
806+
endif
807+
ifeq ($(PLATFORM_OS),LINUX)
808+
find . -type f -executable -delete
809+
rm -fv *.o
810+
endif
811+
ifeq ($(PLATFORM_OS),OSX)
812+
find . -type f -perm +ugo+x -delete
813+
rm -f *.o
814+
endif
815+
endif
797816
ifeq ($(TARGET_PLATFORM),PLATFORM_DRM)
798817
find . -type f -executable -delete
799818
rm -fv *.o

examples/others/raylib_opengl_interop.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
#include "raylib.h"
3030

31-
#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_DESKTOP_SDL)
31+
#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_DESKTOP_SDL) || defined(PLATFORM_DESKTOP_RGFW)
3232
#if defined(GRAPHICS_API_OPENGL_ES2)
3333
#include "glad_gles2.h" // Required for: OpenGL functionality
3434
#define glGenVertexArrays glGenVertexArraysOES

src/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ USE_EXTERNAL_GLFW ?= FALSE
119119

120120
# Enable support for X11 by default on Linux when using GLFW
121121
# NOTE: Wayland is disabled by default, only enable if you are sure
122-
GLFW_LINUX_ENABLE_WAYLAND ?= TRUE
122+
GLFW_LINUX_ENABLE_WAYLAND ?= FALSE
123123
GLFW_LINUX_ENABLE_X11 ?= TRUE
124124

125125
# Enable support for X11 by default on Linux when using RGFW

src/external/jar_mod.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1538,10 +1538,10 @@ mulong jar_mod_load_file(jar_mod_context_t * modctx, const char* filename)
15381538
modctx->modfile = (muchar *) JARMOD_MALLOC(fsize);
15391539
modctx->modfilesize = fsize;
15401540
memset(modctx->modfile, 0, fsize);
1541-
fread(modctx->modfile, fsize, 1, f);
1541+
if(fread(modctx->modfile, fsize, 1, f) != 1) fsize = 0;
15421542
fclose(f);
15431543

1544-
if(!jar_mod_load(modctx, (void *)modctx->modfile, fsize)) fsize = 0;
1544+
if(fsize && !jar_mod_load(modctx, (void *)modctx->modfile, fsize)) fsize = 0;
15451545
} else fsize = 0;
15461546
}
15471547
return fsize;

0 commit comments

Comments
 (0)