Skip to content

Commit

Permalink
Merge branch 'raysan5:master' into pure
Browse files Browse the repository at this point in the history
  • Loading branch information
ColleagueRiley authored Jan 11, 2025
2 parents e75de4b + 43db59d commit 6b23824
Show file tree
Hide file tree
Showing 58 changed files with 691 additions and 391 deletions.
3 changes: 2 additions & 1 deletion BINDINGS.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Some people ported raylib to other languages in the form of bindings or wrappers
| [raylib-matte](https://github.com/jcorks/raylib-matte) | 4.6-dev | [Matte](https://github.com/jcorks/matte) | **???** |
| [Raylib.nelua](https://github.com/AuzFox/Raylib.nelua) | **5.0** | [nelua](https://nelua.io) | Zlib |
| [raylib-bindings](https://github.com/vaiorabbit/raylib-bindings) | 5.6-dev | [Ruby](https://www.ruby-lang.org/en) | Zlib |
| [naylib](https://github.com/planetis-m/naylib) | **5.1-dev** | [Nim](https://nim-lang.org) | MIT |
| [naylib](https://github.com/planetis-m/naylib) | **5.6-dev** | [Nim](https://nim-lang.org) | MIT |
| [node-raylib](https://github.com/RobLoach/node-raylib) | 4.5 | [Node.js](https://nodejs.org/en) | Zlib |
| [raylib-odin](https://github.com/odin-lang/Odin/tree/master/vendor/raylib) | **5.5** | [Odin](https://odin-lang.org) | BSD-3Clause |
| [raylib_odin_bindings](https://github.com/Deathbat2190/raylib_odin_bindings) | 4.0-dev | [Odin](https://odin-lang.org) | MIT |
Expand All @@ -69,6 +69,7 @@ Some people ported raylib to other languages in the form of bindings or wrappers
| [raylibr](https://github.com/jeroenjanssens/raylibr) | 4.0 | [R](https://www.r-project.org) | MIT |
| [raylib-ffi](https://github.com/ewpratten/raylib-ffi) | 5.5 | [Rust](https://www.rust-lang.org) | GPLv3 |
| [raylib-rs](https://github.com/raylib-rs/raylib-rs) | **5.5** | [Rust](https://www.rust-lang.org) | Zlib |
| [raylib-ruby](https://github.com/wilsonsilva/raylib-ruby) | 4.5 | [Ruby](https://www.ruby-lang.org) | Zlib |
| [Relib](https://github.com/RedCubeDev-ByteSpace/Relib) | 3.5 | [ReCT](https://github.com/RedCubeDev-ByteSpace/ReCT) | **???** |
| [racket-raylib](https://github.com/eutro/racket-raylib) | 4.0 | [Racket](https://racket-lang.org) | MIT/Apache-2.0 |
| [raylib-swift](https://github.com/STREGAsGate/Raylib) | 4.0 | [Swift](https://swift.org) | MIT |
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2013-2024 Ramon Santamaria (@raysan5)
Copyright (c) 2013-2025 Ramon Santamaria (@raysan5)

This software is provided "as-is", without any express or implied warranty. In no event
will the authors be held liable for any damages arising from the use of this software.
Expand Down
24 changes: 12 additions & 12 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ comptime {

fn setDesktopPlatform(raylib: *std.Build.Step.Compile, platform: PlatformBackend) void {
switch (platform) {
.glfw => raylib.defineCMacro("PLATFORM_DESKTOP_GLFW", null),
.rgfw => raylib.defineCMacro("PLATFORM_DESKTOP_RGFW", null),
.sdl => raylib.defineCMacro("PLATFORM_DESKTOP_SDL", null),
.glfw => raylib.root_module.addCMacro("PLATFORM_DESKTOP_GLFW", ""),
.rgfw => raylib.root_module.addCMacro("PLATFORM_DESKTOP_RGFW", ""),
.sdl => raylib.root_module.addCMacro("PLATFORM_DESKTOP_SDL", ""),
else => {},
}
}
Expand Down Expand Up @@ -173,7 +173,7 @@ fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.
}

if (options.opengl_version != .auto) {
raylib.defineCMacro(options.opengl_version.toCMacroStr(), null);
raylib.root_module.addCMacro(options.opengl_version.toCMacroStr(), "");
}

raylib.addIncludePath(b.path("src/platforms"));
Expand All @@ -191,7 +191,7 @@ fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.
try c_source_files.append("src/rglfw.c");

if (options.linux_display_backend == .X11 or options.linux_display_backend == .Both) {
raylib.defineCMacro("_GLFW_X11", null);
raylib.root_module.addCMacro("_GLFW_X11", "");
raylib.linkSystemLibrary("GLX");
raylib.linkSystemLibrary("X11");
raylib.linkSystemLibrary("Xcursor");
Expand All @@ -211,7 +211,7 @@ fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.
, .{});
@panic("`wayland-scanner` not found");
};
raylib.defineCMacro("_GLFW_WAYLAND", null);
raylib.root_module.addCMacro("_GLFW_WAYLAND", "");
raylib.linkSystemLibrary("EGL");
raylib.linkSystemLibrary("wayland-client");
raylib.linkSystemLibrary("xkbcommon");
Expand All @@ -230,16 +230,16 @@ fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.
} else {
if (options.opengl_version == .auto) {
raylib.linkSystemLibrary("GLESv2");
raylib.defineCMacro("GRAPHICS_API_OPENGL_ES2", null);
raylib.root_module.addCMacro("GRAPHICS_API_OPENGL_ES2", "");
}

raylib.linkSystemLibrary("EGL");
raylib.linkSystemLibrary("gbm");
raylib.linkSystemLibrary2("libdrm", .{ .use_pkg_config = .force });

raylib.defineCMacro("PLATFORM_DRM", null);
raylib.defineCMacro("EGL_NO_X11", null);
raylib.defineCMacro("DEFAULT_BATCH_BUFFER_ELEMENT", "2048");
raylib.root_module.addCMacro("PLATFORM_DRM", "");
raylib.root_module.addCMacro("EGL_NO_X11", "");
raylib.root_module.addCMacro("DEFAULT_BATCH_BUFFER_ELEMENT", "");
}
},
.freebsd, .openbsd, .netbsd, .dragonfly => {
Expand Down Expand Up @@ -290,9 +290,9 @@ fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.
raylib.addIncludePath(dep.path("upstream/emscripten/cache/sysroot/include"));
}

raylib.defineCMacro("PLATFORM_WEB", null);
raylib.root_module.addCMacro("PLATFORM_WEB", "");
if (options.opengl_version == .auto) {
raylib.defineCMacro("GRAPHICS_API_OPENGL_ES2", null);
raylib.root_module.addCMacro("GRAPHICS_API_OPENGL_ES2", "");
}
},
else => {
Expand Down
4 changes: 2 additions & 2 deletions build.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

.dependencies = .{
.xcode_frameworks = .{
.url = "git+https://github.com/hexops/xcode-frameworks#a6bf82e032d4d9923ad5c222d466710fcc05f249",
.hash = "12208da4dfcd9b53fb367375fb612ec73f38e53015f1ce6ae6d6e8437a637078e170",
.url = "git+https://github.com/hexops/xcode-frameworks#9a45f3ac977fd25dff77e58c6de1870b6808c4a7",
.hash = "122098b9174895f9708bc824b0f9e550c401892c40a900006459acf2cbf78acd99bb",
.lazy = true,
},
.emsdk = .{
Expand Down
8 changes: 8 additions & 0 deletions cmake/LibraryConfigurations.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,14 @@ elseif (${PLATFORM} MATCHES "Android")
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
list(APPEND raylib_sources ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
include_directories(${ANDROID_NDK}/sources/android/native_app_glue)

# NOTE: We remove '-Wl,--no-undefined' (set by default) as it conflicts with '-Wl,-undefined,dynamic_lookup' needed
# for compiling with the missing 'void main(void)' declaration in `android_main()`.
# We also remove other unnecessary or problematic flags.

string(REPLACE "-Wl,--no-undefined -Qunused-arguments" "" CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}")
string(REPLACE "-static-libstdc++" "" CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}")

set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--exclude-libs,libatomic.a -Wl,--build-id -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,--warn-shared-textrel -Wl,--fatal-warnings -u ANativeActivity_onCreate -Wl,-undefined,dynamic_lookup")

find_library(OPENGL_LIBRARY OpenGL)
Expand Down
14 changes: 14 additions & 0 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,21 @@ endif ()
# The rlgl_standalone example only targets desktop, without shared libraries.
if (BUILD_SHARED_LIBS OR NOT ${PLATFORM} MATCHES "Desktop")
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/others/rlgl_standalone.c)
endif()

# The audio examples fail to link if raylib is built without raudio
if (NOT SUPPORT_MODULE_RAUDIO)
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/audio/audio_mixed_processor.c)
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/audio/audio_module_playing.c)
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/audio/audio_music_stream.c)
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/audio/audio_raw_stream.c)
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/audio/audio_sound_loading.c)
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/audio/audio_sound_multi.c)
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/audio/audio_stream_effects.c)

list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/others/embedded_files_loading.c)
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/textures/textures_sprite_button.c)
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/textures/textures_sprite_explosion.c)
endif()

include_directories(BEFORE SYSTEM others/external/include)
Expand Down
2 changes: 1 addition & 1 deletion examples/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
# > PLATFORM_ANDROID:
# - Android (ARM, ARM64)
#
# Copyright (c) 2013-2024 Ramon Santamaria (@raysan5)
# Copyright (c) 2013-2025 Ramon Santamaria (@raysan5)
#
# This software is provided "as-is", without any express or implied warranty. In no event
# will the authors be held liable for any damages arising from the use of this software.
Expand Down
2 changes: 1 addition & 1 deletion examples/Makefile.Android
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# raylib makefile for Android project (APK building)
#
# Copyright (c) 2017-2024 Ramon Santamaria (@raysan5)
# Copyright (c) 2017-2025 Ramon Santamaria (@raysan5)
#
# This software is provided "as-is", without any express or implied warranty. In no event
# will the authors be held liable for any damages arising from the use of this software.
Expand Down
2 changes: 1 addition & 1 deletion examples/Makefile.Web
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# raylib makefile for Web platform
#
# Copyright (c) 2013-2024 Ramon Santamaria (@raysan5)
# Copyright (c) 2013-2025 Ramon Santamaria (@raysan5)
#
# This software is provided "as-is", without any express or implied warranty. In no event
# will the authors be held liable for any damages arising from the use of this software.
Expand Down
6 changes: 3 additions & 3 deletions examples/build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ fn add_module(comptime module: []const u8, b: *std.Build, target: std.Build.Reso
exe.linkSystemLibrary("gdi32");
exe.linkSystemLibrary("opengl32");

exe.defineCMacro("PLATFORM_DESKTOP", null);
exe.root_module.addCMacro("PLATFORM_DESKTOP", "");
},
.linux => {
exe.linkSystemLibrary("GL");
Expand All @@ -55,7 +55,7 @@ fn add_module(comptime module: []const u8, b: *std.Build, target: std.Build.Reso
exe.linkSystemLibrary("m");
exe.linkSystemLibrary("X11");

exe.defineCMacro("PLATFORM_DESKTOP", null);
exe.root_module.addCMacro("PLATFORM_DESKTOP", "");
},
.macos => {
exe.linkFramework("Foundation");
Expand All @@ -65,7 +65,7 @@ fn add_module(comptime module: []const u8, b: *std.Build, target: std.Build.Reso
exe.linkFramework("CoreVideo");
exe.linkFramework("IOKit");

exe.defineCMacro("PLATFORM_DESKTOP", null);
exe.root_module.addCMacro("PLATFORM_DESKTOP", "");
},
else => {
@panic("Unsupported OS");
Expand Down
4 changes: 2 additions & 2 deletions examples/core/core_3d_camera_split_screen.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ int main(void)
// Update
//----------------------------------------------------------------------------------
// If anyone moves this frame, how far will they move based on the time since the last frame
// this moves thigns at 10 world units per second, regardless of the actual FPS
// this moves things at 10 world units per second, regardless of the actual FPS
float offsetThisFrame = 10.0f*GetFrameTime();

// Move Player1 forward and backwards (no turning)
Expand Down Expand Up @@ -171,4 +171,4 @@ int main(void)
//--------------------------------------------------------------------------------------

return 0;
}
}
2 changes: 1 addition & 1 deletion examples/examples.rc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ BEGIN
VALUE "FileDescription", "raylib example"
VALUE "FileVersion", "1.0"
VALUE "InternalName", "raylib-example"
VALUE "LegalCopyright", "(c) 2024 raylib technologies (@raylibtech)"
VALUE "LegalCopyright", "(c) 2025 raylib technologies (@raylibtech)"
//VALUE "OriginalFilename", "raylib_app.exe"
VALUE "ProductName", "raylib-example"
VALUE "ProductVersion", "1.0"
Expand Down
14 changes: 13 additions & 1 deletion examples/models/resources/shaders/glsl330/skinning.vs
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,19 @@
in vec3 vertexPosition;
in vec2 vertexTexCoord;
in vec4 vertexColor;
in vec3 vertexNormal;
in vec4 vertexBoneIds;
in vec4 vertexBoneWeights;

// Input uniform values
uniform mat4 mvp;
uniform mat4 matNormal;
uniform mat4 boneMatrices[MAX_BONE_NUM];

// Output vertex attributes (to fragment shader)
out vec2 fragTexCoord;
out vec4 fragColor;
out vec3 fragNormal;

void main()
{
Expand All @@ -29,9 +32,18 @@ void main()
vertexBoneWeights.y*(boneMatrices[boneIndex1]*vec4(vertexPosition, 1.0)) +
vertexBoneWeights.z*(boneMatrices[boneIndex2]*vec4(vertexPosition, 1.0)) +
vertexBoneWeights.w*(boneMatrices[boneIndex3]*vec4(vertexPosition, 1.0));


vec4 skinnedNormal =
vertexBoneWeights.x*(boneMatrices[boneIndex0]*vec4(vertexNormal, 0.0)) +
vertexBoneWeights.y*(boneMatrices[boneIndex1]*vec4(vertexNormal, 0.0)) +
vertexBoneWeights.z*(boneMatrices[boneIndex2]*vec4(vertexNormal, 0.0)) +
vertexBoneWeights.w*(boneMatrices[boneIndex3]*vec4(vertexNormal, 0.0));
skinnedNormal.w = 0.0;

fragTexCoord = vertexTexCoord;
fragColor = vertexColor;

fragNormal = normalize(vec3(matNormal*skinnedNormal));

gl_Position = mvp*skinnedPosition;
}
Loading

0 comments on commit 6b23824

Please sign in to comment.