9 Commits

Author SHA1 Message Date
4ee2013169 various rlparser fixes (#5794) 2026-04-24 21:08:20 +02:00
Ray
d892f3ba4a Update shapes_ball_physics.c 2026-04-24 15:11:39 +02:00
61dd488b76 [examples] Move window for ball shake (#5791) 2026-04-24 15:09:02 +02:00
Ray
4cae4ba9d5 REVIEWED: IsModelValid() #5780 2026-04-24 14:03:59 +02:00
Ray
07a056441a Update raudio.c 2026-04-24 13:59:41 +02:00
Ray
254953611e Update rcore.c 2026-04-24 13:58:52 +02:00
5608460901 add missing UnloadFileData() (#5787)
Adds missing function necessary for using the module as a standalone library.
2026-04-24 13:57:20 +02:00
3b23200b85 Update BINDINGS.md to add vala-vapi version update (#5789) 2026-04-24 13:56:30 +02:00
1c5cd35372 Add sola-raylib to BINDINGS.md (#5790)
Rust bindings and wrapper library. A maintained fork of raylib-rs with
bug fixes in the 5.5.x series and upcoming support for 6.0.
2026-04-24 13:55:59 +02:00
8 changed files with 47 additions and 20 deletions

4
.gitignore vendored
View File

@ -125,8 +125,8 @@ build-*/
docgen_tmp/
# Tools stuff
tools/parser/rlparser.exe
tools/parser/rlparser
tools/rlparser/rlparser.exe
tools/rlparser/rlparser
tools/rexm/rexm.exe
tools/rexm/rexm

View File

@ -77,6 +77,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 |
| [sola-raylib](https://github.com/brettchalupa/sola-raylib) | **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) | **5.5** | [Racket](https://racket-lang.org) | MIT/Apache-2.0 |
@ -86,7 +87,7 @@ Some people ported raylib to other languages in the form of bindings or wrappers
| [raylib-umka](https://github.com/robloach/raylib-umka) | 4.5 | [Umka](https://github.com/vtereshkov/umka-lang) | Zlib |
| [raylib-v](https://github.com/vlang/raylib) | 5.5 | [V](https://vlang.io) | MIT/Unlicense |
| [raylib.v](https://github.com/irishgreencitrus/raylib.v) | 4.2 | [V](https://vlang.io) | Zlib |
| [raylib-vapi](https://github.com/lxmcf/raylib-vapi) | **5.0** | [Vala](https://vala.dev) | Zlib |
| [raylib-vapi](https://github.com/lxmcf/raylib-vapi) | **6.0** | [Vala](https://vala.dev) | Zlib |
| [raylib-wave](https://github.com/wavefnd/raylib-wave) | **auto** |[Wave](http://wave-lang.dev) | Zlib |
| [raylib-wren](https://github.com/TSnake41/raylib-wren) | 4.5 | [Wren](http://wren.io) | ISC |
| [raylib-zig](https://github.com/raylib-zig/raylib-zig) | **5.6-dev** | [Zig](https://ziglang.org) | MIT |

View File

@ -17,6 +17,8 @@
#include "raylib.h"
#include "raymath.h"
#include <stdlib.h> // Required for: malloc(), free()
#include <math.h> // Required for: hypot()
@ -68,6 +70,8 @@ int main(void)
Vector2 pressOffset = { 0 }; // Mouse press offset relative to the ball that grabbedd
float gravity = 100; // World gravity
Vector2 windowPosition = GetWindowPosition();
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
//---------------------------------------------------------------------------------------
@ -128,6 +132,17 @@ int main(void)
}
}
// Get window position change for shaking
Vector2 windowPositionDelta = Vector2Subtract(windowPosition, GetWindowPosition());
if (Vector2Length(windowPositionDelta) > 5.0f)
{
for (int i = 0; i < ballCount; i++)
{
if (!balls[i].grabbed) balls[i].speed = Vector2Add(balls[i].speed, Vector2Scale(windowPositionDelta, 10.0f));
}
}
// Shake balls
if (IsMouseButtonPressed(MOUSE_BUTTON_MIDDLE))
{
@ -194,6 +209,8 @@ int main(void)
ball->prevPosition = ball->position;
}
}
windowPosition = GetWindowPosition();
//----------------------------------------------------------------------------------
// Draw
@ -222,8 +239,9 @@ int main(void)
// De-Initialization
//--------------------------------------------------------------------------------------
RL_FREE(balls);
CloseWindow(); // Close window and OpenGL context
//--------------------------------------------------------------------------------------
return 0;
}
}

View File

@ -434,6 +434,7 @@ static const char *GetFileName(const char *filePath); // Get point
static const char *GetFileNameWithoutExt(const char *filePath); // Get filename string without extension (uses static string)
static unsigned char *LoadFileData(const char *fileName, int *dataSize); // Load file data as byte array (read)
static void UnloadFileData(unsigned char *data); // Unload file data allocated by LoadFileData()
static bool SaveFileData(const char *fileName, void *data, int dataSize); // Save data to file from byte array (write)
static bool SaveFileText(const char *fileName, char *text); // Save text data to file (write), string must be '\0' terminated
#endif
@ -2882,6 +2883,12 @@ static unsigned char *LoadFileData(const char *fileName, int *dataSize)
return data;
}
// Unload file data allocated by LoadFileData()
static void UnloadFileData(unsigned char *data)
{
RL_FREE(data);
}
// Save data to file from buffer
static bool SaveFileData(const char *fileName, void *data, int dataSize)
{

View File

@ -106,7 +106,7 @@
#include "config.h" // Defines module configuration flags
#include <stdlib.h> // Required for: srand(), rand(), atexit(), exit()
#include <stdlib.h> // Required for: srand(), rand(), exit()
#include <stdio.h> // Required for: FILE, fopen(), fseek(), ftell(), fread(), fwrite(), fprintf(), vprintf(), fclose(), sprintf() [Used in OpenURL()]
#include <string.h> // Required for: strlen(), strncpy(), strcmp(), strrchr(), memset(), strcat()
#include <stdarg.h> // Required for: va_list, va_start(), va_end() [Used in TraceLog()]
@ -1757,9 +1757,9 @@ int GetRandomValue(int min, int max)
else
{
// Rejection sampling to get a uniform integer in [min, max]
unsigned long c = (unsigned long)RAND_MAX + 1UL; // number of possible rand() results
unsigned long m = (unsigned long)range; // size of the target interval
unsigned long t = c - (c%m); // largest multiple of m <= c
unsigned long c = (unsigned long)RAND_MAX + 1UL; // Number of possible results
unsigned long m = (unsigned long)range; // Size of the target interval
unsigned long t = c - (c%m); // Largest multiple of m <= c
unsigned long r = 0;
for (;;)

View File

@ -1182,16 +1182,17 @@ bool IsModelValid(Model model)
// but some VBOs could not be used, it depends on Mesh vertex data
for (int i = 0; i < model.meshCount; i++)
{
if ((model.meshes[i].vertices != NULL) && (model.meshes[i].vboId[0] == 0)) { result = false; break; } // Vertex position buffer not uploaded to GPU
if ((model.meshes[i].vertices != NULL) && (model.meshes[i].vboId[0] == 0)) { result = false; break; } // Vertex position buffer not uploaded to GPU
if ((model.meshes[i].texcoords != NULL) && (model.meshes[i].vboId[1] == 0)) { result = false; break; } // Vertex textcoords buffer not uploaded to GPU
if ((model.meshes[i].normals != NULL) && (model.meshes[i].vboId[2] == 0)) { result = false; break; } // Vertex normals buffer not uploaded to GPU
if ((model.meshes[i].colors != NULL) && (model.meshes[i].vboId[3] == 0)) { result = false; break; } // Vertex colors buffer not uploaded to GPU
if ((model.meshes[i].tangents != NULL) && (model.meshes[i].vboId[4] == 0)) { result = false; break; } // Vertex tangents buffer not uploaded to GPU
if ((model.meshes[i].texcoords2 != NULL) && (model.meshes[i].vboId[5] == 0)) { result = false; break; } // Vertex texcoords2 buffer not uploaded to GPU
if ((model.meshes[i].indices != NULL) && (model.meshes[i].vboId[6] == 0)) { result = false; break; } // Vertex indices buffer not uploaded to GPU
if ((model.meshes[i].boneIndices != NULL) && (model.meshes[i].vboId[7] == 0)) { result = false; break; } // Vertex boneIndices buffer not uploaded to GPU
if ((model.meshes[i].boneWeights != NULL) && (model.meshes[i].vboId[8] == 0)) { result = false; break; } // Vertex boneWeights buffer not uploaded to GPU
if ((model.meshes[i].normals != NULL) && (model.meshes[i].vboId[2] == 0)) { result = false; break; } // Vertex normals buffer not uploaded to GPU
if ((model.meshes[i].colors != NULL) && (model.meshes[i].vboId[3] == 0)) { result = false; break; } // Vertex colors buffer not uploaded to GPU
if ((model.meshes[i].tangents != NULL) && (model.meshes[i].vboId[4] == 0)) { result = false; break; } // Vertex tangents buffer not uploaded to GPU
if ((model.meshes[i].texcoords2 != NULL) && (model.meshes[i].vboId[5] == 0)) { result = false; break; } // Vertex texcoords2 buffer not uploaded to GPU
if ((model.meshes[i].indices != NULL) && (model.meshes[i].vboId[6] == 0)) { result = false; break; } // Vertex indices buffer not uploaded to GPU
#if SUPPORT_GPU_SKINNING
if ((model.meshes[i].boneIndices != NULL) && (model.meshes[i].vboId[7] == 0)) { result = false; break; } // Vertex boneIndices buffer not uploaded to GPU
if ((model.meshes[i].boneWeights != NULL) && (model.meshes[i].vboId[8] == 0)) { result = false; break; } // Vertex boneWeights buffer not uploaded to GPU
#endif
// NOTE: Some OpenGL versions do not support VAO, so avoid below check
//if (model.meshes[i].vaoId == 0) { result = false; break }
}

View File

@ -1,6 +1,6 @@
# rlparser - raylib parser
This parser scans [`raylib.h`](../src/raylib.h) to get information about `defines`, `structs`, `enums` and `functions`.
This parser scans [`raylib.h`](../../src/raylib.h) to get information about `defines`, `structs`, `enums` and `functions`.
All data is separated into parts, usually as strings. The following types are used for data:
- `struct DefineInfo`

View File

@ -202,7 +202,7 @@ int main(int argc, char *argv[])
{
if (argc > 1) ProcessCommandLine(argc, argv);
const char *raylibhPath = "../src/raylib.h\0";
const char *raylibhPath = "../../src/raylib.h\0";
const char *raylibapiPath = "raylib_api.txt\0";
const char *rlapiPath = "RLAPI\0";
if (inFileName[0] == '\0') MemoryCopy(inFileName, raylibhPath, TextLength(raylibhPath) + 1);
@ -1154,7 +1154,7 @@ static void ProcessCommandLine(int argc, char *argv[])
else if (IsTextEqual(argv[i + 1], "JSON\0", 5)) outputFormat = JSON;
else if (IsTextEqual(argv[i + 1], "XML\0", 4)) outputFormat = XML;
else if (IsTextEqual(argv[i + 1], "LUA\0", 4)) outputFormat = LUA;
else if (IsTextEqual(argv[i + 1], "CODE\0", 4)) outputFormat = CODE;
else if (IsTextEqual(argv[i + 1], "CODE\0", 5)) outputFormat = CODE;
}
else printf("WARNING: No format parameters provided\n");
}