Merge branch 'master' into rcore_platform_split

This commit is contained in:
Ray 2023-10-08 18:28:59 +02:00 committed by GitHub
commit b4d2928f20
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
23 changed files with 12906 additions and 12592 deletions

View File

@ -22,7 +22,7 @@ jobs:
build: build:
permissions: permissions:
contents: write # for actions/upload-release-asset to upload release asset contents: write # for actions/upload-release-asset to upload release asset
runs-on: ubuntu-latest runs-on: ubuntu-20.04
strategy: strategy:
fail-fast: false fail-fast: false
max-parallel: 1 max-parallel: 1

View File

@ -23,7 +23,7 @@ Some people ported raylib to other languages in form of bindings or wrappers to
| raylib-d | **4.5** | [D](https://dlang.org/) | Zlib | https://github.com/schveiguy/raylib-d | | raylib-d | **4.5** | [D](https://dlang.org/) | Zlib | https://github.com/schveiguy/raylib-d |
| dlang_raylib | 4.0 | [D](https://dlang.org) | MPL-2.0 |https://github.com/rc-05/dlang_raylib | | dlang_raylib | 4.0 | [D](https://dlang.org) | MPL-2.0 |https://github.com/rc-05/dlang_raylib |
| rayex | 3.7 | [elixir](https://elixir-lang.org/) | Apache-2.0 | https://github.com/shiryel/rayex | | rayex | 3.7 | [elixir](https://elixir-lang.org/) | Apache-2.0 | https://github.com/shiryel/rayex |
| raylib-factor | 4.0 | [Factor](https://factorcode.org/) | BSD | https://github.com/factor/factor/blob/master/extra/raylib/raylib.factor | | raylib-factor | **4.5** | [Factor](https://factorcode.org/) | BSD | https://github.com/factor/factor/blob/master/extra/raylib/raylib.factor |
| raylib-freebasic | **4.5** | [FreeBASIC](https://www.freebasic.net/) | MIT | https://github.com/WIITD/raylib-freebasic | | raylib-freebasic | **4.5** | [FreeBASIC](https://www.freebasic.net/) | MIT | https://github.com/WIITD/raylib-freebasic |
| fortran-raylib | **4.5** | [Fortran](https://fortran-lang.org/) | ISC | https://github.com/interkosmos/fortran-raylib | | fortran-raylib | **4.5** | [Fortran](https://fortran-lang.org/) | ISC | https://github.com/interkosmos/fortran-raylib |
| raylib for Pascal | **4.5** | [Object Pascal](https://en.wikipedia.org/wiki/Object_Pascal) | Modified Zlib | https://github.com/tinyBigGAMES/raylib | | raylib for Pascal | **4.5** | [Object Pascal](https://en.wikipedia.org/wiki/Object_Pascal) | Modified Zlib | https://github.com/tinyBigGAMES/raylib |
@ -44,7 +44,7 @@ Some people ported raylib to other languages in form of bindings or wrappers to
| nelua-raylib | 4.0 | [nelua](https://nelua.io/) | MIT | https://github.com/AKDev21/nelua-raylib | | nelua-raylib | 4.0 | [nelua](https://nelua.io/) | MIT | https://github.com/AKDev21/nelua-raylib |
| Raylib.nelua | **4.5** | [nelua](https://nelua.io/) | Zlib | https://github.com/Its-Kenta/Raylib-Nelua | | Raylib.nelua | **4.5** | [nelua](https://nelua.io/) | Zlib | https://github.com/Its-Kenta/Raylib-Nelua |
| NimraylibNow! | 4.2 | [Nim](https://nim-lang.org/) | MIT | https://github.com/greenfork/nimraylib_now | | NimraylibNow! | 4.2 | [Nim](https://nim-lang.org/) | MIT | https://github.com/greenfork/nimraylib_now |
| raylib-bindings | **4.5** | [Ruby](https://www.ruby-lang.org/en/) | https://github.com/vaiorabbit/raylib-bindings | | raylib-bindings | **4.5** | [Ruby](https://www.ruby-lang.org/en/) | Zlib | https://github.com/vaiorabbit/raylib-bindings |
| raylib-Forever | auto | [Nim](https://nim-lang.org/) | ? | https://github.com/Guevara-chan/Raylib-Forever | | raylib-Forever | auto | [Nim](https://nim-lang.org/) | ? | https://github.com/Guevara-chan/Raylib-Forever |
| naylib | auto | [Nim](https://nim-lang.org/) | MIT | https://github.com/planetis-m/naylib | | naylib | auto | [Nim](https://nim-lang.org/) | MIT | https://github.com/planetis-m/naylib |
| node-raylib | **4.5** | [Node.js](https://nodejs.org/en/) | Zlib | https://github.com/RobLoach/node-raylib | | node-raylib | **4.5** | [Node.js](https://nodejs.org/en/) | Zlib | https://github.com/RobLoach/node-raylib |
@ -59,6 +59,7 @@ Some people ported raylib to other languages in form of bindings or wrappers to
| raylibpyctbg | **4.5** | [Python](https://www.python.org/) | MIT | https://github.com/overdev/raylibpyctbg | | raylibpyctbg | **4.5** | [Python](https://www.python.org/) | MIT | https://github.com/overdev/raylibpyctbg |
| raylib-py | **4.5** | [Python](https://www.python.org/) | MIT | https://github.com/overdev/raylib-py | | raylib-py | **4.5** | [Python](https://www.python.org/) | MIT | https://github.com/overdev/raylib-py |
| raylib-python-ctypes | 4.6-dev | [Python](https://www.python.org/) | MIT | https://github.com/sDos280/raylib-python-ctypes | | raylib-python-ctypes | 4.6-dev | [Python](https://www.python.org/) | MIT | https://github.com/sDos280/raylib-python-ctypes |
| raylib-pkpy-bindings | 4.6-dev | [pocketpy](https://pocketpy.dev/) | MIT | https://github.com/blueloveTH/pkpy-bindings |
| raylib-php | **4.5** | [PHP](https://en.wikipedia.org/wiki/PHP) | Zlib | https://github.com/joseph-montanez/raylib-php | | raylib-php | **4.5** | [PHP](https://en.wikipedia.org/wiki/PHP) | Zlib | https://github.com/joseph-montanez/raylib-php |
| raylib-phpcpp | 3.5 | [PHP](https://en.wikipedia.org/wiki/PHP) | Zlib | https://github.com/oraoto/raylib-phpcpp | | raylib-phpcpp | 3.5 | [PHP](https://en.wikipedia.org/wiki/PHP) | Zlib | https://github.com/oraoto/raylib-phpcpp |
| raylibr | 4.0 | [R](https://www.r-project.org) | MIT | https://github.com/jeroenjanssens/raylibr | | raylibr | 4.0 | [R](https://www.r-project.org) | MIT | https://github.com/jeroenjanssens/raylibr |

View File

@ -35,6 +35,23 @@
9. In case of additional information is required, just come to raylib Discord channel: example-contributions 9. In case of additional information is required, just come to raylib Discord channel: example-contributions
10. Have fun! 10. Have fun!
The following files should be updated when adding a new example, it's planned to create some
script to automatize this process but not available yet.
- raylib/examples/<category>/<category>_example_name.c
- raylib/examples/<category>/<category>_example_name.png
- raylib/examples/<category>/resources/*.*
- raylib/examples/Makefile
- raylib/examples/Makefile.Web
- raylib/examples/README.md
- raylib/projects/VS2022/examples/<category>_example_name.vcxproj
- raylib/projects/VS2022/raylib.sln
- raylib.com/common/examples.js
- raylib.com/examples/<category>/<category>_example_name.html
- raylib.com/examples/<category>/<category>_example_name.data
- raylib.com/examples/<category>/<category>_example_name.wasm
- raylib.com/examples/<category>/<category>_example_name.js
*/ */
/******************************************************************************************* /*******************************************************************************************

View File

@ -0,0 +1,14 @@
#version 330 core
uniform sampler2D diffuseMap;
uniform vec2 tiling;
in vec2 fragTexCoord;
out vec4 fragColor;
void main()
{
vec2 texCoord = fragTexCoord * tiling;
fragColor = texture(diffuseMap, texCoord);
}

View File

@ -0,0 +1,94 @@
/*******************************************************************************************
*
* raylib [textures] example - Texture Tiling
*
* Example demonstrates how to tile a texture on a 3D model using raylib.
*
* Example contributed by Luís Almeida (https://github.com/luis605)
*
* 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) 2023 Luís Almeida (https://github.com/luis605)
*
********************************************************************************************/
#include "raylib.h"
//------------------------------------------------------------------------------------
// Program main entry point
//------------------------------------------------------------------------------------
int main(void)
{
const int screenWidth = 800;
const int screenHeight = 600;
// Initialization
//--------------------------------------------------------------------------------------
InitWindow(screenWidth, screenHeight, "Raylib Texture Tiling");
SetTargetFPS(60);
// Load a texture
Texture2D texture = LoadTexture("resources/raylib_logo.png");
// Create a cube mesh
Mesh cube = GenMeshCube(1.0f, 1.0f, 1.0f);
// Load the texture onto the GPU
Model model = LoadModelFromMesh(cube);
model.materials[0].maps[MATERIAL_MAP_DIFFUSE].texture = texture;
// Set the tiling of the texture
float tiling[2] = {3.0f, 3.0f};
Shader shader = LoadShader(0, "resources/shaders/glsl330/tiling.fs"); // Create a custom shader in a .glsl file
SetShaderValue(shader, GetShaderLocation(shader, "tiling"), tiling, SHADER_UNIFORM_VEC2);
model.materials[0].shader = shader;
// Camera setup
Camera camera = { 0 };
camera.position = (Vector3){ 3.0f, 3.0f, 3.0f };
camera.target = (Vector3){ 0.0f, 0.0f, 0.0f };
camera.up = (Vector3){ 0.0f, 1.0f, 0.0f };
camera.fovy = 45.0f;
camera.projection = CAMERA_PERSPECTIVE;
// Main game loop
while (!WindowShouldClose())
{
// Update
//----------------------------------------------------------------------------------
BeginDrawing();
ClearBackground(RAYWHITE);
UpdateCamera(&camera, CAMERA_FREE);
// Draw the model
{
BeginMode3D(camera);
BeginShaderMode(shader);
DrawModel(model, (Vector3){ 0.0f, 0.0f, 0.0f }, 5.0f, WHITE);
EndShaderMode();
EndMode3D();
}
DrawText("Use mouse to rotate the camera", 10, 10, 20, DARKGRAY);
EndDrawing();
}
// De-Initialization
//--------------------------------------------------------------------------------------
UnloadTexture(texture); // Unload texture
UnloadModel(model); // Unload model
UnloadShader(shader); // Unload shader
CloseWindow(); // Close window and OpenGL context
return 0;
}

File diff suppressed because it is too large Load Diff

View File

@ -1428,6 +1428,11 @@
"value": 16384, "value": 16384,
"description": "Set to support mouse passthrough, only supported when FLAG_WINDOW_UNDECORATED" "description": "Set to support mouse passthrough, only supported when FLAG_WINDOW_UNDECORATED"
}, },
{
"name": "FLAG_BORDERLESS_WINDOWED_MODE",
"value": 32768,
"description": "Set to run program in borderless windowed mode"
},
{ {
"name": "FLAG_MSAA_4X_HINT", "name": "FLAG_MSAA_4X_HINT",
"value": 32, "value": 32,
@ -2605,58 +2610,73 @@
"description": "32*4 bpp (4 channels - float)" "description": "32*4 bpp (4 channels - float)"
}, },
{ {
"name": "PIXELFORMAT_COMPRESSED_DXT1_RGB", "name": "PIXELFORMAT_UNCOMPRESSED_R16",
"value": 11, "value": 11,
"description": "16 bpp (1 channel - half float)"
},
{
"name": "PIXELFORMAT_UNCOMPRESSED_R16G16B16",
"value": 12,
"description": "16*3 bpp (3 channels - half float)"
},
{
"name": "PIXELFORMAT_UNCOMPRESSED_R16G16B16A16",
"value": 13,
"description": "16*4 bpp (4 channels - half float)"
},
{
"name": "PIXELFORMAT_COMPRESSED_DXT1_RGB",
"value": 14,
"description": "4 bpp (no alpha)" "description": "4 bpp (no alpha)"
}, },
{ {
"name": "PIXELFORMAT_COMPRESSED_DXT1_RGBA", "name": "PIXELFORMAT_COMPRESSED_DXT1_RGBA",
"value": 12, "value": 15,
"description": "4 bpp (1 bit alpha)" "description": "4 bpp (1 bit alpha)"
}, },
{ {
"name": "PIXELFORMAT_COMPRESSED_DXT3_RGBA", "name": "PIXELFORMAT_COMPRESSED_DXT3_RGBA",
"value": 13, "value": 16,
"description": "8 bpp" "description": "8 bpp"
}, },
{ {
"name": "PIXELFORMAT_COMPRESSED_DXT5_RGBA", "name": "PIXELFORMAT_COMPRESSED_DXT5_RGBA",
"value": 14,
"description": "8 bpp"
},
{
"name": "PIXELFORMAT_COMPRESSED_ETC1_RGB",
"value": 15,
"description": "4 bpp"
},
{
"name": "PIXELFORMAT_COMPRESSED_ETC2_RGB",
"value": 16,
"description": "4 bpp"
},
{
"name": "PIXELFORMAT_COMPRESSED_ETC2_EAC_RGBA",
"value": 17, "value": 17,
"description": "8 bpp" "description": "8 bpp"
}, },
{ {
"name": "PIXELFORMAT_COMPRESSED_PVRT_RGB", "name": "PIXELFORMAT_COMPRESSED_ETC1_RGB",
"value": 18, "value": 18,
"description": "4 bpp" "description": "4 bpp"
}, },
{ {
"name": "PIXELFORMAT_COMPRESSED_PVRT_RGBA", "name": "PIXELFORMAT_COMPRESSED_ETC2_RGB",
"value": 19, "value": 19,
"description": "4 bpp" "description": "4 bpp"
}, },
{ {
"name": "PIXELFORMAT_COMPRESSED_ASTC_4x4_RGBA", "name": "PIXELFORMAT_COMPRESSED_ETC2_EAC_RGBA",
"value": 20, "value": 20,
"description": "8 bpp" "description": "8 bpp"
}, },
{ {
"name": "PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA", "name": "PIXELFORMAT_COMPRESSED_PVRT_RGB",
"value": 21, "value": 21,
"description": "4 bpp"
},
{
"name": "PIXELFORMAT_COMPRESSED_PVRT_RGBA",
"value": 22,
"description": "4 bpp"
},
{
"name": "PIXELFORMAT_COMPRESSED_ASTC_4x4_RGBA",
"value": 23,
"description": "8 bpp"
},
{
"name": "PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA",
"value": 24,
"description": "2 bpp" "description": "2 bpp"
} }
] ]
@ -2986,8 +3006,8 @@
"name": "fileName" "name": "fileName"
}, },
{ {
"type": "unsigned int *", "type": "int *",
"name": "bytesRead" "name": "dataSize"
} }
] ]
}, },
@ -3005,8 +3025,8 @@
"name": "data" "name": "data"
}, },
{ {
"type": "unsigned int", "type": "int",
"name": "bytesToWrite" "name": "dataSize"
} }
] ]
}, },
@ -3155,6 +3175,11 @@
"description": "Toggle window state: fullscreen/windowed (only PLATFORM_DESKTOP)", "description": "Toggle window state: fullscreen/windowed (only PLATFORM_DESKTOP)",
"returnType": "void" "returnType": "void"
}, },
{
"name": "ToggleBorderlessWindowed",
"description": "Toggle window state: borderless windowed (only PLATFORM_DESKTOP)",
"returnType": "void"
},
{ {
"name": "MaximizeWindow", "name": "MaximizeWindow",
"description": "Set window state: maximized, if resizable (only PLATFORM_DESKTOP)", "description": "Set window state: maximized, if resizable (only PLATFORM_DESKTOP)",
@ -3198,7 +3223,7 @@
}, },
{ {
"name": "SetWindowTitle", "name": "SetWindowTitle",
"description": "Set title for window (only PLATFORM_DESKTOP)", "description": "Set title for window (only PLATFORM_DESKTOP and PLATFORM_WEB)",
"returnType": "void", "returnType": "void",
"params": [ "params": [
{ {
@ -3224,7 +3249,7 @@
}, },
{ {
"name": "SetWindowMonitor", "name": "SetWindowMonitor",
"description": "Set monitor for the current window (fullscreen mode)", "description": "Set monitor for the current window",
"returnType": "void", "returnType": "void",
"params": [ "params": [
{ {
@ -3248,6 +3273,21 @@
} }
] ]
}, },
{
"name": "SetWindowMaxSize",
"description": "Set window maximum dimensions (for FLAG_WINDOW_RESIZABLE)",
"returnType": "void",
"params": [
{
"type": "int",
"name": "width"
},
{
"type": "int",
"name": "height"
}
]
},
{ {
"name": "SetWindowSize", "name": "SetWindowSize",
"description": "Set window dimensions", "description": "Set window dimensions",
@ -3274,6 +3314,11 @@
} }
] ]
}, },
{
"name": "SetWindowFocused",
"description": "Set window focused (only PLATFORM_DESKTOP)",
"returnType": "void"
},
{ {
"name": "GetWindowHandle", "name": "GetWindowHandle",
"description": "Get native window handle", "description": "Get native window handle",
@ -3387,7 +3432,7 @@
}, },
{ {
"name": "GetMonitorName", "name": "GetMonitorName",
"description": "Get the human-readable, UTF-8 encoded name of the primary monitor", "description": "Get the human-readable, UTF-8 encoded name of the specified monitor",
"returnType": "const char *", "returnType": "const char *",
"params": [ "params": [
{ {
@ -4132,8 +4177,8 @@
"name": "fileName" "name": "fileName"
}, },
{ {
"type": "unsigned int *", "type": "int *",
"name": "bytesRead" "name": "dataSize"
} }
] ]
}, },
@ -4162,8 +4207,8 @@
"name": "data" "name": "data"
}, },
{ {
"type": "unsigned int", "type": "int",
"name": "bytesToWrite" "name": "dataSize"
} }
] ]
}, },
@ -4177,8 +4222,8 @@
"name": "data" "name": "data"
}, },
{ {
"type": "unsigned int", "type": "int",
"name": "size" "name": "dataSize"
}, },
{ {
"type": "const char *", "type": "const char *",
@ -4333,7 +4378,7 @@
}, },
{ {
"name": "GetApplicationDirectory", "name": "GetApplicationDirectory",
"description": "Get the directory if the running application (uses static string)", "description": "Get the directory of the running application (uses static string)",
"returnType": "const char *" "returnType": "const char *"
}, },
{ {
@ -4514,6 +4559,17 @@
} }
] ]
}, },
{
"name": "IsKeyPressedRepeat",
"description": "Check if a key has been pressed again (Only PLATFORM_DESKTOP)",
"returnType": "bool",
"params": [
{
"type": "int",
"name": "key"
}
]
},
{ {
"name": "IsKeyDown", "name": "IsKeyDown",
"description": "Check if a key is being pressed", "description": "Check if a key is being pressed",
@ -4876,7 +4932,7 @@
"returnType": "bool", "returnType": "bool",
"params": [ "params": [
{ {
"type": "int", "type": "unsigned int",
"name": "gesture" "name": "gesture"
} }
] ]
@ -5148,6 +5204,52 @@
} }
] ]
}, },
{
"name": "DrawLineBSpline",
"description": "Draw a B-Spline line, minimum 4 points",
"returnType": "void",
"params": [
{
"type": "Vector2 *",
"name": "points"
},
{
"type": "int",
"name": "pointCount"
},
{
"type": "float",
"name": "thick"
},
{
"type": "Color",
"name": "color"
}
]
},
{
"name": "DrawLineCatmullRom",
"description": "Draw a Catmull Rom spline line, minimum 4 points",
"returnType": "void",
"params": [
{
"type": "Vector2 *",
"name": "points"
},
{
"type": "int",
"name": "pointCount"
},
{
"type": "float",
"name": "thick"
},
{
"type": "Color",
"name": "color"
}
]
},
{ {
"name": "DrawLineStrip", "name": "DrawLineStrip",
"description": "Draw lines sequence", "description": "Draw lines sequence",
@ -6119,6 +6221,25 @@
} }
] ]
}, },
{
"name": "LoadImageSvg",
"description": "Load image from SVG file data or string with specified size",
"returnType": "Image",
"params": [
{
"type": "const char *",
"name": "fileNameOrString"
},
{
"type": "int",
"name": "width"
},
{
"type": "int",
"name": "height"
}
]
},
{ {
"name": "LoadImageAnim", "name": "LoadImageAnim",
"description": "Load image sequence from file (frames appended to image.data)", "description": "Load image sequence from file (frames appended to image.data)",
@ -6206,6 +6327,25 @@
} }
] ]
}, },
{
"name": "ExportImageToMemory",
"description": "Export image to memory buffer",
"returnType": "unsigned char *",
"params": [
{
"type": "Image",
"name": "image"
},
{
"type": "const char *",
"name": "fileType"
},
{
"type": "int *",
"name": "fileSize"
}
]
},
{ {
"name": "ExportImageAsCode", "name": "ExportImageAsCode",
"description": "Export image as code file defining an array of bytes, returns true on success", "description": "Export image as code file defining an array of bytes, returns true on success",
@ -6759,7 +6899,7 @@
}, },
{ {
"name": "ImageRotate", "name": "ImageRotate",
"description": "Rotate image by input angle in degrees (-359 to 359) ", "description": "Rotate image by input angle in degrees (-359 to 359)",
"returnType": "void", "returnType": "void",
"params": [ "params": [
{ {
@ -7930,7 +8070,7 @@
}, },
{ {
"name": "LoadFontEx", "name": "LoadFontEx",
"description": "Load font from file with extended parameters, use NULL for fontChars and 0 for glyphCount to load the default character set", "description": "Load font from file with extended parameters, use NULL for codepoints and 0 for codepointCount to load the default character setFont",
"returnType": "Font", "returnType": "Font",
"params": [ "params": [
{ {
@ -7943,11 +8083,11 @@
}, },
{ {
"type": "int *", "type": "int *",
"name": "fontChars" "name": "codepoints"
}, },
{ {
"type": "int", "type": "int",
"name": "glyphCount" "name": "codepointCount"
} }
] ]
}, },
@ -7993,11 +8133,11 @@
}, },
{ {
"type": "int *", "type": "int *",
"name": "fontChars" "name": "codepoints"
}, },
{ {
"type": "int", "type": "int",
"name": "glyphCount" "name": "codepointCount"
} }
] ]
}, },
@ -8031,11 +8171,11 @@
}, },
{ {
"type": "int *", "type": "int *",
"name": "fontChars" "name": "codepoints"
}, },
{ {
"type": "int", "type": "int",
"name": "glyphCount" "name": "codepointCount"
}, },
{ {
"type": "int", "type": "int",
@ -8050,11 +8190,11 @@
"params": [ "params": [
{ {
"type": "const GlyphInfo *", "type": "const GlyphInfo *",
"name": "chars" "name": "glyphs"
}, },
{ {
"type": "Rectangle **", "type": "Rectangle **",
"name": "recs" "name": "glyphRecs"
}, },
{ {
"type": "int", "type": "int",
@ -8081,7 +8221,7 @@
"params": [ "params": [
{ {
"type": "GlyphInfo *", "type": "GlyphInfo *",
"name": "chars" "name": "glyphs"
}, },
{ {
"type": "int", "type": "int",
@ -8269,7 +8409,7 @@
}, },
{ {
"type": "int", "type": "int",
"name": "count" "name": "codepointCount"
}, },
{ {
"type": "Vector2", "type": "Vector2",
@ -8289,6 +8429,17 @@
} }
] ]
}, },
{
"name": "SetTextLineSpacing",
"description": "Set vertical line spacing when drawing with line-breaks",
"returnType": "void",
"params": [
{
"type": "int",
"name": "spacing"
}
]
},
{ {
"name": "MeasureText", "name": "MeasureText",
"description": "Measure string width for default font", "description": "Measure string width for default font",
@ -9937,7 +10088,7 @@
"name": "fileName" "name": "fileName"
}, },
{ {
"type": "unsigned int *", "type": "int *",
"name": "animCount" "name": "animCount"
} }
] ]
@ -9982,8 +10133,8 @@
"name": "animations" "name": "animations"
}, },
{ {
"type": "unsigned int", "type": "int",
"name": "count" "name": "animCount"
} }
] ]
}, },
@ -10251,6 +10402,17 @@
} }
] ]
}, },
{
"name": "LoadSoundAlias",
"description": "Create a new sound that shares the same sample data as the source sound, does not own the sound data",
"returnType": "Sound",
"params": [
{
"type": "Sound",
"name": "source"
}
]
},
{ {
"name": "IsSoundReady", "name": "IsSoundReady",
"description": "Checks if a sound is ready", "description": "Checks if a sound is ready",
@ -10303,6 +10465,17 @@
} }
] ]
}, },
{
"name": "UnloadSoundAlias",
"description": "Unload a sound alias (does not deallocate sample data)",
"returnType": "void",
"params": [
{
"type": "Sound",
"name": "alias"
}
]
},
{ {
"name": "ExportWave", "name": "ExportWave",
"description": "Export wave data to file, returns true on success", "description": "Export wave data to file, returns true on success",
@ -10907,7 +11080,7 @@
}, },
{ {
"name": "AttachAudioStreamProcessor", "name": "AttachAudioStreamProcessor",
"description": "Attach audio stream processor to stream", "description": "Attach audio stream processor to stream, receives the samples as <float>s",
"returnType": "void", "returnType": "void",
"params": [ "params": [
{ {
@ -10937,7 +11110,7 @@
}, },
{ {
"name": "AttachAudioMixedProcessor", "name": "AttachAudioMixedProcessor",
"description": "Attach audio stream processor to the entire audio pipeline", "description": "Attach audio stream processor to the entire audio pipeline, receives the samples as <float>s",
"returnType": "void", "returnType": "void",
"params": [ "params": [
{ {

View File

@ -1428,6 +1428,11 @@ return {
value = 16384, value = 16384,
description = "Set to support mouse passthrough, only supported when FLAG_WINDOW_UNDECORATED" description = "Set to support mouse passthrough, only supported when FLAG_WINDOW_UNDECORATED"
}, },
{
name = "FLAG_BORDERLESS_WINDOWED_MODE",
value = 32768,
description = "Set to run program in borderless windowed mode"
},
{ {
name = "FLAG_MSAA_4X_HINT", name = "FLAG_MSAA_4X_HINT",
value = 32, value = 32,
@ -2605,58 +2610,73 @@ return {
description = "32*4 bpp (4 channels - float)" description = "32*4 bpp (4 channels - float)"
}, },
{ {
name = "PIXELFORMAT_COMPRESSED_DXT1_RGB", name = "PIXELFORMAT_UNCOMPRESSED_R16",
value = 11, value = 11,
description = "16 bpp (1 channel - half float)"
},
{
name = "PIXELFORMAT_UNCOMPRESSED_R16G16B16",
value = 12,
description = "16*3 bpp (3 channels - half float)"
},
{
name = "PIXELFORMAT_UNCOMPRESSED_R16G16B16A16",
value = 13,
description = "16*4 bpp (4 channels - half float)"
},
{
name = "PIXELFORMAT_COMPRESSED_DXT1_RGB",
value = 14,
description = "4 bpp (no alpha)" description = "4 bpp (no alpha)"
}, },
{ {
name = "PIXELFORMAT_COMPRESSED_DXT1_RGBA", name = "PIXELFORMAT_COMPRESSED_DXT1_RGBA",
value = 12, value = 15,
description = "4 bpp (1 bit alpha)" description = "4 bpp (1 bit alpha)"
}, },
{ {
name = "PIXELFORMAT_COMPRESSED_DXT3_RGBA", name = "PIXELFORMAT_COMPRESSED_DXT3_RGBA",
value = 13, value = 16,
description = "8 bpp" description = "8 bpp"
}, },
{ {
name = "PIXELFORMAT_COMPRESSED_DXT5_RGBA", name = "PIXELFORMAT_COMPRESSED_DXT5_RGBA",
value = 14,
description = "8 bpp"
},
{
name = "PIXELFORMAT_COMPRESSED_ETC1_RGB",
value = 15,
description = "4 bpp"
},
{
name = "PIXELFORMAT_COMPRESSED_ETC2_RGB",
value = 16,
description = "4 bpp"
},
{
name = "PIXELFORMAT_COMPRESSED_ETC2_EAC_RGBA",
value = 17, value = 17,
description = "8 bpp" description = "8 bpp"
}, },
{ {
name = "PIXELFORMAT_COMPRESSED_PVRT_RGB", name = "PIXELFORMAT_COMPRESSED_ETC1_RGB",
value = 18, value = 18,
description = "4 bpp" description = "4 bpp"
}, },
{ {
name = "PIXELFORMAT_COMPRESSED_PVRT_RGBA", name = "PIXELFORMAT_COMPRESSED_ETC2_RGB",
value = 19, value = 19,
description = "4 bpp" description = "4 bpp"
}, },
{ {
name = "PIXELFORMAT_COMPRESSED_ASTC_4x4_RGBA", name = "PIXELFORMAT_COMPRESSED_ETC2_EAC_RGBA",
value = 20, value = 20,
description = "8 bpp" description = "8 bpp"
}, },
{ {
name = "PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA", name = "PIXELFORMAT_COMPRESSED_PVRT_RGB",
value = 21, value = 21,
description = "4 bpp"
},
{
name = "PIXELFORMAT_COMPRESSED_PVRT_RGBA",
value = 22,
description = "4 bpp"
},
{
name = "PIXELFORMAT_COMPRESSED_ASTC_4x4_RGBA",
value = 23,
description = "8 bpp"
},
{
name = "PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA",
value = 24,
description = "2 bpp" description = "2 bpp"
} }
} }
@ -2973,7 +2993,7 @@ return {
returnType = "unsigned char *", returnType = "unsigned char *",
params = { params = {
{type = "const char *", name = "fileName"}, {type = "const char *", name = "fileName"},
{type = "unsigned int *", name = "bytesRead"} {type = "int *", name = "dataSize"}
} }
}, },
{ {
@ -2983,7 +3003,7 @@ return {
params = { params = {
{type = "const char *", name = "fileName"}, {type = "const char *", name = "fileName"},
{type = "void *", name = "data"}, {type = "void *", name = "data"},
{type = "unsigned int", name = "bytesToWrite"} {type = "int", name = "dataSize"}
} }
}, },
{ {
@ -3098,6 +3118,11 @@ return {
description = "Toggle window state: fullscreen/windowed (only PLATFORM_DESKTOP)", description = "Toggle window state: fullscreen/windowed (only PLATFORM_DESKTOP)",
returnType = "void" returnType = "void"
}, },
{
name = "ToggleBorderlessWindowed",
description = "Toggle window state: borderless windowed (only PLATFORM_DESKTOP)",
returnType = "void"
},
{ {
name = "MaximizeWindow", name = "MaximizeWindow",
description = "Set window state: maximized, if resizable (only PLATFORM_DESKTOP)", description = "Set window state: maximized, if resizable (only PLATFORM_DESKTOP)",
@ -3132,7 +3157,7 @@ return {
}, },
{ {
name = "SetWindowTitle", name = "SetWindowTitle",
description = "Set title for window (only PLATFORM_DESKTOP)", description = "Set title for window (only PLATFORM_DESKTOP and PLATFORM_WEB)",
returnType = "void", returnType = "void",
params = { params = {
{type = "const char *", name = "title"} {type = "const char *", name = "title"}
@ -3149,7 +3174,7 @@ return {
}, },
{ {
name = "SetWindowMonitor", name = "SetWindowMonitor",
description = "Set monitor for the current window (fullscreen mode)", description = "Set monitor for the current window",
returnType = "void", returnType = "void",
params = { params = {
{type = "int", name = "monitor"} {type = "int", name = "monitor"}
@ -3164,6 +3189,15 @@ return {
{type = "int", name = "height"} {type = "int", name = "height"}
} }
}, },
{
name = "SetWindowMaxSize",
description = "Set window maximum dimensions (for FLAG_WINDOW_RESIZABLE)",
returnType = "void",
params = {
{type = "int", name = "width"},
{type = "int", name = "height"}
}
},
{ {
name = "SetWindowSize", name = "SetWindowSize",
description = "Set window dimensions", description = "Set window dimensions",
@ -3181,6 +3215,11 @@ return {
{type = "float", name = "opacity"} {type = "float", name = "opacity"}
} }
}, },
{
name = "SetWindowFocused",
description = "Set window focused (only PLATFORM_DESKTOP)",
returnType = "void"
},
{ {
name = "GetWindowHandle", name = "GetWindowHandle",
description = "Get native window handle", description = "Get native window handle",
@ -3276,7 +3315,7 @@ return {
}, },
{ {
name = "GetMonitorName", name = "GetMonitorName",
description = "Get the human-readable, UTF-8 encoded name of the primary monitor", description = "Get the human-readable, UTF-8 encoded name of the specified monitor",
returnType = "const char *", returnType = "const char *",
params = { params = {
{type = "int", name = "monitor"} {type = "int", name = "monitor"}
@ -3792,7 +3831,7 @@ return {
returnType = "unsigned char *", returnType = "unsigned char *",
params = { params = {
{type = "const char *", name = "fileName"}, {type = "const char *", name = "fileName"},
{type = "unsigned int *", name = "bytesRead"} {type = "int *", name = "dataSize"}
} }
}, },
{ {
@ -3810,7 +3849,7 @@ return {
params = { params = {
{type = "const char *", name = "fileName"}, {type = "const char *", name = "fileName"},
{type = "void *", name = "data"}, {type = "void *", name = "data"},
{type = "unsigned int", name = "bytesToWrite"} {type = "int", name = "dataSize"}
} }
}, },
{ {
@ -3819,7 +3858,7 @@ return {
returnType = "bool", returnType = "bool",
params = { params = {
{type = "const unsigned char *", name = "data"}, {type = "const unsigned char *", name = "data"},
{type = "unsigned int", name = "size"}, {type = "int", name = "dataSize"},
{type = "const char *", name = "fileName"} {type = "const char *", name = "fileName"}
} }
}, },
@ -3928,7 +3967,7 @@ return {
}, },
{ {
name = "GetApplicationDirectory", name = "GetApplicationDirectory",
description = "Get the directory if the running application (uses static string)", description = "Get the directory of the running application (uses static string)",
returnType = "const char *" returnType = "const char *"
}, },
{ {
@ -4046,6 +4085,14 @@ return {
{type = "int", name = "key"} {type = "int", name = "key"}
} }
}, },
{
name = "IsKeyPressedRepeat",
description = "Check if a key has been pressed again (Only PLATFORM_DESKTOP)",
returnType = "bool",
params = {
{type = "int", name = "key"}
}
},
{ {
name = "IsKeyDown", name = "IsKeyDown",
description = "Check if a key is being pressed", description = "Check if a key is being pressed",
@ -4311,7 +4358,7 @@ return {
description = "Check if a gesture have been detected", description = "Check if a gesture have been detected",
returnType = "bool", returnType = "bool",
params = { params = {
{type = "int", name = "gesture"} {type = "unsigned int", name = "gesture"}
} }
}, },
{ {
@ -4461,6 +4508,28 @@ return {
{type = "Color", name = "color"} {type = "Color", name = "color"}
} }
}, },
{
name = "DrawLineBSpline",
description = "Draw a B-Spline line, minimum 4 points",
returnType = "void",
params = {
{type = "Vector2 *", name = "points"},
{type = "int", name = "pointCount"},
{type = "float", name = "thick"},
{type = "Color", name = "color"}
}
},
{
name = "DrawLineCatmullRom",
description = "Draw a Catmull Rom spline line, minimum 4 points",
returnType = "void",
params = {
{type = "Vector2 *", name = "points"},
{type = "int", name = "pointCount"},
{type = "float", name = "thick"},
{type = "Color", name = "color"}
}
},
{ {
name = "DrawLineStrip", name = "DrawLineStrip",
description = "Draw lines sequence", description = "Draw lines sequence",
@ -4919,6 +4988,16 @@ return {
{type = "int", name = "headerSize"} {type = "int", name = "headerSize"}
} }
}, },
{
name = "LoadImageSvg",
description = "Load image from SVG file data or string with specified size",
returnType = "Image",
params = {
{type = "const char *", name = "fileNameOrString"},
{type = "int", name = "width"},
{type = "int", name = "height"}
}
},
{ {
name = "LoadImageAnim", name = "LoadImageAnim",
description = "Load image sequence from file (frames appended to image.data)", description = "Load image sequence from file (frames appended to image.data)",
@ -4976,6 +5055,16 @@ return {
{type = "const char *", name = "fileName"} {type = "const char *", name = "fileName"}
} }
}, },
{
name = "ExportImageToMemory",
description = "Export image to memory buffer",
returnType = "unsigned char *",
params = {
{type = "Image", name = "image"},
{type = "const char *", name = "fileType"},
{type = "int *", name = "fileSize"}
}
},
{ {
name = "ExportImageAsCode", name = "ExportImageAsCode",
description = "Export image as code file defining an array of bytes, returns true on success", description = "Export image as code file defining an array of bytes, returns true on success",
@ -5268,7 +5357,7 @@ return {
}, },
{ {
name = "ImageRotate", name = "ImageRotate",
description = "Rotate image by input angle in degrees (-359 to 359) ", description = "Rotate image by input angle in degrees (-359 to 359)",
returnType = "void", returnType = "void",
params = { params = {
{type = "Image *", name = "image"}, {type = "Image *", name = "image"},
@ -5911,13 +6000,13 @@ return {
}, },
{ {
name = "LoadFontEx", name = "LoadFontEx",
description = "Load font from file with extended parameters, use NULL for fontChars and 0 for glyphCount to load the default character set", description = "Load font from file with extended parameters, use NULL for codepoints and 0 for codepointCount to load the default character setFont",
returnType = "Font", returnType = "Font",
params = { params = {
{type = "const char *", name = "fileName"}, {type = "const char *", name = "fileName"},
{type = "int", name = "fontSize"}, {type = "int", name = "fontSize"},
{type = "int *", name = "fontChars"}, {type = "int *", name = "codepoints"},
{type = "int", name = "glyphCount"} {type = "int", name = "codepointCount"}
} }
}, },
{ {
@ -5939,8 +6028,8 @@ return {
{type = "const unsigned char *", name = "fileData"}, {type = "const unsigned char *", name = "fileData"},
{type = "int", name = "dataSize"}, {type = "int", name = "dataSize"},
{type = "int", name = "fontSize"}, {type = "int", name = "fontSize"},
{type = "int *", name = "fontChars"}, {type = "int *", name = "codepoints"},
{type = "int", name = "glyphCount"} {type = "int", name = "codepointCount"}
} }
}, },
{ {
@ -5959,8 +6048,8 @@ return {
{type = "const unsigned char *", name = "fileData"}, {type = "const unsigned char *", name = "fileData"},
{type = "int", name = "dataSize"}, {type = "int", name = "dataSize"},
{type = "int", name = "fontSize"}, {type = "int", name = "fontSize"},
{type = "int *", name = "fontChars"}, {type = "int *", name = "codepoints"},
{type = "int", name = "glyphCount"}, {type = "int", name = "codepointCount"},
{type = "int", name = "type"} {type = "int", name = "type"}
} }
}, },
@ -5969,8 +6058,8 @@ return {
description = "Generate image font atlas using chars info", description = "Generate image font atlas using chars info",
returnType = "Image", returnType = "Image",
params = { params = {
{type = "const GlyphInfo *", name = "chars"}, {type = "const GlyphInfo *", name = "glyphs"},
{type = "Rectangle **", name = "recs"}, {type = "Rectangle **", name = "glyphRecs"},
{type = "int", name = "glyphCount"}, {type = "int", name = "glyphCount"},
{type = "int", name = "fontSize"}, {type = "int", name = "fontSize"},
{type = "int", name = "padding"}, {type = "int", name = "padding"},
@ -5982,7 +6071,7 @@ return {
description = "Unload font chars info data (RAM)", description = "Unload font chars info data (RAM)",
returnType = "void", returnType = "void",
params = { params = {
{type = "GlyphInfo *", name = "chars"}, {type = "GlyphInfo *", name = "glyphs"},
{type = "int", name = "glyphCount"} {type = "int", name = "glyphCount"}
} }
}, },
@ -6071,13 +6160,21 @@ return {
params = { params = {
{type = "Font", name = "font"}, {type = "Font", name = "font"},
{type = "const int *", name = "codepoints"}, {type = "const int *", name = "codepoints"},
{type = "int", name = "count"}, {type = "int", name = "codepointCount"},
{type = "Vector2", name = "position"}, {type = "Vector2", name = "position"},
{type = "float", name = "fontSize"}, {type = "float", name = "fontSize"},
{type = "float", name = "spacing"}, {type = "float", name = "spacing"},
{type = "Color", name = "tint"} {type = "Color", name = "tint"}
} }
}, },
{
name = "SetTextLineSpacing",
description = "Set vertical line spacing when drawing with line-breaks",
returnType = "void",
params = {
{type = "int", name = "spacing"}
}
},
{ {
name = "MeasureText", name = "MeasureText",
description = "Measure string width for default font", description = "Measure string width for default font",
@ -6954,7 +7051,7 @@ return {
returnType = "ModelAnimation *", returnType = "ModelAnimation *",
params = { params = {
{type = "const char *", name = "fileName"}, {type = "const char *", name = "fileName"},
{type = "unsigned int *", name = "animCount"} {type = "int *", name = "animCount"}
} }
}, },
{ {
@ -6981,7 +7078,7 @@ return {
returnType = "void", returnType = "void",
params = { params = {
{type = "ModelAnimation *", name = "animations"}, {type = "ModelAnimation *", name = "animations"},
{type = "unsigned int", name = "count"} {type = "int", name = "animCount"}
} }
}, },
{ {
@ -7140,6 +7237,14 @@ return {
{type = "Wave", name = "wave"} {type = "Wave", name = "wave"}
} }
}, },
{
name = "LoadSoundAlias",
description = "Create a new sound that shares the same sample data as the source sound, does not own the sound data",
returnType = "Sound",
params = {
{type = "Sound", name = "source"}
}
},
{ {
name = "IsSoundReady", name = "IsSoundReady",
description = "Checks if a sound is ready", description = "Checks if a sound is ready",
@ -7174,6 +7279,14 @@ return {
{type = "Sound", name = "sound"} {type = "Sound", name = "sound"}
} }
}, },
{
name = "UnloadSoundAlias",
description = "Unload a sound alias (does not deallocate sample data)",
returnType = "void",
params = {
{type = "Sound", name = "alias"}
}
},
{ {
name = "ExportWave", name = "ExportWave",
description = "Export wave data to file, returns true on success", description = "Export wave data to file, returns true on success",
@ -7568,7 +7681,7 @@ return {
}, },
{ {
name = "AttachAudioStreamProcessor", name = "AttachAudioStreamProcessor",
description = "Attach audio stream processor to stream", description = "Attach audio stream processor to stream, receives the samples as <float>s",
returnType = "void", returnType = "void",
params = { params = {
{type = "AudioStream", name = "stream"}, {type = "AudioStream", name = "stream"},
@ -7586,7 +7699,7 @@ return {
}, },
{ {
name = "AttachAudioMixedProcessor", name = "AttachAudioMixedProcessor",
description = "Attach audio stream processor to the entire audio pipeline", description = "Attach audio stream processor to the entire audio pipeline, receives the samples as <float>s",
returnType = "void", returnType = "void",
params = { params = {
{type = "AudioCallback", name = "processor"} {type = "AudioCallback", name = "processor"}

File diff suppressed because it is too large Load Diff

View File

@ -292,7 +292,7 @@
<Alias type="Camera" name="Camera3D" desc="Camera type fallback, defaults to Camera3D" /> <Alias type="Camera" name="Camera3D" desc="Camera type fallback, defaults to Camera3D" />
</Aliases> </Aliases>
<Enums count="21"> <Enums count="21">
<Enum name="ConfigFlags" valueCount="15" desc="System/Window config flags"> <Enum name="ConfigFlags" valueCount="16" desc="System/Window config flags">
<Value name="FLAG_VSYNC_HINT" integer="64" desc="Set to try enabling V-Sync on GPU" /> <Value name="FLAG_VSYNC_HINT" integer="64" desc="Set to try enabling V-Sync on GPU" />
<Value name="FLAG_FULLSCREEN_MODE" integer="2" desc="Set to run program in fullscreen" /> <Value name="FLAG_FULLSCREEN_MODE" integer="2" desc="Set to run program in fullscreen" />
<Value name="FLAG_WINDOW_RESIZABLE" integer="4" desc="Set to allow resizable window" /> <Value name="FLAG_WINDOW_RESIZABLE" integer="4" desc="Set to allow resizable window" />
@ -306,6 +306,7 @@
<Value name="FLAG_WINDOW_TRANSPARENT" integer="16" desc="Set to allow transparent framebuffer" /> <Value name="FLAG_WINDOW_TRANSPARENT" integer="16" desc="Set to allow transparent framebuffer" />
<Value name="FLAG_WINDOW_HIGHDPI" integer="8192" desc="Set to support HighDPI" /> <Value name="FLAG_WINDOW_HIGHDPI" integer="8192" desc="Set to support HighDPI" />
<Value name="FLAG_WINDOW_MOUSE_PASSTHROUGH" integer="16384" desc="Set to support mouse passthrough, only supported when FLAG_WINDOW_UNDECORATED" /> <Value name="FLAG_WINDOW_MOUSE_PASSTHROUGH" integer="16384" desc="Set to support mouse passthrough, only supported when FLAG_WINDOW_UNDECORATED" />
<Value name="FLAG_BORDERLESS_WINDOWED_MODE" integer="32768" desc="Set to run program in borderless windowed mode" />
<Value name="FLAG_MSAA_4X_HINT" integer="32" desc="Set to try enabling MSAA 4X" /> <Value name="FLAG_MSAA_4X_HINT" integer="32" desc="Set to try enabling MSAA 4X" />
<Value name="FLAG_INTERLACED_HINT" integer="65536" desc="Set to try enabling interlaced video format (for V3D)" /> <Value name="FLAG_INTERLACED_HINT" integer="65536" desc="Set to try enabling interlaced video format (for V3D)" />
</Enum> </Enum>
@ -539,7 +540,7 @@
<Value name="SHADER_ATTRIB_VEC3" integer="2" desc="Shader attribute type: vec3 (3 float)" /> <Value name="SHADER_ATTRIB_VEC3" integer="2" desc="Shader attribute type: vec3 (3 float)" />
<Value name="SHADER_ATTRIB_VEC4" integer="3" desc="Shader attribute type: vec4 (4 float)" /> <Value name="SHADER_ATTRIB_VEC4" integer="3" desc="Shader attribute type: vec4 (4 float)" />
</Enum> </Enum>
<Enum name="PixelFormat" valueCount="21" desc="Pixel formats"> <Enum name="PixelFormat" valueCount="24" desc="Pixel formats">
<Value name="PIXELFORMAT_UNCOMPRESSED_GRAYSCALE" integer="1" desc="8 bit per pixel (no alpha)" /> <Value name="PIXELFORMAT_UNCOMPRESSED_GRAYSCALE" integer="1" desc="8 bit per pixel (no alpha)" />
<Value name="PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA" integer="2" desc="8*2 bpp (2 channels)" /> <Value name="PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA" integer="2" desc="8*2 bpp (2 channels)" />
<Value name="PIXELFORMAT_UNCOMPRESSED_R5G6B5" integer="3" desc="16 bpp" /> <Value name="PIXELFORMAT_UNCOMPRESSED_R5G6B5" integer="3" desc="16 bpp" />
@ -550,17 +551,20 @@
<Value name="PIXELFORMAT_UNCOMPRESSED_R32" integer="8" desc="32 bpp (1 channel - float)" /> <Value name="PIXELFORMAT_UNCOMPRESSED_R32" integer="8" desc="32 bpp (1 channel - float)" />
<Value name="PIXELFORMAT_UNCOMPRESSED_R32G32B32" integer="9" desc="32*3 bpp (3 channels - float)" /> <Value name="PIXELFORMAT_UNCOMPRESSED_R32G32B32" integer="9" desc="32*3 bpp (3 channels - float)" />
<Value name="PIXELFORMAT_UNCOMPRESSED_R32G32B32A32" integer="10" desc="32*4 bpp (4 channels - float)" /> <Value name="PIXELFORMAT_UNCOMPRESSED_R32G32B32A32" integer="10" desc="32*4 bpp (4 channels - float)" />
<Value name="PIXELFORMAT_COMPRESSED_DXT1_RGB" integer="11" desc="4 bpp (no alpha)" /> <Value name="PIXELFORMAT_UNCOMPRESSED_R16" integer="11" desc="16 bpp (1 channel - half float)" />
<Value name="PIXELFORMAT_COMPRESSED_DXT1_RGBA" integer="12" desc="4 bpp (1 bit alpha)" /> <Value name="PIXELFORMAT_UNCOMPRESSED_R16G16B16" integer="12" desc="16*3 bpp (3 channels - half float)" />
<Value name="PIXELFORMAT_COMPRESSED_DXT3_RGBA" integer="13" desc="8 bpp" /> <Value name="PIXELFORMAT_UNCOMPRESSED_R16G16B16A16" integer="13" desc="16*4 bpp (4 channels - half float)" />
<Value name="PIXELFORMAT_COMPRESSED_DXT5_RGBA" integer="14" desc="8 bpp" /> <Value name="PIXELFORMAT_COMPRESSED_DXT1_RGB" integer="14" desc="4 bpp (no alpha)" />
<Value name="PIXELFORMAT_COMPRESSED_ETC1_RGB" integer="15" desc="4 bpp" /> <Value name="PIXELFORMAT_COMPRESSED_DXT1_RGBA" integer="15" desc="4 bpp (1 bit alpha)" />
<Value name="PIXELFORMAT_COMPRESSED_ETC2_RGB" integer="16" desc="4 bpp" /> <Value name="PIXELFORMAT_COMPRESSED_DXT3_RGBA" integer="16" desc="8 bpp" />
<Value name="PIXELFORMAT_COMPRESSED_ETC2_EAC_RGBA" integer="17" desc="8 bpp" /> <Value name="PIXELFORMAT_COMPRESSED_DXT5_RGBA" integer="17" desc="8 bpp" />
<Value name="PIXELFORMAT_COMPRESSED_PVRT_RGB" integer="18" desc="4 bpp" /> <Value name="PIXELFORMAT_COMPRESSED_ETC1_RGB" integer="18" desc="4 bpp" />
<Value name="PIXELFORMAT_COMPRESSED_PVRT_RGBA" integer="19" desc="4 bpp" /> <Value name="PIXELFORMAT_COMPRESSED_ETC2_RGB" integer="19" desc="4 bpp" />
<Value name="PIXELFORMAT_COMPRESSED_ASTC_4x4_RGBA" integer="20" desc="8 bpp" /> <Value name="PIXELFORMAT_COMPRESSED_ETC2_EAC_RGBA" integer="20" desc="8 bpp" />
<Value name="PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA" integer="21" desc="2 bpp" /> <Value name="PIXELFORMAT_COMPRESSED_PVRT_RGB" integer="21" desc="4 bpp" />
<Value name="PIXELFORMAT_COMPRESSED_PVRT_RGBA" integer="22" desc="4 bpp" />
<Value name="PIXELFORMAT_COMPRESSED_ASTC_4x4_RGBA" integer="23" desc="8 bpp" />
<Value name="PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA" integer="24" desc="2 bpp" />
</Enum> </Enum>
<Enum name="TextureFilter" valueCount="6" desc="Texture parameters: filter mode"> <Enum name="TextureFilter" valueCount="6" desc="Texture parameters: filter mode">
<Value name="TEXTURE_FILTER_POINT" integer="0" desc="No filter, just pixel approximation" /> <Value name="TEXTURE_FILTER_POINT" integer="0" desc="No filter, just pixel approximation" />
@ -637,12 +641,12 @@
</Callback> </Callback>
<Callback name="LoadFileDataCallback" retType="unsigned char *" paramCount="2" desc="FileIO: Load binary data"> <Callback name="LoadFileDataCallback" retType="unsigned char *" paramCount="2" desc="FileIO: Load binary data">
<Param type="const char *" name="fileName" desc="" /> <Param type="const char *" name="fileName" desc="" />
<Param type="unsigned int *" name="bytesRead" desc="" /> <Param type="int *" name="dataSize" desc="" />
</Callback> </Callback>
<Callback name="SaveFileDataCallback" retType="bool" paramCount="3" desc="FileIO: Save binary data"> <Callback name="SaveFileDataCallback" retType="bool" paramCount="3" desc="FileIO: Save binary data">
<Param type="const char *" name="fileName" desc="" /> <Param type="const char *" name="fileName" desc="" />
<Param type="void *" name="data" desc="" /> <Param type="void *" name="data" desc="" />
<Param type="unsigned int" name="bytesToWrite" desc="" /> <Param type="int" name="dataSize" desc="" />
</Callback> </Callback>
<Callback name="LoadFileTextCallback" retType="char *" paramCount="1" desc="FileIO: Load text data"> <Callback name="LoadFileTextCallback" retType="char *" paramCount="1" desc="FileIO: Load text data">
<Param type="const char *" name="fileName" desc="" /> <Param type="const char *" name="fileName" desc="" />
@ -656,7 +660,7 @@
<Param type="unsigned int" name="frames" desc="" /> <Param type="unsigned int" name="frames" desc="" />
</Callback> </Callback>
</Callbacks> </Callbacks>
<Functions count="518"> <Functions count="529">
<Function name="InitWindow" retType="void" paramCount="3" desc="Initialize window and OpenGL context"> <Function name="InitWindow" retType="void" paramCount="3" desc="Initialize window and OpenGL context">
<Param type="int" name="width" desc="" /> <Param type="int" name="width" desc="" />
<Param type="int" name="height" desc="" /> <Param type="int" name="height" desc="" />
@ -691,6 +695,8 @@
</Function> </Function>
<Function name="ToggleFullscreen" retType="void" paramCount="0" desc="Toggle window state: fullscreen/windowed (only PLATFORM_DESKTOP)"> <Function name="ToggleFullscreen" retType="void" paramCount="0" desc="Toggle window state: fullscreen/windowed (only PLATFORM_DESKTOP)">
</Function> </Function>
<Function name="ToggleBorderlessWindowed" retType="void" paramCount="0" desc="Toggle window state: borderless windowed (only PLATFORM_DESKTOP)">
</Function>
<Function name="MaximizeWindow" retType="void" paramCount="0" desc="Set window state: maximized, if resizable (only PLATFORM_DESKTOP)"> <Function name="MaximizeWindow" retType="void" paramCount="0" desc="Set window state: maximized, if resizable (only PLATFORM_DESKTOP)">
</Function> </Function>
<Function name="MinimizeWindow" retType="void" paramCount="0" desc="Set window state: minimized, if resizable (only PLATFORM_DESKTOP)"> <Function name="MinimizeWindow" retType="void" paramCount="0" desc="Set window state: minimized, if resizable (only PLATFORM_DESKTOP)">
@ -704,20 +710,24 @@
<Param type="Image *" name="images" desc="" /> <Param type="Image *" name="images" desc="" />
<Param type="int" name="count" desc="" /> <Param type="int" name="count" desc="" />
</Function> </Function>
<Function name="SetWindowTitle" retType="void" paramCount="1" desc="Set title for window (only PLATFORM_DESKTOP)"> <Function name="SetWindowTitle" retType="void" paramCount="1" desc="Set title for window (only PLATFORM_DESKTOP and PLATFORM_WEB)">
<Param type="const char *" name="title" desc="" /> <Param type="const char *" name="title" desc="" />
</Function> </Function>
<Function name="SetWindowPosition" retType="void" paramCount="2" desc="Set window position on screen (only PLATFORM_DESKTOP)"> <Function name="SetWindowPosition" retType="void" paramCount="2" desc="Set window position on screen (only PLATFORM_DESKTOP)">
<Param type="int" name="x" desc="" /> <Param type="int" name="x" desc="" />
<Param type="int" name="y" desc="" /> <Param type="int" name="y" desc="" />
</Function> </Function>
<Function name="SetWindowMonitor" retType="void" paramCount="1" desc="Set monitor for the current window (fullscreen mode)"> <Function name="SetWindowMonitor" retType="void" paramCount="1" desc="Set monitor for the current window">
<Param type="int" name="monitor" desc="" /> <Param type="int" name="monitor" desc="" />
</Function> </Function>
<Function name="SetWindowMinSize" retType="void" paramCount="2" desc="Set window minimum dimensions (for FLAG_WINDOW_RESIZABLE)"> <Function name="SetWindowMinSize" retType="void" paramCount="2" desc="Set window minimum dimensions (for FLAG_WINDOW_RESIZABLE)">
<Param type="int" name="width" desc="" /> <Param type="int" name="width" desc="" />
<Param type="int" name="height" desc="" /> <Param type="int" name="height" desc="" />
</Function> </Function>
<Function name="SetWindowMaxSize" retType="void" paramCount="2" desc="Set window maximum dimensions (for FLAG_WINDOW_RESIZABLE)">
<Param type="int" name="width" desc="" />
<Param type="int" name="height" desc="" />
</Function>
<Function name="SetWindowSize" retType="void" paramCount="2" desc="Set window dimensions"> <Function name="SetWindowSize" retType="void" paramCount="2" desc="Set window dimensions">
<Param type="int" name="width" desc="" /> <Param type="int" name="width" desc="" />
<Param type="int" name="height" desc="" /> <Param type="int" name="height" desc="" />
@ -725,6 +735,8 @@
<Function name="SetWindowOpacity" retType="void" paramCount="1" desc="Set window opacity [0.0f..1.0f] (only PLATFORM_DESKTOP)"> <Function name="SetWindowOpacity" retType="void" paramCount="1" desc="Set window opacity [0.0f..1.0f] (only PLATFORM_DESKTOP)">
<Param type="float" name="opacity" desc="" /> <Param type="float" name="opacity" desc="" />
</Function> </Function>
<Function name="SetWindowFocused" retType="void" paramCount="0" desc="Set window focused (only PLATFORM_DESKTOP)">
</Function>
<Function name="GetWindowHandle" retType="void *" paramCount="0" desc="Get native window handle"> <Function name="GetWindowHandle" retType="void *" paramCount="0" desc="Get native window handle">
</Function> </Function>
<Function name="GetScreenWidth" retType="int" paramCount="0" desc="Get current screen width"> <Function name="GetScreenWidth" retType="int" paramCount="0" desc="Get current screen width">
@ -761,7 +773,7 @@
</Function> </Function>
<Function name="GetWindowScaleDPI" retType="Vector2" paramCount="0" desc="Get window scale DPI factor"> <Function name="GetWindowScaleDPI" retType="Vector2" paramCount="0" desc="Get window scale DPI factor">
</Function> </Function>
<Function name="GetMonitorName" retType="const char *" paramCount="1" desc="Get the human-readable, UTF-8 encoded name of the primary monitor"> <Function name="GetMonitorName" retType="const char *" paramCount="1" desc="Get the human-readable, UTF-8 encoded name of the specified monitor">
<Param type="int" name="monitor" desc="" /> <Param type="int" name="monitor" desc="" />
</Function> </Function>
<Function name="SetClipboardText" retType="void" paramCount="1" desc="Set clipboard text content"> <Function name="SetClipboardText" retType="void" paramCount="1" desc="Set clipboard text content">
@ -976,7 +988,7 @@
</Function> </Function>
<Function name="LoadFileData" retType="unsigned char *" paramCount="2" desc="Load file data as byte array (read)"> <Function name="LoadFileData" retType="unsigned char *" paramCount="2" desc="Load file data as byte array (read)">
<Param type="const char *" name="fileName" desc="" /> <Param type="const char *" name="fileName" desc="" />
<Param type="unsigned int *" name="bytesRead" desc="" /> <Param type="int *" name="dataSize" desc="" />
</Function> </Function>
<Function name="UnloadFileData" retType="void" paramCount="1" desc="Unload file data allocated by LoadFileData()"> <Function name="UnloadFileData" retType="void" paramCount="1" desc="Unload file data allocated by LoadFileData()">
<Param type="unsigned char *" name="data" desc="" /> <Param type="unsigned char *" name="data" desc="" />
@ -984,11 +996,11 @@
<Function name="SaveFileData" retType="bool" paramCount="3" desc="Save data to file from byte array (write), returns true on success"> <Function name="SaveFileData" retType="bool" paramCount="3" desc="Save data to file from byte array (write), returns true on success">
<Param type="const char *" name="fileName" desc="" /> <Param type="const char *" name="fileName" desc="" />
<Param type="void *" name="data" desc="" /> <Param type="void *" name="data" desc="" />
<Param type="unsigned int" name="bytesToWrite" desc="" /> <Param type="int" name="dataSize" desc="" />
</Function> </Function>
<Function name="ExportDataAsCode" retType="bool" paramCount="3" desc="Export data to code (.h), returns true on success"> <Function name="ExportDataAsCode" retType="bool" paramCount="3" desc="Export data to code (.h), returns true on success">
<Param type="const unsigned char *" name="data" desc="" /> <Param type="const unsigned char *" name="data" desc="" />
<Param type="unsigned int" name="size" desc="" /> <Param type="int" name="dataSize" desc="" />
<Param type="const char *" name="fileName" desc="" /> <Param type="const char *" name="fileName" desc="" />
</Function> </Function>
<Function name="LoadFileText" retType="char *" paramCount="1" desc="Load text data from file (read), returns a '\0' terminated string"> <Function name="LoadFileText" retType="char *" paramCount="1" desc="Load text data from file (read), returns a '\0' terminated string">
@ -1031,7 +1043,7 @@
</Function> </Function>
<Function name="GetWorkingDirectory" retType="const char *" paramCount="0" desc="Get current working directory (uses static string)"> <Function name="GetWorkingDirectory" retType="const char *" paramCount="0" desc="Get current working directory (uses static string)">
</Function> </Function>
<Function name="GetApplicationDirectory" retType="const char *" paramCount="0" desc="Get the directory if the running application (uses static string)"> <Function name="GetApplicationDirectory" retType="const char *" paramCount="0" desc="Get the directory of the running application (uses static string)">
</Function> </Function>
<Function name="ChangeDirectory" retType="bool" paramCount="1" desc="Change working directory, return true on success"> <Function name="ChangeDirectory" retType="bool" paramCount="1" desc="Change working directory, return true on success">
<Param type="const char *" name="dir" desc="" /> <Param type="const char *" name="dir" desc="" />
@ -1082,6 +1094,9 @@
<Function name="IsKeyPressed" retType="bool" paramCount="1" desc="Check if a key has been pressed once"> <Function name="IsKeyPressed" retType="bool" paramCount="1" desc="Check if a key has been pressed once">
<Param type="int" name="key" desc="" /> <Param type="int" name="key" desc="" />
</Function> </Function>
<Function name="IsKeyPressedRepeat" retType="bool" paramCount="1" desc="Check if a key has been pressed again (Only PLATFORM_DESKTOP)">
<Param type="int" name="key" desc="" />
</Function>
<Function name="IsKeyDown" retType="bool" paramCount="1" desc="Check if a key is being pressed"> <Function name="IsKeyDown" retType="bool" paramCount="1" desc="Check if a key is being pressed">
<Param type="int" name="key" desc="" /> <Param type="int" name="key" desc="" />
</Function> </Function>
@ -1187,7 +1202,7 @@
<Param type="unsigned int" name="flags" desc="" /> <Param type="unsigned int" name="flags" desc="" />
</Function> </Function>
<Function name="IsGestureDetected" retType="bool" paramCount="1" desc="Check if a gesture have been detected"> <Function name="IsGestureDetected" retType="bool" paramCount="1" desc="Check if a gesture have been detected">
<Param type="int" name="gesture" desc="" /> <Param type="unsigned int" name="gesture" desc="" />
</Function> </Function>
<Function name="GetGestureDetected" retType="int" paramCount="0" desc="Get latest detected gesture"> <Function name="GetGestureDetected" retType="int" paramCount="0" desc="Get latest detected gesture">
</Function> </Function>
@ -1263,6 +1278,18 @@
<Param type="float" name="thick" desc="" /> <Param type="float" name="thick" desc="" />
<Param type="Color" name="color" desc="" /> <Param type="Color" name="color" desc="" />
</Function> </Function>
<Function name="DrawLineBSpline" retType="void" paramCount="4" desc="Draw a B-Spline line, minimum 4 points">
<Param type="Vector2 *" name="points" desc="" />
<Param type="int" name="pointCount" desc="" />
<Param type="float" name="thick" desc="" />
<Param type="Color" name="color" desc="" />
</Function>
<Function name="DrawLineCatmullRom" retType="void" paramCount="4" desc="Draw a Catmull Rom spline line, minimum 4 points">
<Param type="Vector2 *" name="points" desc="" />
<Param type="int" name="pointCount" desc="" />
<Param type="float" name="thick" desc="" />
<Param type="Color" name="color" desc="" />
</Function>
<Function name="DrawLineStrip" retType="void" paramCount="3" desc="Draw lines sequence"> <Function name="DrawLineStrip" retType="void" paramCount="3" desc="Draw lines sequence">
<Param type="Vector2 *" name="points" desc="" /> <Param type="Vector2 *" name="points" desc="" />
<Param type="int" name="pointCount" desc="" /> <Param type="int" name="pointCount" desc="" />
@ -1516,6 +1543,11 @@
<Param type="int" name="format" desc="" /> <Param type="int" name="format" desc="" />
<Param type="int" name="headerSize" desc="" /> <Param type="int" name="headerSize" desc="" />
</Function> </Function>
<Function name="LoadImageSvg" retType="Image" paramCount="3" desc="Load image from SVG file data or string with specified size">
<Param type="const char *" name="fileNameOrString" desc="" />
<Param type="int" name="width" desc="" />
<Param type="int" name="height" desc="" />
</Function>
<Function name="LoadImageAnim" retType="Image" paramCount="2" desc="Load image sequence from file (frames appended to image.data)"> <Function name="LoadImageAnim" retType="Image" paramCount="2" desc="Load image sequence from file (frames appended to image.data)">
<Param type="const char *" name="fileName" desc="" /> <Param type="const char *" name="fileName" desc="" />
<Param type="int *" name="frames" desc="" /> <Param type="int *" name="frames" desc="" />
@ -1540,6 +1572,11 @@
<Param type="Image" name="image" desc="" /> <Param type="Image" name="image" desc="" />
<Param type="const char *" name="fileName" desc="" /> <Param type="const char *" name="fileName" desc="" />
</Function> </Function>
<Function name="ExportImageToMemory" retType="unsigned char *" paramCount="3" desc="Export image to memory buffer">
<Param type="Image" name="image" desc="" />
<Param type="const char *" name="fileType" desc="" />
<Param type="int *" name="fileSize" desc="" />
</Function>
<Function name="ExportImageAsCode" retType="bool" paramCount="2" desc="Export image as code file defining an array of bytes, returns true on success"> <Function name="ExportImageAsCode" retType="bool" paramCount="2" desc="Export image as code file defining an array of bytes, returns true on success">
<Param type="Image" name="image" desc="" /> <Param type="Image" name="image" desc="" />
<Param type="const char *" name="fileName" desc="" /> <Param type="const char *" name="fileName" desc="" />
@ -1685,7 +1722,7 @@
<Function name="ImageFlipHorizontal" retType="void" paramCount="1" desc="Flip image horizontally"> <Function name="ImageFlipHorizontal" retType="void" paramCount="1" desc="Flip image horizontally">
<Param type="Image *" name="image" desc="" /> <Param type="Image *" name="image" desc="" />
</Function> </Function>
<Function name="ImageRotate" retType="void" paramCount="2" desc="Rotate image by input angle in degrees (-359 to 359) "> <Function name="ImageRotate" retType="void" paramCount="2" desc="Rotate image by input angle in degrees (-359 to 359)">
<Param type="Image *" name="image" desc="" /> <Param type="Image *" name="image" desc="" />
<Param type="int" name="degrees" desc="" /> <Param type="int" name="degrees" desc="" />
</Function> </Function>
@ -1995,11 +2032,11 @@
<Function name="LoadFont" retType="Font" paramCount="1" desc="Load font from file into GPU memory (VRAM)"> <Function name="LoadFont" retType="Font" paramCount="1" desc="Load font from file into GPU memory (VRAM)">
<Param type="const char *" name="fileName" desc="" /> <Param type="const char *" name="fileName" desc="" />
</Function> </Function>
<Function name="LoadFontEx" retType="Font" paramCount="4" desc="Load font from file with extended parameters, use NULL for fontChars and 0 for glyphCount to load the default character set"> <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">
<Param type="const char *" name="fileName" desc="" /> <Param type="const char *" name="fileName" desc="" />
<Param type="int" name="fontSize" desc="" /> <Param type="int" name="fontSize" desc="" />
<Param type="int *" name="fontChars" desc="" /> <Param type="int *" name="codepoints" desc="" />
<Param type="int" name="glyphCount" desc="" /> <Param type="int" name="codepointCount" desc="" />
</Function> </Function>
<Function name="LoadFontFromImage" retType="Font" paramCount="3" desc="Load font from Image (XNA style)"> <Function name="LoadFontFromImage" retType="Font" paramCount="3" desc="Load font from Image (XNA style)">
<Param type="Image" name="image" desc="" /> <Param type="Image" name="image" desc="" />
@ -2011,8 +2048,8 @@
<Param type="const unsigned char *" name="fileData" desc="" /> <Param type="const unsigned char *" name="fileData" desc="" />
<Param type="int" name="dataSize" desc="" /> <Param type="int" name="dataSize" desc="" />
<Param type="int" name="fontSize" desc="" /> <Param type="int" name="fontSize" desc="" />
<Param type="int *" name="fontChars" desc="" /> <Param type="int *" name="codepoints" desc="" />
<Param type="int" name="glyphCount" desc="" /> <Param type="int" name="codepointCount" desc="" />
</Function> </Function>
<Function name="IsFontReady" retType="bool" paramCount="1" desc="Check if a font is ready"> <Function name="IsFontReady" retType="bool" paramCount="1" desc="Check if a font is ready">
<Param type="Font" name="font" desc="" /> <Param type="Font" name="font" desc="" />
@ -2021,20 +2058,20 @@
<Param type="const unsigned char *" name="fileData" desc="" /> <Param type="const unsigned char *" name="fileData" desc="" />
<Param type="int" name="dataSize" desc="" /> <Param type="int" name="dataSize" desc="" />
<Param type="int" name="fontSize" desc="" /> <Param type="int" name="fontSize" desc="" />
<Param type="int *" name="fontChars" desc="" /> <Param type="int *" name="codepoints" desc="" />
<Param type="int" name="glyphCount" desc="" /> <Param type="int" name="codepointCount" desc="" />
<Param type="int" name="type" desc="" /> <Param type="int" name="type" desc="" />
</Function> </Function>
<Function name="GenImageFontAtlas" retType="Image" paramCount="6" desc="Generate image font atlas using chars info"> <Function name="GenImageFontAtlas" retType="Image" paramCount="6" desc="Generate image font atlas using chars info">
<Param type="const GlyphInfo *" name="chars" desc="" /> <Param type="const GlyphInfo *" name="glyphs" desc="" />
<Param type="Rectangle **" name="recs" desc="" /> <Param type="Rectangle **" name="glyphRecs" desc="" />
<Param type="int" name="glyphCount" desc="" /> <Param type="int" name="glyphCount" desc="" />
<Param type="int" name="fontSize" desc="" /> <Param type="int" name="fontSize" desc="" />
<Param type="int" name="padding" desc="" /> <Param type="int" name="padding" desc="" />
<Param type="int" name="packMethod" desc="" /> <Param type="int" name="packMethod" desc="" />
</Function> </Function>
<Function name="UnloadFontData" retType="void" paramCount="2" desc="Unload font chars info data (RAM)"> <Function name="UnloadFontData" retType="void" paramCount="2" desc="Unload font chars info data (RAM)">
<Param type="GlyphInfo *" name="chars" desc="" /> <Param type="GlyphInfo *" name="glyphs" desc="" />
<Param type="int" name="glyphCount" desc="" /> <Param type="int" name="glyphCount" desc="" />
</Function> </Function>
<Function name="UnloadFont" retType="void" paramCount="1" desc="Unload font from GPU memory (VRAM)"> <Function name="UnloadFont" retType="void" paramCount="1" desc="Unload font from GPU memory (VRAM)">
@ -2083,12 +2120,15 @@
<Function name="DrawTextCodepoints" retType="void" paramCount="7" desc="Draw multiple character (codepoint)"> <Function name="DrawTextCodepoints" retType="void" paramCount="7" desc="Draw multiple character (codepoint)">
<Param type="Font" name="font" desc="" /> <Param type="Font" name="font" desc="" />
<Param type="const int *" name="codepoints" desc="" /> <Param type="const int *" name="codepoints" desc="" />
<Param type="int" name="count" desc="" /> <Param type="int" name="codepointCount" desc="" />
<Param type="Vector2" name="position" desc="" /> <Param type="Vector2" name="position" desc="" />
<Param type="float" name="fontSize" desc="" /> <Param type="float" name="fontSize" desc="" />
<Param type="float" name="spacing" desc="" /> <Param type="float" name="spacing" desc="" />
<Param type="Color" name="tint" desc="" /> <Param type="Color" name="tint" desc="" />
</Function> </Function>
<Function name="SetTextLineSpacing" retType="void" paramCount="1" desc="Set vertical line spacing when drawing with line-breaks">
<Param type="int" name="spacing" desc="" />
</Function>
<Function name="MeasureText" retType="int" paramCount="2" desc="Measure string width for default font"> <Function name="MeasureText" retType="int" paramCount="2" desc="Measure string width for default font">
<Param type="const char *" name="text" desc="" /> <Param type="const char *" name="text" desc="" />
<Param type="int" name="fontSize" desc="" /> <Param type="int" name="fontSize" desc="" />
@ -2523,7 +2563,7 @@
</Function> </Function>
<Function name="LoadModelAnimations" retType="ModelAnimation *" paramCount="2" desc="Load model animations from file"> <Function name="LoadModelAnimations" retType="ModelAnimation *" paramCount="2" desc="Load model animations from file">
<Param type="const char *" name="fileName" desc="" /> <Param type="const char *" name="fileName" desc="" />
<Param type="unsigned int *" name="animCount" desc="" /> <Param type="int *" name="animCount" desc="" />
</Function> </Function>
<Function name="UpdateModelAnimation" retType="void" paramCount="3" desc="Update model animation pose"> <Function name="UpdateModelAnimation" retType="void" paramCount="3" desc="Update model animation pose">
<Param type="Model" name="model" desc="" /> <Param type="Model" name="model" desc="" />
@ -2535,7 +2575,7 @@
</Function> </Function>
<Function name="UnloadModelAnimations" retType="void" paramCount="2" desc="Unload animation array data"> <Function name="UnloadModelAnimations" retType="void" paramCount="2" desc="Unload animation array data">
<Param type="ModelAnimation *" name="animations" desc="" /> <Param type="ModelAnimation *" name="animations" desc="" />
<Param type="unsigned int" name="count" desc="" /> <Param type="int" name="animCount" desc="" />
</Function> </Function>
<Function name="IsModelAnimationValid" retType="bool" paramCount="2" desc="Check model animation skeleton match"> <Function name="IsModelAnimationValid" retType="bool" paramCount="2" desc="Check model animation skeleton match">
<Param type="Model" name="model" desc="" /> <Param type="Model" name="model" desc="" />
@ -2609,6 +2649,9 @@
<Function name="LoadSoundFromWave" retType="Sound" paramCount="1" desc="Load sound from wave data"> <Function name="LoadSoundFromWave" retType="Sound" paramCount="1" desc="Load sound from wave data">
<Param type="Wave" name="wave" desc="" /> <Param type="Wave" name="wave" desc="" />
</Function> </Function>
<Function name="LoadSoundAlias" retType="Sound" paramCount="1" desc="Create a new sound that shares the same sample data as the source sound, does not own the sound data">
<Param type="Sound" name="source" desc="" />
</Function>
<Function name="IsSoundReady" retType="bool" paramCount="1" desc="Checks if a sound is ready"> <Function name="IsSoundReady" retType="bool" paramCount="1" desc="Checks if a sound is ready">
<Param type="Sound" name="sound" desc="" /> <Param type="Sound" name="sound" desc="" />
</Function> </Function>
@ -2623,6 +2666,9 @@
<Function name="UnloadSound" retType="void" paramCount="1" desc="Unload sound"> <Function name="UnloadSound" retType="void" paramCount="1" desc="Unload sound">
<Param type="Sound" name="sound" desc="" /> <Param type="Sound" name="sound" desc="" />
</Function> </Function>
<Function name="UnloadSoundAlias" retType="void" paramCount="1" desc="Unload a sound alias (does not deallocate sample data)">
<Param type="Sound" name="alias" desc="" />
</Function>
<Function name="ExportWave" retType="bool" paramCount="2" desc="Export wave data to file, returns true on success"> <Function name="ExportWave" retType="bool" paramCount="2" desc="Export wave data to file, returns true on success">
<Param type="Wave" name="wave" desc="" /> <Param type="Wave" name="wave" desc="" />
<Param type="const char *" name="fileName" desc="" /> <Param type="const char *" name="fileName" desc="" />
@ -2785,7 +2831,7 @@
<Param type="AudioStream" name="stream" desc="" /> <Param type="AudioStream" name="stream" desc="" />
<Param type="AudioCallback" name="callback" desc="" /> <Param type="AudioCallback" name="callback" desc="" />
</Function> </Function>
<Function name="AttachAudioStreamProcessor" retType="void" paramCount="2" desc="Attach audio stream processor to stream"> <Function name="AttachAudioStreamProcessor" retType="void" paramCount="2" desc="Attach audio stream processor to stream, receives the samples as <float>s">
<Param type="AudioStream" name="stream" desc="" /> <Param type="AudioStream" name="stream" desc="" />
<Param type="AudioCallback" name="processor" desc="" /> <Param type="AudioCallback" name="processor" desc="" />
</Function> </Function>
@ -2793,7 +2839,7 @@
<Param type="AudioStream" name="stream" desc="" /> <Param type="AudioStream" name="stream" desc="" />
<Param type="AudioCallback" name="processor" desc="" /> <Param type="AudioCallback" name="processor" desc="" />
</Function> </Function>
<Function name="AttachAudioMixedProcessor" retType="void" paramCount="1" desc="Attach audio stream processor to the entire audio pipeline"> <Function name="AttachAudioMixedProcessor" retType="void" paramCount="1" desc="Attach audio stream processor to the entire audio pipeline, receives the samples as <float>s">
<Param type="AudioCallback" name="processor" desc="" /> <Param type="AudioCallback" name="processor" desc="" />
</Function> </Function>
<Function name="DetachAudioMixedProcessor" retType="void" paramCount="1" desc="Detach audio stream processor from the entire audio pipeline"> <Function name="DetachAudioMixedProcessor" retType="void" paramCount="1" desc="Detach audio stream processor from the entire audio pipeline">

View File

@ -169,10 +169,12 @@ static FunctionInfo *funcs = NULL;
// Command line variables // Command line variables
static char apiDefine[32] = { 0 }; // Functions define (i.e. RLAPI for raylib.h, RMDEF for raymath.h, etc.) static char apiDefine[32] = { 0 }; // Functions define (i.e. RLAPI for raylib.h, RMDEF for raymath.h, etc.)
static char truncAfter[32] = { 0 }; // Truncate marker (i.e. "RLGL IMPLEMENTATION" for rlgl.h) static char truncAfter[32] = { 0 }; // Truncate marker (i.e. "RLGL IMPLEMENTATION" for rlgl.h)
static char inFileName[512] = { 0 }; // Input file name (required in case of provided through CLI)
static char outFileName[512] = { 0 }; // Output file name (required for file save/export)
static int outputFormat = DEFAULT; static int outputFormat = DEFAULT;
// NOTE: Max length depends on OS, in Windows MAX_PATH = 256
static char inFileName[512] = { 0 }; // Input file name (required in case of drag & drop over executable)
static char outFileName[512] = { 0 }; // Output file name (required for file save/export)
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
// Module Functions Declaration // Module Functions Declaration
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
@ -445,11 +447,11 @@ int main(int argc, char* argv[])
{ {
if (isFloat) if (isFloat)
{ {
defines[defineIndex].type = linePtr[j-1] == 'f' ? FLOAT : DOUBLE; defines[defineIndex].type = (linePtr[j-1] == 'f')? FLOAT : DOUBLE;
} }
else else
{ {
defines[defineIndex].type = linePtr[j-1] == 'L' ? LONG : INT; defines[defineIndex].type = (linePtr[j-1] == 'L')? LONG : INT;
defines[defineIndex].isHex = isHex; defines[defineIndex].isHex = isHex;
} }
} }
@ -532,8 +534,8 @@ int main(int argc, char* argv[])
{ {
// Found a valid number -> update largestType // Found a valid number -> update largestType
int numberType; int numberType;
if (isFloat) numberType = valuePtr[c - 1] == 'f' ? FLOAT_MATH : DOUBLE_MATH; if (isFloat) numberType = (valuePtr[c - 1] == 'f')? FLOAT_MATH : DOUBLE_MATH;
else numberType = valuePtr[c - 1] == 'L' ? LONG_MATH : INT_MATH; else numberType = (valuePtr[c - 1] == 'L')? LONG_MATH : INT_MATH;
if (numberType > largestType) largestType = numberType; if (numberType > largestType) largestType = numberType;
} }

View File

@ -55,9 +55,7 @@
// Use busy wait loop for timing sync, if not defined, a high-resolution timer is set up and used // Use busy wait loop for timing sync, if not defined, a high-resolution timer is set up and used
//#define SUPPORT_BUSY_WAIT_LOOP 1 //#define SUPPORT_BUSY_WAIT_LOOP 1
// Use a partial-busy wait loop, in this case frame sleeps for most of the time, but then runs a busy loop at the end for accuracy // Use a partial-busy wait loop, in this case frame sleeps for most of the time, but then runs a busy loop at the end for accuracy
#define SUPPORT_PARTIALBUSY_WAIT_LOOP #define SUPPORT_PARTIALBUSY_WAIT_LOOP 1
// Wait for events passively (sleeping while no events) instead of polling them actively every frame
//#define SUPPORT_EVENTS_WAITING 1
// Allow automatic screen capture of current screen pressing F12, defined in KeyCallback() // Allow automatic screen capture of current screen pressing F12, defined in KeyCallback()
#define SUPPORT_SCREEN_CAPTURE 1 #define SUPPORT_SCREEN_CAPTURE 1
// Allow automatic gif recording of current screen pressing CTRL+F12, defined in KeyCallback() // Allow automatic gif recording of current screen pressing CTRL+F12, defined in KeyCallback()

21797
src/external/miniaudio.h vendored

File diff suppressed because it is too large Load Diff

View File

@ -256,16 +256,16 @@ static void msf_cook_frame(MsfCookedFrame * frame, uint8_t * raw, uint8_t * used
int width, int height, int pitch, int depth) int width, int height, int pitch, int depth)
{ MsfTimeFunc { MsfTimeFunc
//bit depth for each channel //bit depth for each channel
const static int rdepthsArray[17] = { 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5 }; static const int rdepthsArray[17] = { 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5 };
const static int gdepthsArray[17] = { 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6 }; static const int gdepthsArray[17] = { 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6 };
const static int bdepthsArray[17] = { 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5 }; static const int bdepthsArray[17] = { 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5 };
//this extra level of indirection looks unnecessary but we need to explicitly decay the arrays to pointers //this extra level of indirection looks unnecessary but we need to explicitly decay the arrays to pointers
//in order to be able to swap them because of C's annoying not-quite-pointers, not-quite-value-types stack arrays. //in order to be able to swap them because of C's annoying not-quite-pointers, not-quite-value-types stack arrays.
const int * rdepths = msf_gif_bgra_flag? bdepthsArray : rdepthsArray; const int * rdepths = msf_gif_bgra_flag? bdepthsArray : rdepthsArray;
const int * gdepths = gdepthsArray; const int * gdepths = gdepthsArray;
const int * bdepths = msf_gif_bgra_flag? rdepthsArray : bdepthsArray; const int * bdepths = msf_gif_bgra_flag? rdepthsArray : bdepthsArray;
const static int ditherKernel[16] = { static const int ditherKernel[16] = {
0 << 12, 8 << 12, 2 << 12, 10 << 12, 0 << 12, 8 << 12, 2 << 12, 10 << 12,
12 << 12, 4 << 12, 14 << 12, 6 << 12, 12 << 12, 4 << 12, 14 << 12, 6 << 12,
3 << 12, 11 << 12, 1 << 12, 9 << 12, 3 << 12, 11 << 12, 1 << 12, 9 << 12,
@ -404,7 +404,7 @@ static MsfGifBuffer * msf_compress_frame(void * allocContext, int width, int hei
MsfGifBuffer * buffer = (MsfGifBuffer *) MSF_GIF_MALLOC(allocContext, maxBufSize); MsfGifBuffer * buffer = (MsfGifBuffer *) MSF_GIF_MALLOC(allocContext, maxBufSize);
if (!buffer) { return NULL; } if (!buffer) { return NULL; }
uint8_t * writeHead = buffer->data; uint8_t * writeHead = buffer->data;
MsfStridedList lzw = { lzwMem }; MsfStridedList lzw = { lzwMem, 0, 0 };
//allocate tlb //allocate tlb
int totalBits = frame.rbits + frame.gbits + frame.bbits; int totalBits = frame.rbits + frame.gbits + frame.bbits;

View File

@ -474,6 +474,16 @@ void InitAudioDevice(void)
return; return;
} }
// Mixing happens on a separate thread which means we need to synchronize. I'm using a mutex here to make things simple, but may
// want to look at something a bit smarter later on to keep everything real-time, if that's necessary.
if (ma_mutex_init(&AUDIO.System.lock) != MA_SUCCESS)
{
TRACELOG(LOG_WARNING, "AUDIO: Failed to create mutex for mixing");
ma_device_uninit(&AUDIO.System.device);
ma_context_uninit(&AUDIO.System.context);
return;
}
// Keep the device running the whole time. May want to consider doing something a bit smarter and only have the device running // Keep the device running the whole time. May want to consider doing something a bit smarter and only have the device running
// while there's at least one sound being played. // while there's at least one sound being played.
result = ma_device_start(&AUDIO.System.device); result = ma_device_start(&AUDIO.System.device);
@ -485,16 +495,6 @@ void InitAudioDevice(void)
return; return;
} }
// Mixing happens on a separate thread which means we need to synchronize. I'm using a mutex here to make things simple, but may
// want to look at something a bit smarter later on to keep everything real-time, if that's necessary.
if (ma_mutex_init(&AUDIO.System.lock) != MA_SUCCESS)
{
TRACELOG(LOG_WARNING, "AUDIO: Failed to create mutex for mixing");
ma_device_uninit(&AUDIO.System.device);
ma_context_uninit(&AUDIO.System.context);
return;
}
TRACELOG(LOG_INFO, "AUDIO: Device initialized successfully"); TRACELOG(LOG_INFO, "AUDIO: Device initialized successfully");
TRACELOG(LOG_INFO, " > Backend: miniaudio / %s", ma_get_backend_name(AUDIO.System.context.backend)); TRACELOG(LOG_INFO, " > Backend: miniaudio / %s", ma_get_backend_name(AUDIO.System.context.backend));
TRACELOG(LOG_INFO, " > Format: %s -> %s", ma_get_format_name(AUDIO.System.device.playback.format), ma_get_format_name(AUDIO.System.device.playback.internalFormat)); TRACELOG(LOG_INFO, " > Format: %s -> %s", ma_get_format_name(AUDIO.System.device.playback.format), ma_get_format_name(AUDIO.System.device.playback.internalFormat));

View File

@ -938,8 +938,8 @@ extern "C" { // Prevents name mangling of functions
// Window-related functions // Window-related functions
RLAPI void InitWindow(int width, int height, const char *title); // Initialize window and OpenGL context RLAPI void InitWindow(int width, int height, const char *title); // Initialize window and OpenGL context
RLAPI bool WindowShouldClose(void); // Check if KEY_ESCAPE pressed or Close icon pressed
RLAPI void CloseWindow(void); // Close window and unload OpenGL context RLAPI void CloseWindow(void); // Close window and unload OpenGL context
RLAPI bool WindowShouldClose(void); // Check if application should close (KEY_ESCAPE pressed or windows close icon clicked)
RLAPI bool IsWindowReady(void); // Check if window has been initialized successfully RLAPI bool IsWindowReady(void); // Check if window has been initialized successfully
RLAPI bool IsWindowFullscreen(void); // Check if window is currently fullscreen RLAPI bool IsWindowFullscreen(void); // Check if window is currently fullscreen
RLAPI bool IsWindowHidden(void); // Check if window is currently hidden (only PLATFORM_DESKTOP) RLAPI bool IsWindowHidden(void); // Check if window is currently hidden (only PLATFORM_DESKTOP)
@ -1163,7 +1163,7 @@ RLAPI int GetTouchPointCount(void); // Get number of t
// Gestures and Touch Handling Functions (Module: rgestures) // Gestures and Touch Handling Functions (Module: rgestures)
//------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------
RLAPI void SetGesturesEnabled(unsigned int flags); // Enable a set of gestures using flags RLAPI void SetGesturesEnabled(unsigned int flags); // Enable a set of gestures using flags
RLAPI bool IsGestureDetected(int gesture); // Check if a gesture have been detected RLAPI bool IsGestureDetected(unsigned int gesture); // Check if a gesture have been detected
RLAPI int GetGestureDetected(void); // Get latest detected gesture RLAPI int GetGestureDetected(void); // Get latest detected gesture
RLAPI float GetGestureHoldDuration(void); // Get gesture hold time in milliseconds RLAPI float GetGestureHoldDuration(void); // Get gesture hold time in milliseconds
RLAPI Vector2 GetGestureDragVector(void); // Get gesture drag vector RLAPI Vector2 GetGestureDragVector(void); // Get gesture drag vector

View File

@ -214,6 +214,10 @@ RMAPI float Wrap(float value, float min, float max)
// Check whether two given floats are almost equal // Check whether two given floats are almost equal
RMAPI int FloatEquals(float x, float y) RMAPI int FloatEquals(float x, float y)
{ {
#if !defined(EPSILON)
#define EPSILON 0.000001f
#endif
int result = (fabsf(x - y)) <= (EPSILON*fmaxf(1.0f, fmaxf(fabsf(x), fabsf(y)))); int result = (fabsf(x - y)) <= (EPSILON*fmaxf(1.0f, fmaxf(fabsf(x), fabsf(y))));
return result; return result;
@ -506,6 +510,10 @@ RMAPI Vector2 Vector2ClampValue(Vector2 v, float min, float max)
// Check whether two given vectors are almost equal // Check whether two given vectors are almost equal
RMAPI int Vector2Equals(Vector2 p, Vector2 q) RMAPI int Vector2Equals(Vector2 p, Vector2 q)
{ {
#if !defined(EPSILON)
#define EPSILON 0.000001f
#endif
int result = ((fabsf(p.x - q.x)) <= (EPSILON*fmaxf(1.0f, fmaxf(fabsf(p.x), fabsf(q.x))))) && int result = ((fabsf(p.x - q.x)) <= (EPSILON*fmaxf(1.0f, fmaxf(fabsf(p.x), fabsf(q.x))))) &&
((fabsf(p.y - q.y)) <= (EPSILON*fmaxf(1.0f, fmaxf(fabsf(p.y), fabsf(q.y))))); ((fabsf(p.y - q.y)) <= (EPSILON*fmaxf(1.0f, fmaxf(fabsf(p.y), fabsf(q.y)))));
@ -1090,6 +1098,10 @@ RMAPI Vector3 Vector3ClampValue(Vector3 v, float min, float max)
// Check whether two given vectors are almost equal // Check whether two given vectors are almost equal
RMAPI int Vector3Equals(Vector3 p, Vector3 q) RMAPI int Vector3Equals(Vector3 p, Vector3 q)
{ {
#if !defined(EPSILON)
#define EPSILON 0.000001f
#endif
int result = ((fabsf(p.x - q.x)) <= (EPSILON*fmaxf(1.0f, fmaxf(fabsf(p.x), fabsf(q.x))))) && int result = ((fabsf(p.x - q.x)) <= (EPSILON*fmaxf(1.0f, fmaxf(fabsf(p.x), fabsf(q.x))))) &&
((fabsf(p.y - q.y)) <= (EPSILON*fmaxf(1.0f, fmaxf(fabsf(p.y), fabsf(q.y))))) && ((fabsf(p.y - q.y)) <= (EPSILON*fmaxf(1.0f, fmaxf(fabsf(p.y), fabsf(q.y))))) &&
((fabsf(p.z - q.z)) <= (EPSILON*fmaxf(1.0f, fmaxf(fabsf(p.z), fabsf(q.z))))); ((fabsf(p.z - q.z)) <= (EPSILON*fmaxf(1.0f, fmaxf(fabsf(p.z), fabsf(q.z)))));
@ -1846,6 +1858,10 @@ RMAPI Quaternion QuaternionSlerp(Quaternion q1, Quaternion q2, float amount)
{ {
Quaternion result = { 0 }; Quaternion result = { 0 };
#if !defined(EPSILON)
#define EPSILON 0.000001f
#endif
float cosHalfTheta = q1.x*q2.x + q1.y*q2.y + q1.z*q2.z + q1.w*q2.w; float cosHalfTheta = q1.x*q2.x + q1.y*q2.y + q1.z*q2.z + q1.w*q2.w;
if (cosHalfTheta < 0) if (cosHalfTheta < 0)
@ -2153,6 +2169,10 @@ RMAPI Quaternion QuaternionTransform(Quaternion q, Matrix mat)
// Check whether two given quaternions are almost equal // Check whether two given quaternions are almost equal
RMAPI int QuaternionEquals(Quaternion p, Quaternion q) RMAPI int QuaternionEquals(Quaternion p, Quaternion q)
{ {
#if !defined(EPSILON)
#define EPSILON 0.000001f
#endif
int result = (((fabsf(p.x - q.x)) <= (EPSILON*fmaxf(1.0f, fmaxf(fabsf(p.x), fabsf(q.x))))) && int result = (((fabsf(p.x - q.x)) <= (EPSILON*fmaxf(1.0f, fmaxf(fabsf(p.x), fabsf(q.x))))) &&
((fabsf(p.y - q.y)) <= (EPSILON*fmaxf(1.0f, fmaxf(fabsf(p.y), fabsf(q.y))))) && ((fabsf(p.y - q.y)) <= (EPSILON*fmaxf(1.0f, fmaxf(fabsf(p.y), fabsf(q.y))))) &&
((fabsf(p.z - q.z)) <= (EPSILON*fmaxf(1.0f, fmaxf(fabsf(p.z), fabsf(q.z))))) && ((fabsf(p.z - q.z)) <= (EPSILON*fmaxf(1.0f, fmaxf(fabsf(p.z), fabsf(q.z))))) &&

View File

@ -46,6 +46,20 @@
// Defines and Macros // Defines and Macros
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
// Function specifiers definition // Function specifiers definition
// Function specifiers in case library is build/used as a shared library (Windows)
// NOTE: Microsoft specifiers to tell compiler that symbols are imported/exported from a .dll
#if defined(_WIN32)
#if defined(BUILD_LIBTYPE_SHARED)
#if defined(__TINYC__)
#define __declspec(x) __attribute__((x))
#endif
#define RLAPI __declspec(dllexport) // We are building the library as a Win32 shared library (.dll)
#elif defined(USE_LIBTYPE_SHARED)
#define RLAPI __declspec(dllimport) // We are using the library as a Win32 shared library (.dll)
#endif
#endif
#ifndef RLAPI #ifndef RLAPI
#define RLAPI // Functions defined as 'extern' by default (implicit specifiers) #define RLAPI // Functions defined as 'extern' by default (implicit specifiers)
#endif #endif

View File

@ -255,7 +255,7 @@ void SetGesturesEnabled(unsigned int flags)
} }
// Check if a gesture have been detected // Check if a gesture have been detected
bool IsGestureDetected(int gesture) bool IsGestureDetected(unsigned int gesture)
{ {
if ((GESTURES.enabledFlags & GESTURES.current) == gesture) return true; if ((GESTURES.enabledFlags & GESTURES.current) == gesture) return true;
else return false; else return false;

View File

@ -2997,7 +2997,10 @@ unsigned int rlLoadTexture(const void *data, int width, int height, int format,
int mipWidth = width; int mipWidth = width;
int mipHeight = height; int mipHeight = height;
int mipOffset = 0; // Mipmap data offset int mipOffset = 0; // Mipmap data offset, only used for tracelog
// NOTE: Added pointer math separately from function to avoid UBSAN complaining
unsigned char *dataPtr = (unsigned char *)data;
// Load the different mipmap levels // Load the different mipmap levels
for (int i = 0; i < mipmapCount; i++) for (int i = 0; i < mipmapCount; i++)
@ -3009,11 +3012,11 @@ unsigned int rlLoadTexture(const void *data, int width, int height, int format,
TRACELOGD("TEXTURE: Load mipmap level %i (%i x %i), size: %i, offset: %i", i, mipWidth, mipHeight, mipSize, mipOffset); TRACELOGD("TEXTURE: Load mipmap level %i (%i x %i), size: %i, offset: %i", i, mipWidth, mipHeight, mipSize, mipOffset);
if (glInternalFormat != -1) if (glInternalFormat != 0)
{ {
if (format < RL_PIXELFORMAT_COMPRESSED_DXT1_RGB) glTexImage2D(GL_TEXTURE_2D, i, glInternalFormat, mipWidth, mipHeight, 0, glFormat, glType, (unsigned char *)data + mipOffset); if (format < RL_PIXELFORMAT_COMPRESSED_DXT1_RGB) glTexImage2D(GL_TEXTURE_2D, i, glInternalFormat, mipWidth, mipHeight, 0, glFormat, glType, dataPtr);
#if !defined(GRAPHICS_API_OPENGL_11) #if !defined(GRAPHICS_API_OPENGL_11)
else glCompressedTexImage2D(GL_TEXTURE_2D, i, glInternalFormat, mipWidth, mipHeight, 0, mipSize, (unsigned char *)data + mipOffset); else glCompressedTexImage2D(GL_TEXTURE_2D, i, glInternalFormat, mipWidth, mipHeight, 0, mipSize, dataPtr);
#endif #endif
#if defined(GRAPHICS_API_OPENGL_33) #if defined(GRAPHICS_API_OPENGL_33)
@ -3036,7 +3039,8 @@ unsigned int rlLoadTexture(const void *data, int width, int height, int format,
mipWidth /= 2; mipWidth /= 2;
mipHeight /= 2; mipHeight /= 2;
mipOffset += mipSize; mipOffset += mipSize; // Increment offset position to next mipmap
dataPtr += mipSize; // Increment data pointer to next mipmap
// Security check for NPOT textures // Security check for NPOT textures
if (mipWidth < 1) mipWidth = 1; if (mipWidth < 1) mipWidth = 1;
@ -3162,7 +3166,7 @@ unsigned int rlLoadTextureCubemap(const void *data, int size, int format)
unsigned int glInternalFormat, glFormat, glType; unsigned int glInternalFormat, glFormat, glType;
rlGetGlTextureFormats(format, &glInternalFormat, &glFormat, &glType); rlGetGlTextureFormats(format, &glInternalFormat, &glFormat, &glType);
if (glInternalFormat != -1) if (glInternalFormat != 0)
{ {
// Load cubemap faces // Load cubemap faces
for (unsigned int i = 0; i < 6; i++) for (unsigned int i = 0; i < 6; i++)
@ -3230,7 +3234,7 @@ void rlUpdateTexture(unsigned int id, int offsetX, int offsetY, int width, int h
unsigned int glInternalFormat, glFormat, glType; unsigned int glInternalFormat, glFormat, glType;
rlGetGlTextureFormats(format, &glInternalFormat, &glFormat, &glType); rlGetGlTextureFormats(format, &glInternalFormat, &glFormat, &glType);
if ((glInternalFormat != -1) && (format < RL_PIXELFORMAT_COMPRESSED_DXT1_RGB)) if ((glInternalFormat != 0) && (format < RL_PIXELFORMAT_COMPRESSED_DXT1_RGB))
{ {
glTexSubImage2D(GL_TEXTURE_2D, 0, offsetX, offsetY, width, height, glFormat, glType, data); glTexSubImage2D(GL_TEXTURE_2D, 0, offsetX, offsetY, width, height, glFormat, glType, data);
} }
@ -3374,7 +3378,7 @@ void *rlReadTexturePixels(unsigned int id, int width, int height, int format)
rlGetGlTextureFormats(format, &glInternalFormat, &glFormat, &glType); rlGetGlTextureFormats(format, &glInternalFormat, &glFormat, &glType);
unsigned int size = rlGetPixelDataSize(width, height, format); unsigned int size = rlGetPixelDataSize(width, height, format);
if ((glInternalFormat != -1) && (format < RL_PIXELFORMAT_COMPRESSED_DXT1_RGB)) if ((glInternalFormat != 0) && (format < RL_PIXELFORMAT_COMPRESSED_DXT1_RGB))
{ {
pixels = RL_MALLOC(size); pixels = RL_MALLOC(size);
glGetTexImage(GL_TEXTURE_2D, 0, glFormat, glType, pixels); glGetTexImage(GL_TEXTURE_2D, 0, glFormat, glType, pixels);
@ -3537,11 +3541,14 @@ bool rlFramebufferComplete(unsigned int id)
void rlUnloadFramebuffer(unsigned int id) void rlUnloadFramebuffer(unsigned int id)
{ {
#if (defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2)) && defined(RLGL_RENDER_TEXTURES_HINT) #if (defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2)) && defined(RLGL_RENDER_TEXTURES_HINT)
// Query depth attachment to automatically delete texture/renderbuffer // Query depth attachment to automatically delete texture/renderbuffer
int depthType = 0, depthId = 0; int depthType = 0, depthId = 0;
glBindFramebuffer(GL_FRAMEBUFFER, id); // Bind framebuffer to query depth texture type glBindFramebuffer(GL_FRAMEBUFFER, id); // Bind framebuffer to query depth texture type
glGetFramebufferAttachmentParameteriv(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, &depthType); glGetFramebufferAttachmentParameteriv(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, &depthType);
// TODO: Review warning retrieving object name in WebGL
// WARNING: WebGL: INVALID_ENUM: getFramebufferAttachmentParameter: invalid parameter name
// https://registry.khronos.org/webgl/specs/latest/1.0/
glGetFramebufferAttachmentParameteriv(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, &depthId); glGetFramebufferAttachmentParameteriv(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, &depthId);
unsigned int depthIdU = (unsigned int)depthId; unsigned int depthIdU = (unsigned int)depthId;
@ -4241,7 +4248,7 @@ void rlBindImageTexture(unsigned int id, unsigned int index, int format, bool re
unsigned int glInternalFormat = 0, glFormat = 0, glType = 0; unsigned int glInternalFormat = 0, glFormat = 0, glType = 0;
rlGetGlTextureFormats(format, &glInternalFormat, &glFormat, &glType); rlGetGlTextureFormats(format, &glInternalFormat, &glFormat, &glType);
glBindImageTexture(index, id, 0, 0, 0, readonly ? GL_READ_ONLY : GL_READ_WRITE, glInternalFormat); glBindImageTexture(index, id, 0, 0, 0, readonly? GL_READ_ONLY : GL_READ_WRITE, glInternalFormat);
#endif #endif
} }

View File

@ -1202,7 +1202,7 @@ void UploadMesh(Mesh *mesh, bool dynamic)
// NOTE: Vertex attributes must be uploaded considering default locations points and available vertex data // NOTE: Vertex attributes must be uploaded considering default locations points and available vertex data
// Enable vertex attributes: position (shader-location = 0) // Enable vertex attributes: position (shader-location = 0)
void *vertices = mesh->animVertices != NULL ? mesh->animVertices : mesh->vertices; void *vertices = (mesh->animVertices != NULL)? mesh->animVertices : mesh->vertices;
mesh->vboId[0] = rlLoadVertexBuffer(vertices, mesh->vertexCount*3*sizeof(float), dynamic); mesh->vboId[0] = rlLoadVertexBuffer(vertices, mesh->vertexCount*3*sizeof(float), dynamic);
rlSetVertexAttribute(0, 3, RL_FLOAT, 0, 0, 0); rlSetVertexAttribute(0, 3, RL_FLOAT, 0, 0, 0);
rlEnableVertexAttribute(0); rlEnableVertexAttribute(0);
@ -1218,7 +1218,7 @@ void UploadMesh(Mesh *mesh, bool dynamic)
if (mesh->normals != NULL) if (mesh->normals != NULL)
{ {
// Enable vertex attributes: normals (shader-location = 2) // Enable vertex attributes: normals (shader-location = 2)
void *normals = mesh->animNormals != NULL ? mesh->animNormals : mesh->normals; void *normals = (mesh->animNormals != NULL)? mesh->animNormals : mesh->normals;
mesh->vboId[2] = rlLoadVertexBuffer(normals, mesh->vertexCount*3*sizeof(float), dynamic); mesh->vboId[2] = rlLoadVertexBuffer(normals, mesh->vertexCount*3*sizeof(float), dynamic);
rlSetVertexAttribute(2, 3, RL_FLOAT, 0, 0, 0); rlSetVertexAttribute(2, 3, RL_FLOAT, 0, 0, 0);
rlEnableVertexAttribute(2); rlEnableVertexAttribute(2);
@ -5246,7 +5246,7 @@ static bool GetPoseAtTimeGLTF(cgltf_accessor *input, cgltf_accessor *output, flo
float tend = 0.0f; float tend = 0.0f;
int keyframe = 0; // Defaults to first pose int keyframe = 0; // Defaults to first pose
for (int i = 0; i < input->count - 1; i++) for (int i = 0; i < (int)input->count - 1; i++)
{ {
cgltf_bool r1 = cgltf_accessor_read_float(input, i, &tstart, 1); cgltf_bool r1 = cgltf_accessor_read_float(input, i, &tstart, 1);
if (!r1) return false; if (!r1) return false;
@ -5585,7 +5585,7 @@ static Model LoadM3D(const char *fileName)
if (!m3d || M3D_ERR_ISFATAL(m3d->errcode)) if (!m3d || M3D_ERR_ISFATAL(m3d->errcode))
{ {
TRACELOG(LOG_WARNING, "MODEL: [%s] Failed to load M3D data, error code %d", fileName, m3d ? m3d->errcode : -2); TRACELOG(LOG_WARNING, "MODEL: [%s] Failed to load M3D data, error code %d", fileName, m3d? m3d->errcode : -2);
if (m3d) m3d_free(m3d); if (m3d) m3d_free(m3d);
UnloadFileData(fileData); UnloadFileData(fileData);
return model; return model;
@ -5614,6 +5614,20 @@ static Model LoadM3D(const char *fileName)
// We always need a default material, so we add +1 // We always need a default material, so we add +1
model.materialCount++; model.materialCount++;
// WARNING: Sorting is not needed, valid M3D model files should already be sorted
// faces should already by grouped by material
// Just keeping the sorting function for reference (Check PR #3363)
/*
static int m3d_compare_faces(const void *a, const void *b)
{
m3df_t *fa = (m3df_t *)a;
m3df_t *fb = (m3df_t *)b;
return (fa->materialid - fb->materialid);
}
qsort(m3d->face, m3d->numface, sizeof(m3df_t), m3d_compare_faces);
*/
model.meshes = (Mesh *)RL_CALLOC(model.meshCount, sizeof(Mesh)); model.meshes = (Mesh *)RL_CALLOC(model.meshCount, sizeof(Mesh));
model.meshMaterial = (int *)RL_CALLOC(model.meshCount, sizeof(int)); model.meshMaterial = (int *)RL_CALLOC(model.meshCount, sizeof(int));
model.materials = (Material *)RL_CALLOC(model.materialCount + 1, sizeof(Material)); model.materials = (Material *)RL_CALLOC(model.materialCount + 1, sizeof(Material));
@ -5680,7 +5694,7 @@ static Model LoadM3D(const char *fileName)
model.meshes[k].vertices[l*9 + 7] = m3d->vertex[m3d->face[i].vertex[2]].y*m3d->scale; model.meshes[k].vertices[l*9 + 7] = m3d->vertex[m3d->face[i].vertex[2]].y*m3d->scale;
model.meshes[k].vertices[l*9 + 8] = m3d->vertex[m3d->face[i].vertex[2]].z*m3d->scale; model.meshes[k].vertices[l*9 + 8] = m3d->vertex[m3d->face[i].vertex[2]].z*m3d->scale;
// without vertex color (full transparency), we use the default color // Without vertex color (full transparency), we use the default color
if (model.meshes[k].colors != NULL) if (model.meshes[k].colors != NULL)
{ {
if (m3d->vertex[m3d->face[i].vertex[0]].color & 0xFF000000) if (m3d->vertex[m3d->face[i].vertex[0]].color & 0xFF000000)
@ -5722,7 +5736,7 @@ static Model LoadM3D(const char *fileName)
int skinid = m3d->vertex[m3d->face[i].vertex[n]].skinid; int skinid = m3d->vertex[m3d->face[i].vertex[n]].skinid;
// Check if there is a skin for this mesh, should be, just failsafe // Check if there is a skin for this mesh, should be, just failsafe
if (skinid != M3D_UNDEF && skinid < (int)m3d->numskin) if ((skinid != M3D_UNDEF) && (skinid < (int)m3d->numskin))
{ {
for (j = 0; j < 4; j++) for (j = 0; j < 4; j++)
{ {
@ -5896,7 +5910,7 @@ static ModelAnimation *LoadModelAnimationsM3D(const char *fileName, int *animCou
if (!m3d || M3D_ERR_ISFATAL(m3d->errcode)) if (!m3d || M3D_ERR_ISFATAL(m3d->errcode))
{ {
TRACELOG(LOG_WARNING, "MODEL: [%s] Failed to load M3D data, error code %d", fileName, m3d ? m3d->errcode : -2); TRACELOG(LOG_WARNING, "MODEL: [%s] Failed to load M3D data, error code %d", fileName, m3d? m3d->errcode : -2);
UnloadFileData(fileData); UnloadFileData(fileData);
return NULL; return NULL;
} }

View File

@ -200,7 +200,7 @@ unsigned char *LoadFileData(const char *fileName, int *dataSize)
// WARNING: On binary streams SEEK_END could not be found, // WARNING: On binary streams SEEK_END could not be found,
// using fseek() and ftell() could not work in some (rare) cases // using fseek() and ftell() could not work in some (rare) cases
fseek(file, 0, SEEK_END); fseek(file, 0, SEEK_END);
int size = ftell(file); int size = ftell(file); // WARNING: ftell() returns 'long int', maximum size returned is INT_MAX (2147483647 bytes)
fseek(file, 0, SEEK_SET); fseek(file, 0, SEEK_SET);
if (size > 0) if (size > 0)
@ -210,12 +210,25 @@ unsigned char *LoadFileData(const char *fileName, int *dataSize)
if (data != NULL) if (data != NULL)
{ {
// NOTE: fread() returns number of read elements instead of bytes, so we read [1 byte, size elements] // NOTE: fread() returns number of read elements instead of bytes, so we read [1 byte, size elements]
unsigned int count = (unsigned int)fread(data, sizeof(unsigned char), size, file); size_t count = fread(data, sizeof(unsigned char), size, file);
*dataSize = count;
if (count != size) TRACELOG(LOG_WARNING, "FILEIO: [%s] File partially loaded", fileName); // WARNING: fread() returns a size_t value, usually 'unsigned int' (32bit compilation) and 'unsigned long long' (64bit compilation)
// dataSize is unified along raylib as a 'int' type, so, for file-sizes > INT_MAX (2147483647 bytes) we have a limitation
if (count > 2147483647)
{
TRACELOG(LOG_WARNING, "FILEIO: [%s] File is bigger than 2147483647 bytes, avoid using LoadFileData()", fileName);
RL_FREE(data);
data = NULL;
}
else
{
*dataSize = (int)count;
if ((*dataSize) != size) TRACELOG(LOG_WARNING, "FILEIO: [%s] File partially loaded (%i bytes out of %i)", fileName, dataSize, count);
else TRACELOG(LOG_INFO, "FILEIO: [%s] File loaded successfully", fileName); else TRACELOG(LOG_INFO, "FILEIO: [%s] File loaded successfully", fileName);
} }
}
else TRACELOG(LOG_WARNING, "FILEIO: [%s] Failed to allocated memory for file reading", fileName); else TRACELOG(LOG_WARNING, "FILEIO: [%s] Failed to allocated memory for file reading", fileName);
} }
else TRACELOG(LOG_WARNING, "FILEIO: [%s] Failed to read file", fileName); else TRACELOG(LOG_WARNING, "FILEIO: [%s] Failed to read file", fileName);
@ -254,7 +267,9 @@ bool SaveFileData(const char *fileName, void *data, int dataSize)
if (file != NULL) if (file != NULL)
{ {
unsigned int count = (unsigned int)fwrite(data, sizeof(unsigned char), dataSize, file); // WARNING: fwrite() returns a size_t value, usually 'unsigned int' (32bit compilation) and 'unsigned long long' (64bit compilation)
// and expects a size_t input value but as dataSize is limited to INT_MAX (2147483647 bytes), there shouldn't be a problem
int count = (int)fwrite(data, sizeof(unsigned char), dataSize, file);
if (count == 0) TRACELOG(LOG_WARNING, "FILEIO: [%s] Failed to write file", fileName); if (count == 0) TRACELOG(LOG_WARNING, "FILEIO: [%s] Failed to write file", fileName);
else if (count != dataSize) TRACELOG(LOG_WARNING, "FILEIO: [%s] File partially written", fileName); else if (count != dataSize) TRACELOG(LOG_WARNING, "FILEIO: [%s] File partially written", fileName);