Skip to content

Commit

Permalink
C:w
Browse files Browse the repository at this point in the history
Merge branch 'pure' of https://github.com/ColleagueRiley/raylib into pure
  • Loading branch information
ColleagueRiley committed Nov 10, 2024
2 parents 8c1c3ed + e1067e1 commit c5c3843
Show file tree
Hide file tree
Showing 46 changed files with 2,008 additions and 807 deletions.
425 changes: 420 additions & 5 deletions CHANGELOG

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion CMakeOptions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ cmake_dependent_option(USE_AUDIO "Build raylib with audio module" ON CUSTOMIZE_B
enum_option(USE_EXTERNAL_GLFW "OFF;IF_POSSIBLE;ON" "Link raylib against system GLFW instead of embedded one")

# GLFW build options
option(GLFW_BUILD_WAYLAND "Build the bundled GLFW with Wayland support" ON)
option(GLFW_BUILD_WAYLAND "Build the bundled GLFW with Wayland support" OFF)
option(GLFW_BUILD_X11 "Build the bundled GLFW with X11 support" ON)

option(INCLUDE_EVERYTHING "Include everything disabled by default (for CI usage" OFF)
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Hello contributors! Welcome to raylib!
Do you enjoy raylib and want to contribute? Nice! You can help with the following points:

- `C programming` - Can you write/review/test/improve the code?
- `Documentation/Tutorials/Example` - Can you write some tutorial/example?
- `Documentation/Tutorials/Example` - Can you write some tutorials/examples?
- `Porting to other platforms` - Can you port/adapt/compile raylib on other systems?
- `Web Development` - Can you help [with the website](https://github.com/raysan5/raylib.com)?
- `Testing` - Can you find some bugs in raylib?
Expand Down
17 changes: 17 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -471,3 +471,20 @@ Make sure to check raylib [CHANGELOG]([CHANGELOG](https://github.com/raysan5/ray
Undoubtedly, this is the **biggest raylib update in 10 years**. Many new features and improvements with a special focus on maintainability and long-term sustainability. **Undoubtedly, this is the raylib of the future**.

**Enjoy programming!** :)

notes on raylib 5.5
-------------------

It's been **1 year** since latest raylib release and **11 years** since raylib 1.0 was officially released...

Some numbers for this release:

- **+260** closed issues (for a TOTAL of **+1800**!)
- **+700** commits since previous RELEASE (for a TOTAL of **+7670**!)
- **+30** functions ADDED to raylib API (for a TOTAL of **580**!)
- **+110** functions REVIEWED with fixes and improvements
- **+135** new contributors (for a TOTAL of **+635**!)

Highlights for `raylib 5.5`:

TODO.
25 changes: 11 additions & 14 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.
// `n` corresponds to the number of user-specified flags
outer: for (config_h_flags) |flag| {
// If a user already specified the flag, skip it
config_iter.reset();
while (config_iter.next()) |config_flag| {
// For a user-specified flag to match, it must share the same prefix and have the
// same length or be followed by an equals sign
Expand Down Expand Up @@ -186,16 +187,18 @@ fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.
.linux => {
if (options.platform != .drm) {
try c_source_files.append("src/rglfw.c");
raylib.linkSystemLibrary("GL");
raylib.linkSystemLibrary("rt");
raylib.linkSystemLibrary("dl");
raylib.linkSystemLibrary("m");

raylib.addLibraryPath(.{ .cwd_relative = "/usr/lib" });
raylib.addIncludePath(.{ .cwd_relative = "/usr/include" });
if (options.linux_display_backend == .X11 or options.linux_display_backend == .Both) {
raylib.defineCMacro("_GLFW_X11", null);
raylib.linkSystemLibrary("GLX");
raylib.linkSystemLibrary("X11");
raylib.linkSystemLibrary("Xcursor");
raylib.linkSystemLibrary("Xext");
raylib.linkSystemLibrary("Xfixes");
raylib.linkSystemLibrary("Xi");
raylib.linkSystemLibrary("Xinerama");
raylib.linkSystemLibrary("Xrandr");
raylib.linkSystemLibrary("Xrender");
}

if (options.linux_display_backend == .Wayland or options.linux_display_backend == .Both) {
Expand All @@ -207,9 +210,8 @@ fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.
@panic("`wayland-scanner` not found");
};
raylib.defineCMacro("_GLFW_WAYLAND", null);
raylib.linkSystemLibrary("EGL");
raylib.linkSystemLibrary("wayland-client");
raylib.linkSystemLibrary("wayland-cursor");
raylib.linkSystemLibrary("wayland-egl");
raylib.linkSystemLibrary("xkbcommon");
waylandGenerate(b, raylib, "wayland.xml", "wayland-client-protocol");
waylandGenerate(b, raylib, "xdg-shell.xml", "xdg-shell-client-protocol");
Expand All @@ -229,13 +231,8 @@ fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.
}

raylib.linkSystemLibrary("EGL");
raylib.linkSystemLibrary("drm");
raylib.linkSystemLibrary("gbm");
raylib.linkSystemLibrary("pthread");
raylib.linkSystemLibrary("rt");
raylib.linkSystemLibrary("m");
raylib.linkSystemLibrary("dl");
raylib.addIncludePath(.{ .cwd_relative = "/usr/include/libdrm" });
raylib.linkSystemLibrary2("libdrm", .{ .use_pkg_config = .force });

raylib.defineCMacro("PLATFORM_DRM", null);
raylib.defineCMacro("EGL_NO_X11", null);
Expand Down
24 changes: 19 additions & 5 deletions examples/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@ ifeq ($(TARGET_PLATFORM),PLATFORM_WEB)
EMSDK_PATH ?= C:/emsdk
EMSCRIPTEN_PATH ?= $(EMSDK_PATH)/upstream/emscripten
CLANG_PATH = $(EMSDK_PATH)/upstream/bin
PYTHON_PATH = $(EMSDK_PATH)/python/3.9.2-1_64bit
NODE_PATH = $(EMSDK_PATH)/node/14.15.5_64bit/bin
PYTHON_PATH = $(EMSDK_PATH)/python/3.9.2-nuget_64bit
NODE_PATH = $(EMSDK_PATH)/node/20.18.0_64bit/bin
export PATH = $(EMSDK_PATH);$(EMSCRIPTEN_PATH);$(CLANG_PATH);$(NODE_PATH);$(PYTHON_PATH):$$(PATH)
endif
endif
Expand Down Expand Up @@ -197,7 +197,16 @@ ifeq ($(TARGET_PLATFORM),PLATFORM_ANDROID)
MAKE = mingw32-make
endif
ifeq ($(TARGET_PLATFORM),PLATFORM_WEB)
MAKE = emmake make
ifeq ($(OS),Windows_NT)
MAKE = mingw32-make
else
EMMAKE != type emmake
ifneq (, $(EMMAKE))
MAKE = emmake make
else
MAKE = mingw32-make
endif
endif
endif

# Define compiler flags: CFLAGS
Expand Down Expand Up @@ -259,7 +268,7 @@ INCLUDE_PATHS = -I. -I$(RAYLIB_PATH)/src -I$(RAYLIB_PATH)/src/external
# Define additional directories containing required header files
ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_GLFW)
ifeq ($(PLATFORM_OS),BSD)
INCLUDE_PATHS += -I$(RAYLIB_INCLUDE_PATH)
INCLUDE_PATHS += -I$(RAYLIB_INCLUDE_PATH) -I/usr/pkg/include -I/usr/X11R7/include
endif
ifeq ($(PLATFORM_OS),LINUX)
INCLUDE_PATHS += -I$(RAYLIB_INCLUDE_PATH)
Expand Down Expand Up @@ -392,6 +401,7 @@ ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_GLFW)
ifeq ($(PLATFORM_OS),BSD)
# Libraries for FreeBSD, OpenBSD, NetBSD, DragonFly desktop compiling
# NOTE: Required packages: mesa-libs
LDFLAGS += -L/usr/X11R7/lib -Wl,-R/usr/X11R7/lib
LDLIBS = -lraylib -lGL -lpthread -lm

# On XWindow requires also below libraries
Expand Down Expand Up @@ -451,7 +461,7 @@ ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_RGFW)
ifeq ($(PLATFORM_OS),OSX)
# Libraries for Debian GNU/Linux desktop compiling
# NOTE: Required packages: libegl1-mesa-dev
LDLIBS = ../src/libraylib.a -lm
LDLIBS = ../src/libraylib.a -lm
LDLIBS += -framework Foundation -framework AppKit -framework OpenGL -framework CoreVideo
endif
endif
Expand Down Expand Up @@ -668,6 +678,10 @@ ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_GLFW)
ifeq ($(PLATFORM_OS),WINDOWS)
del *.o *.exe /s
endif
ifeq ($(PLATFORM_OS),BSD)
find . -type f -perm -ugo+x -delete
rm -fv *.o
endif
ifeq ($(PLATFORM_OS),LINUX)
find . -type f -executable -delete
rm -fv *.o
Expand Down
58 changes: 42 additions & 16 deletions examples/Makefile.Web
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ USE_EXTERNAL_GLFW ?= FALSE
# NOTE: This variable is only used for PLATFORM_OS: LINUX
USE_WAYLAND_DISPLAY ?= FALSE

# Use WebGL2 backend (OpenGL 3.0)
# WARNING: Requires raylib compiled with GRAPHICS_API_OPENGL_ES3
USE_WEBGL2 ?= FALSE

# Determine PLATFORM_OS in case PLATFORM_DESKTOP or PLATFORM_WEB selected
ifeq ($(PLATFORM),$(filter $(PLATFORM),PLATFORM_DESKTOP PLATFORM_WEB))
# No uname.exe on MinGW!, but OS=Windows_NT on Windows!
Expand Down Expand Up @@ -110,8 +114,8 @@ ifeq ($(PLATFORM),PLATFORM_WEB)
EMSDK_PATH ?= C:/emsdk
EMSCRIPTEN_PATH ?= $(EMSDK_PATH)/upstream/emscripten
CLANG_PATH = $(EMSDK_PATH)/upstream/bin
PYTHON_PATH = $(EMSDK_PATH)/python/3.9.2-1_64bit
NODE_PATH = $(EMSDK_PATH)/node/14.15.5_64bit/bin
PYTHON_PATH = $(EMSDK_PATH)/python/3.9.2-nuget_64bit
NODE_PATH = $(EMSDK_PATH)/node/20.18.0_64bit/bin
export PATH = $(EMSDK_PATH);$(EMSCRIPTEN_PATH);$(CLANG_PATH);$(NODE_PATH);$(PYTHON_PATH):$$(PATH)
endif
endif
Expand Down Expand Up @@ -139,7 +143,7 @@ endif

# Define default make program: MAKE
#------------------------------------------------------------------------------------------------
MAKE ?= emmake make
MAKE ?= make

ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(PLATFORM_OS),WINDOWS)
Expand All @@ -149,8 +153,17 @@ endif
ifeq ($(PLATFORM),PLATFORM_ANDROID)
MAKE = mingw32-make
endif
ifeq ($(PLATFORM),PLATFORM_WEB)
MAKE = emmake make
ifeq ($(TARGET_PLATFORM),PLATFORM_WEB)
ifeq ($(OS),Windows_NT)
MAKE = mingw32-make
else
EMMAKE != type emmake
ifneq (, $(EMMAKE))
MAKE = emmake make
else
MAKE = mingw32-make
endif
endif
endif

# Define compiler flags: CFLAGS
Expand Down Expand Up @@ -261,6 +274,12 @@ ifeq ($(PLATFORM),PLATFORM_WEB)
# --source-map-base # allow debugging in browser with source map
LDFLAGS += -sUSE_GLFW=3 -sASYNCIFY -sEXPORTED_RUNTIME_METHODS=ccall

# NOTE: Flags required for WebGL 2.0 (OpenGL ES 3.0)
# WARNING: Requires raylib compiled with GRAPHICS_API_OPENGL_ES3
ifeq ($(USE_WEBGL2),TRUE)
LDFLAGS += -sMIN_WEBGL_VERSION=2 -sMAX_WEBGL_VERSION=2
endif

# NOTE: Simple raylib examples are compiled to be interpreter with asyncify, that way,
# we can compile same code for ALL platforms with no change required, but, working on bigger
# projects, code needs to be refactored to avoid a blocking while() loop, moving Update and Draw
Expand Down Expand Up @@ -434,6 +453,7 @@ TEXT = \

MODELS = \
models/models_animation \
models/models_gpu_skinning \
models/models_billboard \
models/models_box_collisions \
models/models_cubicmap \
Expand Down Expand Up @@ -540,10 +560,10 @@ core/core_3d_camera_split_screen: core/core_3d_camera_split_screen.c

core/core_3d_picking: core/core_3d_picking.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)

core/core_automation_events : core/core_automation_events.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)

core/core_basic_window: core/core_basic_window.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)

Expand Down Expand Up @@ -642,7 +662,7 @@ shapes/shapes_draw_circle_sector: shapes/shapes_draw_circle_sector.c

shapes/shapes_draw_rectangle_rounded: shapes/shapes_draw_rectangle_rounded.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)

shapes/shapes_draw_ring: shapes/shapes_draw_ring.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)

Expand Down Expand Up @@ -712,7 +732,7 @@ textures/textures_image_drawing: textures/textures_image_drawing.c

textures/textures_image_generation: textures/textures_image_generation.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) -sTOTAL_MEMORY=67108864

textures/textures_image_kernel: textures/textures_image_kernel.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
--preload-file textures/resources/cat.png@resources/cat.png
Expand Down Expand Up @@ -788,7 +808,7 @@ textures/textures_to_image: textures/textures_to_image.c
text/text_codepoints_loading: text/text_codepoints_loading.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
--preload-file text/resources/DotGothic16-Regular.ttf@resources/DotGothic16-Regular.ttf

text/text_draw_3d: text/text_draw_3d.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
--preload-file text/resources/shaders/glsl100/alpha_discard.fs@resources/shaders/glsl100/alpha_discard.fs
Expand Down Expand Up @@ -854,6 +874,12 @@ models/models_animation: models/models_animation.c
--preload-file models/resources/models/iqm/guytex.png@resources/models/iqm/guytex.png \
--preload-file models/resources/models/iqm/guyanim.iqm@resources/models/iqm/guyanim.iqm

models/models_gpu_skinning: models/models_gpu_skinning.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) -sTOTAL_MEMORY=67108864 \
--preload-file models/resources/models/gltf/greenman.glb@resources/models/gltf/greenman.glb \
--preload-file models/resources/shaders/glsl100/skinning.vs@resources/shaders/glsl100/skinning.vs \
--preload-file models/resources/shaders/glsl100/skinning.fs@resources/shaders/glsl100/skinning.fs

models/models_billboard: models/models_billboard.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
--preload-file models/resources/billboard.png@resources/billboard.png
Expand All @@ -877,7 +903,7 @@ models/models_first_person_maze: models/models_first_person_maze.c

models/models_geometric_shapes: models/models_geometric_shapes.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)

models/models_heightmap: models/models_heightmap.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
--preload-file models/resources/heightmap.png@resources/heightmap.png
Expand All @@ -886,20 +912,20 @@ models/models_loading: models/models_loading.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) -sTOTAL_MEMORY=67108864 \
--preload-file models/resources/models/obj/castle.obj@resources/models/obj/castle.obj \
--preload-file models/resources/models/obj/castle_diffuse.png@resources/models/obj/castle_diffuse.png

models/models_loading_gltf: models/models_loading_gltf.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) -sTOTAL_MEMORY=67108864 \
--preload-file models/resources/models/gltf/robot.glb@resources/models/gltf/robot.glb

models/models_loading_m3d: models/models_loading_m3d.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) -sTOTAL_MEMORY=67108864 \
--preload-file models/resources/models/m3d/cesium_man.m3d@resources/models/m3d/cesium_man.m3d

models/models_loading_vox: models/models_loading_vox.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) -sTOTAL_MEMORY=67108864 \
--preload-file models/resources/models/vox/chr_knight.vox@resources/models/vox/chr_knight.vox \
--preload-file models/resources/models/vox/chr_sword.vox@resources/models/vox/chr_sword.vox \
--preload-file models/resources/models/vox/monu9.vox@resources/models/vox/monu9.vox
--preload-file models/resources/models/vox/monu9.vox@resources/models/vox/monu9.vox

models/models_mesh_generation: models/models_mesh_generation.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
Expand All @@ -925,7 +951,7 @@ models/models_skybox: models/models_skybox.c

models/models_waving_cubes: models/models_waving_cubes.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)

models/models_yaw_pitch_roll: models/models_yaw_pitch_roll.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) -sTOTAL_MEMORY=67108864 \
--preload-file models/resources/models/obj/plane.obj@resources/models/obj/plane.obj \
Expand Down Expand Up @@ -1058,7 +1084,7 @@ audio/audio_mixed_processor: audio/audio_mixed_processor.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) -sTOTAL_MEMORY=67108864 \
--preload-file audio/resources/country.mp3@resources/country.mp3 \
--preload-file audio/resources/coin.wav@resources/coin.wav

audio/audio_module_playing: audio/audio_module_playing.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
--preload-file audio/resources/mini1111.xm@resources/mini1111.xm
Expand Down
Loading

0 comments on commit c5c3843

Please sign in to comment.