Skip to content

Commit a06962e

Browse files
authored
Merge branch 'master' into normalmap_example
2 parents 32026ca + c19c6fc commit a06962e

File tree

177 files changed

+17250
-2576
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

177 files changed

+17250
-2576
lines changed

.github/workflows/linux.yml

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,22 +22,28 @@ jobs:
2222
build:
2323
permissions:
2424
contents: write # for actions/upload-release-asset to upload release asset
25-
runs-on: ubuntu-latest
2625
strategy:
2726
fail-fast: false
2827
max-parallel: 1
2928
matrix:
30-
bits: [32, 64]
3129
include:
3230
- bits: 32
3331
ARCH: "i386"
3432
ARCH_NAME: "i386"
3533
COMPILER_PATH: "/user/bin"
34+
runner: "ubuntu-latest"
3635
- bits: 64
3736
ARCH: "x86_64"
3837
ARCH_NAME: "amd64"
3938
COMPILER_PATH: "/user/bin"
39+
runner: "ubuntu-latest"
40+
- bits: 64
41+
ARCH: "aarch64"
42+
ARCH_NAME: "arm64"
43+
COMPILER_PATH: "/user/bin"
44+
runner: "ubuntu-24.04-arm"
4045

46+
runs-on: ${{ matrix.runner }}
4147
env:
4248
RELEASE_NAME: raylib-dev_linux_${{ matrix.ARCH_NAME }}
4349

@@ -54,7 +60,6 @@ jobs:
5460
- name: Setup Environment
5561
run: |
5662
sudo apt-get update -qq
57-
sudo apt-get install gcc-multilib
5863
sudo apt-get install -y --no-install-recommends libglfw3 libglfw3-dev libx11-dev libxcursor-dev libxrandr-dev libxinerama-dev libxi-dev libxext-dev libxfixes-dev libwayland-dev libxkbcommon-dev
5964
mkdir build
6065
cd build
@@ -64,23 +69,36 @@ jobs:
6469
mkdir lib
6570
cd ../../../raylib
6671
# ${{ matrix.ARCH }}-linux-gnu-gcc -v
72+
73+
- name: Setup Environment (x86)
74+
run : |
75+
sudo apt-get install gcc-multilib
76+
if: matrix.bits == 32 && matrix.ARCH == 'i386'
6777

6878
# TODO: Support 32bit (i386) static/shared library building
69-
- name: Build Library
79+
- name: Build Library (32-bit)
7080
run: |
7181
cd src
7282
make PLATFORM=PLATFORM_DESKTOP CC=gcc RAYLIB_LIBTYPE=STATIC RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib" CUSTOM_CFLAGS="-m32" -B
7383
# make PLATFORM=PLATFORM_DESKTOP CC=gcc RAYLIB_LIBTYPE=SHARED RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib" -B
7484
cd ..
7585
if: matrix.bits == 32
7686

77-
- name: Build Library
87+
- name: Build Library (64-bit x86)
88+
run: |
89+
cd src
90+
make PLATFORM=PLATFORM_DESKTOP CC=gcc RAYLIB_LIBTYPE=STATIC RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib" -B
91+
make PLATFORM=PLATFORM_DESKTOP CC=gcc RAYLIB_LIBTYPE=SHARED RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib" -B
92+
cd ..
93+
if: matrix.bits == 64 && matrix.ARCH == 'x86_64'
94+
95+
- name: Build Library (64-bit ARM)
7896
run: |
7997
cd src
8098
make PLATFORM=PLATFORM_DESKTOP CC=gcc RAYLIB_LIBTYPE=STATIC RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib" -B
8199
make PLATFORM=PLATFORM_DESKTOP CC=gcc RAYLIB_LIBTYPE=SHARED RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib" -B
82100
cd ..
83-
if: matrix.bits == 64
101+
if: matrix.bits == 64 && matrix.ARCH == 'aarch64'
84102

85103
- name: Generate Artifacts
86104
run: |

.github/workflows/parse.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Parse raylib_api
1+
name: Parse raylib API
22

33
on:
44
workflow_dispatch:
@@ -14,7 +14,7 @@ jobs:
1414
- uses: actions/checkout@v4
1515

1616
- name: Update parse files
17-
working-directory: parser
17+
working-directory: tools/parser
1818
run: |
1919
make raylib_api
2020
mv raylib_api.* output

.github/workflows/windows.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ jobs:
5454
- compiler: mingw-w64
5555
ziptarget: winarm64 # We don't build arm64 with mingw-w64 yet
5656

57-
5857
env:
5958
RELEASE_NAME: raylib-dev_${{ matrix.ziptarget }}_${{ matrix.compiler }}
6059
GNUTARGET: default

.gitignore

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,5 +111,7 @@ build/
111111
build-*/
112112
docgen_tmp/
113113

114-
# Parser stuff
115-
parser/raylib_parser
114+
# Tools stuff
115+
tools/parser/raylib_parser
116+
tools/rexm/VS2022
117+
tools/rexm/rexm

BINDINGS.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,6 @@ These are older raylib bindings that are more than 2 versions old or have not be
145145
| [clj-raylib](https://github.com/lsevero/clj-raylib) | 3.0 | [Clojure](https://clojure.org) |
146146
| [QuickJS-raylib](https://github.com/sntg-p/QuickJS-raylib) | 3.0 | [QuickJS](https://bellard.org/quickjs) |
147147
| [raylib-duktape](https://github.com/RobLoach/raylib-duktape) | 2.6 | [JavaScript (Duktape)](https://en.wikipedia.org/wiki/JavaScript) |
148-
| [raylib-v7](https://github.com/Rabios/raylib-v7) | 3.5 | [JavaScript (v7)](https://en.wikipedia.org/wiki/JavaScript) |
149148
| [raylib-chaiscript](https://github.com/RobLoach/raylib-chaiscript) | 2.6 | [ChaiScript](http://chaiscript.com) |
150149
| [raylib-squirrel](https://github.com/RobLoach/raylib-squirrel) | 2.5 | [Squirrel](http://www.squirrel-lang.org) |
151150
| [racket-raylib-2d](https://github.com/arvyy/racket-raylib-2d) | 2.5 | [Racket](https://racket-lang.org) |

build.zig

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -153,18 +153,14 @@ fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.
153153
try raylib_flags_arr.appendSlice(&config_h_flags);
154154
}
155155

156-
const raylib = if (options.shared)
157-
b.addSharedLibrary(.{
158-
.name = "raylib",
156+
const raylib = b.addLibrary(.{
157+
.name = "raylib",
158+
.linkage = if (options.shared) .dynamic else .static,
159+
.root_module = b.createModule(.{
159160
.target = target,
160161
.optimize = optimize,
161-
})
162-
else
163-
b.addStaticLibrary(.{
164-
.name = "raylib",
165-
.target = target,
166-
.optimize = optimize,
167-
});
162+
}),
163+
});
168164
raylib.linkLibC();
169165

170166
// No GLFW required on PLATFORM_DRM
@@ -550,10 +546,13 @@ fn addExamples(
550546
if (std.mem.eql(u8, "core_loading_thread", name) and target.result.os.tag == .windows) continue;
551547

552548
if (target.result.os.tag == .emscripten) {
553-
const exe_lib = b.addStaticLibrary(.{
549+
const exe_lib = b.addLibrary(.{
554550
.name = name,
555-
.target = target,
556-
.optimize = optimize,
551+
.linkage = .static,
552+
.root_module = b.createModule(.{
553+
.target = target,
554+
.optimize = optimize,
555+
}),
557556
});
558557
exe_lib.addCSourceFile(.{
559558
.file = b.path(path),
@@ -633,8 +632,10 @@ fn addExamples(
633632
} else {
634633
const exe = b.addExecutable(.{
635634
.name = name,
636-
.target = target,
637-
.optimize = optimize,
635+
.root_module = b.createModule(.{
636+
.target = target,
637+
.optimize = optimize,
638+
}),
638639
});
639640
exe.addCSourceFile(.{ .file = b.path(path), .flags = &.{} });
640641
exe.linkLibC();

cmake/LibraryConfigurations.cmake

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,37 @@ elseif ("${PLATFORM}" MATCHES "DRM")
101101
set(LIBS_PRIVATE ${GLESV2} ${EGL} ${DRM} ${GBM} atomic pthread m dl)
102102

103103
elseif ("${PLATFORM}" MATCHES "SDL")
104-
find_package(SDL2 REQUIRED)
105-
set(PLATFORM_CPP "PLATFORM_DESKTOP_SDL")
106-
set(LIBS_PRIVATE SDL2::SDL2)
107-
104+
# First, check if SDL is included as a subdirectory
105+
if(TARGET SDL3::SDL3)
106+
message(STATUS "Using SDL3 from subdirectory")
107+
set(PLATFORM_CPP "PLATFORM_DESKTOP_SDL")
108+
set(LIBS_PRIVATE SDL3::SDL3)
109+
add_compile_definitions(USING_SDL3_PROJECT)
110+
elseif(TARGET SDL2::SDL2)
111+
message(STATUS "Using SDL2 from subdirectory")
112+
set(PLATFORM_CPP "PLATFORM_DESKTOP_SDL")
113+
set(LIBS_PRIVATE SDL2::SDL2)
114+
add_compile_definitions(USING_SDL2_PROJECT)
115+
else()
116+
# No SDL added via add_subdirectory(), try find_package()
117+
message(STATUS "No SDL target from subdirectory, searching via find_package()...")
118+
119+
# First try SDL3
120+
find_package(SDL3 QUIET)
121+
if(SDL3_FOUND)
122+
message(STATUS "Found SDL3 via find_package()")
123+
set(PLATFORM_CPP "PLATFORM_DESKTOP_SDL")
124+
set(LIBS_PRIVATE SDL3::SDL3)
125+
add_compile_definitions(USING_SDL3_PACKAGE)
126+
else()
127+
# Fallback to SDL2
128+
find_package(SDL2 REQUIRED)
129+
message(STATUS "Found SDL2 via find_package()")
130+
set(PLATFORM_CPP "PLATFORM_DESKTOP_SDL")
131+
set(LIBS_PRIVATE SDL2::SDL2)
132+
add_compile_definitions(USING_SDL2_PACKAGE)
133+
endif()
134+
endif()
108135
endif ()
109136

110137
if (NOT ${OPENGL_VERSION} MATCHES "OFF")

examples/Makefile

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,9 @@ BUILD_WEB_SHELL ?= $(RAYLIB_PATH)/src/minshell.html
106106
BUILD_WEB_HEAP_SIZE ?= 134217728
107107
BUILD_WEB_RESOURCES ?= TRUE
108108
BUILD_WEB_RESOURCES_PATH ?= $(dir $<)resources@resources
109+
# Use WebGL2 backend (OpenGL 3.0)
110+
# WARNING: Requires raylib compiled with GRAPHICS_API_OPENGL_ES3
111+
BUILD_WEB_WEBGL2 ?= FALSE
109112

110113
# Determine PLATFORM_OS when required
111114
ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_DESKTOP_GLFW PLATFORM_DESKTOP_SDL PLATFORM_DESKTOP_RGFW PLATFORM_WEB PLATFORM_WEB_RGFW))
@@ -186,7 +189,7 @@ ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_GLFW)
186189
endif
187190
endif
188191
ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW))
189-
# HTML5 emscripten compiler
192+
# HTML5 emscripten compiler
190193
# WARNING: To compile to HTML5, code must be redesigned
191194
# to use emscripten.h and emscripten_set_main_loop()
192195
CC = emcc
@@ -269,8 +272,8 @@ endif
269272
# NOTE: Some external/extras libraries could be required (stb, easings...)
270273
#------------------------------------------------------------------------------------------------
271274
INCLUDE_PATHS = -I. -I$(RAYLIB_PATH)/src -I$(RAYLIB_PATH)/src/external $(EXTRA_INCLUDE_PATHS)
272-
# Define additional directories containing required header files
273275

276+
# Define additional directories containing required header files
274277
ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_GLFW)
275278
ifeq ($(PLATFORM_OS),BSD)
276279
INCLUDE_PATHS += -I$(RAYLIB_INCLUDE_PATH) -I/usr/pkg/include -I/usr/X11R7/include
@@ -287,11 +290,6 @@ ifeq ($(TARGET_PLATFORM),PLATFORM_DRM)
287290
INCLUDE_PATHS += -I/usr/include/libdrm
288291
endif
289292

290-
# Include GLFW required for examples/others/rlgl_standalone.c
291-
ifeq ($(USE_EXTERNAL_GLFW),FALSE)
292-
all others: INCLUDE_PATHS += -I$(RAYLIB_PATH)/src/external/glfw/include
293-
endif
294-
295293
# Define library paths containing required libs: LDFLAGS
296294
#------------------------------------------------------------------------------------------------
297295
LDFLAGS = -L. -L$(RAYLIB_RELEASE_PATH) -L$(RAYLIB_PATH)/src
@@ -340,18 +338,24 @@ ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_WEB PLATFORM_WEB_R
340338
# --preload-file resources # specify a resources folder for data compilation
341339
# --source-map-base # allow debugging in browser with source map
342340
# --shell-file shell.html # define a custom shell .html and output extension
343-
LDFLAGS += -sTOTAL_MEMORY=$(BUILD_WEB_HEAP_SIZE) -sFORCE_FILESYSTEM=1 -sMINIFY_HTML=0
341+
LDFLAGS += -sTOTAL_MEMORY=$(BUILD_WEB_HEAP_SIZE) -sFORCE_FILESYSTEM=1 -sEXPORTED_RUNTIME_METHODS=ccall -sMINIFY_HTML=0
344342

345343
# Using GLFW3 library (instead of RGFW)
346344
ifeq ($(TARGET_PLATFORM),PLATFORM_WEB)
347345
LDFLAGS += -sUSE_GLFW=3
348346
endif
349347

350-
# Build using asyncify
348+
# Build using asyncify
351349
ifeq ($(BUILD_WEB_ASYNCIFY),TRUE)
352350
LDFLAGS += -sASYNCIFY
353351
endif
354352

353+
# NOTE: Flags required for WebGL 2.0 (OpenGL ES 3.0)
354+
# WARNING: Requires raylib compiled with GRAPHICS_API_OPENGL_ES3
355+
ifeq ($(BUILD_WEB_WEBGL2),TRUE)
356+
LDFLAGS += -sMIN_WEBGL_VERSION=2 -sMAX_WEBGL_VERSION=2
357+
endif
358+
355359
# Add resources building if required
356360
ifeq ($(BUILD_WEB_RESOURCES),TRUE)
357361
LDFLAGS += --preload-file $(BUILD_WEB_RESOURCES_PATH)
@@ -489,8 +493,11 @@ ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_WEB PLATFORM_WEB_R
489493
LDLIBS = $(RAYLIB_RELEASE_PATH)/libraylib.web.a
490494
endif
491495

496+
CURRENT_MAKEFILE = $(lastword $(MAKEFILE_LIST))
497+
492498
# Define source code object files required
493499
#------------------------------------------------------------------------------------------------
500+
#EXAMPLES_LIST_START
494501
CORE = \
495502
core/core_2d_camera \
496503
core/core_2d_camera_mouse_zoom \
@@ -534,6 +541,8 @@ SHAPES = \
534541
shapes/shapes_bouncing_ball \
535542
shapes/shapes_collision_area \
536543
shapes/shapes_colors_palette \
544+
shapes/shapes_digital_clock \
545+
shapes/shapes_double_pendulum \
537546
shapes/shapes_draw_circle_sector \
538547
shapes/shapes_draw_rectangle_rounded \
539548
shapes/shapes_draw_ring \
@@ -547,8 +556,7 @@ SHAPES = \
547556
shapes/shapes_rectangle_advanced \
548557
shapes/shapes_rectangle_scaling \
549558
shapes/shapes_splines_drawing \
550-
shapes/shapes_top_down_lights \
551-
shapes/shapes_digital_clock
559+
shapes/shapes_top_down_lights
552560

553561
TEXTURES = \
554562
textures/textures_background_scrolling \
@@ -644,9 +652,9 @@ SHADERS = \
644652
shaders/shaders_texture_outline \
645653
shaders/shaders_texture_tiling \
646654
shaders/shaders_texture_waves \
655+
shaders/shaders_vertex_displacement \
647656
shaders/shaders_view_depth \
648-
shaders/shaders_write_depth \
649-
shaders/shaders_vertex_displacement
657+
shaders/shaders_write_depth
650658

651659
AUDIO = \
652660
audio/audio_mixed_processor \
@@ -663,18 +671,14 @@ OTHERS = \
663671
others/embedded_files_loading \
664672
others/raylib_opengl_interop \
665673
others/raymath_vector_angle \
666-
others/rlgl_compute_shader
667-
668-
ifeq ($(TARGET_PLATFORM), PLATFORM_DESKTOP_GFLW)
669-
OTHERS += others/rlgl_standalone
670-
endif
671-
672-
CURRENT_MAKEFILE = $(lastword $(MAKEFILE_LIST))
674+
others/rlgl_compute_shader \
675+
others/rlgl_standalone
676+
#EXAMPLES_LIST_END
673677

674678
# Define processes to execute
675679
#------------------------------------------------------------------------------------------------
676680
# Default target entry
677-
all: $(CORE) $(SHAPES) $(TEXT) $(TEXTURES) $(MODELS) $(SHADERS) $(AUDIO) $(OTHERS)
681+
all: $(CORE) $(SHAPES) $(TEXT) $(TEXTURES) $(MODELS) $(SHADERS) $(AUDIO)
678682

679683
core: $(CORE)
680684
shapes: $(SHAPES)
@@ -683,7 +687,6 @@ text: $(TEXT)
683687
models: $(MODELS)
684688
shaders: $(SHADERS)
685689
audio: $(AUDIO)
686-
others: $(OTHERS)
687690

688691
# Generic compilation pattern
689692
# NOTE: Examples must be ready for Android compilation!

0 commit comments

Comments
 (0)