From bd637c295469be81af7234fb43fa3a3b70c9b702 Mon Sep 17 00:00:00 2001 From: execphantasmagoria Date: Sun, 1 Mar 2026 20:40:33 +0530 Subject: [PATCH 1/9] Fixed references to boneCount, bones, bindPose to reflect access to ModelSkeleton struct in raylib v6 --- .gitignore | 1 + include/Model.hpp | 29 +++++++++++++++++------------ 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/.gitignore b/.gitignore index dfcbe19a..c8e7988f 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ node_modules cmake-build-debug .idea docs +/.vs diff --git a/include/Model.hpp b/include/Model.hpp index c8c65af5..f8132120 100644 --- a/include/Model.hpp +++ b/include/Model.hpp @@ -58,9 +58,14 @@ class Model : public ::Model { other.meshes = nullptr; other.materials = nullptr; other.meshMaterial = nullptr; - other.boneCount = 0; - other.bones = nullptr; - other.bindPose = nullptr; + + /* + The Animation Data is now stored within a separate struct called + `ModelSkeleton`. The changes below reflect this update. + */ + other.skeleton.boneCount = 0; + other.skeleton.bones = nullptr; + other.skeleton.bindPose = nullptr; } GETTERSETTER(::Matrix, Transform, transform) @@ -69,9 +74,9 @@ class Model : public ::Model { GETTERSETTER(::Mesh*, Meshes, meshes) GETTERSETTER(::Material*, Materials, materials) GETTERSETTER(int*, MeshMaterial, meshMaterial) - GETTERSETTER(int, BoneCount, boneCount) - GETTERSETTER(::BoneInfo*, Bones, bones) - GETTERSETTER(::Transform*, BindPose, bindPose) + GETTERSETTER(int, BoneCount, skeleton.boneCount) + GETTERSETTER(::BoneInfo*, Bones, skeleton.bones) + GETTERSETTER(::Transform*, BindPose, skeleton.bindPose) Model& operator=(const ::Model& model) { set(model); @@ -93,9 +98,9 @@ class Model : public ::Model { other.meshes = nullptr; other.materials = nullptr; other.meshMaterial = nullptr; - other.boneCount = 0; - other.bones = nullptr; - other.bindPose = nullptr; + other.skeleton.boneCount = 0; + other.skeleton.bones = nullptr; + other.skeleton.bindPose = nullptr; return *this; } @@ -240,9 +245,9 @@ class Model : public ::Model { materials = model.materials; meshMaterial = model.meshMaterial; - boneCount = model.boneCount; - bones = model.bones; - bindPose = model.bindPose; + skeleton.boneCount = model.skeleton.boneCount; + skeleton.bones = model.skeleton.bones; + skeleton.bindPose = model.skeleton.bindPose; } }; From 2bbd53de3b8875f5cea85623b603adee080c6211 Mon Sep 17 00:00:00 2001 From: execphantasmagoria Date: Tue, 3 Mar 2026 17:42:05 +0530 Subject: [PATCH 2/9] Updated method UpdateModelAnimationBones() to UpdateModelAnimationEx() with correct datatype --- include/Model.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/Model.hpp b/include/Model.hpp index f8132120..5ba30cf5 100644 --- a/include/Model.hpp +++ b/include/Model.hpp @@ -127,7 +127,7 @@ class Model : public ::Model { /** * Update model animation pose */ - Model& UpdateAnimation(const ::ModelAnimation& anim, int frame) { + Model& UpdateAnimation(const ::ModelAnimation& anim, float frame) { ::UpdateModelAnimation(*this, anim, frame); return *this; } @@ -135,8 +135,8 @@ class Model : public ::Model { /** * Update model animation pose */ - Model& UpdateAnimationBones(const ::ModelAnimation& anim, int frame) { - ::UpdateModelAnimationBones(*this, anim, frame); + Model& UpdateAnimationsEx(const ::ModelAnimation& animA, float frameA, const ::ModelAnimation& animB, float frameB, float blend) { + ::UpdateModelAnimationEx(*this, animA, frameA, animB, frameB, blend); return *this; } From 9ce142d541a018b2cbe516edacb996079cd99fde Mon Sep 17 00:00:00 2001 From: execphantasmagoria Date: Tue, 3 Mar 2026 18:01:12 +0530 Subject: [PATCH 3/9] Updated boneId to boneIndices, relocated boneMatrices from Mesh to Model, added currentPose --- include/MeshUnmanaged.hpp | 8 +++----- include/Model.hpp | 13 +++++++++---- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/include/MeshUnmanaged.hpp b/include/MeshUnmanaged.hpp index 386ae2a4..8aaa1d6e 100644 --- a/include/MeshUnmanaged.hpp +++ b/include/MeshUnmanaged.hpp @@ -35,9 +35,8 @@ class MeshUnmanaged : public ::Mesh { indices = nullptr; animVertices = nullptr; animNormals = nullptr; - boneIds = nullptr; + boneIndices = nullptr; boneWeights = nullptr; - boneMatrices = nullptr; boneCount = 0; vaoId = 0; vboId = nullptr; @@ -130,7 +129,7 @@ class MeshUnmanaged : public ::Mesh { GETTERSETTER(unsigned short*, Indices, indices) // NOLINT GETTERSETTER(float*, AnimVertices, animVertices) GETTERSETTER(float*, AnimNormals, animNormals) - GETTERSETTER(unsigned char*, BoneIds, boneIds) + GETTERSETTER(unsigned char*, BoneIndices, boneIndices) GETTERSETTER(float*, BoneWeights, boneWeights) GETTERSETTER(unsigned int, VaoId, vaoId) GETTERSETTER(unsigned int*, VboId, vboId) @@ -242,9 +241,8 @@ class MeshUnmanaged : public ::Mesh { indices = mesh.indices; animVertices = mesh.animVertices; animNormals = mesh.animNormals; - boneIds = mesh.boneIds; + boneIndices = mesh.boneIndices; boneWeights = mesh.boneWeights; - boneMatrices = mesh.boneMatrices; vaoId = mesh.vaoId; vboId = mesh.vboId; } diff --git a/include/Model.hpp b/include/Model.hpp index 5ba30cf5..5e6597c0 100644 --- a/include/Model.hpp +++ b/include/Model.hpp @@ -59,13 +59,12 @@ class Model : public ::Model { other.materials = nullptr; other.meshMaterial = nullptr; - /* - The Animation Data is now stored within a separate struct called - `ModelSkeleton`. The changes below reflect this update. - */ other.skeleton.boneCount = 0; other.skeleton.bones = nullptr; other.skeleton.bindPose = nullptr; + + ModelAnimPose currentPose; + Matrix *boneMatrices; } GETTERSETTER(::Matrix, Transform, transform) @@ -77,6 +76,8 @@ class Model : public ::Model { GETTERSETTER(int, BoneCount, skeleton.boneCount) GETTERSETTER(::BoneInfo*, Bones, skeleton.bones) GETTERSETTER(::Transform*, BindPose, skeleton.bindPose) + GETTERSETTER(::ModelAnimPose, CurrentPose, currentPose) + GETTERSETTER(::Matrix*, BoneMatrices, boneMatrices) Model& operator=(const ::Model& model) { set(model); @@ -101,6 +102,8 @@ class Model : public ::Model { other.skeleton.boneCount = 0; other.skeleton.bones = nullptr; other.skeleton.bindPose = nullptr; + other.currentPose = nullptr; + other.boneMatrices = nullptr; return *this; } @@ -248,6 +251,8 @@ class Model : public ::Model { skeleton.boneCount = model.skeleton.boneCount; skeleton.bones = model.skeleton.bones; skeleton.bindPose = model.skeleton.bindPose; + currentPose = model.currentPose; + boneMatrices = model.boneMatrices; } }; From 17494404818be1df836f1b3a3e4c0c72259546bc Mon Sep 17 00:00:00 2001 From: execphantasmagoria Date: Tue, 3 Mar 2026 18:11:23 +0530 Subject: [PATCH 4/9] Updated boneId to boneIndices in Mesh.hpp --- include/Mesh.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/Mesh.hpp b/include/Mesh.hpp index ff960406..29182350 100644 --- a/include/Mesh.hpp +++ b/include/Mesh.hpp @@ -48,7 +48,7 @@ class Mesh : public MeshUnmanaged { other.indices = nullptr; other.animVertices = nullptr; other.animNormals = nullptr; - other.boneIds = nullptr; + other.boneIndices = nullptr; other.boneWeights = nullptr; other.vaoId = 0; other.vboId = nullptr; @@ -73,7 +73,7 @@ class Mesh : public MeshUnmanaged { other.indices = nullptr; other.animVertices = nullptr; other.animNormals = nullptr; - other.boneIds = nullptr; + other.boneIndices = nullptr; other.boneWeights = nullptr; other.vaoId = 0; other.vboId = nullptr; From a417182fa2c9505cbeb89e6367e638e67554e0bc Mon Sep 17 00:00:00 2001 From: execphantasmagoria Date: Tue, 3 Mar 2026 18:25:26 +0530 Subject: [PATCH 5/9] Updated ModelAnimation frameCount and framePoses to keyframeCount and keyframePoses. Removed redundant BoneInfo. --- include/ModelAnimation.hpp | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/include/ModelAnimation.hpp b/include/ModelAnimation.hpp index f747244e..ec9111ee 100644 --- a/include/ModelAnimation.hpp +++ b/include/ModelAnimation.hpp @@ -22,9 +22,8 @@ class ModelAnimation : public ::ModelAnimation { set(other); other.boneCount = 0; - other.frameCount = 0; - other.bones = nullptr; - other.framePoses = nullptr; + other.keyframeCount = 0; + other.keyframePoses = nullptr; } ~ModelAnimation() { Unload(); } @@ -43,9 +42,8 @@ class ModelAnimation : public ::ModelAnimation { } GETTERSETTER(int, BoneCount, boneCount) - GETTERSETTER(::BoneInfo*, Bones, bones) - GETTERSETTER(int, FrameCount, frameCount) - GETTERSETTER(::Transform**, FramePoses, framePoses) + GETTERSETTER(int, KeyframeCount, keyframeCount) + GETTERSETTER(::Transform**, KeyframePoses, keyframePoses) ModelAnimation& operator=(const ::ModelAnimation& model) { set(model); @@ -63,9 +61,8 @@ class ModelAnimation : public ::ModelAnimation { set(other); other.boneCount = 0; - other.frameCount = 0; - other.bones = nullptr; - other.framePoses = nullptr; + other.keyframeCount = 0; + other.keyframePoses = nullptr; return *this; } @@ -98,9 +95,8 @@ class ModelAnimation : public ::ModelAnimation { protected: void set(const ::ModelAnimation& model) { boneCount = model.boneCount; - frameCount = model.frameCount; - bones = model.bones; - framePoses = model.framePoses; + keyframeCount = model.keyframeCount; + keyframePoses = model.keyframePoses; // Duplicate the name. TextCopy() uses the null terminator, which we ignore here. for (int i = 0; i < 32; i++) { From ad071979fa41c178812158ee1d246da7c2b6e35c Mon Sep 17 00:00:00 2001 From: execphantasmagoria Date: Tue, 3 Mar 2026 22:14:33 +0530 Subject: [PATCH 6/9] Fixed UnloadModelAnimation() to use a count --- include/ModelAnimation.hpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/include/ModelAnimation.hpp b/include/ModelAnimation.hpp index ec9111ee..c824995e 100644 --- a/include/ModelAnimation.hpp +++ b/include/ModelAnimation.hpp @@ -26,7 +26,8 @@ class ModelAnimation : public ::ModelAnimation { other.keyframePoses = nullptr; } - ~ModelAnimation() { Unload(); } + // TODO: Implement a way to unload all animations at once, as the current Unload() only unloads one animation. + ~ModelAnimation() { Unload(1); } /** * Load model animations from file @@ -57,7 +58,7 @@ class ModelAnimation : public ::ModelAnimation { return *this; } - Unload(); + Unload(1); set(other); other.boneCount = 0; @@ -70,7 +71,7 @@ class ModelAnimation : public ::ModelAnimation { /** * Unload animation data */ - void Unload() { ::UnloadModelAnimation(*this); } + void Unload(int animCount) { ::UnloadModelAnimation(this, animCount); } /** * Update model animation pose From fd98a5ece187e9f339c655ed9fc4ec659e473d3e Mon Sep 17 00:00:00 2001 From: execphantasmagoria Date: Tue, 3 Mar 2026 22:17:52 +0530 Subject: [PATCH 7/9] Fixed UpdateBones() to use UpdateModelAnimationsEx() instead --- include/ModelAnimation.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/ModelAnimation.hpp b/include/ModelAnimation.hpp index c824995e..20697525 100644 --- a/include/ModelAnimation.hpp +++ b/include/ModelAnimation.hpp @@ -84,8 +84,8 @@ class ModelAnimation : public ::ModelAnimation { /** * Update model animation mesh bone matrices (GPU skinning) */ - ModelAnimation& UpdateBones(const ::Model& model, int frame) { - ::UpdateModelAnimationBones(model, *this, frame); + ModelAnimation& UpdateBones(const ::Model& animA, float frameA, const ::Model& animB, float frameB, float blend) { + ::UpdateModelAnimationEx(*this, animA, frameA, animB, frameB, blend); return *this; } From 4e3a5ea5f330a42b11faabcde1178b0feddeed44 Mon Sep 17 00:00:00 2001 From: execphantasmagoria Date: Tue, 3 Mar 2026 22:26:24 +0530 Subject: [PATCH 8/9] Fixed: Reverted UpdateModelAnimationEx() to UpdateModelAnimation(). Corrected typos --- include/ModelAnimation.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/ModelAnimation.hpp b/include/ModelAnimation.hpp index 20697525..c5b2efd1 100644 --- a/include/ModelAnimation.hpp +++ b/include/ModelAnimation.hpp @@ -71,7 +71,7 @@ class ModelAnimation : public ::ModelAnimation { /** * Unload animation data */ - void Unload(int animCount) { ::UnloadModelAnimation(this, animCount); } + void Unload(int animCount) { ::UnloadModelAnimations(this, animCount); } /** * Update model animation pose @@ -84,8 +84,8 @@ class ModelAnimation : public ::ModelAnimation { /** * Update model animation mesh bone matrices (GPU skinning) */ - ModelAnimation& UpdateBones(const ::Model& animA, float frameA, const ::Model& animB, float frameB, float blend) { - ::UpdateModelAnimationEx(*this, animA, frameA, animB, frameB, blend); + ModelAnimation& UpdateBones(const ::Model& model, int frame) { + ::UpdateModelAnimation(model, *this, frame); return *this; } From 3cfa3dbf3e52c6dc8997e8c3ad1b439141b165ce Mon Sep 17 00:00:00 2001 From: Rob Loach Date: Tue, 3 Mar 2026 12:26:54 -0500 Subject: [PATCH 9/9] Update raylib version targeting for 6 --- CMakeLists.txt | 2 +- README.md | 2 +- clib.json | 2 +- examples/CMakeLists.txt | 2 +- include/raylib.hpp | 12 ++++-------- package.json | 2 +- projects/CMake/CMakeLists.txt | 2 +- 7 files changed, 10 insertions(+), 14 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8dfa16bd..bc49c3a8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.11) set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") project (raylib_cpp - VERSION 5.5.0 + VERSION 6.0.0 DESCRIPTION "raylib-cpp C++ Object Oriented Wrapper for raylib" HOMEPAGE_URL "https://github.com/robloach/raylib-cpp" LANGUAGES C CXX diff --git a/README.md b/README.md index dd5b59f3..4e2374da 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ![raylib-cpp Logo](projects/Doxygen/raylib-cpp_256x256.png) -# raylib-cpp ![Targeting raylib 5.0](https://img.shields.io/badge/for_raylib-5.0-blue) [![Tests](https://github.com/RobLoach/raylib-cpp/workflows/Tests/badge.svg)](https://github.com/RobLoach/raylib-cpp/actions?query=workflow%3ATests+branch%3Amaster) [![License](https://img.shields.io/badge/license-zlib%2Flibpng-blue.svg)](LICENSE) +# raylib-cpp ![Targeting raylib 6](https://img.shields.io/badge/for_raylib-6-blue) [![Tests](https://github.com/RobLoach/raylib-cpp/workflows/Tests/badge.svg)](https://github.com/RobLoach/raylib-cpp/actions?query=workflow%3ATests+branch%3Amaster) [![License](https://img.shields.io/badge/license-zlib%2Flibpng-blue.svg)](LICENSE) [raylib-cpp](https://github.com/robloach/raylib-cpp) is a C++ wrapper library for [raylib](https://www.raylib.com), a simple and easy-to-use library to enjoy videogames programming. This C++ header provides object-oriented wrappers around *raylib*'s struct interfaces. *raylib-cpp* is not required to use *raylib* in C++, but the classes do bring using the raylib API more inline with C++'s language paradigm. diff --git a/clib.json b/clib.json index 66e52e15..cd9ef040 100644 --- a/clib.json +++ b/clib.json @@ -1,6 +1,6 @@ { "name": "raylib-cpp", - "version": "5.5.0", + "version": "6.0.0-alpha1", "repo": "RobLoach/raylib-cpp", "description": "raylib-cpp: C++ Object-Oriented Wrapper for raylib", "homepage": "https://github.com/robloach/raylib-cpp", diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 6f4c3681..7e10e029 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -15,7 +15,7 @@ if (NOT raylib_FOUND) FetchContent_Declare( raylib GIT_REPOSITORY https://github.com/raysan5/raylib.git - GIT_TAG 5.5 + GIT_TAG 9ae34d2 GIT_SHALLOW 1 ) FetchContent_GetProperties(raylib) diff --git a/include/raylib.hpp b/include/raylib.hpp index 7fb2da34..94a85719 100644 --- a/include/raylib.hpp +++ b/include/raylib.hpp @@ -18,16 +18,12 @@ extern "C" { #error "raylib-cpp requires raylib >= 5" #endif -#if RAYLIB_VERSION_MAJOR < 5 -#error "raylib-cpp requires raylib >= 5" -#endif - -#if RAYLIB_VERSION_MAJOR > 5 -#error "raylib-cpp requires raylib ~5.0. Use the `next` branch for the next version of raylib." +#if RAYLIB_VERSION_MAJOR < 6 +#error "raylib-cpp requires raylib >= 6" #endif -#if RAYLIB_VERSION_MINOR < 1 - #error "raylib-cpp targets raylib 5.1 or higher." +#if RAYLIB_VERSION_MAJOR > 6 +#error "raylib-cpp requires raylib ~6.0. Use the `next` branch for the next version of raylib." #endif #ifdef __cplusplus diff --git a/package.json b/package.json index 615102d1..1a1e0c98 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "raylib-cpp", - "version": "5.5.0", + "version": "6.0.0-alpha1", "description": "raylib-cpp: C++ Object-Oriented Wrapper for raylib", "main": "index.js", "private": true, diff --git a/projects/CMake/CMakeLists.txt b/projects/CMake/CMakeLists.txt index 8fe355ca..c328ef3f 100644 --- a/projects/CMake/CMakeLists.txt +++ b/projects/CMake/CMakeLists.txt @@ -8,7 +8,7 @@ if (NOT raylib_FOUND) FetchContent_Declare( raylib GIT_REPOSITORY https://github.com/raysan5/raylib.git - GIT_TAG 5e6cdf3 + GIT_TAG 9ae34d2 GIT_SHALLOW 1 ) FetchContent_MakeAvailable(raylib)