Skip to content

Commit

Permalink
Merge branch 'master' into overridable_config
Browse files Browse the repository at this point in the history
  • Loading branch information
raysan5 authored Dec 18, 2024
2 parents e3ac719 + 5800472 commit f2bfdea
Show file tree
Hide file tree
Showing 22 changed files with 1,195 additions and 1,042 deletions.
1 change: 1 addition & 0 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,7 @@ pub fn build(b: *std.Build) !void {
const lib = try compileRaylib(b, target, optimize, Options.getOptions(b));

lib.installHeader(b.path("src/raylib.h"), "raylib.h");
lib.installHeader(b.path("src/rcamera.h"), "rcamera.h");
lib.installHeader(b.path("src/raymath.h"), "raymath.h");
lib.installHeader(b.path("src/rlgl.h"), "rlgl.h");

Expand Down
39 changes: 23 additions & 16 deletions examples/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
# - Linux (X11 desktop mode)
# - macOS/OSX (x64, arm64 (not tested))
# - Others (not tested)
# > PLATFORM_WEB_RGFW:
# - HTML5 (WebAssembly)
# > PLATFORM_WEB:
# - HTML5 (WebAssembly)
# > PLATFORM_DRM:
Expand Down Expand Up @@ -51,7 +53,7 @@

# Define required environment variables
#------------------------------------------------------------------------------------------------
# Define target platform: PLATFORM_DESKTOP, PLATFORM_DESKTOP_SDL, PLATFORM_DRM, PLATFORM_ANDROID, PLATFORM_WEB
# Define target platform: PLATFORM_DESKTOP, PLATFORM_DESKTOP_SDL, PLATFORM_DRM, PLATFORM_ANDROID, PLATFORM_WEB, PLATFORM_WEB_RGFW
PLATFORM ?= PLATFORM_DESKTOP

ifeq ($(PLATFORM),$(filter $(PLATFORM),PLATFORM_DESKTOP_GLFW PLATFORM_DESKTOP_SDL PLATFORM_DESKTOP_RGFW))
Expand Down Expand Up @@ -107,7 +109,7 @@ BUILD_WEB_RESOURCES ?= TRUE
BUILD_WEB_RESOURCES_PATH ?= $(dir $<)resources@resources

# Determine PLATFORM_OS when required
ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_DESKTOP_GLFW PLATFORM_DESKTOP_SDL PLATFORM_DESKTOP_RGFW PLATFORM_WEB))
ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_DESKTOP_GLFW PLATFORM_DESKTOP_SDL PLATFORM_DESKTOP_RGFW PLATFORM_WEB PLATFORM_WEB_RGFW))
# No uname.exe on MinGW!, but OS=Windows_NT on Windows!
# ifeq ($(UNAME),Msys) -> Windows
ifeq ($(OS),Windows_NT)
Expand Down Expand Up @@ -158,7 +160,7 @@ endif
# Define raylib release directory for compiled library
RAYLIB_RELEASE_PATH ?= $(RAYLIB_PATH)/src

ifeq ($(TARGET_PLATFORM),PLATFORM_WEB)
ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW))
ifeq ($(PLATFORM_OS),WINDOWS)
# Emscripten required variables
EMSDK_PATH ?= C:/raylib/emsdk
Expand All @@ -184,8 +186,8 @@ ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_GLFW)
CC = clang
endif
endif
ifeq ($(TARGET_PLATFORM),PLATFORM_WEB)
# HTML5 emscripten compiler
ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW))
# HTML5 emscripten compiler
# WARNING: To compile to HTML5, code must be redesigned
# to use emscripten.h and emscripten_set_main_loop()
CC = emcc
Expand All @@ -203,7 +205,7 @@ endif
ifeq ($(TARGET_PLATFORM),PLATFORM_ANDROID)
MAKE = mingw32-make
endif
ifeq ($(TARGET_PLATFORM),PLATFORM_WEB)
ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW))
ifeq ($(OS),Windows_NT)
MAKE = mingw32-make
else
Expand Down Expand Up @@ -231,11 +233,11 @@ CFLAGS = -Wall -std=c99 -D_DEFAULT_SOURCE -Wno-missing-braces -Wunused-result

ifeq ($(BUILD_MODE),DEBUG)
CFLAGS += -g -D_DEBUG
ifeq ($(TARGET_PLATFORM),PLATFORM_WEB)
ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW))
CFLAGS += -sASSERTIONS=1 --profiling
endif
else
ifeq ($(TARGET_PLATFORM),PLATFORM_WEB)
else
ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW))
ifeq ($(BUILD_WEB_ASYNCIFY),TRUE)
CFLAGS += -O3
else
Expand Down Expand Up @@ -325,7 +327,7 @@ ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_SDL)
endif
LDFLAGS += -L$(SDL_LIBRARY_PATH)
endif
ifeq ($(TARGET_PLATFORM),PLATFORM_WEB)
ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW))
# -Os # size optimization
# -O2 # optimization level 2, if used, also set --memory-init-file 0
# -sUSE_GLFW=3 # Use glfw3 library (context/input management)
Expand All @@ -341,9 +343,14 @@ ifeq ($(TARGET_PLATFORM),PLATFORM_WEB)
# --memory-init-file 0 # to avoid an external memory initialization code file (.mem)
# --preload-file resources # specify a resources folder for data compilation
# --source-map-base # allow debugging in browser with source map
LDFLAGS += -sUSE_GLFW=3 -sTOTAL_MEMORY=$(BUILD_WEB_HEAP_SIZE) -sFORCE_FILESYSTEM=1

# Build using asyncify
ifeq ($(TARGET_PLATFORM),PLATFORM_WEB)
LDFLAGS += -sUSE_GLFW=3
endif

LDFLAGS += -sTOTAL_MEMORY=$(BUILD_WEB_HEAP_SIZE) -sFORCE_FILESYSTEM=1

# Build using asyncify
ifeq ($(BUILD_WEB_ASYNCIFY),TRUE)
LDFLAGS += -sASYNCIFY
endif
Expand Down Expand Up @@ -480,9 +487,9 @@ ifeq ($(TARGET_PLATFORM),PLATFORM_DRM)
# NOTE: Required packages: libasound2-dev (ALSA)
LDLIBS = -lraylib -lGLESv2 -lEGL -lpthread -lrt -lm -lgbm -ldrm -ldl -latomic
endif
ifeq ($(TARGET_PLATFORM),PLATFORM_WEB)
ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW))
# Libraries for web (HTML5) compiling
LDLIBS = $(RAYLIB_RELEASE_PATH)/libraylib.a
LDLIBS = $(RAYLIB_RELEASE_PATH)/libraylib.web.a
endif

# Define source code object files required
Expand Down Expand Up @@ -681,7 +688,7 @@ others: $(OTHERS)
%: %.c
ifeq ($(TARGET_PLATFORM),PLATFORM_ANDROID)
$(MAKE) -f Makefile.Android PROJECT_NAME=$@ PROJECT_SOURCE_FILES=$<
else ifeq ($(TARGET_PLATFORM),PLATFORM_WEB)
else ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW))
$(MAKE) -f Makefile.Web $@
else
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) -D$(TARGET_PLATFORM)
Expand Down Expand Up @@ -710,7 +717,7 @@ ifeq ($(TARGET_PLATFORM),PLATFORM_DRM)
find . -type f -executable -delete
rm -fv *.o
endif
ifeq ($(TARGET_PLATFORM),PLATFORM_WEB)
ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW))
ifeq ($(PLATFORM_OS),WINDOWS)
del *.wasm *.html *.js *.data
else
Expand Down
27 changes: 16 additions & 11 deletions examples/Makefile.Web
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ BUILD_WEB_HEAP_SIZE ?= 134217728
USE_WEBGL2 ?= FALSE

# Determine PLATFORM_OS in case PLATFORM_DESKTOP or PLATFORM_WEB selected
ifeq ($(PLATFORM),$(filter $(PLATFORM),PLATFORM_DESKTOP PLATFORM_WEB))
ifeq ($(PLATFORM),$(filter $(PLATFORM),PLATFORM_DESKTOP PLATFORM_WEB PLATFORM_WEB_RGFW))
# No uname.exe on MinGW!, but OS=Windows_NT on Windows!
# ifeq ($(UNAME),Msys) -> Windows
ifeq ($(OS),Windows_NT)
Expand Down Expand Up @@ -116,7 +116,7 @@ endif
# Define raylib release directory for compiled library
RAYLIB_RELEASE_PATH ?= $(RAYLIB_PATH)/src

ifeq ($(PLATFORM),PLATFORM_WEB)
ifeq ($(PLATFORM),$(filter $(PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW))
ifeq ($(PLATFORM_OS),WINDOWS)
# Emscripten required variables
EMSDK_PATH ?= C:/raylib/emsdk
Expand All @@ -142,7 +142,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
CC = clang
endif
endif
ifeq ($(PLATFORM),PLATFORM_WEB)
ifeq ($(PLATFORM),$(filter $(PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW))
# HTML5 emscripten compiler
# WARNING: To compile to HTML5, code must be redesigned
# to use emscripten.h and emscripten_set_main_loop()
Expand All @@ -161,7 +161,7 @@ endif
ifeq ($(PLATFORM),PLATFORM_ANDROID)
MAKE = mingw32-make
endif
ifeq ($(TARGET_PLATFORM),PLATFORM_WEB)
ifeq ($(PLATFORM),$(filter $(PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW))
ifeq ($(OS),Windows_NT)
MAKE = mingw32-make
else
Expand Down Expand Up @@ -189,11 +189,11 @@ CFLAGS = -Wall -std=c99 -D_DEFAULT_SOURCE -Wno-missing-braces -Wunused-result

ifeq ($(BUILD_MODE),DEBUG)
CFLAGS += -g -D_DEBUG
ifeq ($(PLATFORM),PLATFORM_WEB)
ifeq ($(PLATFORM),$(filter $(PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW))
CFLAGS += -sASSERTIONS=1 --profiling
endif
else
ifeq ($(PLATFORM),PLATFORM_WEB)
ifeq ($(PLATFORM),$(filter $(PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW))
ifeq ($(BUILD_WEB_ASYNCIFY),TRUE)
CFLAGS += -O3
else
Expand Down Expand Up @@ -263,7 +263,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
LDFLAGS += -Lsrc -L$(RAYLIB_LIB_PATH)
endif
endif
ifeq ($(PLATFORM),PLATFORM_WEB)
ifeq ($(PLATFORM),$(filter $(PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW))
# -Os # size optimization
# -O2 # optimization level 2, if used, also set --memory-init-file 0
# -sUSE_GLFW=3 # Use glfw3 library (context/input management)
Expand All @@ -279,7 +279,12 @@ ifeq ($(PLATFORM),PLATFORM_WEB)
# --memory-init-file 0 # to avoid an external memory initialization code file (.mem)
# --preload-file resources # specify a resources folder for data compilation
# --source-map-base # allow debugging in browser with source map
LDFLAGS += -sUSE_GLFW=3 -sEXPORTED_RUNTIME_METHODS=ccall

ifeq ($(PLATFORM),PLATFORM_WEB)
LDFLAGS += -sUSE_GLFW=3
endif

LDFLAGS += -sEXPORTED_RUNTIME_METHODS=ccall

# Build using asyncify
ifeq ($(BUILD_WEB_ASYNCIFY),TRUE)
Expand Down Expand Up @@ -363,9 +368,9 @@ ifeq ($(PLATFORM),PLATFORM_DRM)
# NOTE: Required packages: libasound2-dev (ALSA)
LDLIBS = -lraylib -lGLESv2 -lEGL -lpthread -lrt -lm -lgbm -ldrm -ldl -latomic
endif
ifeq ($(PLATFORM),PLATFORM_WEB)
ifeq ($(PLATFORM),$(filter $(PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW))
# Libraries for web (HTML5) compiling
LDLIBS = $(RAYLIB_RELEASE_PATH)/libraylib.a
LDLIBS = $(RAYLIB_RELEASE_PATH)/libraylib.web.a
endif

# Define source code object files required
Expand Down Expand Up @@ -1225,7 +1230,7 @@ ifeq ($(PLATFORM),PLATFORM_DRM)
find . -type f -executable -delete
rm -fv *.o
endif
ifeq ($(PLATFORM),PLATFORM_WEB)
ifeq ($(PLATFORM),$(filter $(PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW))
del *.o *.html *.js
endif
@echo Cleaning done
Expand Down
4 changes: 2 additions & 2 deletions parser/output/raylib_api.json
Original file line number Diff line number Diff line change
Expand Up @@ -9801,7 +9801,7 @@
},
{
"name": "TextToInteger",
"description": "Get integer value from text (negative values not supported)",
"description": "Get integer value from text",
"returnType": "int",
"params": [
{
Expand All @@ -9812,7 +9812,7 @@
},
{
"name": "TextToFloat",
"description": "Get float value from text (negative values not supported)",
"description": "Get float value from text",
"returnType": "float",
"params": [
{
Expand Down
4 changes: 2 additions & 2 deletions parser/output/raylib_api.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6969,15 +6969,15 @@ return {
},
{
name = "TextToInteger",
description = "Get integer value from text (negative values not supported)",
description = "Get integer value from text",
returnType = "int",
params = {
{type = "const char *", name = "text"}
}
},
{
name = "TextToFloat",
description = "Get float value from text (negative values not supported)",
description = "Get float value from text",
returnType = "float",
params = {
{type = "const char *", name = "text"}
Expand Down
4 changes: 2 additions & 2 deletions parser/output/raylib_api.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3757,12 +3757,12 @@ Function 438: TextToCamel() (1 input parameters)
Function 439: TextToInteger() (1 input parameters)
Name: TextToInteger
Return type: int
Description: Get integer value from text (negative values not supported)
Description: Get integer value from text
Param[1]: text (type: const char *)
Function 440: TextToFloat() (1 input parameters)
Name: TextToFloat
Return type: float
Description: Get float value from text (negative values not supported)
Description: Get float value from text
Param[1]: text (type: const char *)
Function 441: DrawLine3D() (3 input parameters)
Name: DrawLine3D
Expand Down
4 changes: 2 additions & 2 deletions parser/output/raylib_api.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2487,10 +2487,10 @@
<Function name="TextToCamel" retType="const char *" paramCount="1" desc="Get Camel case notation version of provided string">
<Param type="const char *" name="text" desc="" />
</Function>
<Function name="TextToInteger" retType="int" paramCount="1" desc="Get integer value from text (negative values not supported)">
<Function name="TextToInteger" retType="int" paramCount="1" desc="Get integer value from text">
<Param type="const char *" name="text" desc="" />
</Function>
<Function name="TextToFloat" retType="float" paramCount="1" desc="Get float value from text (negative values not supported)">
<Function name="TextToFloat" retType="float" paramCount="1" desc="Get float value from text">
<Param type="const char *" name="text" desc="" />
</Function>
<Function name="DrawLine3D" retType="void" paramCount="3" desc="Draw a line in 3D world space">
Expand Down
4 changes: 0 additions & 4 deletions projects/VS2022/raylib.sln
Original file line number Diff line number Diff line change
Expand Up @@ -693,16 +693,12 @@ Global
{F026020F-7B00-40C8-91C3-5DE85EC45A95}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32
{F026020F-7B00-40C8-91C3-5DE85EC45A95}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32
{F026020F-7B00-40C8-91C3-5DE85EC45A95}.Debug|x64.ActiveCfg = Debug|x64
{F026020F-7B00-40C8-91C3-5DE85EC45A95}.Debug|x64.Build.0 = Debug|x64
{F026020F-7B00-40C8-91C3-5DE85EC45A95}.Debug|x86.ActiveCfg = Debug|Win32
{F026020F-7B00-40C8-91C3-5DE85EC45A95}.Debug|x86.Build.0 = Debug|Win32
{F026020F-7B00-40C8-91C3-5DE85EC45A95}.Release.DLL|x64.ActiveCfg = Release.DLL|x64
{F026020F-7B00-40C8-91C3-5DE85EC45A95}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32
{F026020F-7B00-40C8-91C3-5DE85EC45A95}.Release.DLL|x86.Build.0 = Release.DLL|Win32
{F026020F-7B00-40C8-91C3-5DE85EC45A95}.Release|x64.ActiveCfg = Release|x64
{F026020F-7B00-40C8-91C3-5DE85EC45A95}.Release|x64.Build.0 = Release|x64
{F026020F-7B00-40C8-91C3-5DE85EC45A95}.Release|x86.ActiveCfg = Release|Win32
{F026020F-7B00-40C8-91C3-5DE85EC45A95}.Release|x86.Build.0 = Release|Win32
{6B8BAAF1-75C7-4C68-80B8-0E2A9EABBD9A}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64
{6B8BAAF1-75C7-4C68-80B8-0E2A9EABBD9A}.Debug.DLL|x64.Build.0 = Debug.DLL|x64
{6B8BAAF1-75C7-4C68-80B8-0E2A9EABBD9A}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32
Expand Down
1 change: 1 addition & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ endif()
# Used as public API to be included into other projects
set(raylib_public_headers
raylib.h
rcamera.h
rlgl.h
raymath.h
)
Expand Down
Loading

0 comments on commit f2bfdea

Please sign in to comment.