Merge branch 'master' of github.com:raysan5/raylib
This commit is contained in:
commit
3f1052db99
29 changed files with 2449 additions and 1334 deletions
|
|
@ -9,7 +9,7 @@ Some people ported raylib to other languages in the form of bindings or wrappers
|
|||
| [raylib](https://github.com/raysan5/raylib) | **5.0** | [C/C++](https://en.wikipedia.org/wiki/C_(programming_language)) | Zlib |
|
||||
| [raylib-beef](https://github.com/Starpelly/raylib-beef) | **5.0** | [Beef](https://www.beeflang.org) | MIT |
|
||||
| [raylib-boo](https://github.com/Rabios/raylib-boo) | 3.7 | [Boo](http://boo-language.github.io) | MIT |
|
||||
| [raybit](https://github.com/Alex-Velez/raybit) | 3.7 | [Brainfuck](https://en.wikipedia.org/wiki/Brainfuck) | MIT |
|
||||
| [raybit](https://github.com/Alex-Velez/raybit) | **5.0** | [Brainfuck](https://en.wikipedia.org/wiki/Brainfuck) | MIT |
|
||||
| [Raylib-cs](https://github.com/ChrisDill/Raylib-cs) | **5.0** | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | Zlib |
|
||||
| [Raylib-CsLo](https://github.com/NotNotTech/Raylib-CsLo) | 4.2 | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | MPL-2.0 |
|
||||
| [Raylib-CSharp-Vinculum](https://github.com/ZeroElectric/Raylib-CSharp-Vinculum) | **5.0** | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | MPL-2.0 |
|
||||
|
|
@ -78,10 +78,10 @@ Some people ported raylib to other languages in the form of bindings or wrappers
|
|||
| [raylib-zig-bindings](https://github.com/L-Briand/raylib-zig-bindings) | **5.0** | [Zig](https://ziglang.org) | Zlib |
|
||||
| [hare-raylib](https://git.sr.ht/~evantj/hare-raylib) | **auto** | [Hare](https://harelang.org) | Zlib |
|
||||
| [raylib-sunder](https://github.com/ashn-dot-dev/raylib-sunder) | **auto** | [Sunder](https://github.com/ashn-dot-dev/sunder) | 0BSD |
|
||||
| [rayed-bqn](https://github.com/Brian-ED/rayed-bqn) | **auto** | [BQN](https://mlochbaum.github.io/BQN) | MIT |
|
||||
| [raylib-bqn](https://github.com/Brian-ED/raylib-bqn) | **5.0** | [BQN](https://mlochbaum.github.io/BQN) | MIT |
|
||||
| [rayjs](https://github.com/mode777/rayjs) | 4.6-dev | [QuickJS](https://bellard.org/quickjs) | MIT |
|
||||
| [raylib-raku](https://github.com/vushu/raylib-raku) | **auto** | [Raku](https://www.raku.org) | Artistic License 2.0 |
|
||||
| [Raylib.lean](https://github.com/KislyjKisel/Raylib.lean) | 4.5 | [Lean4](https://lean-lang.org) | BSD-3-Clause |
|
||||
| [Raylib.lean](https://github.com/KislyjKisel/Raylib.lean) | **5.5-dev** | [Lean4](https://lean-lang.org) | BSD-3-Clause |
|
||||
| [raylib-cobol](https://codeberg.org/glowiak/raylib-cobol) | **auto** | [COBOL](https://gnucobol.sourceforge.io) | Public domain |
|
||||
| [raylib-apl](https://github.com/Brian-ED/raylib-apl) | **5.0** | [Dyalog APL](https://www.dyalog.com/) | MIT |
|
||||
|
||||
|
|
@ -92,6 +92,7 @@ These are utility wrappers for specific languages, they are not required to use
|
|||
| ---------------------------------------------------- | :------------: | :------------------------------------------: | :-----: |
|
||||
| [raylib-cpp](https://github.com/robloach/raylib-cpp) | **5.0** | [C++](https://en.wikipedia.org/wiki/C%2B%2B) | Zlib |
|
||||
| [claylib](https://github.com/defun-games/claylib) | 4.5 | [Common Lisp](https://common-lisp.net) | Zlib |
|
||||
| [rayed-bqn](https://github.com/Brian-ED/rayed-bqn) | **5.0** | [BQN](https://mlochbaum.github.io/BQN) | MIT |
|
||||
|
||||
### Older or Unmaintained Language Bindings
|
||||
|
||||
|
|
|
|||
|
|
@ -70,8 +70,9 @@ RAYLIB_SRC_PATH ?= ../src
|
|||
|
||||
# Locations of raylib.h and libraylib.a/libraylib.so
|
||||
# NOTE: Those variables are only used for PLATFORM_OS: LINUX, BSD
|
||||
RAYLIB_INCLUDE_PATH ?= /usr/local/include
|
||||
RAYLIB_LIB_PATH ?= /usr/local/lib
|
||||
DESTDIR ?= /usr/local
|
||||
RAYLIB_INCLUDE_PATH ?= $(DESTDIR)/include
|
||||
RAYLIB_LIB_PATH ?= $(DESTDIR)/lib
|
||||
|
||||
# Library type compilation: STATIC (.a) or SHARED (.so/.dll)
|
||||
RAYLIB_LIBTYPE ?= STATIC
|
||||
|
|
@ -586,7 +587,8 @@ MODELS = \
|
|||
models/models_rlgl_solar_system \
|
||||
models/models_skybox \
|
||||
models/models_waving_cubes \
|
||||
models/models_yaw_pitch_roll
|
||||
models/models_yaw_pitch_roll \
|
||||
models/models_gpu_skinning
|
||||
|
||||
SHADERS = \
|
||||
shaders/shaders_basic_lighting \
|
||||
|
|
|
|||
|
|
@ -35,8 +35,9 @@ RAYLIB_PATH ?= ..
|
|||
|
||||
# Locations of raylib.h and libraylib.a/libraylib.so
|
||||
# NOTE: Those variables are only used for PLATFORM_OS: LINUX, BSD
|
||||
RAYLIB_INCLUDE_PATH ?= /usr/local/include
|
||||
RAYLIB_LIB_PATH ?= /usr/local/lib
|
||||
DESTDIR ?= /usr/local
|
||||
RAYLIB_INCLUDE_PATH ?= $(DESTDIR)/include
|
||||
RAYLIB_LIB_PATH ?= $(DESTDIR)/lib
|
||||
|
||||
# Library type compilation: STATIC (.a) or SHARED (.so/.dll)
|
||||
RAYLIB_LIBTYPE ?= STATIC
|
||||
|
|
|
|||
117
examples/models/models_gpu_skinning.c
Normal file
117
examples/models/models_gpu_skinning.c
Normal file
|
|
@ -0,0 +1,117 @@
|
|||
/*******************************************************************************************
|
||||
*
|
||||
* raylib [core] example - Doing skinning on the gpu using a vertex shader
|
||||
*
|
||||
* Example originally created with raylib 4.5, last time updated with raylib 4.5
|
||||
*
|
||||
* Example contributed by Daniel Holden (@orangeduck) and reviewed by Ramon Santamaria (@raysan5)
|
||||
*
|
||||
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||
* BSD-like license that allows static linking with closed source software
|
||||
*
|
||||
* Copyright (c) 2024 Daniel Holden (@orangeduck)
|
||||
*
|
||||
********************************************************************************************/
|
||||
|
||||
#include "raylib.h"
|
||||
|
||||
#include "raymath.h"
|
||||
|
||||
#if defined(PLATFORM_DESKTOP)
|
||||
#define GLSL_VERSION 330
|
||||
#else // PLATFORM_ANDROID, PLATFORM_WEB
|
||||
#define GLSL_VERSION 100
|
||||
#endif
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
// Program main entry point
|
||||
//------------------------------------------------------------------------------------
|
||||
int main(void)
|
||||
{
|
||||
// Initialization
|
||||
//--------------------------------------------------------------------------------------
|
||||
const int screenWidth = 800;
|
||||
const int screenHeight = 450;
|
||||
|
||||
InitWindow(screenWidth, screenHeight, "raylib [models] example - GPU skinning");
|
||||
|
||||
// Define the camera to look into our 3d world
|
||||
Camera camera = { 0 };
|
||||
camera.position = (Vector3){ 5.0f, 5.0f, 5.0f }; // Camera position
|
||||
camera.target = (Vector3){ 0.0f, 2.0f, 0.0f }; // Camera looking at point
|
||||
camera.up = (Vector3){ 0.0f, 1.0f, 0.0f }; // Camera up vector (rotation towards target)
|
||||
camera.fovy = 45.0f; // Camera field-of-view Y
|
||||
camera.projection = CAMERA_PERSPECTIVE; // Camera projection type
|
||||
|
||||
// Load gltf model
|
||||
Model characterModel = LoadModel("resources/models/gltf/greenman.glb"); // Load character model
|
||||
|
||||
// Load skinning shader
|
||||
Shader skinningShader = LoadShader(TextFormat("resources/shaders/glsl%i/skinning.vs", GLSL_VERSION),
|
||||
TextFormat("resources/shaders/glsl%i/skinning.fs", GLSL_VERSION));
|
||||
|
||||
characterModel.materials[1].shader = skinningShader;
|
||||
|
||||
// Load gltf model animations
|
||||
int animsCount = 0;
|
||||
unsigned int animIndex = 0;
|
||||
unsigned int animCurrentFrame = 0;
|
||||
ModelAnimation *modelAnimations = LoadModelAnimations("resources/models/gltf/greenman.glb", &animsCount);
|
||||
|
||||
Vector3 position = { 0.0f, 0.0f, 0.0f }; // Set model position
|
||||
|
||||
DisableCursor(); // Limit cursor to relative movement inside the window
|
||||
|
||||
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
// Main game loop
|
||||
while (!WindowShouldClose()) // Detect window close button or ESC key
|
||||
{
|
||||
// Update
|
||||
//----------------------------------------------------------------------------------
|
||||
UpdateCamera(&camera, CAMERA_THIRD_PERSON);
|
||||
|
||||
// Select current animation
|
||||
if (IsKeyPressed(KEY_T)) animIndex = (animIndex + 1)%animsCount;
|
||||
else if (IsKeyPressed(KEY_G)) animIndex = (animIndex + animsCount - 1)%animsCount;
|
||||
|
||||
// Update model animation
|
||||
ModelAnimation anim = modelAnimations[animIndex];
|
||||
animCurrentFrame = (animCurrentFrame + 1)%anim.frameCount;
|
||||
UpdateModelAnimationBoneMatrices(characterModel, anim, animCurrentFrame);
|
||||
//----------------------------------------------------------------------------------
|
||||
|
||||
// Draw
|
||||
//----------------------------------------------------------------------------------
|
||||
BeginDrawing();
|
||||
|
||||
ClearBackground(RAYWHITE);
|
||||
|
||||
BeginMode3D(camera);
|
||||
|
||||
// Draw character
|
||||
characterModel.transform = MatrixTranslate(position.x, position.y, position.z);
|
||||
UpdateModelAnimationBoneMatrices(characterModel, anim, animCurrentFrame);
|
||||
DrawMesh(characterModel.meshes[0], characterModel.materials[1], characterModel.transform);
|
||||
|
||||
DrawGrid(10, 1.0f);
|
||||
EndMode3D();
|
||||
|
||||
DrawText("Use the T/G to switch animation", 10, 10, 20, GRAY);
|
||||
|
||||
EndDrawing();
|
||||
//----------------------------------------------------------------------------------
|
||||
}
|
||||
|
||||
// De-Initialization
|
||||
//--------------------------------------------------------------------------------------
|
||||
UnloadModelAnimations(modelAnimations, animsCount);
|
||||
UnloadModel(characterModel); // Unload character model and meshes/material
|
||||
UnloadShader(skinningShader);
|
||||
|
||||
CloseWindow(); // Close window and OpenGL context
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
return 0;
|
||||
}
|
||||
17
examples/models/resources/shaders/glsl100/skinning.fs
Normal file
17
examples/models/resources/shaders/glsl100/skinning.fs
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
#version 100
|
||||
|
||||
// Input vertex attributes (from vertex shader)
|
||||
in vec2 fragTexCoord;
|
||||
in vec4 fragColor;
|
||||
|
||||
// Output fragment color
|
||||
out vec4 finalColor;
|
||||
|
||||
uniform sampler2D texture0;
|
||||
uniform vec4 colDiffuse;
|
||||
|
||||
void main()
|
||||
{
|
||||
vec4 texelColor = texture(texture0, fragTexCoord);
|
||||
finalColor = texelColor*colDiffuse*fragColor;
|
||||
}
|
||||
34
examples/models/resources/shaders/glsl100/skinning.vs
Normal file
34
examples/models/resources/shaders/glsl100/skinning.vs
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
#version 100
|
||||
|
||||
in vec3 vertexPosition;
|
||||
in vec2 vertexTexCoord;
|
||||
in vec4 vertexColor;
|
||||
in vec4 vertexBoneIds;
|
||||
in vec4 vertexBoneWeights;
|
||||
|
||||
#define MAX_BONE_NUM 128
|
||||
uniform mat4 boneMatrices[MAX_BONE_NUM];
|
||||
|
||||
uniform mat4 mvp;
|
||||
|
||||
out vec2 fragTexCoord;
|
||||
out vec4 fragColor;
|
||||
|
||||
void main()
|
||||
{
|
||||
int boneIndex0 = int(vertexBoneIds.x);
|
||||
int boneIndex1 = int(vertexBoneIds.y);
|
||||
int boneIndex2 = int(vertexBoneIds.z);
|
||||
int boneIndex3 = int(vertexBoneIds.w);
|
||||
|
||||
vec4 skinnedPosition =
|
||||
vertexBoneWeights.x * (boneMatrices[boneIndex0] * vec4(vertexPosition, 1.0f)) +
|
||||
vertexBoneWeights.y * (boneMatrices[boneIndex1] * vec4(vertexPosition, 1.0f)) +
|
||||
vertexBoneWeights.z * (boneMatrices[boneIndex2] * vec4(vertexPosition, 1.0f)) +
|
||||
vertexBoneWeights.w * (boneMatrices[boneIndex3] * vec4(vertexPosition, 1.0f));
|
||||
|
||||
fragTexCoord = vertexTexCoord;
|
||||
fragColor = vertexColor;
|
||||
|
||||
gl_Position = mvp * skinnedPosition;
|
||||
}
|
||||
17
examples/models/resources/shaders/glsl330/skinning.fs
Normal file
17
examples/models/resources/shaders/glsl330/skinning.fs
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
#version 330
|
||||
|
||||
// Input vertex attributes (from vertex shader)
|
||||
in vec2 fragTexCoord;
|
||||
in vec4 fragColor;
|
||||
|
||||
// Output fragment color
|
||||
out vec4 finalColor;
|
||||
|
||||
uniform sampler2D texture0;
|
||||
uniform vec4 colDiffuse;
|
||||
|
||||
void main()
|
||||
{
|
||||
vec4 texelColor = texture(texture0, fragTexCoord);
|
||||
finalColor = texelColor*colDiffuse*fragColor;
|
||||
}
|
||||
34
examples/models/resources/shaders/glsl330/skinning.vs
Normal file
34
examples/models/resources/shaders/glsl330/skinning.vs
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
#version 330
|
||||
|
||||
in vec3 vertexPosition;
|
||||
in vec2 vertexTexCoord;
|
||||
in vec4 vertexColor;
|
||||
in vec4 vertexBoneIds;
|
||||
in vec4 vertexBoneWeights;
|
||||
|
||||
#define MAX_BONE_NUM 128
|
||||
uniform mat4 boneMatrices[MAX_BONE_NUM];
|
||||
|
||||
uniform mat4 mvp;
|
||||
|
||||
out vec2 fragTexCoord;
|
||||
out vec4 fragColor;
|
||||
|
||||
void main()
|
||||
{
|
||||
int boneIndex0 = int(vertexBoneIds.x);
|
||||
int boneIndex1 = int(vertexBoneIds.y);
|
||||
int boneIndex2 = int(vertexBoneIds.z);
|
||||
int boneIndex3 = int(vertexBoneIds.w);
|
||||
|
||||
vec4 skinnedPosition =
|
||||
vertexBoneWeights.x * (boneMatrices[boneIndex0] * vec4(vertexPosition, 1.0f)) +
|
||||
vertexBoneWeights.y * (boneMatrices[boneIndex1] * vec4(vertexPosition, 1.0f)) +
|
||||
vertexBoneWeights.z * (boneMatrices[boneIndex2] * vec4(vertexPosition, 1.0f)) +
|
||||
vertexBoneWeights.w * (boneMatrices[boneIndex3] * vec4(vertexPosition, 1.0f));
|
||||
|
||||
fragTexCoord = vertexTexCoord;
|
||||
fragColor = vertexColor;
|
||||
|
||||
gl_Position = mvp * skinnedPosition;
|
||||
}
|
||||
|
|
@ -41,7 +41,7 @@ OPTIONS:
|
|||
-f, --format <type> : Define output format for parser data.
|
||||
Supported types: DEFAULT, JSON, XML, LUA
|
||||
|
||||
-d, --define <DEF> : Define functions specifiers (i.e. RLAPI for raylib.h, RMDEF for raymath.h, etc.)
|
||||
-d, --define <DEF> : Define functions specifiers (i.e. RLAPI for raylib.h, RMAPI for raymath.h, etc.)
|
||||
NOTE: If no specifier defined, defaults to: RLAPI
|
||||
|
||||
-t, --truncate <after> : Define string to truncate input after (i.e. "RLGL IMPLEMENTATION" for rlgl.h)
|
||||
|
|
@ -56,7 +56,7 @@ EXAMPLES:
|
|||
> raylib_parser --output raylib_data.info --format XML
|
||||
Process <raylib.h> to generate <raylib_data.info> as XML text data
|
||||
|
||||
> raylib_parser --input raymath.h --output raymath_data.info --format XML
|
||||
> raylib_parser --input raymath.h --output raymath_data.info --format XML --define RMAPI
|
||||
Process <raymath.h> to generate <raymath_data.info> as XML text data
|
||||
```
|
||||
|
||||
|
|
|
|||
|
|
@ -850,12 +850,22 @@
|
|||
{
|
||||
"type": "unsigned char *",
|
||||
"name": "boneIds",
|
||||
"description": "Vertex bone ids, max 255 bone ids, up to 4 bones influence by vertex (skinning)"
|
||||
"description": "Vertex bone ids, max 255 bone ids, up to 4 bones influence by vertex (skinning) (shader-location = 6)"
|
||||
},
|
||||
{
|
||||
"type": "float *",
|
||||
"name": "boneWeights",
|
||||
"description": "Vertex bone weight, up to 4 bones influence by vertex (skinning)"
|
||||
"description": "Vertex bone weight, up to 4 bones influence by vertex (skinning) (shader-location = 7)"
|
||||
},
|
||||
{
|
||||
"type": "Matrix *",
|
||||
"name": "boneMatrices",
|
||||
"description": "Bones animated transformation matrices"
|
||||
},
|
||||
{
|
||||
"type": "int",
|
||||
"name": "boneCount",
|
||||
"description": "Number of bones"
|
||||
},
|
||||
{
|
||||
"type": "unsigned int",
|
||||
|
|
@ -2518,6 +2528,21 @@
|
|||
"name": "SHADER_LOC_MAP_BRDF",
|
||||
"value": 25,
|
||||
"description": "Shader location: sampler2d texture: brdf"
|
||||
},
|
||||
{
|
||||
"name": "SHADER_LOC_VERTEX_BONEIDS",
|
||||
"value": 26,
|
||||
"description": "Shader location: vertex attribute: boneIds"
|
||||
},
|
||||
{
|
||||
"name": "SHADER_LOC_VERTEX_BONEWEIGHTS",
|
||||
"value": 27,
|
||||
"description": "Shader location: vertex attribute: boneWeights"
|
||||
},
|
||||
{
|
||||
"name": "SHADER_LOC_BONE_MATRICES",
|
||||
"value": 28,
|
||||
"description": "Shader location: array of matrices uniform: boneMatrices"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
@ -4477,6 +4502,17 @@
|
|||
"description": "Get the directory of the running application (uses static string)",
|
||||
"returnType": "const char *"
|
||||
},
|
||||
{
|
||||
"name": "MakeDirectory",
|
||||
"description": "Create directories (including full path requested), returns 0 on success",
|
||||
"returnType": "int",
|
||||
"params": [
|
||||
{
|
||||
"type": "const char *",
|
||||
"name": "dirPath"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "ChangeDirectory",
|
||||
"description": "Change working directory, return true on success",
|
||||
|
|
@ -4523,7 +4559,7 @@
|
|||
},
|
||||
{
|
||||
"name": "LoadDirectoryFilesEx",
|
||||
"description": "Load directory filepaths with extension filtering and recursive directory scan",
|
||||
"description": "Load directory filepaths with extension filtering and recursive directory scan. Use 'DIR' in the filter string to include directories in the result",
|
||||
"returnType": "FilePathList",
|
||||
"params": [
|
||||
{
|
||||
|
|
@ -8780,6 +8816,25 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "ColorLerp",
|
||||
"description": "Get color lerp interpolation between two colors, factor [0.0f..1.0f]",
|
||||
"returnType": "Color",
|
||||
"params": [
|
||||
{
|
||||
"type": "Color",
|
||||
"name": "color1"
|
||||
},
|
||||
{
|
||||
"type": "Color",
|
||||
"name": "color2"
|
||||
},
|
||||
{
|
||||
"type": "float",
|
||||
"name": "factor"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "GetColor",
|
||||
"description": "Get Color structure from hexadecimal value",
|
||||
|
|
@ -8862,7 +8917,7 @@
|
|||
},
|
||||
{
|
||||
"name": "LoadFontEx",
|
||||
"description": "Load font from file with extended parameters, use NULL for codepoints and 0 for codepointCount to load the default character setFont",
|
||||
"description": "Load font from file with extended parameters, use NULL for codepoints and 0 for codepointCount to load the default character set, font size is provided in pixels height",
|
||||
"returnType": "Font",
|
||||
"params": [
|
||||
{
|
||||
|
|
@ -11047,6 +11102,25 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "UpdateModelAnimationBoneMatrices",
|
||||
"description": "Update model animation mesh bone matrices",
|
||||
"returnType": "void",
|
||||
"params": [
|
||||
{
|
||||
"type": "Model",
|
||||
"name": "model"
|
||||
},
|
||||
{
|
||||
"type": "ModelAnimation",
|
||||
"name": "anim"
|
||||
},
|
||||
{
|
||||
"type": "int",
|
||||
"name": "frame"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "CheckCollisionSpheres",
|
||||
"description": "Check collision between two spheres",
|
||||
|
|
|
|||
|
|
@ -850,12 +850,22 @@ return {
|
|||
{
|
||||
type = "unsigned char *",
|
||||
name = "boneIds",
|
||||
description = "Vertex bone ids, max 255 bone ids, up to 4 bones influence by vertex (skinning)"
|
||||
description = "Vertex bone ids, max 255 bone ids, up to 4 bones influence by vertex (skinning) (shader-location = 6)"
|
||||
},
|
||||
{
|
||||
type = "float *",
|
||||
name = "boneWeights",
|
||||
description = "Vertex bone weight, up to 4 bones influence by vertex (skinning)"
|
||||
description = "Vertex bone weight, up to 4 bones influence by vertex (skinning) (shader-location = 7)"
|
||||
},
|
||||
{
|
||||
type = "Matrix *",
|
||||
name = "boneMatrices",
|
||||
description = "Bones animated transformation matrices"
|
||||
},
|
||||
{
|
||||
type = "int",
|
||||
name = "boneCount",
|
||||
description = "Number of bones"
|
||||
},
|
||||
{
|
||||
type = "unsigned int",
|
||||
|
|
@ -2518,6 +2528,21 @@ return {
|
|||
name = "SHADER_LOC_MAP_BRDF",
|
||||
value = 25,
|
||||
description = "Shader location: sampler2d texture: brdf"
|
||||
},
|
||||
{
|
||||
name = "SHADER_LOC_VERTEX_BONEIDS",
|
||||
value = 26,
|
||||
description = "Shader location: vertex attribute: boneIds"
|
||||
},
|
||||
{
|
||||
name = "SHADER_LOC_VERTEX_BONEWEIGHTS",
|
||||
value = 27,
|
||||
description = "Shader location: vertex attribute: boneWeights"
|
||||
},
|
||||
{
|
||||
name = "SHADER_LOC_BONE_MATRICES",
|
||||
value = 28,
|
||||
description = "Shader location: array of matrices uniform: boneMatrices"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
@ -4042,6 +4067,14 @@ return {
|
|||
description = "Get the directory of the running application (uses static string)",
|
||||
returnType = "const char *"
|
||||
},
|
||||
{
|
||||
name = "MakeDirectory",
|
||||
description = "Create directories (including full path requested), returns 0 on success",
|
||||
returnType = "int",
|
||||
params = {
|
||||
{type = "const char *", name = "dirPath"}
|
||||
}
|
||||
},
|
||||
{
|
||||
name = "ChangeDirectory",
|
||||
description = "Change working directory, return true on success",
|
||||
|
|
@ -4076,7 +4109,7 @@ return {
|
|||
},
|
||||
{
|
||||
name = "LoadDirectoryFilesEx",
|
||||
description = "Load directory filepaths with extension filtering and recursive directory scan",
|
||||
description = "Load directory filepaths with extension filtering and recursive directory scan. Use 'DIR' in the filter string to include directories in the result",
|
||||
returnType = "FilePathList",
|
||||
params = {
|
||||
{type = "const char *", name = "basePath"},
|
||||
|
|
@ -6377,6 +6410,16 @@ return {
|
|||
{type = "Color", name = "tint"}
|
||||
}
|
||||
},
|
||||
{
|
||||
name = "ColorLerp",
|
||||
description = "Get color lerp interpolation between two colors, factor [0.0f..1.0f]",
|
||||
returnType = "Color",
|
||||
params = {
|
||||
{type = "Color", name = "color1"},
|
||||
{type = "Color", name = "color2"},
|
||||
{type = "float", name = "factor"}
|
||||
}
|
||||
},
|
||||
{
|
||||
name = "GetColor",
|
||||
description = "Get Color structure from hexadecimal value",
|
||||
|
|
@ -6429,7 +6472,7 @@ return {
|
|||
},
|
||||
{
|
||||
name = "LoadFontEx",
|
||||
description = "Load font from file with extended parameters, use NULL for codepoints and 0 for codepointCount to load the default character setFont",
|
||||
description = "Load font from file with extended parameters, use NULL for codepoints and 0 for codepointCount to load the default character set, font size is provided in pixels height",
|
||||
returnType = "Font",
|
||||
params = {
|
||||
{type = "const char *", name = "fileName"},
|
||||
|
|
@ -7576,6 +7619,16 @@ return {
|
|||
{type = "ModelAnimation", name = "anim"}
|
||||
}
|
||||
},
|
||||
{
|
||||
name = "UpdateModelAnimationBoneMatrices",
|
||||
description = "Update model animation mesh bone matrices",
|
||||
returnType = "void",
|
||||
params = {
|
||||
{type = "Model", name = "model"},
|
||||
{type = "ModelAnimation", name = "anim"},
|
||||
{type = "int", name = "frame"}
|
||||
}
|
||||
},
|
||||
{
|
||||
name = "CheckCollisionSpheres",
|
||||
description = "Check collision between two spheres",
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -160,7 +160,7 @@
|
|||
<Field type="float" name="rotation" desc="Camera rotation in degrees" />
|
||||
<Field type="float" name="zoom" desc="Camera zoom (scaling), should be 1.0f by default" />
|
||||
</Struct>
|
||||
<Struct name="Mesh" fieldCount="15" desc="Mesh, vertex data and vao/vbo">
|
||||
<Struct name="Mesh" fieldCount="17" desc="Mesh, vertex data and vao/vbo">
|
||||
<Field type="int" name="vertexCount" desc="Number of vertices stored in arrays" />
|
||||
<Field type="int" name="triangleCount" desc="Number of triangles stored (indexed or not)" />
|
||||
<Field type="float *" name="vertices" desc="Vertex position (XYZ - 3 components per vertex) (shader-location = 0)" />
|
||||
|
|
@ -172,8 +172,10 @@
|
|||
<Field type="unsigned short *" name="indices" desc="Vertex indices (in case vertex data comes indexed)" />
|
||||
<Field type="float *" name="animVertices" desc="Animated vertex positions (after bones transformations)" />
|
||||
<Field type="float *" name="animNormals" desc="Animated normals (after bones transformations)" />
|
||||
<Field type="unsigned char *" name="boneIds" desc="Vertex bone ids, max 255 bone ids, up to 4 bones influence by vertex (skinning)" />
|
||||
<Field type="float *" name="boneWeights" desc="Vertex bone weight, up to 4 bones influence by vertex (skinning)" />
|
||||
<Field type="unsigned char *" name="boneIds" desc="Vertex bone ids, max 255 bone ids, up to 4 bones influence by vertex (skinning) (shader-location = 6)" />
|
||||
<Field type="float *" name="boneWeights" desc="Vertex bone weight, up to 4 bones influence by vertex (skinning) (shader-location = 7)" />
|
||||
<Field type="Matrix *" name="boneMatrices" desc="Bones animated transformation matrices" />
|
||||
<Field type="int" name="boneCount" desc="Number of bones" />
|
||||
<Field type="unsigned int" name="vaoId" desc="OpenGL Vertex Array Object id" />
|
||||
<Field type="unsigned int *" name="vboId" desc="OpenGL Vertex Buffer Objects id (default vertex data)" />
|
||||
</Struct>
|
||||
|
|
@ -505,7 +507,7 @@
|
|||
<Value name="MATERIAL_MAP_PREFILTER" integer="9" desc="Prefilter material (NOTE: Uses GL_TEXTURE_CUBE_MAP)" />
|
||||
<Value name="MATERIAL_MAP_BRDF" integer="10" desc="Brdf material" />
|
||||
</Enum>
|
||||
<Enum name="ShaderLocationIndex" valueCount="26" desc="Shader location index">
|
||||
<Enum name="ShaderLocationIndex" valueCount="29" desc="Shader location index">
|
||||
<Value name="SHADER_LOC_VERTEX_POSITION" integer="0" desc="Shader location: vertex attribute: position" />
|
||||
<Value name="SHADER_LOC_VERTEX_TEXCOORD01" integer="1" desc="Shader location: vertex attribute: texcoord01" />
|
||||
<Value name="SHADER_LOC_VERTEX_TEXCOORD02" integer="2" desc="Shader location: vertex attribute: texcoord02" />
|
||||
|
|
@ -532,6 +534,9 @@
|
|||
<Value name="SHADER_LOC_MAP_IRRADIANCE" integer="23" desc="Shader location: samplerCube texture: irradiance" />
|
||||
<Value name="SHADER_LOC_MAP_PREFILTER" integer="24" desc="Shader location: samplerCube texture: prefilter" />
|
||||
<Value name="SHADER_LOC_MAP_BRDF" integer="25" desc="Shader location: sampler2d texture: brdf" />
|
||||
<Value name="SHADER_LOC_VERTEX_BONEIDS" integer="26" desc="Shader location: vertex attribute: boneIds" />
|
||||
<Value name="SHADER_LOC_VERTEX_BONEWEIGHTS" integer="27" desc="Shader location: vertex attribute: boneWeights" />
|
||||
<Value name="SHADER_LOC_BONE_MATRICES" integer="28" desc="Shader location: array of matrices uniform: boneMatrices" />
|
||||
</Enum>
|
||||
<Enum name="ShaderUniformDataType" valueCount="9" desc="Shader uniform data type">
|
||||
<Value name="SHADER_UNIFORM_FLOAT" integer="0" desc="Shader uniform type: float" />
|
||||
|
|
@ -670,7 +675,7 @@
|
|||
<Param type="unsigned int" name="frames" desc="" />
|
||||
</Callback>
|
||||
</Callbacks>
|
||||
<Functions count="575">
|
||||
<Functions count="578">
|
||||
<Function name="InitWindow" retType="void" paramCount="3" desc="Initialize window and OpenGL context">
|
||||
<Param type="int" name="width" desc="" />
|
||||
<Param type="int" name="height" desc="" />
|
||||
|
|
@ -1069,6 +1074,9 @@
|
|||
</Function>
|
||||
<Function name="GetApplicationDirectory" retType="const char *" paramCount="0" desc="Get the directory of the running application (uses static string)">
|
||||
</Function>
|
||||
<Function name="MakeDirectory" retType="int" paramCount="1" desc="Create directories (including full path requested), returns 0 on success">
|
||||
<Param type="const char *" name="dirPath" desc="" />
|
||||
</Function>
|
||||
<Function name="ChangeDirectory" retType="bool" paramCount="1" desc="Change working directory, return true on success">
|
||||
<Param type="const char *" name="dir" desc="" />
|
||||
</Function>
|
||||
|
|
@ -1081,7 +1089,7 @@
|
|||
<Function name="LoadDirectoryFiles" retType="FilePathList" paramCount="1" desc="Load directory filepaths">
|
||||
<Param type="const char *" name="dirPath" desc="" />
|
||||
</Function>
|
||||
<Function name="LoadDirectoryFilesEx" retType="FilePathList" paramCount="3" desc="Load directory filepaths with extension filtering and recursive directory scan">
|
||||
<Function name="LoadDirectoryFilesEx" retType="FilePathList" paramCount="3" desc="Load directory filepaths with extension filtering and recursive directory scan. Use 'DIR' in the filter string to include directories in the result">
|
||||
<Param type="const char *" name="basePath" desc="" />
|
||||
<Param type="const char *" name="filter" desc="" />
|
||||
<Param type="bool" name="scanSubdirs" desc="" />
|
||||
|
|
@ -2219,6 +2227,11 @@
|
|||
<Param type="Color" name="src" desc="" />
|
||||
<Param type="Color" name="tint" desc="" />
|
||||
</Function>
|
||||
<Function name="ColorLerp" retType="Color" paramCount="3" desc="Get color lerp interpolation between two colors, factor [0.0f..1.0f]">
|
||||
<Param type="Color" name="color1" desc="" />
|
||||
<Param type="Color" name="color2" desc="" />
|
||||
<Param type="float" name="factor" desc="" />
|
||||
</Function>
|
||||
<Function name="GetColor" retType="Color" paramCount="1" desc="Get Color structure from hexadecimal value">
|
||||
<Param type="unsigned int" name="hexValue" desc="" />
|
||||
</Function>
|
||||
|
|
@ -2241,7 +2254,7 @@
|
|||
<Function name="LoadFont" retType="Font" paramCount="1" desc="Load font from file into GPU memory (VRAM)">
|
||||
<Param type="const char *" name="fileName" desc="" />
|
||||
</Function>
|
||||
<Function name="LoadFontEx" retType="Font" paramCount="4" desc="Load font from file with extended parameters, use NULL for codepoints and 0 for codepointCount to load the default character setFont">
|
||||
<Function name="LoadFontEx" retType="Font" paramCount="4" desc="Load font from file with extended parameters, use NULL for codepoints and 0 for codepointCount to load the default character set, font size is provided in pixels height">
|
||||
<Param type="const char *" name="fileName" desc="" />
|
||||
<Param type="int" name="fontSize" desc="" />
|
||||
<Param type="int *" name="codepoints" desc="" />
|
||||
|
|
@ -2817,6 +2830,11 @@
|
|||
<Param type="Model" name="model" desc="" />
|
||||
<Param type="ModelAnimation" name="anim" desc="" />
|
||||
</Function>
|
||||
<Function name="UpdateModelAnimationBoneMatrices" retType="void" paramCount="3" desc="Update model animation mesh bone matrices">
|
||||
<Param type="Model" name="model" desc="" />
|
||||
<Param type="ModelAnimation" name="anim" desc="" />
|
||||
<Param type="int" name="frame" desc="" />
|
||||
</Function>
|
||||
<Function name="CheckCollisionSpheres" retType="bool" paramCount="4" desc="Check collision between two spheres">
|
||||
<Param type="Vector3" name="center1" desc="" />
|
||||
<Param type="float" name="radius1" desc="" />
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@
|
|||
#define MAX_CALLBACKS_TO_PARSE 64 // Maximum number of callbacks to parse
|
||||
#define MAX_FUNCS_TO_PARSE 1024 // Maximum number of functions to parse
|
||||
|
||||
#define MAX_LINE_LENGTH 512 // Maximum length of one line (including comments)
|
||||
#define MAX_LINE_LENGTH 1024 // Maximum length of one line (including comments)
|
||||
|
||||
#define MAX_STRUCT_FIELDS 64 // Maximum number of struct fields
|
||||
#define MAX_ENUM_VALUES 512 // Maximum number of enum values
|
||||
|
|
@ -139,7 +139,7 @@ typedef struct EnumInfo {
|
|||
// Function info data
|
||||
typedef struct FunctionInfo {
|
||||
char name[64]; // Function name
|
||||
char desc[128]; // Function description (comment at the end)
|
||||
char desc[512]; // Function description (comment at the end)
|
||||
char retType[32]; // Return value type
|
||||
int paramCount; // Number of function parameters
|
||||
char paramType[MAX_FUNCTION_PARAMETERS][32]; // Parameters type
|
||||
|
|
|
|||
|
|
@ -30,8 +30,8 @@ target_link_libraries(${PROJECT_NAME} raylib)
|
|||
|
||||
# Web Configurations
|
||||
if (${PLATFORM} STREQUAL "Web")
|
||||
# Tell Emscripten to build an example.html file.
|
||||
set_target_properties(${PROJECT_NAME} PROPERTIES SUFFIX ".html")
|
||||
set_target_properties(${PROJECT_NAME} PROPERTIES SUFFIX ".html") # Tell Emscripten to build an example.html file.
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s USE_GLFW=3 -s ASSERTIONS=1 -s WASM=1 -s ASYNCIFY -s GL_ENABLE_GET_PROC_ADDRESS=1")
|
||||
endif()
|
||||
|
||||
# Checks if OSX and links appropriate frameworks (Only required on MacOS)
|
||||
|
|
|
|||
|
|
@ -22,6 +22,6 @@ Compiling for the web requires the [Emscripten SDK](https://emscripten.org/docs/
|
|||
``` bash
|
||||
mkdir build
|
||||
cd build
|
||||
emcmake cmake .. -DPLATFORM=Web -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXE_LINKER_FLAGS="-s USE_GLFW=3" -DCMAKE_EXECUTABLE_SUFFIX=".html"
|
||||
emcmake cmake .. -DPLATFORM=Web -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXECUTABLE_SUFFIX=".html"
|
||||
emmake make
|
||||
```
|
||||
```
|
||||
|
|
|
|||
15
src/config.h
15
src/config.h
|
|
@ -113,12 +113,15 @@
|
|||
#define RL_CULL_DISTANCE_FAR 1000.0 // Default projection matrix far cull distance
|
||||
|
||||
// Default shader vertex attribute locations
|
||||
#define RL_DEFAULT_SHADER_ATTRIB_LOCATION_POSITION 0
|
||||
#define RL_DEFAULT_SHADER_ATTRIB_LOCATION_TEXCOORD 1
|
||||
#define RL_DEFAULT_SHADER_ATTRIB_LOCATION_NORMAL 2
|
||||
#define RL_DEFAULT_SHADER_ATTRIB_LOCATION_COLOR 3
|
||||
#define RL_DEFAULT_SHADER_ATTRIB_LOCATION_TANGENT 4
|
||||
#define RL_DEFAULT_SHADER_ATTRIB_LOCATION_TEXCOORD2 5
|
||||
#define RL_DEFAULT_SHADER_ATTRIB_LOCATION_POSITION 0
|
||||
#define RL_DEFAULT_SHADER_ATTRIB_LOCATION_TEXCOORD 1
|
||||
#define RL_DEFAULT_SHADER_ATTRIB_LOCATION_NORMAL 2
|
||||
#define RL_DEFAULT_SHADER_ATTRIB_LOCATION_COLOR 3
|
||||
#define RL_DEFAULT_SHADER_ATTRIB_LOCATION_TANGENT 4
|
||||
#define RL_DEFAULT_SHADER_ATTRIB_LOCATION_TEXCOORD2 5
|
||||
#define RL_DEFAULT_SHADER_ATTRIB_LOCATION_BONEIDS 6
|
||||
#define RL_DEFAULT_SHADER_ATTRIB_LOCATION_BONEWEIGHTS 7
|
||||
#define RL_DEFAULT_SHADER_ATTRIB_LOCATION_INDICES 8
|
||||
|
||||
// Default shader vertex attribute names to set location points
|
||||
// NOTE: When a new shader is loaded, the following locations are tried to be set for convenience
|
||||
|
|
|
|||
1
src/external/glfw/src/mappings.h
vendored
1
src/external/glfw/src/mappings.h
vendored
|
|
@ -996,6 +996,7 @@ const char* _glfwDefaultMappings[] =
|
|||
"03000000c0160000e105000001010000,Xin-Mo Xin-Mo Dual Arcade,a:b4,b:b3,back:b6,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b9,leftshoulder:b2,leftx:a0,lefty:a1,rightshoulder:b5,start:b7,x:b1,y:b0,platform:Linux,",
|
||||
"03000000120c0000100e000011010000,ZEROPLUS P4 Gamepad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux,",
|
||||
"03000000120c0000101e000011010000,ZEROPLUS P4 Wired Gamepad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux,",
|
||||
"03000000af1e00002400000010010000,Clockwork Pi DevTerm,a:b2,b:b1,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,start:b9,x:b3,y:b0,platform:Linux,",
|
||||
#endif // GLFW_BUILD_LINUX_JOYSTICK
|
||||
};
|
||||
|
||||
|
|
|
|||
2
src/external/par_shapes.h
vendored
2
src/external/par_shapes.h
vendored
|
|
@ -1130,7 +1130,7 @@ static par_shapes__rule* par_shapes__pick_rule(const char* name,
|
|||
total += rule->weight;
|
||||
}
|
||||
}
|
||||
float r = (float) rand() / RAND_MAX;
|
||||
float r = (float) rand() / (float) RAND_MAX;
|
||||
float t = 0;
|
||||
for (int i = 0; i < nrules; i++) {
|
||||
rule = rules + i;
|
||||
|
|
|
|||
1655
src/external/stb_image_resize2.h
vendored
1655
src/external/stb_image_resize2.h
vendored
File diff suppressed because it is too large
Load diff
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue