From 668acb02a0059dc2dbdb9c467b6609ca85ae4589 Mon Sep 17 00:00:00 2001 From: Nawarian Date: Mon, 21 Feb 2022 12:26:19 +0100 Subject: [PATCH 1/3] Add raylib.h and raylib_api.json from raylib source code --- resources/raylib.h | 1911 ++-- resources/raylib_api.json | 10023 ++++++++++++++++++++ src/HasRaylibBlendModeConstants.php | 15 - src/HasRaylibFilterModeConstants.php | 15 - src/HasRaylibGestureConstants.php | 20 - src/HasRaylibImageProcessConstants.php | 17 - src/HasRaylibKeysConstants.php | 114 - src/HasRaylibMaterialMapTypeConstants.php | 23 - src/HasRaylibMouseConstants.php | 12 - src/HasRaylibPixelFormatConstants.php | 30 - src/HasRaylibTraceLogConstants.php | 17 - src/HasRaylibWindowFlagConstants.php | 23 - src/Raylib.php | 2421 ----- src/RaylibFFIProxy.php | 262 - src/RaylibFactory.php | 39 - src/Types/AudioStream.php | 48 - src/Types/BoundingBox.php | 47 - src/Types/Camera2D.php | 48 - src/Types/Camera3D.php | 60 - src/Types/CharInfo.php | 56 - src/Types/Color.php | 204 - src/Types/Font.php | 60 - src/Types/Image.php | 68 - src/Types/Matrix.php | 55 - src/Types/Model.php | 71 - src/Types/Music.php | 51 - src/Types/Ray.php | 48 - src/Types/Rectangle.php | 48 - src/Types/RenderTexture2D.php | 45 - src/Types/Sound.php | 42 - src/Types/Texture2D.php | 51 - src/Types/Vector2.php | 57 - src/Types/Vector3.php | 38 - src/Types/Vector4.php | 39 - src/Utils/Composer/CommandHandler.php | 140 - src/generated-functions.php | 2416 ----- tests/RaylibFactoryTest.php | 25 - tests/RaylibTest.php | 3228 ------- tests/Types/Camera2DTest.php | 59 - tests/Types/ColorTest.php | 72 - tests/Types/MatrixTest.php | 49 - tests/Types/RectangleTest.php | 47 - tests/Types/Vector2Test.php | 85 - tests/resources/raylib.h | 311 - 44 files changed, 11049 insertions(+), 11461 deletions(-) create mode 100644 resources/raylib_api.json delete mode 100644 src/HasRaylibBlendModeConstants.php delete mode 100644 src/HasRaylibFilterModeConstants.php delete mode 100644 src/HasRaylibGestureConstants.php delete mode 100644 src/HasRaylibImageProcessConstants.php delete mode 100644 src/HasRaylibKeysConstants.php delete mode 100644 src/HasRaylibMaterialMapTypeConstants.php delete mode 100644 src/HasRaylibMouseConstants.php delete mode 100644 src/HasRaylibPixelFormatConstants.php delete mode 100644 src/HasRaylibTraceLogConstants.php delete mode 100644 src/HasRaylibWindowFlagConstants.php delete mode 100644 src/Raylib.php delete mode 100644 src/RaylibFFIProxy.php delete mode 100644 src/RaylibFactory.php delete mode 100644 src/Types/AudioStream.php delete mode 100644 src/Types/BoundingBox.php delete mode 100644 src/Types/Camera2D.php delete mode 100644 src/Types/Camera3D.php delete mode 100644 src/Types/CharInfo.php delete mode 100644 src/Types/Color.php delete mode 100644 src/Types/Font.php delete mode 100644 src/Types/Image.php delete mode 100644 src/Types/Matrix.php delete mode 100644 src/Types/Model.php delete mode 100644 src/Types/Music.php delete mode 100644 src/Types/Ray.php delete mode 100644 src/Types/Rectangle.php delete mode 100644 src/Types/RenderTexture2D.php delete mode 100644 src/Types/Sound.php delete mode 100644 src/Types/Texture2D.php delete mode 100644 src/Types/Vector2.php delete mode 100644 src/Types/Vector3.php delete mode 100644 src/Types/Vector4.php delete mode 100644 src/Utils/Composer/CommandHandler.php delete mode 100644 src/generated-functions.php delete mode 100644 tests/RaylibFactoryTest.php delete mode 100644 tests/RaylibTest.php delete mode 100644 tests/Types/Camera2DTest.php delete mode 100644 tests/Types/ColorTest.php delete mode 100644 tests/Types/MatrixTest.php delete mode 100644 tests/Types/RectangleTest.php delete mode 100644 tests/Types/Vector2Test.php delete mode 100644 tests/resources/raylib.h diff --git a/resources/raylib.h b/resources/raylib.h index cd3363b..1604ecc 100644 --- a/resources/raylib.h +++ b/resources/raylib.h @@ -1,6 +1,148 @@ +/********************************************************************************************** +* +* raylib v4.1-dev - A simple and easy-to-use library to enjoy videogames programming (www.raylib.com) +* +* FEATURES: +* - NO external dependencies, all required libraries included with raylib +* - Multiplatform: Windows, Linux, FreeBSD, OpenBSD, NetBSD, DragonFly, +* MacOS, Haiku, Android, Raspberry Pi, DRM native, HTML5. +* - Written in plain C code (C99) in PascalCase/camelCase notation +* - Hardware accelerated with OpenGL (1.1, 2.1, 3.3, 4.3 or ES2 - choose at compile) +* - Unique OpenGL abstraction layer (usable as standalone module): [rlgl] +* - Multiple Fonts formats supported (TTF, XNA fonts, AngelCode fonts) +* - Outstanding texture formats support, including compressed formats (DXT, ETC, ASTC) +* - Full 3d support for 3d Shapes, Models, Billboards, Heightmaps and more! +* - Flexible Materials system, supporting classic maps and PBR maps +* - Animated 3D models supported (skeletal bones animation) (IQM) +* - Shaders support, including Model shaders and Postprocessing shaders +* - Powerful math module for Vector, Matrix and Quaternion operations: [raymath] +* - Audio loading and playing with streaming support (WAV, OGG, MP3, FLAC, XM, MOD) +* - VR stereo rendering with configurable HMD device parameters +* - Bindings to multiple programming languages available! +* +* NOTES: +* - One default Font is loaded on InitWindow()->LoadFontDefault() [core, text] +* - One default Texture2D is loaded on rlglInit(), 1x1 white pixel R8G8B8A8 [rlgl] (OpenGL 3.3 or ES2) +* - One default Shader is loaded on rlglInit()->rlLoadShaderDefault() [rlgl] (OpenGL 3.3 or ES2) +* - One default RenderBatch is loaded on rlglInit()->rlLoadRenderBatch() [rlgl] (OpenGL 3.3 or ES2) +* +* DEPENDENCIES (included): +* [rcore] rglfw (Camilla Löwy - github.com/glfw/glfw) for window/context management and input (PLATFORM_DESKTOP) +* [rlgl] glad (David Herberth - github.com/Dav1dde/glad) for OpenGL 3.3 extensions loading (PLATFORM_DESKTOP) +* [raudio] miniaudio (David Reid - github.com/mackron/miniaudio) for audio device/context management +* +* OPTIONAL DEPENDENCIES (included): +* [rcore] msf_gif (Miles Fogle) for GIF recording +* [rcore] sinfl (Micha Mettke) for DEFLATE decompression algorythm +* [rcore] sdefl (Micha Mettke) for DEFLATE compression algorythm +* [rtextures] stb_image (Sean Barret) for images loading (BMP, TGA, PNG, JPEG, HDR...) +* [rtextures] stb_image_write (Sean Barret) for image writing (BMP, TGA, PNG, JPG) +* [rtextures] stb_image_resize (Sean Barret) for image resizing algorithms +* [rtext] stb_truetype (Sean Barret) for ttf fonts loading +* [rtext] stb_rect_pack (Sean Barret) for rectangles packing +* [rmodels] par_shapes (Philip Rideout) for parametric 3d shapes generation +* [rmodels] tinyobj_loader_c (Syoyo Fujita) for models loading (OBJ, MTL) +* [rmodels] cgltf (Johannes Kuhlmann) for models loading (glTF) +* [raudio] dr_wav (David Reid) for WAV audio file loading +* [raudio] dr_flac (David Reid) for FLAC audio file loading +* [raudio] dr_mp3 (David Reid) for MP3 audio file loading +* [raudio] stb_vorbis (Sean Barret) for OGG audio loading +* [raudio] jar_xm (Joshua Reisenauer) for XM audio module loading +* [raudio] jar_mod (Joshua Reisenauer) for MOD audio module loading +* +* +* LICENSE: zlib/libpng +* +* raylib is 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) 2013-2022 Ramon Santamaria (@raysan5) +* +* This software is provided "as-is", without any express or implied warranty. In no event +* will the authors be held liable for any damages arising from the use of this software. +* +* Permission is granted to anyone to use this software for any purpose, including commercial +* applications, and to alter it and redistribute it freely, subject to the following restrictions: +* +* 1. The origin of this software must not be misrepresented; you must not claim that you +* wrote the original software. If you use this software in a product, an acknowledgment +* in the product documentation would be appreciated but is not required. +* +* 2. Altered source versions must be plainly marked as such, and must not be misrepresented +* as being the original software. +* +* 3. This notice may not be removed or altered from any source distribution. +* +**********************************************************************************************/ + +#ifndef RAYLIB_H +#define RAYLIB_H + +#include // Required for: va_list - Only used by TraceLogCallback + +#define RAYLIB_VERSION "4.1-dev" + +// 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) + #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 + #define RLAPI // Functions defined as 'extern' by default (implicit specifiers) +#endif + //---------------------------------------------------------------------------------- // Some basic Defines //---------------------------------------------------------------------------------- +#ifndef PI + #define PI 3.14159265358979323846f +#endif +#ifndef DEG2RAD + #define DEG2RAD (PI/180.0f) +#endif +#ifndef RAD2DEG + #define RAD2DEG (180.0f/PI) +#endif + +// Allow custom memory allocators +#ifndef RL_MALLOC + #define RL_MALLOC(sz) malloc(sz) +#endif +#ifndef RL_CALLOC + #define RL_CALLOC(n,sz) calloc(n,sz) +#endif +#ifndef RL_REALLOC + #define RL_REALLOC(ptr,sz) realloc(ptr,sz) +#endif +#ifndef RL_FREE + #define RL_FREE(ptr) free(ptr) +#endif + +// NOTE: MSVC C++ compiler does not support compound literals (C99 feature) +// Plain structures in C++ (without constructors) can be initialized with { } +#if defined(__cplusplus) + #define CLITERAL(type) type +#else + #define CLITERAL(type) (type) +#endif + +// NOTE: We set some defines with some data types declared by raylib +// Other modules (raymath, rlgl) also require some of those types, so, +// to be able to use those other modules as standalone (not depending on raylib) +// this defines are very useful for internal check and avoid type (re)definitions +#define RL_COLOR_TYPE +#define RL_RECTANGLE_TYPE +#define RL_VECTOR2_TYPE +#define RL_VECTOR3_TYPE +#define RL_VECTOR4_TYPE +#define RL_QUATERNION_TYPE +#define RL_MATRIX_TYPE + // Some Basic Colors // NOTE: Custom raylib color palette for amazing visuals on WHITE background #define LIGHTGRAY CLITERAL(Color){ 200, 200, 200, 255 } // Light Gray @@ -31,70 +173,66 @@ #define MAGENTA CLITERAL(Color){ 255, 0, 255, 255 } // Magenta #define RAYWHITE CLITERAL(Color){ 245, 245, 245, 255 } // My own White (raylib logo) -// Temporal hacks to avoid breaking old codebases using -// deprecated raylib implementation or definitions -#define FormatText TextFormat -#define LoadText LoadFileText -#define GetExtension GetFileExtension -#define GetImageData LoadImageColors -#define FILTER_POINT TEXTURE_FILTER_POINT -#define FILTER_BILINEAR TEXTURE_FILTER_BILINEAR -#define MAP_DIFFUSE MATERIAL_MAP_DIFFUSE -#define PIXELFORMAT_UNCOMPRESSED_R8G8B8A8 PIXELFORMAT_PIXELFORMAT_UNCOMPRESSED_R8G8B8A8 - //---------------------------------------------------------------------------------- // Structures Definition //---------------------------------------------------------------------------------- -// Vector2 type +// Boolean type +#if defined(__STDC__) && __STDC_VERSION__ >= 199901L + #include +#elif !defined(__cplusplus) && !defined(bool) + typedef enum bool { false, true } bool; + #define RL_BOOL_TYPE +#endif + +// Vector2, 2 components typedef struct Vector2 { - float x; - float y; + float x; // Vector x component + float y; // Vector y component } Vector2; -// Vector3 type +// Vector3, 3 components typedef struct Vector3 { - float x; - float y; - float z; + float x; // Vector x component + float y; // Vector y component + float z; // Vector z component } Vector3; -// Vector4 type +// Vector4, 4 components typedef struct Vector4 { - float x; - float y; - float z; - float w; + float x; // Vector x component + float y; // Vector y component + float z; // Vector z component + float w; // Vector w component } Vector4; -// Quaternion type, same as Vector4 +// Quaternion, 4 components (Vector4 alias) typedef Vector4 Quaternion; -// Matrix type (OpenGL style 4x4 - right handed, column major) +// Matrix, 4x4 components, column major, OpenGL style, right handed typedef struct Matrix { - float m0, m4, m8, m12; - float m1, m5, m9, m13; - float m2, m6, m10, m14; - float m3, m7, m11, m15; + float m0, m4, m8, m12; // Matrix first row (4 components) + float m1, m5, m9, m13; // Matrix second row (4 components) + float m2, m6, m10, m14; // Matrix third row (4 components) + float m3, m7, m11, m15; // Matrix fourth row (4 components) } Matrix; -// Color type, RGBA (32bit) +// Color, 4 components, R8G8B8A8 (32bit) typedef struct Color { - unsigned char r; - unsigned char g; - unsigned char b; - unsigned char a; + unsigned char r; // Color red value + unsigned char g; // Color green value + unsigned char b; // Color blue value + unsigned char a; // Color alpha value } Color; -// Rectangle type +// Rectangle, 4 components typedef struct Rectangle { - float x; - float y; - float width; - float height; + float x; // Rectangle top-left corner position x + float y; // Rectangle top-left corner position y + float width; // Rectangle width + float height; // Rectangle height } Rectangle; -// Image type, bpp always RGBA (32bit) -// NOTE: Data stored in CPU memory (RAM) +// Image, pixel data stored in CPU memory (RAM) typedef struct Image { void *data; // Image raw data int width; // Image base width @@ -103,8 +241,7 @@ typedef struct Image { int format; // Data format (PixelFormat type) } Image; -// Texture type -// NOTE: Data stored in GPU memory +// Texture, tex data stored in GPU memory (VRAM) typedef struct Texture { unsigned int id; // OpenGL texture id int width; // Texture base width @@ -113,23 +250,23 @@ typedef struct Texture { int format; // Data format (PixelFormat type) } Texture; -// Texture2D type, same as Texture +// Texture2D, same as Texture typedef Texture Texture2D; -// TextureCubemap type, actually, same as Texture +// TextureCubemap, same as Texture typedef Texture TextureCubemap; -// RenderTexture type, for texture rendering +// RenderTexture, fbo for texture rendering typedef struct RenderTexture { unsigned int id; // OpenGL framebuffer object id Texture texture; // Color buffer attachment texture Texture depth; // Depth buffer attachment texture } RenderTexture; -// RenderTexture2D type, same as RenderTexture +// RenderTexture2D, same as RenderTexture typedef RenderTexture RenderTexture2D; -// N-Patch layout info +// NPatchInfo, n-patch layout info typedef struct NPatchInfo { Rectangle source; // Texture source rectangle int left; // Left border offset @@ -148,28 +285,17 @@ typedef struct GlyphInfo { Image image; // Character image data } GlyphInfo; -// Font character info -typedef struct CharInfo { - int value; // Character value (Unicode) - int offsetX; // Character offset X when drawing - int offsetY; // Character offset Y when drawing - int advanceX; // Character advance position X - Image image; // Character image data -} CharInfo; - -// Font type, includes texture and charSet array data +// Font, font texture and GlyphInfo array data typedef struct Font { int baseSize; // Base size (default chars height) - int charsCount; // Number of characters - int charsPadding; // Padding around the chars - Texture2D texture; // Characters texture atlas - Rectangle *recs; // Characters rectangles in texture - CharInfo *chars; // Characters info data + int glyphCount; // Number of glyph characters + int glyphPadding; // Padding around the glyph characters + Texture2D texture; // Texture atlas containing the glyphs + Rectangle *recs; // Rectangles in texture for the glyphs + GlyphInfo *glyphs; // Glyphs info data } Font; -#define SpriteFont Font // SpriteFont type fallback, defaults to Font - -// Camera type, defines a camera position/orientation in 3d space +// Camera, defines position/orientation in 3d space typedef struct Camera3D { Vector3 position; // Camera position Vector3 target; // Camera target it looks-at @@ -180,7 +306,7 @@ typedef struct Camera3D { typedef Camera3D Camera; // Camera type fallback, defaults to Camera3D -// Camera2D type, defines a 2d camera +// Camera2D, defines position/orientation in 2d space typedef struct Camera2D { Vector2 offset; // Camera offset (displacement from target) Vector2 target; // Camera target (rotation and zoom origin) @@ -188,25 +314,24 @@ typedef struct Camera2D { float zoom; // Camera zoom (scaling), should be 1.0f by default } Camera2D; -// Vertex data definning a mesh -// NOTE: Data stored in CPU memory (and GPU) +// Mesh, vertex data and vao/vbo typedef struct Mesh { int vertexCount; // Number of vertices stored in arrays int triangleCount; // Number of triangles stored (indexed or not) - // Default vertex data + // Vertex attributes data float *vertices; // Vertex position (XYZ - 3 components per vertex) (shader-location = 0) float *texcoords; // Vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1) float *texcoords2; // Vertex second texture coordinates (useful for lightmaps) (shader-location = 5) float *normals; // Vertex normals (XYZ - 3 components per vertex) (shader-location = 2) float *tangents; // Vertex tangents (XYZW - 4 components per vertex) (shader-location = 4) - unsigned char *colors; // Vertex colors (RGBA - 4 components per vertex) (shader-location = 3) - unsigned short *indices;// Vertex indices (in case vertex data comes indexed) + unsigned char *colors; // Vertex colors (RGBA - 4 components per vertex) (shader-location = 3) + unsigned short *indices; // Vertex indices (in case vertex data comes indexed) // Animation vertex data float *animVertices; // Animated vertex positions (after bones transformations) float *animNormals; // Animated normals (after bones transformations) - int *boneIds; // Vertex bone ids, up to 4 bones influence by vertex (skinning) + unsigned char *boneIds; // Vertex bone ids, max 255 bone ids, up to 4 bones influence by vertex (skinning) float *boneWeights; // Vertex bone weight, up to 4 bones influence by vertex (skinning) // OpenGL identifiers @@ -214,40 +339,40 @@ typedef struct Mesh { unsigned int *vboId; // OpenGL Vertex Buffer Objects id (default vertex data) } Mesh; -// Shader type (generic) +// Shader typedef struct Shader { unsigned int id; // Shader program id - int *locs; // Shader locations array (MAX_SHADER_LOCATIONS) + int *locs; // Shader locations array (RL_MAX_SHADER_LOCATIONS) } Shader; -// Material texture map +// MaterialMap typedef struct MaterialMap { Texture2D texture; // Material map texture Color color; // Material map color float value; // Material map value } MaterialMap; -// Material type (generic) +// Material, includes shader and maps typedef struct Material { Shader shader; // Material shader MaterialMap *maps; // Material maps array (MAX_MATERIAL_MAPS) float params[4]; // Material generic parameters (if required) } Material; -// Transformation properties +// Transform, vectex transformation data typedef struct Transform { Vector3 translation; // Translation Quaternion rotation; // Rotation Vector3 scale; // Scale } Transform; -// Bone information +// Bone, skeletal animation bone typedef struct BoneInfo { char name[32]; // Bone name int parent; // Bone parent } BoneInfo; -// Model type +// Model, meshes, materials and animation data typedef struct Model { Matrix transform; // Local transform matrix @@ -263,7 +388,7 @@ typedef struct Model { Transform *bindPose; // Bones base transformation (pose) } Model; -// Model animation +// ModelAnimation typedef struct ModelAnimation { int boneCount; // Number of bones int frameCount; // Number of animation frames @@ -271,7 +396,7 @@ typedef struct ModelAnimation { Transform **framePoses; // Poses array by frame } ModelAnimation; -// Ray type (useful for raycast) +// Ray, ray for raycasting typedef struct Ray { Vector3 position; // Ray position (origin) Vector3 direction; // Ray direction @@ -285,59 +410,49 @@ typedef struct RayCollision { Vector3 normal; // Surface normal of hit } RayCollision; -// Raycast hit information -typedef struct RayHitInfo { - bool hit; // Did the ray hit something? - float distance; // Distance to nearest hit - Vector3 position; // Position of nearest hit - Vector3 normal; // Surface normal of hit -} RayHitInfo; - -// Bounding box type +// BoundingBox typedef struct BoundingBox { Vector3 min; // Minimum vertex box-corner Vector3 max; // Maximum vertex box-corner } BoundingBox; -// Wave type, defines audio wave data +// Wave, audio wave data typedef struct Wave { - unsigned int sampleCount; // Total number of samples - unsigned int sampleRate; // Frequency (samples per second) - unsigned int sampleSize; // Bit depth (bits per sample): 8, 16, 32 (24 not supported) - unsigned int channels; // Number of channels (1-mono, 2-stereo) - void *data; // Buffer data pointer + unsigned int frameCount; // Total number of frames (considering channels) + unsigned int sampleRate; // Frequency (samples per second) + unsigned int sampleSize; // Bit depth (bits per sample): 8, 16, 32 (24 not supported) + unsigned int channels; // Number of channels (1-mono, 2-stereo, ...) + void *data; // Buffer data pointer } Wave; typedef struct rAudioBuffer rAudioBuffer; -// Audio stream type -// NOTE: Useful to create custom audio streams not bound to a specific file +// AudioStream, custom audio stream typedef struct AudioStream { - rAudioBuffer *buffer; // Pointer to internal data used by the audio system + rAudioBuffer *buffer; // Pointer to internal data used by the audio system - unsigned int sampleRate; // Frequency (samples per second) - unsigned int sampleSize; // Bit depth (bits per sample): 8, 16, 32 (24 not supported) - unsigned int channels; // Number of channels (1-mono, 2-stereo) + unsigned int sampleRate; // Frequency (samples per second) + unsigned int sampleSize; // Bit depth (bits per sample): 8, 16, 32 (24 not supported) + unsigned int channels; // Number of channels (1-mono, 2-stereo, ...) } AudioStream; -// Sound source type +// Sound typedef struct Sound { - AudioStream stream; // Audio stream - unsigned int sampleCount; // Total number of samples + AudioStream stream; // Audio stream + unsigned int frameCount; // Total number of frames (considering channels) } Sound; -// Music stream type (audio file streaming from memory) -// NOTE: Anything longer than ~10 seconds should be streamed +// Music, audio stream, anything longer than ~10 seconds should be streamed typedef struct Music { - AudioStream stream; // Audio stream - unsigned int sampleCount; // Total number of samples - bool looping; // Music looping enable + AudioStream stream; // Audio stream + unsigned int frameCount; // Total number of frames (considering channels) + bool looping; // Music looping enable - int ctxType; // Type of music context (audio filetype) - void *ctxData; // Audio context data, depends on type + int ctxType; // Type of music context (audio filetype) + void *ctxData; // Audio context data, depends on type } Music; -// Head-Mounted-Display device parameters +// VrDeviceInfo, Head-Mounted-Display device parameters typedef struct VrDeviceInfo { int hResolution; // Horizontal resolution in pixels int vResolution; // Vertical resolution in pixels @@ -351,7 +466,7 @@ typedef struct VrDeviceInfo { float chromaAbCorrection[4]; // Chromatic aberration correction parameters } VrDeviceInfo; -// VR Stereo rendering configuration for simulator +// VrStereoConfig, VR stereo rendering configuration for simulator typedef struct VrStereoConfig { Matrix projection[2]; // VR projection matrices (per eye) Matrix viewOffset[2]; // VR view offset matrices (per eye) @@ -387,14 +502,15 @@ typedef enum { } ConfigFlags; // Trace log level +// NOTE: Organized by priority level typedef enum { LOG_ALL = 0, // Display all logs - LOG_TRACE, - LOG_DEBUG, - LOG_INFO, - LOG_WARNING, - LOG_ERROR, - LOG_FATAL, + LOG_TRACE, // Trace logging, intended for internal use only + LOG_DEBUG, // Debug logging, used for internal debugging, it should be disabled on release builds + LOG_INFO, // Info logging, used for program execution info + LOG_WARNING, // Warning logging, used on recoverable failures + LOG_ERROR, // Error logging, used on unrecoverable failures + LOG_FATAL, // Fatal logging, used to abort program: exit(EXIT_FAILURE) LOG_NONE // Disable logging } TraceLogLevel; @@ -402,141 +518,148 @@ typedef enum { // NOTE: Use GetKeyPressed() to allow redefining // required keys for alternative layouts typedef enum { - KEY_NULL = 0, + KEY_NULL = 0, // Key: NULL, used for no key pressed // Alphanumeric keys - KEY_APOSTROPHE = 39, - KEY_COMMA = 44, - KEY_MINUS = 45, - KEY_PERIOD = 46, - KEY_SLASH = 47, - KEY_ZERO = 48, - KEY_ONE = 49, - KEY_TWO = 50, - KEY_THREE = 51, - KEY_FOUR = 52, - KEY_FIVE = 53, - KEY_SIX = 54, - KEY_SEVEN = 55, - KEY_EIGHT = 56, - KEY_NINE = 57, - KEY_SEMICOLON = 59, - KEY_EQUAL = 61, - KEY_A = 65, - KEY_B = 66, - KEY_C = 67, - KEY_D = 68, - KEY_E = 69, - KEY_F = 70, - KEY_G = 71, - KEY_H = 72, - KEY_I = 73, - KEY_J = 74, - KEY_K = 75, - KEY_L = 76, - KEY_M = 77, - KEY_N = 78, - KEY_O = 79, - KEY_P = 80, - KEY_Q = 81, - KEY_R = 82, - KEY_S = 83, - KEY_T = 84, - KEY_U = 85, - KEY_V = 86, - KEY_W = 87, - KEY_X = 88, - KEY_Y = 89, - KEY_Z = 90, - + KEY_APOSTROPHE = 39, // Key: ' + KEY_COMMA = 44, // Key: , + KEY_MINUS = 45, // Key: - + KEY_PERIOD = 46, // Key: . + KEY_SLASH = 47, // Key: / + KEY_ZERO = 48, // Key: 0 + KEY_ONE = 49, // Key: 1 + KEY_TWO = 50, // Key: 2 + KEY_THREE = 51, // Key: 3 + KEY_FOUR = 52, // Key: 4 + KEY_FIVE = 53, // Key: 5 + KEY_SIX = 54, // Key: 6 + KEY_SEVEN = 55, // Key: 7 + KEY_EIGHT = 56, // Key: 8 + KEY_NINE = 57, // Key: 9 + KEY_SEMICOLON = 59, // Key: ; + KEY_EQUAL = 61, // Key: = + KEY_A = 65, // Key: A | a + KEY_B = 66, // Key: B | b + KEY_C = 67, // Key: C | c + KEY_D = 68, // Key: D | d + KEY_E = 69, // Key: E | e + KEY_F = 70, // Key: F | f + KEY_G = 71, // Key: G | g + KEY_H = 72, // Key: H | h + KEY_I = 73, // Key: I | i + KEY_J = 74, // Key: J | j + KEY_K = 75, // Key: K | k + KEY_L = 76, // Key: L | l + KEY_M = 77, // Key: M | m + KEY_N = 78, // Key: N | n + KEY_O = 79, // Key: O | o + KEY_P = 80, // Key: P | p + KEY_Q = 81, // Key: Q | q + KEY_R = 82, // Key: R | r + KEY_S = 83, // Key: S | s + KEY_T = 84, // Key: T | t + KEY_U = 85, // Key: U | u + KEY_V = 86, // Key: V | v + KEY_W = 87, // Key: W | w + KEY_X = 88, // Key: X | x + KEY_Y = 89, // Key: Y | y + KEY_Z = 90, // Key: Z | z + KEY_LEFT_BRACKET = 91, // Key: [ + KEY_BACKSLASH = 92, // Key: '\' + KEY_RIGHT_BRACKET = 93, // Key: ] + KEY_GRAVE = 96, // Key: ` // Function keys - KEY_SPACE = 32, - KEY_ESCAPE = 256, - KEY_ENTER = 257, - KEY_TAB = 258, - KEY_BACKSPACE = 259, - KEY_INSERT = 260, - KEY_DELETE = 261, - KEY_RIGHT = 262, - KEY_LEFT = 263, - KEY_DOWN = 264, - KEY_UP = 265, - KEY_PAGE_UP = 266, - KEY_PAGE_DOWN = 267, - KEY_HOME = 268, - KEY_END = 269, - KEY_CAPS_LOCK = 280, - KEY_SCROLL_LOCK = 281, - KEY_NUM_LOCK = 282, - KEY_PRINT_SCREEN = 283, - KEY_PAUSE = 284, - KEY_F1 = 290, - KEY_F2 = 291, - KEY_F3 = 292, - KEY_F4 = 293, - KEY_F5 = 294, - KEY_F6 = 295, - KEY_F7 = 296, - KEY_F8 = 297, - KEY_F9 = 298, - KEY_F10 = 299, - KEY_F11 = 300, - KEY_F12 = 301, - KEY_LEFT_SHIFT = 340, - KEY_LEFT_CONTROL = 341, - KEY_LEFT_ALT = 342, - KEY_LEFT_SUPER = 343, - KEY_RIGHT_SHIFT = 344, - KEY_RIGHT_CONTROL = 345, - KEY_RIGHT_ALT = 346, - KEY_RIGHT_SUPER = 347, - KEY_KB_MENU = 348, - KEY_LEFT_BRACKET = 91, - KEY_BACKSLASH = 92, - KEY_RIGHT_BRACKET = 93, - KEY_GRAVE = 96, - + KEY_SPACE = 32, // Key: Space + KEY_ESCAPE = 256, // Key: Esc + KEY_ENTER = 257, // Key: Enter + KEY_TAB = 258, // Key: Tab + KEY_BACKSPACE = 259, // Key: Backspace + KEY_INSERT = 260, // Key: Ins + KEY_DELETE = 261, // Key: Del + KEY_RIGHT = 262, // Key: Cursor right + KEY_LEFT = 263, // Key: Cursor left + KEY_DOWN = 264, // Key: Cursor down + KEY_UP = 265, // Key: Cursor up + KEY_PAGE_UP = 266, // Key: Page up + KEY_PAGE_DOWN = 267, // Key: Page down + KEY_HOME = 268, // Key: Home + KEY_END = 269, // Key: End + KEY_CAPS_LOCK = 280, // Key: Caps lock + KEY_SCROLL_LOCK = 281, // Key: Scroll down + KEY_NUM_LOCK = 282, // Key: Num lock + KEY_PRINT_SCREEN = 283, // Key: Print screen + KEY_PAUSE = 284, // Key: Pause + KEY_F1 = 290, // Key: F1 + KEY_F2 = 291, // Key: F2 + KEY_F3 = 292, // Key: F3 + KEY_F4 = 293, // Key: F4 + KEY_F5 = 294, // Key: F5 + KEY_F6 = 295, // Key: F6 + KEY_F7 = 296, // Key: F7 + KEY_F8 = 297, // Key: F8 + KEY_F9 = 298, // Key: F9 + KEY_F10 = 299, // Key: F10 + KEY_F11 = 300, // Key: F11 + KEY_F12 = 301, // Key: F12 + KEY_LEFT_SHIFT = 340, // Key: Shift left + KEY_LEFT_CONTROL = 341, // Key: Control left + KEY_LEFT_ALT = 342, // Key: Alt left + KEY_LEFT_SUPER = 343, // Key: Super left + KEY_RIGHT_SHIFT = 344, // Key: Shift right + KEY_RIGHT_CONTROL = 345, // Key: Control right + KEY_RIGHT_ALT = 346, // Key: Alt right + KEY_RIGHT_SUPER = 347, // Key: Super right + KEY_KB_MENU = 348, // Key: KB menu // Keypad keys - KEY_KP_0 = 320, - KEY_KP_1 = 321, - KEY_KP_2 = 322, - KEY_KP_3 = 323, - KEY_KP_4 = 324, - KEY_KP_5 = 325, - KEY_KP_6 = 326, - KEY_KP_7 = 327, - KEY_KP_8 = 328, - KEY_KP_9 = 329, - KEY_KP_DECIMAL = 330, - KEY_KP_DIVIDE = 331, - KEY_KP_MULTIPLY = 332, - KEY_KP_SUBTRACT = 333, - KEY_KP_ADD = 334, - KEY_KP_ENTER = 335, - KEY_KP_EQUAL = 336, + KEY_KP_0 = 320, // Key: Keypad 0 + KEY_KP_1 = 321, // Key: Keypad 1 + KEY_KP_2 = 322, // Key: Keypad 2 + KEY_KP_3 = 323, // Key: Keypad 3 + KEY_KP_4 = 324, // Key: Keypad 4 + KEY_KP_5 = 325, // Key: Keypad 5 + KEY_KP_6 = 326, // Key: Keypad 6 + KEY_KP_7 = 327, // Key: Keypad 7 + KEY_KP_8 = 328, // Key: Keypad 8 + KEY_KP_9 = 329, // Key: Keypad 9 + KEY_KP_DECIMAL = 330, // Key: Keypad . + KEY_KP_DIVIDE = 331, // Key: Keypad / + KEY_KP_MULTIPLY = 332, // Key: Keypad * + KEY_KP_SUBTRACT = 333, // Key: Keypad - + KEY_KP_ADD = 334, // Key: Keypad + + KEY_KP_ENTER = 335, // Key: Keypad Enter + KEY_KP_EQUAL = 336, // Key: Keypad = // Android key buttons - KEY_BACK = 4, - KEY_MENU = 82, - KEY_VOLUME_UP = 24, - KEY_VOLUME_DOWN = 25 + KEY_BACK = 4, // Key: Android back button + KEY_MENU = 82, // Key: Android menu button + KEY_VOLUME_UP = 24, // Key: Android volume up button + KEY_VOLUME_DOWN = 25 // Key: Android volume down button } KeyboardKey; +// Add backwards compatibility support for deprecated names +#define MOUSE_LEFT_BUTTON MOUSE_BUTTON_LEFT +#define MOUSE_RIGHT_BUTTON MOUSE_BUTTON_RIGHT +#define MOUSE_MIDDLE_BUTTON MOUSE_BUTTON_MIDDLE + // Mouse buttons typedef enum { - MOUSE_LEFT_BUTTON = 0, - MOUSE_RIGHT_BUTTON = 1, - MOUSE_MIDDLE_BUTTON = 2 + MOUSE_BUTTON_LEFT = 0, // Mouse button left + MOUSE_BUTTON_RIGHT = 1, // Mouse button right + MOUSE_BUTTON_MIDDLE = 2, // Mouse button middle (pressed wheel) + MOUSE_BUTTON_SIDE = 3, // Mouse button side (advanced mouse device) + MOUSE_BUTTON_EXTRA = 4, // Mouse button extra (advanced mouse device) + MOUSE_BUTTON_FORWARD = 5, // Mouse button fordward (advanced mouse device) + MOUSE_BUTTON_BACK = 6, // Mouse button back (advanced mouse device) } MouseButton; // Mouse cursor typedef enum { - MOUSE_CURSOR_DEFAULT = 0, - MOUSE_CURSOR_ARROW = 1, - MOUSE_CURSOR_IBEAM = 2, - MOUSE_CURSOR_CROSSHAIR = 3, - MOUSE_CURSOR_POINTING_HAND = 4, - MOUSE_CURSOR_RESIZE_EW = 5, // The horizontal resize/move arrow shape - MOUSE_CURSOR_RESIZE_NS = 6, // The vertical resize/move arrow shape - MOUSE_CURSOR_RESIZE_NWSE = 7, // The top-left to bottom-right diagonal resize/move arrow shape + MOUSE_CURSOR_DEFAULT = 0, // Default pointer shape + MOUSE_CURSOR_ARROW = 1, // Arrow shape + MOUSE_CURSOR_IBEAM = 2, // Text writing cursor shape + MOUSE_CURSOR_CROSSHAIR = 3, // Cross shape + MOUSE_CURSOR_POINTING_HAND = 4, // Pointing hand cursor + MOUSE_CURSOR_RESIZE_EW = 5, // Horizontal resize/move arrow shape + MOUSE_CURSOR_RESIZE_NS = 6, // Vertical resize/move arrow shape + MOUSE_CURSOR_RESIZE_NWSE = 7, // Top-left to bottom-right diagonal resize/move arrow shape MOUSE_CURSOR_RESIZE_NESW = 8, // The top-right to bottom-left diagonal resize/move arrow shape MOUSE_CURSOR_RESIZE_ALL = 9, // The omni-directional resize/move cursor shape MOUSE_CURSOR_NOT_ALLOWED = 10 // The operation-not-allowed shape @@ -544,68 +667,49 @@ typedef enum { // Gamepad buttons typedef enum { - // This is here just for error checking - GAMEPAD_BUTTON_UNKNOWN = 0, - - // This is normally a DPAD - GAMEPAD_BUTTON_LEFT_FACE_UP, - GAMEPAD_BUTTON_LEFT_FACE_RIGHT, - GAMEPAD_BUTTON_LEFT_FACE_DOWN, - GAMEPAD_BUTTON_LEFT_FACE_LEFT, - - // This normally corresponds with PlayStation and Xbox controllers - // XBOX: [Y,X,A,B] - // PS3: [Triangle,Square,Cross,Circle] - // No support for 6 button controllers though.. - GAMEPAD_BUTTON_RIGHT_FACE_UP, - GAMEPAD_BUTTON_RIGHT_FACE_RIGHT, - GAMEPAD_BUTTON_RIGHT_FACE_DOWN, - GAMEPAD_BUTTON_RIGHT_FACE_LEFT, - - // Triggers - GAMEPAD_BUTTON_LEFT_TRIGGER_1, - GAMEPAD_BUTTON_LEFT_TRIGGER_2, - GAMEPAD_BUTTON_RIGHT_TRIGGER_1, - GAMEPAD_BUTTON_RIGHT_TRIGGER_2, - - // These are buttons in the center of the gamepad - GAMEPAD_BUTTON_MIDDLE_LEFT, // PS3 Select - GAMEPAD_BUTTON_MIDDLE, // PS Button/XBOX Button - GAMEPAD_BUTTON_MIDDLE_RIGHT, // PS3 Start - - // These are the joystick press in buttons - GAMEPAD_BUTTON_LEFT_THUMB, - GAMEPAD_BUTTON_RIGHT_THUMB + GAMEPAD_BUTTON_UNKNOWN = 0, // Unknown button, just for error checking + GAMEPAD_BUTTON_LEFT_FACE_UP, // Gamepad left DPAD up button + GAMEPAD_BUTTON_LEFT_FACE_RIGHT, // Gamepad left DPAD right button + GAMEPAD_BUTTON_LEFT_FACE_DOWN, // Gamepad left DPAD down button + GAMEPAD_BUTTON_LEFT_FACE_LEFT, // Gamepad left DPAD left button + GAMEPAD_BUTTON_RIGHT_FACE_UP, // Gamepad right button up (i.e. PS3: Triangle, Xbox: Y) + GAMEPAD_BUTTON_RIGHT_FACE_RIGHT, // Gamepad right button right (i.e. PS3: Square, Xbox: X) + GAMEPAD_BUTTON_RIGHT_FACE_DOWN, // Gamepad right button down (i.e. PS3: Cross, Xbox: A) + GAMEPAD_BUTTON_RIGHT_FACE_LEFT, // Gamepad right button left (i.e. PS3: Circle, Xbox: B) + GAMEPAD_BUTTON_LEFT_TRIGGER_1, // Gamepad top/back trigger left (first), it could be a trailing button + GAMEPAD_BUTTON_LEFT_TRIGGER_2, // Gamepad top/back trigger left (second), it could be a trailing button + GAMEPAD_BUTTON_RIGHT_TRIGGER_1, // Gamepad top/back trigger right (one), it could be a trailing button + GAMEPAD_BUTTON_RIGHT_TRIGGER_2, // Gamepad top/back trigger right (second), it could be a trailing button + GAMEPAD_BUTTON_MIDDLE_LEFT, // Gamepad center buttons, left one (i.e. PS3: Select) + GAMEPAD_BUTTON_MIDDLE, // Gamepad center buttons, middle one (i.e. PS3: PS, Xbox: XBOX) + GAMEPAD_BUTTON_MIDDLE_RIGHT, // Gamepad center buttons, right one (i.e. PS3: Start) + GAMEPAD_BUTTON_LEFT_THUMB, // Gamepad joystick pressed button left + GAMEPAD_BUTTON_RIGHT_THUMB // Gamepad joystick pressed button right } GamepadButton; // Gamepad axis typedef enum { - // Left stick - GAMEPAD_AXIS_LEFT_X = 0, - GAMEPAD_AXIS_LEFT_Y = 1, - - // Right stick - GAMEPAD_AXIS_RIGHT_X = 2, - GAMEPAD_AXIS_RIGHT_Y = 3, - - // Pressure levels for the back triggers - GAMEPAD_AXIS_LEFT_TRIGGER = 4, // [1..-1] (pressure-level) - GAMEPAD_AXIS_RIGHT_TRIGGER = 5 // [1..-1] (pressure-level) + GAMEPAD_AXIS_LEFT_X = 0, // Gamepad left stick X axis + GAMEPAD_AXIS_LEFT_Y = 1, // Gamepad left stick Y axis + GAMEPAD_AXIS_RIGHT_X = 2, // Gamepad right stick X axis + GAMEPAD_AXIS_RIGHT_Y = 3, // Gamepad right stick Y axis + GAMEPAD_AXIS_LEFT_TRIGGER = 4, // Gamepad back trigger left, pressure level: [1..-1] + GAMEPAD_AXIS_RIGHT_TRIGGER = 5 // Gamepad back trigger right, pressure level: [1..-1] } GamepadAxis; // Material map index typedef enum { - MATERIAL_MAP_ALBEDO = 0, // MATERIAL_MAP_DIFFUSE - MATERIAL_MAP_METALNESS = 1, // MATERIAL_MAP_SPECULAR - MATERIAL_MAP_NORMAL = 2, - MATERIAL_MAP_ROUGHNESS = 3, - MATERIAL_MAP_OCCLUSION, - MATERIAL_MAP_EMISSION, - MATERIAL_MAP_HEIGHT, - MATERIAL_MAP_BRDG, - MATERIAL_MAP_CUBEMAP, // NOTE: Uses GL_TEXTURE_CUBE_MAP - MATERIAL_MAP_IRRADIANCE, // NOTE: Uses GL_TEXTURE_CUBE_MAP - MATERIAL_MAP_PREFILTER // NOTE: Uses GL_TEXTURE_CUBE_MAP + MATERIAL_MAP_ALBEDO = 0, // Albedo material (same as: MATERIAL_MAP_DIFFUSE) + MATERIAL_MAP_METALNESS, // Metalness material (same as: MATERIAL_MAP_SPECULAR) + MATERIAL_MAP_NORMAL, // Normal material + MATERIAL_MAP_ROUGHNESS, // Roughness material + MATERIAL_MAP_OCCLUSION, // Ambient occlusion material + MATERIAL_MAP_EMISSION, // Emission material + MATERIAL_MAP_HEIGHT, // Heightmap material + MATERIAL_MAP_CUBEMAP, // Cubemap material (NOTE: Uses GL_TEXTURE_CUBE_MAP) + MATERIAL_MAP_IRRADIANCE, // Irradiance material (NOTE: Uses GL_TEXTURE_CUBE_MAP) + MATERIAL_MAP_PREFILTER, // Prefilter material (NOTE: Uses GL_TEXTURE_CUBE_MAP) + MATERIAL_MAP_BRDF // Brdf material } MaterialMapIndex; #define MATERIAL_MAP_DIFFUSE MATERIAL_MAP_ALBEDO @@ -613,32 +717,32 @@ typedef enum { // Shader location index typedef enum { - SHADER_LOC_VERTEX_POSITION = 0, - SHADER_LOC_VERTEX_TEXCOORD01, - SHADER_LOC_VERTEX_TEXCOORD02, - SHADER_LOC_VERTEX_NORMAL, - SHADER_LOC_VERTEX_TANGENT, - SHADER_LOC_VERTEX_COLOR, - SHADER_LOC_MATRIX_MVP, - SHADER_LOC_MATRIX_VIEW, - SHADER_LOC_MATRIX_PROJECTION, - SHADER_LOC_MATRIX_MODEL, - SHADER_LOC_MATRIX_NORMAL, - SHADER_LOC_VECTOR_VIEW, - SHADER_LOC_COLOR_DIFFUSE, - SHADER_LOC_COLOR_SPECULAR, - SHADER_LOC_COLOR_AMBIENT, - SHADER_LOC_MAP_ALBEDO, // SHADER_LOC_MAP_DIFFUSE - SHADER_LOC_MAP_METALNESS, // SHADER_LOC_MAP_SPECULAR - SHADER_LOC_MAP_NORMAL, - SHADER_LOC_MAP_ROUGHNESS, - SHADER_LOC_MAP_OCCLUSION, - SHADER_LOC_MAP_EMISSION, - SHADER_LOC_MAP_HEIGHT, - SHADER_LOC_MAP_CUBEMAP, - SHADER_LOC_MAP_IRRADIANCE, - SHADER_LOC_MAP_PREFILTER, - SHADER_LOC_MAP_BRDF + SHADER_LOC_VERTEX_POSITION = 0, // Shader location: vertex attribute: position + SHADER_LOC_VERTEX_TEXCOORD01, // Shader location: vertex attribute: texcoord01 + SHADER_LOC_VERTEX_TEXCOORD02, // Shader location: vertex attribute: texcoord02 + SHADER_LOC_VERTEX_NORMAL, // Shader location: vertex attribute: normal + SHADER_LOC_VERTEX_TANGENT, // Shader location: vertex attribute: tangent + SHADER_LOC_VERTEX_COLOR, // Shader location: vertex attribute: color + SHADER_LOC_MATRIX_MVP, // Shader location: matrix uniform: model-view-projection + SHADER_LOC_MATRIX_VIEW, // Shader location: matrix uniform: view (camera transform) + SHADER_LOC_MATRIX_PROJECTION, // Shader location: matrix uniform: projection + SHADER_LOC_MATRIX_MODEL, // Shader location: matrix uniform: model (transform) + SHADER_LOC_MATRIX_NORMAL, // Shader location: matrix uniform: normal + SHADER_LOC_VECTOR_VIEW, // Shader location: vector uniform: view + SHADER_LOC_COLOR_DIFFUSE, // Shader location: vector uniform: diffuse color + SHADER_LOC_COLOR_SPECULAR, // Shader location: vector uniform: specular color + SHADER_LOC_COLOR_AMBIENT, // Shader location: vector uniform: ambient color + SHADER_LOC_MAP_ALBEDO, // Shader location: sampler2d texture: albedo (same as: SHADER_LOC_MAP_DIFFUSE) + SHADER_LOC_MAP_METALNESS, // Shader location: sampler2d texture: metalness (same as: SHADER_LOC_MAP_SPECULAR) + SHADER_LOC_MAP_NORMAL, // Shader location: sampler2d texture: normal + SHADER_LOC_MAP_ROUGHNESS, // Shader location: sampler2d texture: roughness + SHADER_LOC_MAP_OCCLUSION, // Shader location: sampler2d texture: occlusion + SHADER_LOC_MAP_EMISSION, // Shader location: sampler2d texture: emission + SHADER_LOC_MAP_HEIGHT, // Shader location: sampler2d texture: height + SHADER_LOC_MAP_CUBEMAP, // Shader location: samplerCube texture: cubemap + SHADER_LOC_MAP_IRRADIANCE, // Shader location: samplerCube texture: irradiance + SHADER_LOC_MAP_PREFILTER, // Shader location: samplerCube texture: prefilter + SHADER_LOC_MAP_BRDF // Shader location: sampler2d texture: brdf } ShaderLocationIndex; #define SHADER_LOC_MAP_DIFFUSE SHADER_LOC_MAP_ALBEDO @@ -646,48 +750,56 @@ typedef enum { // Shader uniform data type typedef enum { - SHADER_UNIFORM_FLOAT = 0, - SHADER_UNIFORM_VEC2, - SHADER_UNIFORM_VEC3, - SHADER_UNIFORM_VEC4, - SHADER_UNIFORM_INT, - SHADER_UNIFORM_IVEC2, - SHADER_UNIFORM_IVEC3, - SHADER_UNIFORM_IVEC4, - SHADER_UNIFORM_SAMPLER2D + SHADER_UNIFORM_FLOAT = 0, // Shader uniform type: float + SHADER_UNIFORM_VEC2, // Shader uniform type: vec2 (2 float) + SHADER_UNIFORM_VEC3, // Shader uniform type: vec3 (3 float) + SHADER_UNIFORM_VEC4, // Shader uniform type: vec4 (4 float) + SHADER_UNIFORM_INT, // Shader uniform type: int + SHADER_UNIFORM_IVEC2, // Shader uniform type: ivec2 (2 int) + SHADER_UNIFORM_IVEC3, // Shader uniform type: ivec3 (3 int) + SHADER_UNIFORM_IVEC4, // Shader uniform type: ivec4 (4 int) + SHADER_UNIFORM_SAMPLER2D // Shader uniform type: sampler2d } ShaderUniformDataType; +// Shader attribute data types +typedef enum { + SHADER_ATTRIB_FLOAT = 0, // Shader attribute type: float + SHADER_ATTRIB_VEC2, // Shader attribute type: vec2 (2 float) + SHADER_ATTRIB_VEC3, // Shader attribute type: vec3 (3 float) + SHADER_ATTRIB_VEC4 // Shader attribute type: vec4 (4 float) +} ShaderAttributeDataType; + // Pixel formats // NOTE: Support depends on OpenGL version and platform typedef enum { - PIXELFORMAT_UNCOMPRESSED_GRAYSCALE = 1, // 8 bit per pixel (no alpha) - PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA, // 8*2 bpp (2 channels) - PIXELFORMAT_UNCOMPRESSED_R5G6B5, // 16 bpp - PIXELFORMAT_UNCOMPRESSED_R8G8B8, // 24 bpp - PIXELFORMAT_UNCOMPRESSED_R5G5B5A1, // 16 bpp (1 bit alpha) - PIXELFORMAT_UNCOMPRESSED_R4G4B4A4, // 16 bpp (4 bit alpha) - PIXELFORMAT_UNCOMPRESSED_R8G8B8A8, // 32 bpp - PIXELFORMAT_UNCOMPRESSED_R32, // 32 bpp (1 channel - float) - PIXELFORMAT_UNCOMPRESSED_R32G32B32, // 32*3 bpp (3 channels - float) - PIXELFORMAT_UNCOMPRESSED_R32G32B32A32, // 32*4 bpp (4 channels - float) - PIXELFORMAT_COMPRESSED_DXT1_RGB, // 4 bpp (no alpha) - PIXELFORMAT_COMPRESSED_DXT1_RGBA, // 4 bpp (1 bit alpha) - PIXELFORMAT_COMPRESSED_DXT3_RGBA, // 8 bpp - PIXELFORMAT_COMPRESSED_DXT5_RGBA, // 8 bpp - PIXELFORMAT_COMPRESSED_ETC1_RGB, // 4 bpp - PIXELFORMAT_COMPRESSED_ETC2_RGB, // 4 bpp - PIXELFORMAT_COMPRESSED_ETC2_EAC_RGBA, // 8 bpp - PIXELFORMAT_COMPRESSED_PVRT_RGB, // 4 bpp - PIXELFORMAT_COMPRESSED_PVRT_RGBA, // 4 bpp - PIXELFORMAT_COMPRESSED_ASTC_4x4_RGBA, // 8 bpp - PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA // 2 bpp + PIXELFORMAT_UNCOMPRESSED_GRAYSCALE = 1, // 8 bit per pixel (no alpha) + PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA, // 8*2 bpp (2 channels) + PIXELFORMAT_UNCOMPRESSED_R5G6B5, // 16 bpp + PIXELFORMAT_UNCOMPRESSED_R8G8B8, // 24 bpp + PIXELFORMAT_UNCOMPRESSED_R5G5B5A1, // 16 bpp (1 bit alpha) + PIXELFORMAT_UNCOMPRESSED_R4G4B4A4, // 16 bpp (4 bit alpha) + PIXELFORMAT_UNCOMPRESSED_R8G8B8A8, // 32 bpp + PIXELFORMAT_UNCOMPRESSED_R32, // 32 bpp (1 channel - float) + PIXELFORMAT_UNCOMPRESSED_R32G32B32, // 32*3 bpp (3 channels - float) + PIXELFORMAT_UNCOMPRESSED_R32G32B32A32, // 32*4 bpp (4 channels - float) + PIXELFORMAT_COMPRESSED_DXT1_RGB, // 4 bpp (no alpha) + PIXELFORMAT_COMPRESSED_DXT1_RGBA, // 4 bpp (1 bit alpha) + PIXELFORMAT_COMPRESSED_DXT3_RGBA, // 8 bpp + PIXELFORMAT_COMPRESSED_DXT5_RGBA, // 8 bpp + PIXELFORMAT_COMPRESSED_ETC1_RGB, // 4 bpp + PIXELFORMAT_COMPRESSED_ETC2_RGB, // 4 bpp + PIXELFORMAT_COMPRESSED_ETC2_EAC_RGBA, // 8 bpp + PIXELFORMAT_COMPRESSED_PVRT_RGB, // 4 bpp + PIXELFORMAT_COMPRESSED_PVRT_RGBA, // 4 bpp + PIXELFORMAT_COMPRESSED_ASTC_4x4_RGBA, // 8 bpp + PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA // 2 bpp } PixelFormat; // Texture parameters: filter mode // NOTE 1: Filtering considers mipmaps if available in the texture // NOTE 2: Filter is accordingly set for minification and magnification typedef enum { - TEXTURE_FILTER_POINT = 0, // No filter, just pixel aproximation + TEXTURE_FILTER_POINT = 0, // No filter, just pixel approximation TEXTURE_FILTER_BILINEAR, // Linear filtering TEXTURE_FILTER_TRILINEAR, // Trilinear filtering (linear with mipmaps) TEXTURE_FILTER_ANISOTROPIC_4X, // Anisotropic filtering 4x @@ -697,68 +809,69 @@ typedef enum { // Texture parameters: wrap mode typedef enum { - TEXTURE_WRAP_REPEAT = 0, // Repeats texture in tiled mode - TEXTURE_WRAP_CLAMP, // Clamps texture to edge pixel in tiled mode - TEXTURE_WRAP_MIRROR_REPEAT, // Mirrors and repeats the texture in tiled mode - TEXTURE_WRAP_MIRROR_CLAMP // Mirrors and clamps to border the texture in tiled mode + TEXTURE_WRAP_REPEAT = 0, // Repeats texture in tiled mode + TEXTURE_WRAP_CLAMP, // Clamps texture to edge pixel in tiled mode + TEXTURE_WRAP_MIRROR_REPEAT, // Mirrors and repeats the texture in tiled mode + TEXTURE_WRAP_MIRROR_CLAMP // Mirrors and clamps to border the texture in tiled mode } TextureWrap; // Cubemap layouts typedef enum { - CUBEMAP_LAYOUT_AUTO_DETECT = 0, // Automatically detect layout type - CUBEMAP_LAYOUT_LINE_VERTICAL, // Layout is defined by a vertical line with faces - CUBEMAP_LAYOUT_LINE_HORIZONTAL, // Layout is defined by an horizontal line with faces - CUBEMAP_LAYOUT_CROSS_THREE_BY_FOUR, // Layout is defined by a 3x4 cross with cubemap faces - CUBEMAP_LAYOUT_CROSS_FOUR_BY_THREE, // Layout is defined by a 4x3 cross with cubemap faces - CUBEMAP_LAYOUT_PANORAMA // Layout is defined by a panorama image (equirectangular map) + CUBEMAP_LAYOUT_AUTO_DETECT = 0, // Automatically detect layout type + CUBEMAP_LAYOUT_LINE_VERTICAL, // Layout is defined by a vertical line with faces + CUBEMAP_LAYOUT_LINE_HORIZONTAL, // Layout is defined by an horizontal line with faces + CUBEMAP_LAYOUT_CROSS_THREE_BY_FOUR, // Layout is defined by a 3x4 cross with cubemap faces + CUBEMAP_LAYOUT_CROSS_FOUR_BY_THREE, // Layout is defined by a 4x3 cross with cubemap faces + CUBEMAP_LAYOUT_PANORAMA // Layout is defined by a panorama image (equirectangular map) } CubemapLayout; // Font type, defines generation method typedef enum { - FONT_DEFAULT = 0, // Default font generation, anti-aliased - FONT_BITMAP, // Bitmap font generation, no anti-aliasing - FONT_SDF // SDF font generation, requires external shader + FONT_DEFAULT = 0, // Default font generation, anti-aliased + FONT_BITMAP, // Bitmap font generation, no anti-aliasing + FONT_SDF // SDF font generation, requires external shader } FontType; // Color blending modes (pre-defined) typedef enum { - BLEND_ALPHA = 0, // Blend textures considering alpha (default) - BLEND_ADDITIVE, // Blend textures adding colors - BLEND_MULTIPLIED, // Blend textures multiplying colors - BLEND_ADD_COLORS, // Blend textures adding colors (alternative) - BLEND_SUBTRACT_COLORS, // Blend textures subtracting colors (alternative) - BLEND_CUSTOM // Belnd textures using custom src/dst factors (use rlSetBlendMode()) + BLEND_ALPHA = 0, // Blend textures considering alpha (default) + BLEND_ADDITIVE, // Blend textures adding colors + BLEND_MULTIPLIED, // Blend textures multiplying colors + BLEND_ADD_COLORS, // Blend textures adding colors (alternative) + BLEND_SUBTRACT_COLORS, // Blend textures subtracting colors (alternative) + BLEND_ALPHA_PREMUL, // Blend premultiplied textures considering alpha + BLEND_CUSTOM // Blend textures using custom src/dst factors (use rlSetBlendMode()) } BlendMode; -// Gestures +// Gesture // NOTE: It could be used as flags to enable only some gestures typedef enum { - GESTURE_NONE = 0, - GESTURE_TAP = 1, - GESTURE_DOUBLETAP = 2, - GESTURE_HOLD = 4, - GESTURE_DRAG = 8, - GESTURE_SWIPE_RIGHT = 16, - GESTURE_SWIPE_LEFT = 32, - GESTURE_SWIPE_UP = 64, - GESTURE_SWIPE_DOWN = 128, - GESTURE_PINCH_IN = 256, - GESTURE_PINCH_OUT = 512 -} Gestures; + GESTURE_NONE = 0, // No gesture + GESTURE_TAP = 1, // Tap gesture + GESTURE_DOUBLETAP = 2, // Double tap gesture + GESTURE_HOLD = 4, // Hold gesture + GESTURE_DRAG = 8, // Drag gesture + GESTURE_SWIPE_RIGHT = 16, // Swipe right gesture + GESTURE_SWIPE_LEFT = 32, // Swipe left gesture + GESTURE_SWIPE_UP = 64, // Swipe up gesture + GESTURE_SWIPE_DOWN = 128, // Swipe down gesture + GESTURE_PINCH_IN = 256, // Pinch in gesture + GESTURE_PINCH_OUT = 512 // Pinch out gesture +} Gesture; // Camera system modes typedef enum { - CAMERA_CUSTOM = 0, - CAMERA_FREE, - CAMERA_ORBITAL, - CAMERA_FIRST_PERSON, - CAMERA_THIRD_PERSON + CAMERA_CUSTOM = 0, // Custom camera + CAMERA_FREE, // Free camera + CAMERA_ORBITAL, // Orbital camera + CAMERA_FIRST_PERSON, // First person camera + CAMERA_THIRD_PERSON // Third person camera } CameraMode; // Camera projection typedef enum { - CAMERA_PERSPECTIVE = 0, - CAMERA_ORTHOGRAPHIC + CAMERA_PERSPECTIVE = 0, // Perspective projection + CAMERA_ORTHOGRAPHIC // Orthographic projection } CameraProjection; // N-patch layout @@ -771,245 +884,261 @@ typedef enum { // Callbacks to hook some internal functions // WARNING: This callbacks are intended for advance users typedef void (*TraceLogCallback)(int logLevel, const char *text, va_list args); // Logging: Redirect trace log messages -typedef unsigned char* (*LoadFileDataCallback)(const char* fileName, unsigned int* bytesRead); // FileIO: Load binary data +typedef unsigned char *(*LoadFileDataCallback)(const char *fileName, unsigned int *bytesRead); // FileIO: Load binary data typedef bool (*SaveFileDataCallback)(const char *fileName, void *data, unsigned int bytesToWrite); // FileIO: Save binary data -typedef char *(*LoadFileTextCallback)(const char* fileName); // FileIO: Load text data +typedef char *(*LoadFileTextCallback)(const char *fileName); // FileIO: Load text data typedef bool (*SaveFileTextCallback)(const char *fileName, char *text); // FileIO: Save text data +//------------------------------------------------------------------------------------ +// Global Variables Definition +//------------------------------------------------------------------------------------ +// It's lonely here... + +//------------------------------------------------------------------------------------ +// Window and Graphics Device Functions (Module: core) +//------------------------------------------------------------------------------------ + +#if defined(__cplusplus) +extern "C" { // Prevents name mangling of functions +#endif + // Window-related functions -void InitWindow(int width, int height, const char *title); // Initialize window and OpenGL context -bool WindowShouldClose(void); // Check if KEY_ESCAPE pressed or Close icon pressed -void CloseWindow(void); // Close window and unload OpenGL context -bool IsWindowReady(void); // Check if window has been initialized successfully -bool IsWindowFullscreen(void); // Check if window is currently fullscreen -bool IsWindowHidden(void); // Check if window is currently hidden (only PLATFORM_DESKTOP) -bool IsWindowMinimized(void); // Check if window is currently minimized (only PLATFORM_DESKTOP) -bool IsWindowMaximized(void); // Check if window is currently maximized (only PLATFORM_DESKTOP) -bool IsWindowFocused(void); // Check if window is currently focused (only PLATFORM_DESKTOP) -bool IsWindowResized(void); // Check if window has been resized last frame -bool IsWindowState(unsigned int flag); // Check if one specific window flag is enabled -void SetWindowState(unsigned int flags); // Set window configuration state using flags -void ClearWindowState(unsigned int flags); // Clear window configuration state flags -void ToggleFullscreen(void); // Toggle window state: fullscreen/windowed (only PLATFORM_DESKTOP) -void MaximizeWindow(void); // Set window state: maximized, if resizable (only PLATFORM_DESKTOP) -void MinimizeWindow(void); // Set window state: minimized, if resizable (only PLATFORM_DESKTOP) -void RestoreWindow(void); // Set window state: not minimized/maximized (only PLATFORM_DESKTOP) -void SetWindowIcon(Image image); // Set icon for window (only PLATFORM_DESKTOP) -void SetWindowTitle(const char *title); // Set title for window (only PLATFORM_DESKTOP) -void SetWindowPosition(int x, int y); // Set window position on screen (only PLATFORM_DESKTOP) -void SetWindowMonitor(int monitor); // Set monitor for the current window (fullscreen mode) -void SetWindowMinSize(int width, int height); // Set window minimum dimensions (for FLAG_WINDOW_RESIZABLE) -void SetWindowSize(int width, int height); // Set window dimensions -void *GetWindowHandle(void); // Get native window handle -int GetScreenWidth(void); // Get current screen width -int GetScreenHeight(void); // Get current screen height -int GetRenderWidth(void); // Get current render width (it considers HiDPI) -int GetRenderHeight(void); // Get current render height (it considers HiDPI) -int GetMonitorCount(void); // Get number of connected monitors -int GetCurrentMonitor(void); // Get current connected monitor -Vector2 GetMonitorPosition(int monitor); // Get specified monitor position -int GetMonitorWidth(int monitor); // Get specified monitor width (max available by monitor) -int GetMonitorHeight(int monitor); // Get specified monitor height (max available by monitor) -int GetMonitorPhysicalWidth(int monitor); // Get specified monitor physical width in millimetres -int GetMonitorPhysicalHeight(int monitor); // Get specified monitor physical height in millimetres -int GetMonitorRefreshRate(int monitor); // Get specified monitor refresh rate -Vector2 GetWindowPosition(void); // Get window position XY on monitor -Vector2 GetWindowScaleDPI(void); // Get window scale DPI factor -const char *GetMonitorName(int monitor); // Get the human-readable, UTF-8 encoded name of the primary monitor -void SetClipboardText(const char *text); // Set clipboard text content -const char *GetClipboardText(void); // Get clipboard text content +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 bool IsWindowReady(void); // Check if window has been initialized successfully +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 IsWindowMinimized(void); // Check if window is currently minimized (only PLATFORM_DESKTOP) +RLAPI bool IsWindowMaximized(void); // Check if window is currently maximized (only PLATFORM_DESKTOP) +RLAPI bool IsWindowFocused(void); // Check if window is currently focused (only PLATFORM_DESKTOP) +RLAPI bool IsWindowResized(void); // Check if window has been resized last frame +RLAPI bool IsWindowState(unsigned int flag); // Check if one specific window flag is enabled +RLAPI void SetWindowState(unsigned int flags); // Set window configuration state using flags (only PLATFORM_DESKTOP) +RLAPI void ClearWindowState(unsigned int flags); // Clear window configuration state flags +RLAPI void ToggleFullscreen(void); // Toggle window state: fullscreen/windowed (only PLATFORM_DESKTOP) +RLAPI void MaximizeWindow(void); // Set window state: maximized, if resizable (only PLATFORM_DESKTOP) +RLAPI void MinimizeWindow(void); // Set window state: minimized, if resizable (only PLATFORM_DESKTOP) +RLAPI void RestoreWindow(void); // Set window state: not minimized/maximized (only PLATFORM_DESKTOP) +RLAPI void SetWindowIcon(Image image); // Set icon for window (only PLATFORM_DESKTOP) +RLAPI void SetWindowTitle(const char *title); // Set title for window (only PLATFORM_DESKTOP) +RLAPI void SetWindowPosition(int x, int y); // Set window position on screen (only PLATFORM_DESKTOP) +RLAPI void SetWindowMonitor(int monitor); // Set monitor for the current window (fullscreen mode) +RLAPI void SetWindowMinSize(int width, int height); // Set window minimum dimensions (for FLAG_WINDOW_RESIZABLE) +RLAPI void SetWindowSize(int width, int height); // Set window dimensions +RLAPI void SetWindowOpacity(float opacity); // Set window opacity [0.0f..1.0f] (only PLATFORM_DESKTOP) +RLAPI void *GetWindowHandle(void); // Get native window handle +RLAPI int GetScreenWidth(void); // Get current screen width +RLAPI int GetScreenHeight(void); // Get current screen height +RLAPI int GetRenderWidth(void); // Get current render width (it considers HiDPI) +RLAPI int GetRenderHeight(void); // Get current render height (it considers HiDPI) +RLAPI int GetMonitorCount(void); // Get number of connected monitors +RLAPI int GetCurrentMonitor(void); // Get current connected monitor +RLAPI Vector2 GetMonitorPosition(int monitor); // Get specified monitor position +RLAPI int GetMonitorWidth(int monitor); // Get specified monitor width (max available by monitor) +RLAPI int GetMonitorHeight(int monitor); // Get specified monitor height (max available by monitor) +RLAPI int GetMonitorPhysicalWidth(int monitor); // Get specified monitor physical width in millimetres +RLAPI int GetMonitorPhysicalHeight(int monitor); // Get specified monitor physical height in millimetres +RLAPI int GetMonitorRefreshRate(int monitor); // Get specified monitor refresh rate +RLAPI Vector2 GetWindowPosition(void); // Get window position XY on monitor +RLAPI Vector2 GetWindowScaleDPI(void); // Get window scale DPI factor +RLAPI const char *GetMonitorName(int monitor); // Get the human-readable, UTF-8 encoded name of the primary monitor +RLAPI void SetClipboardText(const char *text); // Set clipboard text content +RLAPI const char *GetClipboardText(void); // Get clipboard text content // Custom frame control functions // NOTE: Those functions are intended for advance users that want full control over the frame processing // By default EndDrawing() does this job: draws everything + SwapScreenBuffer() + manage frame timming + PollInputEvents() // To avoid that behaviour and control frame processes manually, enable in config.h: SUPPORT_CUSTOM_FRAME_CONTROL -void SwapScreenBuffer(void); // Swap back buffer with front buffer (screen drawing) -void PollInputEvents(void); // Register all input events -void WaitTime(float ms); // Wait for some milliseconds (halt program execution) +RLAPI void SwapScreenBuffer(void); // Swap back buffer with front buffer (screen drawing) +RLAPI void PollInputEvents(void); // Register all input events +RLAPI void WaitTime(float ms); // Wait for some milliseconds (halt program execution) // Cursor-related functions -void ShowCursor(void); // Shows cursor -void HideCursor(void); // Hides cursor -bool IsCursorHidden(void); // Check if cursor is not visible -void EnableCursor(void); // Enables cursor (unlock cursor) -void DisableCursor(void); // Disables cursor (lock cursor) -bool IsCursorOnScreen(void); // Check if cursor is on the screen +RLAPI void ShowCursor(void); // Shows cursor +RLAPI void HideCursor(void); // Hides cursor +RLAPI bool IsCursorHidden(void); // Check if cursor is not visible +RLAPI void EnableCursor(void); // Enables cursor (unlock cursor) +RLAPI void DisableCursor(void); // Disables cursor (lock cursor) +RLAPI bool IsCursorOnScreen(void); // Check if cursor is on the screen // Drawing-related functions -void ClearBackground(Color color); // Set background color (framebuffer clear color) -void BeginDrawing(void); // Setup canvas (framebuffer) to start drawing -void EndDrawing(void); // End canvas drawing and swap buffers (double buffering) -void BeginMode2D(Camera2D camera); // Begin 2D mode with custom camera (2D) -void EndMode2D(void); // Ends 2D mode with custom camera -void BeginMode3D(Camera3D camera); // Begin 3D mode with custom camera (3D) -void EndMode3D(void); // Ends 3D mode and returns to default 2D orthographic mode -void BeginTextureMode(RenderTexture2D target); // Begin drawing to render texture -void EndTextureMode(void); // Ends drawing to render texture -void BeginShaderMode(Shader shader); // Begin custom shader drawing -void EndShaderMode(void); // End custom shader drawing (use default shader) -void BeginBlendMode(int mode); // Begin blending mode (alpha, additive, multiplied, subtract, custom) -void EndBlendMode(void); // End blending mode (reset to default: alpha blending) -void BeginScissorMode(int x, int y, int width, int height); // Begin scissor mode (define screen area for following drawing) -void EndScissorMode(void); // End scissor mode -void BeginVrStereoMode(VrStereoConfig config); // Begin stereo rendering (requires VR simulator) -void EndVrStereoMode(void); // End stereo rendering (requires VR simulator) +RLAPI void ClearBackground(Color color); // Set background color (framebuffer clear color) +RLAPI void BeginDrawing(void); // Setup canvas (framebuffer) to start drawing +RLAPI void EndDrawing(void); // End canvas drawing and swap buffers (double buffering) +RLAPI void BeginMode2D(Camera2D camera); // Begin 2D mode with custom camera (2D) +RLAPI void EndMode2D(void); // Ends 2D mode with custom camera +RLAPI void BeginMode3D(Camera3D camera); // Begin 3D mode with custom camera (3D) +RLAPI void EndMode3D(void); // Ends 3D mode and returns to default 2D orthographic mode +RLAPI void BeginTextureMode(RenderTexture2D target); // Begin drawing to render texture +RLAPI void EndTextureMode(void); // Ends drawing to render texture +RLAPI void BeginShaderMode(Shader shader); // Begin custom shader drawing +RLAPI void EndShaderMode(void); // End custom shader drawing (use default shader) +RLAPI void BeginBlendMode(int mode); // Begin blending mode (alpha, additive, multiplied, subtract, custom) +RLAPI void EndBlendMode(void); // End blending mode (reset to default: alpha blending) +RLAPI void BeginScissorMode(int x, int y, int width, int height); // Begin scissor mode (define screen area for following drawing) +RLAPI void EndScissorMode(void); // End scissor mode +RLAPI void BeginVrStereoMode(VrStereoConfig config); // Begin stereo rendering (requires VR simulator) +RLAPI void EndVrStereoMode(void); // End stereo rendering (requires VR simulator) // VR stereo config functions for VR simulator -VrStereoConfig LoadVrStereoConfig(VrDeviceInfo device); // Load VR stereo config for VR simulator device parameters -void UnloadVrStereoConfig(VrStereoConfig config); // Unload VR stereo config +RLAPI VrStereoConfig LoadVrStereoConfig(VrDeviceInfo device); // Load VR stereo config for VR simulator device parameters +RLAPI void UnloadVrStereoConfig(VrStereoConfig config); // Unload VR stereo config // Shader management functions // NOTE: Shader functionality is not available on OpenGL 1.1 -Shader LoadShader(const char *vsFileName, const char *fsFileName); // Load shader from files and bind default locations -Shader LoadShaderFromMemory(const char *vsCode, const char *fsCode); // Load shader from code strings and bind default locations -int GetShaderLocation(Shader shader, const char *uniformName); // Get shader uniform location -int GetShaderLocationAttrib(Shader shader, const char *attribName); // Get shader attribute location -void SetShaderValue(Shader shader, int locIndex, const void *value, int uniformType); // Set shader uniform value -void SetShaderValueV(Shader shader, int locIndex, const void *value, int uniformType, int count); // Set shader uniform value vector -void SetShaderValueMatrix(Shader shader, int locIndex, Matrix mat); // Set shader uniform value (matrix 4x4) -void SetShaderValueTexture(Shader shader, int locIndex, Texture2D texture); // Set shader uniform value for texture (sampler2d) -void UnloadShader(Shader shader); // Unload shader from GPU memory (VRAM) +RLAPI Shader LoadShader(const char *vsFileName, const char *fsFileName); // Load shader from files and bind default locations +RLAPI Shader LoadShaderFromMemory(const char *vsCode, const char *fsCode); // Load shader from code strings and bind default locations +RLAPI int GetShaderLocation(Shader shader, const char *uniformName); // Get shader uniform location +RLAPI int GetShaderLocationAttrib(Shader shader, const char *attribName); // Get shader attribute location +RLAPI void SetShaderValue(Shader shader, int locIndex, const void *value, int uniformType); // Set shader uniform value +RLAPI void SetShaderValueV(Shader shader, int locIndex, const void *value, int uniformType, int count); // Set shader uniform value vector +RLAPI void SetShaderValueMatrix(Shader shader, int locIndex, Matrix mat); // Set shader uniform value (matrix 4x4) +RLAPI void SetShaderValueTexture(Shader shader, int locIndex, Texture2D texture); // Set shader uniform value for texture (sampler2d) +RLAPI void UnloadShader(Shader shader); // Unload shader from GPU memory (VRAM) // Screen-space-related functions -Ray GetMouseRay(Vector2 mousePosition, Camera camera); // Get a ray trace from mouse position -Matrix GetCameraMatrix(Camera camera); // Get camera transform matrix (view matrix) -Matrix GetCameraMatrix2D(Camera2D camera); // Get camera 2d transform matrix -Vector2 GetWorldToScreen(Vector3 position, Camera camera); // Get the screen space position for a 3d world space position -Vector2 GetWorldToScreenEx(Vector3 position, Camera camera, int width, int height); // Get size position for a 3d world space position -Vector2 GetWorldToScreen2D(Vector2 position, Camera2D camera); // Get the screen space position for a 2d camera world space position -Vector2 GetScreenToWorld2D(Vector2 position, Camera2D camera); // Get the world space position for a 2d camera screen space position +RLAPI Ray GetMouseRay(Vector2 mousePosition, Camera camera); // Get a ray trace from mouse position +RLAPI Matrix GetCameraMatrix(Camera camera); // Get camera transform matrix (view matrix) +RLAPI Matrix GetCameraMatrix2D(Camera2D camera); // Get camera 2d transform matrix +RLAPI Vector2 GetWorldToScreen(Vector3 position, Camera camera); // Get the screen space position for a 3d world space position +RLAPI Vector2 GetWorldToScreenEx(Vector3 position, Camera camera, int width, int height); // Get size position for a 3d world space position +RLAPI Vector2 GetWorldToScreen2D(Vector2 position, Camera2D camera); // Get the screen space position for a 2d camera world space position +RLAPI Vector2 GetScreenToWorld2D(Vector2 position, Camera2D camera); // Get the world space position for a 2d camera screen space position // Timing-related functions -void SetTargetFPS(int fps); // Set target FPS (maximum) -int GetFPS(void); // Get current FPS -float GetFrameTime(void); // Get time in seconds for last frame drawn (delta time) -double GetTime(void); // Get elapsed time in seconds since InitWindow() +RLAPI void SetTargetFPS(int fps); // Set target FPS (maximum) +RLAPI int GetFPS(void); // Get current FPS +RLAPI float GetFrameTime(void); // Get time in seconds for last frame drawn (delta time) +RLAPI double GetTime(void); // Get elapsed time in seconds since InitWindow() // Misc. functions -int GetRandomValue(int min, int max); // Get a random value between min and max (both included) -void SetRandomSeed(unsigned int seed); // Set the seed for the random number generator -void TakeScreenshot(const char *fileName); // Takes a screenshot of current screen (filename extension defines format) -void SetConfigFlags(unsigned int flags); // Setup init configuration flags (view FLAGS) +RLAPI int GetRandomValue(int min, int max); // Get a random value between min and max (both included) +RLAPI void SetRandomSeed(unsigned int seed); // Set the seed for the random number generator +RLAPI void TakeScreenshot(const char *fileName); // Takes a screenshot of current screen (filename extension defines format) +RLAPI void SetConfigFlags(unsigned int flags); // Setup init configuration flags (view FLAGS) -void TraceLog(int logLevel, const char *text, ...); // Show trace log messages (LOG_DEBUG, LOG_INFO, LOG_WARNING, LOG_ERROR...) -void SetTraceLogLevel(int logLevel); // Set the current threshold (minimum) log level -void *MemAlloc(int size); // Internal memory allocator -void *MemRealloc(void *ptr, int size); // Internal memory reallocator -void MemFree(void *ptr); // Internal memory free +RLAPI void TraceLog(int logLevel, const char *text, ...); // Show trace log messages (LOG_DEBUG, LOG_INFO, LOG_WARNING, LOG_ERROR...) +RLAPI void SetTraceLogLevel(int logLevel); // Set the current threshold (minimum) log level +RLAPI void *MemAlloc(int size); // Internal memory allocator +RLAPI void *MemRealloc(void *ptr, int size); // Internal memory reallocator +RLAPI void MemFree(void *ptr); // Internal memory free // Set custom callbacks // WARNING: Callbacks setup is intended for advance users -void SetTraceLogCallback(TraceLogCallback callback); // Set custom trace log -void SetLoadFileDataCallback(LoadFileDataCallback callback); // Set custom file binary data loader -void SetSaveFileDataCallback(SaveFileDataCallback callback); // Set custom file binary data saver -void SetLoadFileTextCallback(LoadFileTextCallback callback); // Set custom file text data loader -void SetSaveFileTextCallback(SaveFileTextCallback callback); // Set custom file text data saver +RLAPI void SetTraceLogCallback(TraceLogCallback callback); // Set custom trace log +RLAPI void SetLoadFileDataCallback(LoadFileDataCallback callback); // Set custom file binary data loader +RLAPI void SetSaveFileDataCallback(SaveFileDataCallback callback); // Set custom file binary data saver +RLAPI void SetLoadFileTextCallback(LoadFileTextCallback callback); // Set custom file text data loader +RLAPI void SetSaveFileTextCallback(SaveFileTextCallback callback); // Set custom file text data saver // Files management functions -unsigned char *LoadFileData(const char *fileName, unsigned int *bytesRead); // Load file data as byte array (read) -void UnloadFileData(unsigned char *data); // Unload file data allocated by LoadFileData() -bool SaveFileData(const char *fileName, void *data, unsigned int bytesToWrite); // Save data to file from byte array (write), returns true on success -char *LoadFileText(const char *fileName); // Load text data from file (read), returns a '\0' terminated string -void UnloadFileText(char *text); // Unload file text data allocated by LoadFileText() -bool SaveFileText(const char *fileName, char *text); // Save text data to file (write), string must be '\0' terminated, returns true on success -bool FileExists(const char *fileName); // Check if file exists -bool DirectoryExists(const char *dirPath); // Check if a directory path exists -bool IsFileExtension(const char *fileName, const char *ext); // Check file extension (including point: .png, .wav) -const char *GetFileExtension(const char *fileName); // Get pointer to extension for a filename string (includes dot: '.png') -const char *GetFileName(const char *filePath); // Get pointer to filename for a path string -const char *GetFileNameWithoutExt(const char *filePath); // Get filename string without extension (uses static string) -const char *GetDirectoryPath(const char *filePath); // Get full path for a given fileName with path (uses static string) -const char *GetPrevDirectoryPath(const char *dirPath); // Get previous directory path for a given path (uses static string) -const char *GetWorkingDirectory(void); // Get current working directory (uses static string) -char **GetDirectoryFiles(const char *dirPath, int *count); // Get filenames in a directory path (memory should be freed) -void ClearDirectoryFiles(void); // Clear directory files paths buffers (free memory) -bool ChangeDirectory(const char *dir); // Change working directory, return true on success -bool IsFileDropped(void); // Check if a file has been dropped into window -char **GetDroppedFiles(int *count); // Get dropped files names (memory should be freed) -void ClearDroppedFiles(void); // Clear dropped files paths buffer (free memory) -long GetFileModTime(const char *fileName); // Get file modification time (last write time) +RLAPI unsigned char *LoadFileData(const char *fileName, unsigned int *bytesRead); // Load file data as byte array (read) +RLAPI void UnloadFileData(unsigned char *data); // Unload file data allocated by LoadFileData() +RLAPI bool SaveFileData(const char *fileName, void *data, unsigned int bytesToWrite); // Save data to file from byte array (write), returns true on success +RLAPI char *LoadFileText(const char *fileName); // Load text data from file (read), returns a '\0' terminated string +RLAPI void UnloadFileText(char *text); // Unload file text data allocated by LoadFileText() +RLAPI bool SaveFileText(const char *fileName, char *text); // Save text data to file (write), string must be '\0' terminated, returns true on success +RLAPI bool FileExists(const char *fileName); // Check if file exists +RLAPI bool DirectoryExists(const char *dirPath); // Check if a directory path exists +RLAPI bool IsFileExtension(const char *fileName, const char *ext); // Check file extension (including point: .png, .wav) +RLAPI int GetFileLength(const char *fileName); // Get file length in bytes (NOTE: GetFileSize() conflicts with windows.h) +RLAPI const char *GetFileExtension(const char *fileName); // Get pointer to extension for a filename string (includes dot: '.png') +RLAPI const char *GetFileName(const char *filePath); // Get pointer to filename for a path string +RLAPI const char *GetFileNameWithoutExt(const char *filePath); // Get filename string without extension (uses static string) +RLAPI const char *GetDirectoryPath(const char *filePath); // Get full path for a given fileName with path (uses static string) +RLAPI const char *GetPrevDirectoryPath(const char *dirPath); // Get previous directory path for a given path (uses static string) +RLAPI const char *GetWorkingDirectory(void); // Get current working directory (uses static string) +RLAPI const char *GetApplicationDirectory(void); // Get the directory if the running application (uses static string) +RLAPI char **GetDirectoryFiles(const char *dirPath, int *count); // Get filenames in a directory path (memory should be freed) +RLAPI void ClearDirectoryFiles(void); // Clear directory files paths buffers (free memory) +RLAPI bool ChangeDirectory(const char *dir); // Change working directory, return true on success +RLAPI bool IsFileDropped(void); // Check if a file has been dropped into window +RLAPI char **GetDroppedFiles(int *count); // Get dropped files names (memory should be freed) +RLAPI void ClearDroppedFiles(void); // Clear dropped files paths buffer (free memory) +RLAPI long GetFileModTime(const char *fileName); // Get file modification time (last write time) // Compression/Encoding functionality -unsigned char *CompressData(unsigned char *data, int dataLength, int *compDataLength); // Compress data (DEFLATE algorithm) -unsigned char *DecompressData(unsigned char *compData, int compDataLength, int *dataLength); // Decompress data (DEFLATE algorithm) -char *EncodeDataBase64(const unsigned char *data, int dataLength, int *outputLength); // Encode data to Base64 string -unsigned char *DecodeDataBase64(unsigned char *data, int *outputLength); // Decode Base64 string data +RLAPI unsigned char *CompressData(const unsigned char *data, int dataLength, int *compDataLength); // Compress data (DEFLATE algorithm) +RLAPI unsigned char *DecompressData(const unsigned char *compData, int compDataLength, int *dataLength); // Decompress data (DEFLATE algorithm) +RLAPI char *EncodeDataBase64(const unsigned char *data, int dataLength, int *outputLength); // Encode data to Base64 string +RLAPI unsigned char *DecodeDataBase64(const unsigned char *data, int *outputLength); // Decode Base64 string data // Persistent storage management -bool SaveStorageValue(unsigned int position, int value); // Save integer value to storage file (to defined position), returns true on success -int LoadStorageValue(unsigned int position); // Load integer value from storage file (from defined position) +RLAPI bool SaveStorageValue(unsigned int position, int value); // Save integer value to storage file (to defined position), returns true on success +RLAPI int LoadStorageValue(unsigned int position); // Load integer value from storage file (from defined position) -void OpenURL(const char *url); // Open URL with default system browser (if available) +RLAPI void OpenURL(const char *url); // Open URL with default system browser (if available) //------------------------------------------------------------------------------------ // Input Handling Functions (Module: core) //------------------------------------------------------------------------------------ // Input-related functions: keyboard -bool IsKeyPressed(int key); // Check if a key has been pressed once -bool IsKeyDown(int key); // Check if a key is being pressed -bool IsKeyReleased(int key); // Check if a key has been released once -bool IsKeyUp(int key); // Check if a key is NOT being pressed -void SetExitKey(int key); // Set a custom key to exit program (default is ESC) -int GetKeyPressed(void); // Get key pressed (keycode), call it multiple times for keys queued, returns 0 when the queue is empty -int GetCharPressed(void); // Get char pressed (unicode), call it multiple times for chars queued, returns 0 when the queue is empty +RLAPI bool IsKeyPressed(int key); // Check if a key has been pressed once +RLAPI bool IsKeyDown(int key); // Check if a key is being pressed +RLAPI bool IsKeyReleased(int key); // Check if a key has been released once +RLAPI bool IsKeyUp(int key); // Check if a key is NOT being pressed +RLAPI void SetExitKey(int key); // Set a custom key to exit program (default is ESC) +RLAPI int GetKeyPressed(void); // Get key pressed (keycode), call it multiple times for keys queued, returns 0 when the queue is empty +RLAPI int GetCharPressed(void); // Get char pressed (unicode), call it multiple times for chars queued, returns 0 when the queue is empty // Input-related functions: gamepads -bool IsGamepadAvailable(int gamepad); // Check if a gamepad is available -const char *GetGamepadName(int gamepad); // Get gamepad internal name id -bool IsGamepadButtonPressed(int gamepad, int button); // Check if a gamepad button has been pressed once -bool IsGamepadButtonDown(int gamepad, int button); // Check if a gamepad button is being pressed -bool IsGamepadButtonReleased(int gamepad, int button); // Check if a gamepad button has been released once -bool IsGamepadButtonUp(int gamepad, int button); // Check if a gamepad button is NOT being pressed -int GetGamepadButtonPressed(void); // Get the last gamepad button pressed -int GetGamepadAxisCount(int gamepad); // Get gamepad axis count for a gamepad -float GetGamepadAxisMovement(int gamepad, int axis); // Get axis movement value for a gamepad axis -int SetGamepadMappings(const char *mappings); // Set internal gamepad mappings (SDL_GameControllerDB) +RLAPI bool IsGamepadAvailable(int gamepad); // Check if a gamepad is available +RLAPI const char *GetGamepadName(int gamepad); // Get gamepad internal name id +RLAPI bool IsGamepadButtonPressed(int gamepad, int button); // Check if a gamepad button has been pressed once +RLAPI bool IsGamepadButtonDown(int gamepad, int button); // Check if a gamepad button is being pressed +RLAPI bool IsGamepadButtonReleased(int gamepad, int button); // Check if a gamepad button has been released once +RLAPI bool IsGamepadButtonUp(int gamepad, int button); // Check if a gamepad button is NOT being pressed +RLAPI int GetGamepadButtonPressed(void); // Get the last gamepad button pressed +RLAPI int GetGamepadAxisCount(int gamepad); // Get gamepad axis count for a gamepad +RLAPI float GetGamepadAxisMovement(int gamepad, int axis); // Get axis movement value for a gamepad axis +RLAPI int SetGamepadMappings(const char *mappings); // Set internal gamepad mappings (SDL_GameControllerDB) // Input-related functions: mouse -bool IsMouseButtonPressed(int button); // Check if a mouse button has been pressed once -bool IsMouseButtonDown(int button); // Check if a mouse button is being pressed -bool IsMouseButtonReleased(int button); // Check if a mouse button has been released once -bool IsMouseButtonUp(int button); // Check if a mouse button is NOT being pressed -int GetMouseX(void); // Get mouse position X -int GetMouseY(void); // Get mouse position Y -Vector2 GetMousePosition(void); // Get mouse position XY -Vector2 GetMouseDelta(void); // Get mouse delta between frames -void SetMousePosition(int x, int y); // Set mouse position XY -void SetMouseOffset(int offsetX, int offsetY); // Set mouse offset -void SetMouseScale(float scaleX, float scaleY); // Set mouse scaling -float GetMouseWheelMove(void); // Get mouse wheel movement Y -void SetMouseCursor(int cursor); // Set mouse cursor +RLAPI bool IsMouseButtonPressed(int button); // Check if a mouse button has been pressed once +RLAPI bool IsMouseButtonDown(int button); // Check if a mouse button is being pressed +RLAPI bool IsMouseButtonReleased(int button); // Check if a mouse button has been released once +RLAPI bool IsMouseButtonUp(int button); // Check if a mouse button is NOT being pressed +RLAPI int GetMouseX(void); // Get mouse position X +RLAPI int GetMouseY(void); // Get mouse position Y +RLAPI Vector2 GetMousePosition(void); // Get mouse position XY +RLAPI Vector2 GetMouseDelta(void); // Get mouse delta between frames +RLAPI void SetMousePosition(int x, int y); // Set mouse position XY +RLAPI void SetMouseOffset(int offsetX, int offsetY); // Set mouse offset +RLAPI void SetMouseScale(float scaleX, float scaleY); // Set mouse scaling +RLAPI float GetMouseWheelMove(void); // Get mouse wheel movement Y +RLAPI void SetMouseCursor(int cursor); // Set mouse cursor // Input-related functions: touch -int GetTouchX(void); // Get touch position X for touch point 0 (relative to screen size) -int GetTouchY(void); // Get touch position Y for touch point 0 (relative to screen size) -Vector2 GetTouchPosition(int index); // Get touch position XY for a touch point index (relative to screen size) -int GetTouchPointId(int index); // Get touch point identifier for given index -int GetTouchPointCount(void); // Get number of touch points +RLAPI int GetTouchX(void); // Get touch position X for touch point 0 (relative to screen size) +RLAPI int GetTouchY(void); // Get touch position Y for touch point 0 (relative to screen size) +RLAPI Vector2 GetTouchPosition(int index); // Get touch position XY for a touch point index (relative to screen size) +RLAPI int GetTouchPointId(int index); // Get touch point identifier for given index +RLAPI int GetTouchPointCount(void); // Get number of touch points //------------------------------------------------------------------------------------ // Gestures and Touch Handling Functions (Module: rgestures) //------------------------------------------------------------------------------------ -void SetGesturesEnabled(unsigned int flags); // Enable a set of gestures using flags -bool IsGestureDetected(int gesture); // Check if a gesture have been detected -int GetGestureDetected(void); // Get latest detected gesture -float GetGestureHoldDuration(void); // Get gesture hold time in milliseconds -Vector2 GetGestureDragVector(void); // Get gesture drag vector -float GetGestureDragAngle(void); // Get gesture drag angle -Vector2 GetGesturePinchVector(void); // Get gesture pinch delta -float GetGesturePinchAngle(void); // Get gesture pinch angle +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 int GetGestureDetected(void); // Get latest detected gesture +RLAPI float GetGestureHoldDuration(void); // Get gesture hold time in milliseconds +RLAPI Vector2 GetGestureDragVector(void); // Get gesture drag vector +RLAPI float GetGestureDragAngle(void); // Get gesture drag angle +RLAPI Vector2 GetGesturePinchVector(void); // Get gesture pinch delta +RLAPI float GetGesturePinchAngle(void); // Get gesture pinch angle //------------------------------------------------------------------------------------ // Camera System Functions (Module: rcamera) //------------------------------------------------------------------------------------ -void SetCameraMode(Camera camera, int mode); // Set camera mode (multiple camera modes available) -void UpdateCamera(Camera *camera); // Update camera position for selected mode +RLAPI void SetCameraMode(Camera camera, int mode); // Set camera mode (multiple camera modes available) +RLAPI void UpdateCamera(Camera *camera); // Update camera position for selected mode -void SetCameraPanControl(int keyPan); // Set camera pan key to combine with mouse movement (free camera) -void SetCameraAltControl(int keyAlt); // Set camera alt key to combine with mouse movement (free camera) -void SetCameraSmoothZoomControl(int keySmoothZoom); // Set camera smooth zoom key to combine with mouse (free camera) -void SetCameraMoveControls(int keyFront, int keyBack, int keyRight, int keyLeft, int keyUp, int keyDown); // Set camera move controls (1st person and 3rd person cameras) +RLAPI void SetCameraPanControl(int keyPan); // Set camera pan key to combine with mouse movement (free camera) +RLAPI void SetCameraAltControl(int keyAlt); // Set camera alt key to combine with mouse movement (free camera) +RLAPI void SetCameraSmoothZoomControl(int keySmoothZoom); // Set camera smooth zoom key to combine with mouse (free camera) +RLAPI void SetCameraMoveControls(int keyFront, int keyBack, int keyRight, int keyLeft, int keyUp, int keyDown); // Set camera move controls (1st person and 3rd person cameras) //------------------------------------------------------------------------------------ // Basic Shapes Drawing Functions (Module: shapes) @@ -1017,57 +1146,57 @@ void SetCameraMoveControls(int keyFront, int keyBack, int keyRight, int keyLeft, // Set texture and rectangle to be used on shapes drawing // NOTE: It can be useful when using basic shapes and one single font, // defining a font char white rectangle would allow drawing everything in a single draw call -void SetShapesTexture(Texture2D texture, Rectangle source); // Set texture and rectangle to be used on shapes drawing +RLAPI void SetShapesTexture(Texture2D texture, Rectangle source); // Set texture and rectangle to be used on shapes drawing // Basic shapes drawing functions -void DrawPixel(int posX, int posY, Color color); // Draw a pixel -void DrawPixelV(Vector2 position, Color color); // Draw a pixel (Vector version) -void DrawLine(int startPosX, int startPosY, int endPosX, int endPosY, Color color); // Draw a line -void DrawLineV(Vector2 startPos, Vector2 endPos, Color color); // Draw a line (Vector version) -void DrawLineEx(Vector2 startPos, Vector2 endPos, float thick, Color color); // Draw a line defining thickness -void DrawLineBezier(Vector2 startPos, Vector2 endPos, float thick, Color color); // Draw a line using cubic-bezier curves in-out -void DrawLineBezierQuad(Vector2 startPos, Vector2 endPos, Vector2 controlPos, float thick, Color color); // Draw line using quadratic bezier curves with a control point -void DrawLineBezierCubic(Vector2 startPos, Vector2 endPos, Vector2 startControlPos, Vector2 endControlPos, float thick, Color color); // Draw line using cubic bezier curves with 2 control points -void DrawLineStrip(Vector2 *points, int pointCount, Color color); // Draw lines sequence -void DrawCircle(int centerX, int centerY, float radius, Color color); // Draw a color-filled circle -void DrawCircleSector(Vector2 center, float radius, float startAngle, float endAngle, int segments, Color color); // Draw a piece of a circle -void DrawCircleSectorLines(Vector2 center, float radius, float startAngle, float endAngle, int segments, Color color); // Draw circle sector outline -void DrawCircleGradient(int centerX, int centerY, float radius, Color color1, Color color2); // Draw a gradient-filled circle -void DrawCircleV(Vector2 center, float radius, Color color); // Draw a color-filled circle (Vector version) -void DrawCircleLines(int centerX, int centerY, float radius, Color color); // Draw circle outline -void DrawEllipse(int centerX, int centerY, float radiusH, float radiusV, Color color); // Draw ellipse -void DrawEllipseLines(int centerX, int centerY, float radiusH, float radiusV, Color color); // Draw ellipse outline -void DrawRing(Vector2 center, float innerRadius, float outerRadius, float startAngle, float endAngle, int segments, Color color); // Draw ring -void DrawRingLines(Vector2 center, float innerRadius, float outerRadius, float startAngle, float endAngle, int segments, Color color); // Draw ring outline -void DrawRectangle(int posX, int posY, int width, int height, Color color); // Draw a color-filled rectangle -void DrawRectangleV(Vector2 position, Vector2 size, Color color); // Draw a color-filled rectangle (Vector version) -void DrawRectangleRec(Rectangle rec, Color color); // Draw a color-filled rectangle -void DrawRectanglePro(Rectangle rec, Vector2 origin, float rotation, Color color); // Draw a color-filled rectangle with pro parameters -void DrawRectangleGradientV(int posX, int posY, int width, int height, Color color1, Color color2);// Draw a vertical-gradient-filled rectangle -void DrawRectangleGradientH(int posX, int posY, int width, int height, Color color1, Color color2);// Draw a horizontal-gradient-filled rectangle -void DrawRectangleGradientEx(Rectangle rec, Color col1, Color col2, Color col3, Color col4); // Draw a gradient-filled rectangle with custom vertex colors -void DrawRectangleLines(int posX, int posY, int width, int height, Color color); // Draw rectangle outline -void DrawRectangleLinesEx(Rectangle rec, float lineThick, Color color); // Draw rectangle outline with extended parameters -void DrawRectangleRounded(Rectangle rec, float roundness, int segments, Color color); // Draw rectangle with rounded edges -void DrawRectangleRoundedLines(Rectangle rec, float roundness, int segments, float lineThick, Color color); // Draw rectangle with rounded edges outline -void DrawTriangle(Vector2 v1, Vector2 v2, Vector2 v3, Color color); // Draw a color-filled triangle (vertex in counter-clockwise order!) -void DrawTriangleLines(Vector2 v1, Vector2 v2, Vector2 v3, Color color); // Draw triangle outline (vertex in counter-clockwise order!) -void DrawTriangleFan(Vector2 *points, int pointCount, Color color); // Draw a triangle fan defined by points (first vertex is the center) -void DrawTriangleStrip(Vector2 *points, int pointCount, Color color); // Draw a triangle strip defined by points -void DrawPoly(Vector2 center, int sides, float radius, float rotation, Color color); // Draw a regular polygon (Vector version) -void DrawPolyLines(Vector2 center, int sides, float radius, float rotation, Color color); // Draw a polygon outline of n sides -void DrawPolyLinesEx(Vector2 center, int sides, float radius, float rotation, float lineThick, Color color); // Draw a polygon outline of n sides with extended parameters +RLAPI void DrawPixel(int posX, int posY, Color color); // Draw a pixel +RLAPI void DrawPixelV(Vector2 position, Color color); // Draw a pixel (Vector version) +RLAPI void DrawLine(int startPosX, int startPosY, int endPosX, int endPosY, Color color); // Draw a line +RLAPI void DrawLineV(Vector2 startPos, Vector2 endPos, Color color); // Draw a line (Vector version) +RLAPI void DrawLineEx(Vector2 startPos, Vector2 endPos, float thick, Color color); // Draw a line defining thickness +RLAPI void DrawLineBezier(Vector2 startPos, Vector2 endPos, float thick, Color color); // Draw a line using cubic-bezier curves in-out +RLAPI void DrawLineBezierQuad(Vector2 startPos, Vector2 endPos, Vector2 controlPos, float thick, Color color); // Draw line using quadratic bezier curves with a control point +RLAPI void DrawLineBezierCubic(Vector2 startPos, Vector2 endPos, Vector2 startControlPos, Vector2 endControlPos, float thick, Color color); // Draw line using cubic bezier curves with 2 control points +RLAPI void DrawLineStrip(Vector2 *points, int pointCount, Color color); // Draw lines sequence +RLAPI void DrawCircle(int centerX, int centerY, float radius, Color color); // Draw a color-filled circle +RLAPI void DrawCircleSector(Vector2 center, float radius, float startAngle, float endAngle, int segments, Color color); // Draw a piece of a circle +RLAPI void DrawCircleSectorLines(Vector2 center, float radius, float startAngle, float endAngle, int segments, Color color); // Draw circle sector outline +RLAPI void DrawCircleGradient(int centerX, int centerY, float radius, Color color1, Color color2); // Draw a gradient-filled circle +RLAPI void DrawCircleV(Vector2 center, float radius, Color color); // Draw a color-filled circle (Vector version) +RLAPI void DrawCircleLines(int centerX, int centerY, float radius, Color color); // Draw circle outline +RLAPI void DrawEllipse(int centerX, int centerY, float radiusH, float radiusV, Color color); // Draw ellipse +RLAPI void DrawEllipseLines(int centerX, int centerY, float radiusH, float radiusV, Color color); // Draw ellipse outline +RLAPI void DrawRing(Vector2 center, float innerRadius, float outerRadius, float startAngle, float endAngle, int segments, Color color); // Draw ring +RLAPI void DrawRingLines(Vector2 center, float innerRadius, float outerRadius, float startAngle, float endAngle, int segments, Color color); // Draw ring outline +RLAPI void DrawRectangle(int posX, int posY, int width, int height, Color color); // Draw a color-filled rectangle +RLAPI void DrawRectangleV(Vector2 position, Vector2 size, Color color); // Draw a color-filled rectangle (Vector version) +RLAPI void DrawRectangleRec(Rectangle rec, Color color); // Draw a color-filled rectangle +RLAPI void DrawRectanglePro(Rectangle rec, Vector2 origin, float rotation, Color color); // Draw a color-filled rectangle with pro parameters +RLAPI void DrawRectangleGradientV(int posX, int posY, int width, int height, Color color1, Color color2);// Draw a vertical-gradient-filled rectangle +RLAPI void DrawRectangleGradientH(int posX, int posY, int width, int height, Color color1, Color color2);// Draw a horizontal-gradient-filled rectangle +RLAPI void DrawRectangleGradientEx(Rectangle rec, Color col1, Color col2, Color col3, Color col4); // Draw a gradient-filled rectangle with custom vertex colors +RLAPI void DrawRectangleLines(int posX, int posY, int width, int height, Color color); // Draw rectangle outline +RLAPI void DrawRectangleLinesEx(Rectangle rec, float lineThick, Color color); // Draw rectangle outline with extended parameters +RLAPI void DrawRectangleRounded(Rectangle rec, float roundness, int segments, Color color); // Draw rectangle with rounded edges +RLAPI void DrawRectangleRoundedLines(Rectangle rec, float roundness, int segments, float lineThick, Color color); // Draw rectangle with rounded edges outline +RLAPI void DrawTriangle(Vector2 v1, Vector2 v2, Vector2 v3, Color color); // Draw a color-filled triangle (vertex in counter-clockwise order!) +RLAPI void DrawTriangleLines(Vector2 v1, Vector2 v2, Vector2 v3, Color color); // Draw triangle outline (vertex in counter-clockwise order!) +RLAPI void DrawTriangleFan(Vector2 *points, int pointCount, Color color); // Draw a triangle fan defined by points (first vertex is the center) +RLAPI void DrawTriangleStrip(Vector2 *points, int pointCount, Color color); // Draw a triangle strip defined by points +RLAPI void DrawPoly(Vector2 center, int sides, float radius, float rotation, Color color); // Draw a regular polygon (Vector version) +RLAPI void DrawPolyLines(Vector2 center, int sides, float radius, float rotation, Color color); // Draw a polygon outline of n sides +RLAPI void DrawPolyLinesEx(Vector2 center, int sides, float radius, float rotation, float lineThick, Color color); // Draw a polygon outline of n sides with extended parameters // Basic shapes collision detection functions -bool CheckCollisionRecs(Rectangle rec1, Rectangle rec2); // Check collision between two rectangles -bool CheckCollisionCircles(Vector2 center1, float radius1, Vector2 center2, float radius2); // Check collision between two circles -bool CheckCollisionCircleRec(Vector2 center, float radius, Rectangle rec); // Check collision between circle and rectangle -bool CheckCollisionPointRec(Vector2 point, Rectangle rec); // Check if point is inside rectangle -bool CheckCollisionPointCircle(Vector2 point, Vector2 center, float radius); // Check if point is inside circle -bool CheckCollisionPointTriangle(Vector2 point, Vector2 p1, Vector2 p2, Vector2 p3); // Check if point is inside a triangle -bool CheckCollisionLines(Vector2 startPos1, Vector2 endPos1, Vector2 startPos2, Vector2 endPos2, Vector2 *collisionPoint); // Check the collision between two lines defined by two points each, returns collision point by reference -bool CheckCollisionPointLine(Vector2 point, Vector2 p1, Vector2 p2, int threshold); // Check if point belongs to line created between two points [p1] and [p2] with defined margin in pixels [threshold] -Rectangle GetCollisionRec(Rectangle rec1, Rectangle rec2); // Get collision rectangle for two rectangles collision +RLAPI bool CheckCollisionRecs(Rectangle rec1, Rectangle rec2); // Check collision between two rectangles +RLAPI bool CheckCollisionCircles(Vector2 center1, float radius1, Vector2 center2, float radius2); // Check collision between two circles +RLAPI bool CheckCollisionCircleRec(Vector2 center, float radius, Rectangle rec); // Check collision between circle and rectangle +RLAPI bool CheckCollisionPointRec(Vector2 point, Rectangle rec); // Check if point is inside rectangle +RLAPI bool CheckCollisionPointCircle(Vector2 point, Vector2 center, float radius); // Check if point is inside circle +RLAPI bool CheckCollisionPointTriangle(Vector2 point, Vector2 p1, Vector2 p2, Vector2 p3); // Check if point is inside a triangle +RLAPI bool CheckCollisionLines(Vector2 startPos1, Vector2 endPos1, Vector2 startPos2, Vector2 endPos2, Vector2 *collisionPoint); // Check the collision between two lines defined by two points each, returns collision point by reference +RLAPI bool CheckCollisionPointLine(Vector2 point, Vector2 p1, Vector2 p2, int threshold); // Check if point belongs to line created between two points [p1] and [p2] with defined margin in pixels [threshold] +RLAPI Rectangle GetCollisionRec(Rectangle rec1, Rectangle rec2); // Get collision rectangle for two rectangles collision //------------------------------------------------------------------------------------ // Texture Loading and Drawing Functions (Module: textures) @@ -1075,333 +1204,345 @@ Rectangle GetCollisionRec(Rectangle rec1, Rectangle rec2); // Image loading functions // NOTE: This functions do not require GPU access -Image LoadImage(const char *fileName); // Load image from file into CPU memory (RAM) -Image LoadImageRaw(const char *fileName, int width, int height, int format, int headerSize); // Load image from RAW file data -Image LoadImageAnim(const char *fileName, int *frames); // Load image sequence from file (frames appended to image.data) -Image LoadImageFromMemory(const char *fileType, const unsigned char *fileData, int dataSize); // Load image from memory buffer, fileType refers to extension: i.e. '.png' -Image LoadImageFromTexture(Texture2D texture); // Load image from GPU texture data -Image LoadImageFromScreen(void); // Load image from screen buffer and (screenshot) -void UnloadImage(Image image); // Unload image from CPU memory (RAM) -bool ExportImage(Image image, const char *fileName); // Export image data to file, returns true on success -bool ExportImageAsCode(Image image, const char *fileName); // Export image as code file defining an array of bytes, returns true on success +RLAPI Image LoadImage(const char *fileName); // Load image from file into CPU memory (RAM) +RLAPI Image LoadImageRaw(const char *fileName, int width, int height, int format, int headerSize); // Load image from RAW file data +RLAPI Image LoadImageAnim(const char *fileName, int *frames); // Load image sequence from file (frames appended to image.data) +RLAPI Image LoadImageFromMemory(const char *fileType, const unsigned char *fileData, int dataSize); // Load image from memory buffer, fileType refers to extension: i.e. '.png' +RLAPI Image LoadImageFromTexture(Texture2D texture); // Load image from GPU texture data +RLAPI Image LoadImageFromScreen(void); // Load image from screen buffer and (screenshot) +RLAPI void UnloadImage(Image image); // Unload image from CPU memory (RAM) +RLAPI bool ExportImage(Image image, const char *fileName); // Export image data to file, returns true on success +RLAPI bool ExportImageAsCode(Image image, const char *fileName); // Export image as code file defining an array of bytes, returns true on success // Image generation functions -Image GenImageColor(int width, int height, Color color); // Generate image: plain color -Image GenImageGradientV(int width, int height, Color top, Color bottom); // Generate image: vertical gradient -Image GenImageGradientH(int width, int height, Color left, Color right); // Generate image: horizontal gradient -Image GenImageGradientRadial(int width, int height, float density, Color inner, Color outer); // Generate image: radial gradient -Image GenImageChecked(int width, int height, int checksX, int checksY, Color col1, Color col2); // Generate image: checked -Image GenImageWhiteNoise(int width, int height, float factor); // Generate image: white noise -Image GenImageCellular(int width, int height, int tileSize); // Generate image: cellular algorithm, bigger tileSize means bigger cells +RLAPI Image GenImageColor(int width, int height, Color color); // Generate image: plain color +RLAPI Image GenImageGradientV(int width, int height, Color top, Color bottom); // Generate image: vertical gradient +RLAPI Image GenImageGradientH(int width, int height, Color left, Color right); // Generate image: horizontal gradient +RLAPI Image GenImageGradientRadial(int width, int height, float density, Color inner, Color outer); // Generate image: radial gradient +RLAPI Image GenImageChecked(int width, int height, int checksX, int checksY, Color col1, Color col2); // Generate image: checked +RLAPI Image GenImageWhiteNoise(int width, int height, float factor); // Generate image: white noise +RLAPI Image GenImageCellular(int width, int height, int tileSize); // Generate image: cellular algorithm, bigger tileSize means bigger cells // Image manipulation functions -Image ImageCopy(Image image); // Create an image duplicate (useful for transformations) -Image ImageFromImage(Image image, Rectangle rec); // Create an image from another image piece -Image ImageText(const char *text, int fontSize, Color color); // Create an image from text (default font) -Image ImageTextEx(Font font, const char *text, float fontSize, float spacing, Color tint); // Create an image from text (custom sprite font) -void ImageFormat(Image *image, int newFormat); // Convert image data to desired format -void ImageToPOT(Image *image, Color fill); // Convert image to POT (power-of-two) -void ImageCrop(Image *image, Rectangle crop); // Crop an image to a defined rectangle -void ImageAlphaCrop(Image *image, float threshold); // Crop image depending on alpha value -void ImageAlphaClear(Image *image, Color color, float threshold); // Clear alpha channel to desired color -void ImageAlphaMask(Image *image, Image alphaMask); // Apply alpha mask to image -void ImageAlphaPremultiply(Image *image); // Premultiply alpha channel -void ImageResize(Image *image, int newWidth, int newHeight); // Resize image (Bicubic scaling algorithm) -void ImageResizeNN(Image *image, int newWidth,int newHeight); // Resize image (Nearest-Neighbor scaling algorithm) -void ImageResizeCanvas(Image *image, int newWidth, int newHeight, int offsetX, int offsetY, Color fill); // Resize canvas and fill with color -void ImageMipmaps(Image *image); // Compute all mipmap levels for a provided image -void ImageDither(Image *image, int rBpp, int gBpp, int bBpp, int aBpp); // Dither image data to 16bpp or lower (Floyd-Steinberg dithering) -void ImageFlipVertical(Image *image); // Flip image vertically -void ImageFlipHorizontal(Image *image); // Flip image horizontally -void ImageRotateCW(Image *image); // Rotate image clockwise 90deg -void ImageRotateCCW(Image *image); // Rotate image counter-clockwise 90deg -void ImageColorTint(Image *image, Color color); // Modify image color: tint -void ImageColorInvert(Image *image); // Modify image color: invert -void ImageColorGrayscale(Image *image); // Modify image color: grayscale -void ImageColorContrast(Image *image, float contrast); // Modify image color: contrast (-100 to 100) -void ImageColorBrightness(Image *image, int brightness); // Modify image color: brightness (-255 to 255) -void ImageColorReplace(Image *image, Color color, Color replace); // Modify image color: replace color -Color *LoadImageColors(Image image); // Load color data from image as a Color array (RGBA - 32bit) -Color *LoadImagePalette(Image image, int maxPaletteSize, int *colorCount); // Load colors palette from image as a Color array (RGBA - 32bit) -void UnloadImageColors(Color *colors); // Unload color data loaded with LoadImageColors() -void UnloadImagePalette(Color *colors); // Unload colors palette loaded with LoadImagePalette() -Rectangle GetImageAlphaBorder(Image image, float threshold); // Get image alpha border rectangle -Color GetImageColor(Image image, int x, int y); // Get image pixel color at (x, y) position +RLAPI Image ImageCopy(Image image); // Create an image duplicate (useful for transformations) +RLAPI Image ImageFromImage(Image image, Rectangle rec); // Create an image from another image piece +RLAPI Image ImageText(const char *text, int fontSize, Color color); // Create an image from text (default font) +RLAPI Image ImageTextEx(Font font, const char *text, float fontSize, float spacing, Color tint); // Create an image from text (custom sprite font) +RLAPI void ImageFormat(Image *image, int newFormat); // Convert image data to desired format +RLAPI void ImageToPOT(Image *image, Color fill); // Convert image to POT (power-of-two) +RLAPI void ImageCrop(Image *image, Rectangle crop); // Crop an image to a defined rectangle +RLAPI void ImageAlphaCrop(Image *image, float threshold); // Crop image depending on alpha value +RLAPI void ImageAlphaClear(Image *image, Color color, float threshold); // Clear alpha channel to desired color +RLAPI void ImageAlphaMask(Image *image, Image alphaMask); // Apply alpha mask to image +RLAPI void ImageAlphaPremultiply(Image *image); // Premultiply alpha channel +RLAPI void ImageResize(Image *image, int newWidth, int newHeight); // Resize image (Bicubic scaling algorithm) +RLAPI void ImageResizeNN(Image *image, int newWidth,int newHeight); // Resize image (Nearest-Neighbor scaling algorithm) +RLAPI void ImageResizeCanvas(Image *image, int newWidth, int newHeight, int offsetX, int offsetY, Color fill); // Resize canvas and fill with color +RLAPI void ImageMipmaps(Image *image); // Compute all mipmap levels for a provided image +RLAPI void ImageDither(Image *image, int rBpp, int gBpp, int bBpp, int aBpp); // Dither image data to 16bpp or lower (Floyd-Steinberg dithering) +RLAPI void ImageFlipVertical(Image *image); // Flip image vertically +RLAPI void ImageFlipHorizontal(Image *image); // Flip image horizontally +RLAPI void ImageRotateCW(Image *image); // Rotate image clockwise 90deg +RLAPI void ImageRotateCCW(Image *image); // Rotate image counter-clockwise 90deg +RLAPI void ImageColorTint(Image *image, Color color); // Modify image color: tint +RLAPI void ImageColorInvert(Image *image); // Modify image color: invert +RLAPI void ImageColorGrayscale(Image *image); // Modify image color: grayscale +RLAPI void ImageColorContrast(Image *image, float contrast); // Modify image color: contrast (-100 to 100) +RLAPI void ImageColorBrightness(Image *image, int brightness); // Modify image color: brightness (-255 to 255) +RLAPI void ImageColorReplace(Image *image, Color color, Color replace); // Modify image color: replace color +RLAPI Color *LoadImageColors(Image image); // Load color data from image as a Color array (RGBA - 32bit) +RLAPI Color *LoadImagePalette(Image image, int maxPaletteSize, int *colorCount); // Load colors palette from image as a Color array (RGBA - 32bit) +RLAPI void UnloadImageColors(Color *colors); // Unload color data loaded with LoadImageColors() +RLAPI void UnloadImagePalette(Color *colors); // Unload colors palette loaded with LoadImagePalette() +RLAPI Rectangle GetImageAlphaBorder(Image image, float threshold); // Get image alpha border rectangle +RLAPI Color GetImageColor(Image image, int x, int y); // Get image pixel color at (x, y) position // Image drawing functions // NOTE: Image software-rendering functions (CPU) -void ImageClearBackground(Image *dst, Color color); // Clear image background with given color -void ImageDrawPixel(Image *dst, int posX, int posY, Color color); // Draw pixel within an image -void ImageDrawPixelV(Image *dst, Vector2 position, Color color); // Draw pixel within an image (Vector version) -void ImageDrawLine(Image *dst, int startPosX, int startPosY, int endPosX, int endPosY, Color color); // Draw line within an image -void ImageDrawLineV(Image *dst, Vector2 start, Vector2 end, Color color); // Draw line within an image (Vector version) -void ImageDrawCircle(Image *dst, int centerX, int centerY, int radius, Color color); // Draw circle within an image -void ImageDrawCircleV(Image *dst, Vector2 center, int radius, Color color); // Draw circle within an image (Vector version) -void ImageDrawRectangle(Image *dst, int posX, int posY, int width, int height, Color color); // Draw rectangle within an image -void ImageDrawRectangleV(Image *dst, Vector2 position, Vector2 size, Color color); // Draw rectangle within an image (Vector version) -void ImageDrawRectangleRec(Image *dst, Rectangle rec, Color color); // Draw rectangle within an image -void ImageDrawRectangleLines(Image *dst, Rectangle rec, int thick, Color color); // Draw rectangle lines within an image -void ImageDraw(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec, Color tint); // Draw a source image within a destination image (tint applied to source) -void ImageDrawText(Image *dst, const char *text, int posX, int posY, int fontSize, Color color); // Draw text (using default font) within an image (destination) -void ImageDrawTextEx(Image *dst, Font font, const char *text, Vector2 position, float fontSize, float spacing, Color tint); // Draw text (custom sprite font) within an image (destination) +RLAPI void ImageClearBackground(Image *dst, Color color); // Clear image background with given color +RLAPI void ImageDrawPixel(Image *dst, int posX, int posY, Color color); // Draw pixel within an image +RLAPI void ImageDrawPixelV(Image *dst, Vector2 position, Color color); // Draw pixel within an image (Vector version) +RLAPI void ImageDrawLine(Image *dst, int startPosX, int startPosY, int endPosX, int endPosY, Color color); // Draw line within an image +RLAPI void ImageDrawLineV(Image *dst, Vector2 start, Vector2 end, Color color); // Draw line within an image (Vector version) +RLAPI void ImageDrawCircle(Image *dst, int centerX, int centerY, int radius, Color color); // Draw circle within an image +RLAPI void ImageDrawCircleV(Image *dst, Vector2 center, int radius, Color color); // Draw circle within an image (Vector version) +RLAPI void ImageDrawRectangle(Image *dst, int posX, int posY, int width, int height, Color color); // Draw rectangle within an image +RLAPI void ImageDrawRectangleV(Image *dst, Vector2 position, Vector2 size, Color color); // Draw rectangle within an image (Vector version) +RLAPI void ImageDrawRectangleRec(Image *dst, Rectangle rec, Color color); // Draw rectangle within an image +RLAPI void ImageDrawRectangleLines(Image *dst, Rectangle rec, int thick, Color color); // Draw rectangle lines within an image +RLAPI void ImageDraw(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec, Color tint); // Draw a source image within a destination image (tint applied to source) +RLAPI void ImageDrawText(Image *dst, const char *text, int posX, int posY, int fontSize, Color color); // Draw text (using default font) within an image (destination) +RLAPI void ImageDrawTextEx(Image *dst, Font font, const char *text, Vector2 position, float fontSize, float spacing, Color tint); // Draw text (custom sprite font) within an image (destination) // Texture loading functions // NOTE: These functions require GPU access -Texture2D LoadTexture(const char *fileName); // Load texture from file into GPU memory (VRAM) -Texture2D LoadTextureFromImage(Image image); // Load texture from image data -TextureCubemap LoadTextureCubemap(Image image, int layout); // Load cubemap from image, multiple image cubemap layouts supported -RenderTexture2D LoadRenderTexture(int width, int height); // Load texture for rendering (framebuffer) -void UnloadTexture(Texture2D texture); // Unload texture from GPU memory (VRAM) -void UnloadRenderTexture(RenderTexture2D target); // Unload render texture from GPU memory (VRAM) -void UpdateTexture(Texture2D texture, const void *pixels); // Update GPU texture with new data -void UpdateTextureRec(Texture2D texture, Rectangle rec, const void *pixels); // Update GPU texture rectangle with new data +RLAPI Texture2D LoadTexture(const char *fileName); // Load texture from file into GPU memory (VRAM) +RLAPI Texture2D LoadTextureFromImage(Image image); // Load texture from image data +RLAPI TextureCubemap LoadTextureCubemap(Image image, int layout); // Load cubemap from image, multiple image cubemap layouts supported +RLAPI RenderTexture2D LoadRenderTexture(int width, int height); // Load texture for rendering (framebuffer) +RLAPI void UnloadTexture(Texture2D texture); // Unload texture from GPU memory (VRAM) +RLAPI void UnloadRenderTexture(RenderTexture2D target); // Unload render texture from GPU memory (VRAM) +RLAPI void UpdateTexture(Texture2D texture, const void *pixels); // Update GPU texture with new data +RLAPI void UpdateTextureRec(Texture2D texture, Rectangle rec, const void *pixels); // Update GPU texture rectangle with new data // Texture configuration functions -void GenTextureMipmaps(Texture2D *texture); // Generate GPU mipmaps for a texture -void SetTextureFilter(Texture2D texture, int filter); // Set texture scaling filter mode -void SetTextureWrap(Texture2D texture, int wrap); // Set texture wrapping mode +RLAPI void GenTextureMipmaps(Texture2D *texture); // Generate GPU mipmaps for a texture +RLAPI void SetTextureFilter(Texture2D texture, int filter); // Set texture scaling filter mode +RLAPI void SetTextureWrap(Texture2D texture, int wrap); // Set texture wrapping mode // Texture drawing functions -void DrawTexture(Texture2D texture, int posX, int posY, Color tint); // Draw a Texture2D -void DrawTextureV(Texture2D texture, Vector2 position, Color tint); // Draw a Texture2D with position defined as Vector2 -void DrawTextureEx(Texture2D texture, Vector2 position, float rotation, float scale, Color tint); // Draw a Texture2D with extended parameters -void DrawTextureRec(Texture2D texture, Rectangle source, Vector2 position, Color tint); // Draw a part of a texture defined by a rectangle -void DrawTextureQuad(Texture2D texture, Vector2 tiling, Vector2 offset, Rectangle quad, Color tint); // Draw texture quad with tiling and offset parameters -void DrawTextureTiled(Texture2D texture, Rectangle source, Rectangle dest, Vector2 origin, float rotation, float scale, Color tint); // Draw part of a texture (defined by a rectangle) with rotation and scale tiled into dest. -void DrawTexturePro(Texture2D texture, Rectangle source, Rectangle dest, Vector2 origin, float rotation, Color tint); // Draw a part of a texture defined by a rectangle with 'pro' parameters -void DrawTextureNPatch(Texture2D texture, NPatchInfo nPatchInfo, Rectangle dest, Vector2 origin, float rotation, Color tint); // Draws a texture (or part of it) that stretches or shrinks nicely -void DrawTexturePoly(Texture2D texture, Vector2 center, Vector2 *points, Vector2 *texcoords, int pointCount, Color tint); // Draw a textured polygon +RLAPI void DrawTexture(Texture2D texture, int posX, int posY, Color tint); // Draw a Texture2D +RLAPI void DrawTextureV(Texture2D texture, Vector2 position, Color tint); // Draw a Texture2D with position defined as Vector2 +RLAPI void DrawTextureEx(Texture2D texture, Vector2 position, float rotation, float scale, Color tint); // Draw a Texture2D with extended parameters +RLAPI void DrawTextureRec(Texture2D texture, Rectangle source, Vector2 position, Color tint); // Draw a part of a texture defined by a rectangle +RLAPI void DrawTextureQuad(Texture2D texture, Vector2 tiling, Vector2 offset, Rectangle quad, Color tint); // Draw texture quad with tiling and offset parameters +RLAPI void DrawTextureTiled(Texture2D texture, Rectangle source, Rectangle dest, Vector2 origin, float rotation, float scale, Color tint); // Draw part of a texture (defined by a rectangle) with rotation and scale tiled into dest. +RLAPI void DrawTexturePro(Texture2D texture, Rectangle source, Rectangle dest, Vector2 origin, float rotation, Color tint); // Draw a part of a texture defined by a rectangle with 'pro' parameters +RLAPI void DrawTextureNPatch(Texture2D texture, NPatchInfo nPatchInfo, Rectangle dest, Vector2 origin, float rotation, Color tint); // Draws a texture (or part of it) that stretches or shrinks nicely +RLAPI void DrawTexturePoly(Texture2D texture, Vector2 center, Vector2 *points, Vector2 *texcoords, int pointCount, Color tint); // Draw a textured polygon // Color/pixel related functions -Color Fade(Color color, float alpha); // Get color with alpha applied, alpha goes from 0.0f to 1.0f -int ColorToInt(Color color); // Get hexadecimal value for a Color -Vector4 ColorNormalize(Color color); // Get Color normalized as float [0..1] -Color ColorFromNormalized(Vector4 normalized); // Get Color from normalized values [0..1] -Vector3 ColorToHSV(Color color); // Get HSV values for a Color, hue [0..360], saturation/value [0..1] -Color ColorFromHSV(float hue, float saturation, float value); // Get a Color from HSV values, hue [0..360], saturation/value [0..1] -Color ColorAlpha(Color color, float alpha); // Get color with alpha applied, alpha goes from 0.0f to 1.0f -Color ColorAlphaBlend(Color dst, Color src, Color tint); // Get src alpha-blended into dst color with tint -Color GetColor(unsigned int hexValue); // Get Color structure from hexadecimal value -Color GetPixelColor(void *srcPtr, int format); // Get Color from a source pixel pointer of certain format -void SetPixelColor(void *dstPtr, Color color, int format); // Set color formatted into destination pixel pointer -int GetPixelDataSize(int width, int height, int format); // Get pixel data size in bytes for certain format +RLAPI Color Fade(Color color, float alpha); // Get color with alpha applied, alpha goes from 0.0f to 1.0f +RLAPI int ColorToInt(Color color); // Get hexadecimal value for a Color +RLAPI Vector4 ColorNormalize(Color color); // Get Color normalized as float [0..1] +RLAPI Color ColorFromNormalized(Vector4 normalized); // Get Color from normalized values [0..1] +RLAPI Vector3 ColorToHSV(Color color); // Get HSV values for a Color, hue [0..360], saturation/value [0..1] +RLAPI Color ColorFromHSV(float hue, float saturation, float value); // Get a Color from HSV values, hue [0..360], saturation/value [0..1] +RLAPI Color ColorAlpha(Color color, float alpha); // Get color with alpha applied, alpha goes from 0.0f to 1.0f +RLAPI Color ColorAlphaBlend(Color dst, Color src, Color tint); // Get src alpha-blended into dst color with tint +RLAPI Color GetColor(unsigned int hexValue); // Get Color structure from hexadecimal value +RLAPI Color GetPixelColor(void *srcPtr, int format); // Get Color from a source pixel pointer of certain format +RLAPI void SetPixelColor(void *dstPtr, Color color, int format); // Set color formatted into destination pixel pointer +RLAPI int GetPixelDataSize(int width, int height, int format); // Get pixel data size in bytes for certain format //------------------------------------------------------------------------------------ // Font Loading and Text Drawing Functions (Module: text) //------------------------------------------------------------------------------------ // Font loading/unloading functions -Font GetFontDefault(void); // Get the default Font -Font LoadFont(const char *fileName); // Load font from file into GPU memory (VRAM) -Font LoadFontEx(const char *fileName, int fontSize, int *fontChars, int glyphCount); // Load font from file with extended parameters, use NULL for fontChars and 0 for glyphCount to load the default character set -Font LoadFontFromImage(Image image, Color key, int firstChar); // Load font from Image (XNA style) -Font LoadFontFromMemory(const char *fileType, const unsigned char *fileData, int dataSize, int fontSize, int *fontChars, int glyphCount); // Load font from memory buffer, fileType refers to extension: i.e. '.ttf' -GlyphInfo *LoadFontData(const unsigned char *fileData, int dataSize, int fontSize, int *fontChars, int glyphCount, int type); // Load font data for further use -Image GenImageFontAtlas(const GlyphInfo *chars, Rectangle **recs, int glyphCount, int fontSize, int padding, int packMethod); // Generate image font atlas using chars info -void UnloadFontData(GlyphInfo *chars, int glyphCount); // Unload font chars info data (RAM) -void UnloadFont(Font font); // Unload Font from GPU memory (VRAM) +RLAPI Font GetFontDefault(void); // Get the default Font +RLAPI Font LoadFont(const char *fileName); // Load font from file into GPU memory (VRAM) +RLAPI Font LoadFontEx(const char *fileName, int fontSize, int *fontChars, int glyphCount); // Load font from file with extended parameters, use NULL for fontChars and 0 for glyphCount to load the default character set +RLAPI Font LoadFontFromImage(Image image, Color key, int firstChar); // Load font from Image (XNA style) +RLAPI Font LoadFontFromMemory(const char *fileType, const unsigned char *fileData, int dataSize, int fontSize, int *fontChars, int glyphCount); // Load font from memory buffer, fileType refers to extension: i.e. '.ttf' +RLAPI GlyphInfo *LoadFontData(const unsigned char *fileData, int dataSize, int fontSize, int *fontChars, int glyphCount, int type); // Load font data for further use +RLAPI Image GenImageFontAtlas(const GlyphInfo *chars, Rectangle **recs, int glyphCount, int fontSize, int padding, int packMethod); // Generate image font atlas using chars info +RLAPI void UnloadFontData(GlyphInfo *chars, int glyphCount); // Unload font chars info data (RAM) +RLAPI void UnloadFont(Font font); // Unload font from GPU memory (VRAM) +RLAPI bool ExportFontAsCode(Font font, const char *fileName); // Export font as code file, returns true on success + // Text drawing functions -void DrawFPS(int posX, int posY); // Draw current FPS -void DrawText(const char *text, int posX, int posY, int fontSize, Color color); // Draw text (using default font) -void DrawTextEx(Font font, const char *text, Vector2 position, float fontSize, float spacing, Color tint); // Draw text using font and additional parameters -void DrawTextPro(Font font, const char *text, Vector2 position, Vector2 origin, float rotation, float fontSize, float spacing, Color tint); // Draw text using Font and pro parameters (rotation) -void DrawTextCodepoint(Font font, int codepoint, Vector2 position, float fontSize, Color tint); // Draw one character (codepoint) +RLAPI void DrawFPS(int posX, int posY); // Draw current FPS +RLAPI void DrawText(const char *text, int posX, int posY, int fontSize, Color color); // Draw text (using default font) +RLAPI void DrawTextEx(Font font, const char *text, Vector2 position, float fontSize, float spacing, Color tint); // Draw text using font and additional parameters +RLAPI void DrawTextPro(Font font, const char *text, Vector2 position, Vector2 origin, float rotation, float fontSize, float spacing, Color tint); // Draw text using Font and pro parameters (rotation) +RLAPI void DrawTextCodepoint(Font font, int codepoint, Vector2 position, float fontSize, Color tint); // Draw one character (codepoint) +RLAPI void DrawTextCodepoints(Font font, const int *codepoints, int count, Vector2 position, float fontSize, float spacing, Color tint); // Draw multiple character (codepoint) // Text font info functions -int MeasureText(const char *text, int fontSize); // Measure string width for default font -Vector2 MeasureTextEx(Font font, const char *text, float fontSize, float spacing); // Measure string size for Font -int GetGlyphIndex(Font font, int codepoint); // Get glyph index position in font for a codepoint (unicode character), fallback to '?' if not found -GlyphInfo GetGlyphInfo(Font font, int codepoint); // Get glyph font info data for a codepoint (unicode character), fallback to '?' if not found -Rectangle GetGlyphAtlasRec(Font font, int codepoint); // Get glyph rectangle in font atlas for a codepoint (unicode character), fallback to '?' if not found +RLAPI int MeasureText(const char *text, int fontSize); // Measure string width for default font +RLAPI Vector2 MeasureTextEx(Font font, const char *text, float fontSize, float spacing); // Measure string size for Font +RLAPI int GetGlyphIndex(Font font, int codepoint); // Get glyph index position in font for a codepoint (unicode character), fallback to '?' if not found +RLAPI GlyphInfo GetGlyphInfo(Font font, int codepoint); // Get glyph font info data for a codepoint (unicode character), fallback to '?' if not found +RLAPI Rectangle GetGlyphAtlasRec(Font font, int codepoint); // Get glyph rectangle in font atlas for a codepoint (unicode character), fallback to '?' if not found // Text codepoints management functions (unicode characters) -int *LoadCodepoints(const char *text, int *count); // Load all codepoints from a UTF-8 text string, codepoints count returned by parameter -void UnloadCodepoints(int *codepoints); // Unload codepoints data from memory -int GetCodepointCount(const char *text); // Get total number of codepoints in a UTF-8 encoded string -int GetCodepoint(const char *text, int *bytesProcessed); // Get next codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure -const char *CodepointToUTF8(int codepoint, int *byteSize); // Encode one codepoint into UTF-8 byte array (array length returned as parameter) -char *TextCodepointsToUTF8(int *codepoints, int length); // Encode text as codepoints array into UTF-8 text string (WARNING: memory must be freed!) +RLAPI int *LoadCodepoints(const char *text, int *count); // Load all codepoints from a UTF-8 text string, codepoints count returned by parameter +RLAPI void UnloadCodepoints(int *codepoints); // Unload codepoints data from memory +RLAPI int GetCodepointCount(const char *text); // Get total number of codepoints in a UTF-8 encoded string +RLAPI int GetCodepoint(const char *text, int *bytesProcessed); // Get next codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure +RLAPI const char *CodepointToUTF8(int codepoint, int *byteSize); // Encode one codepoint into UTF-8 byte array (array length returned as parameter) +RLAPI char *TextCodepointsToUTF8(const int *codepoints, int length); // Encode text as codepoints array into UTF-8 text string (WARNING: memory must be freed!) // Text strings management functions (no UTF-8 strings, only byte chars) // NOTE: Some strings allocate memory internally for returned strings, just be careful! -int TextCopy(char *dst, const char *src); // Copy one string to another, returns bytes copied -bool TextIsEqual(const char *text1, const char *text2); // Check if two text string are equal -unsigned int TextLength(const char *text); // Get text length, checks for '\0' ending -const char *TextFormat(const char *text, ...); // Text formatting with variables (sprintf() style) -const char *TextSubtext(const char *text, int position, int length); // Get a piece of a text string -char *TextReplace(char *text, const char *replace, const char *by); // Replace text string (WARNING: memory must be freed!) -char *TextInsert(const char *text, const char *insert, int position); // Insert text in a position (WARNING: memory must be freed!) -const char *TextJoin(const char **textList, int count, const char *delimiter); // Join text strings with delimiter -const char **TextSplit(const char *text, char delimiter, int *count); // Split text into multiple strings -void TextAppend(char *text, const char *append, int *position); // Append text at specific position and move cursor! -int TextFindIndex(const char *text, const char *find); // Find first text occurrence within a string -const char *TextToUpper(const char *text); // Get upper case version of provided string -const char *TextToLower(const char *text); // Get lower case version of provided string -const char *TextToPascal(const char *text); // Get Pascal case notation version of provided string -int TextToInteger(const char *text); // Get integer value from text (negative values not supported) +RLAPI int TextCopy(char *dst, const char *src); // Copy one string to another, returns bytes copied +RLAPI bool TextIsEqual(const char *text1, const char *text2); // Check if two text string are equal +RLAPI unsigned int TextLength(const char *text); // Get text length, checks for '\0' ending +RLAPI const char *TextFormat(const char *text, ...); // Text formatting with variables (sprintf() style) +RLAPI const char *TextSubtext(const char *text, int position, int length); // Get a piece of a text string +RLAPI char *TextReplace(char *text, const char *replace, const char *by); // Replace text string (WARNING: memory must be freed!) +RLAPI char *TextInsert(const char *text, const char *insert, int position); // Insert text in a position (WARNING: memory must be freed!) +RLAPI const char *TextJoin(const char **textList, int count, const char *delimiter); // Join text strings with delimiter +RLAPI const char **TextSplit(const char *text, char delimiter, int *count); // Split text into multiple strings +RLAPI void TextAppend(char *text, const char *append, int *position); // Append text at specific position and move cursor! +RLAPI int TextFindIndex(const char *text, const char *find); // Find first text occurrence within a string +RLAPI const char *TextToUpper(const char *text); // Get upper case version of provided string +RLAPI const char *TextToLower(const char *text); // Get lower case version of provided string +RLAPI const char *TextToPascal(const char *text); // Get Pascal case notation version of provided string +RLAPI int TextToInteger(const char *text); // Get integer value from text (negative values not supported) //------------------------------------------------------------------------------------ // Basic 3d Shapes Drawing Functions (Module: models) //------------------------------------------------------------------------------------ // Basic geometric 3D shapes drawing functions -void DrawLine3D(Vector3 startPos, Vector3 endPos, Color color); // Draw a line in 3D world space -void DrawPoint3D(Vector3 position, Color color); // Draw a point in 3D space, actually a small line -void DrawCircle3D(Vector3 center, float radius, Vector3 rotationAxis, float rotationAngle, Color color); // Draw a circle in 3D world space -void DrawTriangle3D(Vector3 v1, Vector3 v2, Vector3 v3, Color color); // Draw a color-filled triangle (vertex in counter-clockwise order!) -void DrawTriangleStrip3D(Vector3 *points, int pointCount, Color color); // Draw a triangle strip defined by points -void DrawCube(Vector3 position, float width, float height, float length, Color color); // Draw cube -void DrawCubeV(Vector3 position, Vector3 size, Color color); // Draw cube (Vector version) -void DrawCubeWires(Vector3 position, float width, float height, float length, Color color); // Draw cube wires -void DrawCubeWiresV(Vector3 position, Vector3 size, Color color); // Draw cube wires (Vector version) -void DrawCubeTexture(Texture2D texture, Vector3 position, float width, float height, float length, Color color); // Draw cube textured -void DrawCubeTextureRec(Texture2D texture, Rectangle source, Vector3 position, float width, float height, float length, Color color); // Draw cube with a region of a texture -void DrawSphere(Vector3 centerPos, float radius, Color color); // Draw sphere -void DrawSphereEx(Vector3 centerPos, float radius, int rings, int slices, Color color); // Draw sphere with extended parameters -void DrawSphereWires(Vector3 centerPos, float radius, int rings, int slices, Color color); // Draw sphere wires -void DrawCylinder(Vector3 position, float radiusTop, float radiusBottom, float height, int slices, Color color); // Draw a cylinder/cone -void DrawCylinderEx(Vector3 startPos, Vector3 endPos, float startRadius, float endRadius, int sides, Color color); // Draw a cylinder with base at startPos and top at endPos -void DrawCylinderWires(Vector3 position, float radiusTop, float radiusBottom, float height, int slices, Color color); // Draw a cylinder/cone wires -void DrawCylinderWiresEx(Vector3 startPos, Vector3 endPos, float startRadius, float endRadius, int sides, Color color); // Draw a cylinder wires with base at startPos and top at endPos -void DrawPlane(Vector3 centerPos, Vector2 size, Color color); // Draw a plane XZ -void DrawRay(Ray ray, Color color); // Draw a ray line -void DrawGrid(int slices, float spacing); // Draw a grid (centered at (0, 0, 0)) +RLAPI void DrawLine3D(Vector3 startPos, Vector3 endPos, Color color); // Draw a line in 3D world space +RLAPI void DrawPoint3D(Vector3 position, Color color); // Draw a point in 3D space, actually a small line +RLAPI void DrawCircle3D(Vector3 center, float radius, Vector3 rotationAxis, float rotationAngle, Color color); // Draw a circle in 3D world space +RLAPI void DrawTriangle3D(Vector3 v1, Vector3 v2, Vector3 v3, Color color); // Draw a color-filled triangle (vertex in counter-clockwise order!) +RLAPI void DrawTriangleStrip3D(Vector3 *points, int pointCount, Color color); // Draw a triangle strip defined by points +RLAPI void DrawCube(Vector3 position, float width, float height, float length, Color color); // Draw cube +RLAPI void DrawCubeV(Vector3 position, Vector3 size, Color color); // Draw cube (Vector version) +RLAPI void DrawCubeWires(Vector3 position, float width, float height, float length, Color color); // Draw cube wires +RLAPI void DrawCubeWiresV(Vector3 position, Vector3 size, Color color); // Draw cube wires (Vector version) +RLAPI void DrawCubeTexture(Texture2D texture, Vector3 position, float width, float height, float length, Color color); // Draw cube textured +RLAPI void DrawCubeTextureRec(Texture2D texture, Rectangle source, Vector3 position, float width, float height, float length, Color color); // Draw cube with a region of a texture +RLAPI void DrawSphere(Vector3 centerPos, float radius, Color color); // Draw sphere +RLAPI void DrawSphereEx(Vector3 centerPos, float radius, int rings, int slices, Color color); // Draw sphere with extended parameters +RLAPI void DrawSphereWires(Vector3 centerPos, float radius, int rings, int slices, Color color); // Draw sphere wires +RLAPI void DrawCylinder(Vector3 position, float radiusTop, float radiusBottom, float height, int slices, Color color); // Draw a cylinder/cone +RLAPI void DrawCylinderEx(Vector3 startPos, Vector3 endPos, float startRadius, float endRadius, int sides, Color color); // Draw a cylinder with base at startPos and top at endPos +RLAPI void DrawCylinderWires(Vector3 position, float radiusTop, float radiusBottom, float height, int slices, Color color); // Draw a cylinder/cone wires +RLAPI void DrawCylinderWiresEx(Vector3 startPos, Vector3 endPos, float startRadius, float endRadius, int sides, Color color); // Draw a cylinder wires with base at startPos and top at endPos +RLAPI void DrawPlane(Vector3 centerPos, Vector2 size, Color color); // Draw a plane XZ +RLAPI void DrawRay(Ray ray, Color color); // Draw a ray line +RLAPI void DrawGrid(int slices, float spacing); // Draw a grid (centered at (0, 0, 0)) //------------------------------------------------------------------------------------ // Model 3d Loading and Drawing Functions (Module: models) //------------------------------------------------------------------------------------ // Model management functions -Model LoadModel(const char *fileName); // Load model from files (meshes and materials) -Model LoadModelFromMesh(Mesh mesh); // Load model from generated mesh (default material) -void UnloadModel(Model model); // Unload model (including meshes) from memory (RAM and/or VRAM) -void UnloadModelKeepMeshes(Model model); // Unload model (but not meshes) from memory (RAM and/or VRAM) -BoundingBox GetModelBoundingBox(Model model); // Compute model bounding box limits (considers all meshes) +RLAPI Model LoadModel(const char *fileName); // Load model from files (meshes and materials) +RLAPI Model LoadModelFromMesh(Mesh mesh); // Load model from generated mesh (default material) +RLAPI void UnloadModel(Model model); // Unload model (including meshes) from memory (RAM and/or VRAM) +RLAPI void UnloadModelKeepMeshes(Model model); // Unload model (but not meshes) from memory (RAM and/or VRAM) +RLAPI BoundingBox GetModelBoundingBox(Model model); // Compute model bounding box limits (considers all meshes) // Model drawing functions -void DrawModel(Model model, Vector3 position, float scale, Color tint); // Draw a model (with texture if set) -void DrawModelEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); // Draw a model with extended parameters -void DrawModelWires(Model model, Vector3 position, float scale, Color tint); // Draw a model wires (with texture if set) -void DrawModelWiresEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); // Draw a model wires (with texture if set) with extended parameters -void DrawBoundingBox(BoundingBox box, Color color); // Draw bounding box (wires) -void DrawBillboard(Camera camera, Texture2D texture, Vector3 position, float size, Color tint); // Draw a billboard texture -void DrawBillboardRec(Camera camera, Texture2D texture, Rectangle source, Vector3 position, Vector2 size, Color tint); // Draw a billboard texture defined by source -void DrawBillboardPro(Camera camera, Texture2D texture, Rectangle source, Vector3 position, Vector3 up, Vector2 size, Vector2 origin, float rotation, Color tint); // Draw a billboard texture defined by source and rotation +RLAPI void DrawModel(Model model, Vector3 position, float scale, Color tint); // Draw a model (with texture if set) +RLAPI void DrawModelEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); // Draw a model with extended parameters +RLAPI void DrawModelWires(Model model, Vector3 position, float scale, Color tint); // Draw a model wires (with texture if set) +RLAPI void DrawModelWiresEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); // Draw a model wires (with texture if set) with extended parameters +RLAPI void DrawBoundingBox(BoundingBox box, Color color); // Draw bounding box (wires) +RLAPI void DrawBillboard(Camera camera, Texture2D texture, Vector3 position, float size, Color tint); // Draw a billboard texture +RLAPI void DrawBillboardRec(Camera camera, Texture2D texture, Rectangle source, Vector3 position, Vector2 size, Color tint); // Draw a billboard texture defined by source +RLAPI void DrawBillboardPro(Camera camera, Texture2D texture, Rectangle source, Vector3 position, Vector3 up, Vector2 size, Vector2 origin, float rotation, Color tint); // Draw a billboard texture defined by source and rotation // Mesh management functions -void UploadMesh(Mesh *mesh, bool dynamic); // Upload mesh vertex data in GPU and provide VAO/VBO ids -void UpdateMeshBuffer(Mesh mesh, int index, void *data, int dataSize, int offset); // Update mesh vertex data in GPU for a specific buffer index -void UnloadMesh(Mesh mesh); // Unload mesh data from CPU and GPU -void DrawMesh(Mesh mesh, Material material, Matrix transform); // Draw a 3d mesh with material and transform -void DrawMeshInstanced(Mesh mesh, Material material, Matrix *transforms, int instances); // Draw multiple mesh instances with material and different transforms -bool ExportMesh(Mesh mesh, const char *fileName); // Export mesh data to file, returns true on success -BoundingBox GetMeshBoundingBox(Mesh mesh); // Compute mesh bounding box limits -void GenMeshTangents(Mesh *mesh); // Compute mesh tangents -void GenMeshBinormals(Mesh *mesh); // Compute mesh binormals +RLAPI void UploadMesh(Mesh *mesh, bool dynamic); // Upload mesh vertex data in GPU and provide VAO/VBO ids +RLAPI void UpdateMeshBuffer(Mesh mesh, int index, const void *data, int dataSize, int offset); // Update mesh vertex data in GPU for a specific buffer index +RLAPI void UnloadMesh(Mesh mesh); // Unload mesh data from CPU and GPU +RLAPI void DrawMesh(Mesh mesh, Material material, Matrix transform); // Draw a 3d mesh with material and transform +RLAPI void DrawMeshInstanced(Mesh mesh, Material material, const Matrix *transforms, int instances); // Draw multiple mesh instances with material and different transforms +RLAPI bool ExportMesh(Mesh mesh, const char *fileName); // Export mesh data to file, returns true on success +RLAPI BoundingBox GetMeshBoundingBox(Mesh mesh); // Compute mesh bounding box limits +RLAPI void GenMeshTangents(Mesh *mesh); // Compute mesh tangents +RLAPI void GenMeshBinormals(Mesh *mesh); // Compute mesh binormals // Mesh generation functions -Mesh GenMeshPoly(int sides, float radius); // Generate polygonal mesh -Mesh GenMeshPlane(float width, float length, int resX, int resZ); // Generate plane mesh (with subdivisions) -Mesh GenMeshCube(float width, float height, float length); // Generate cuboid mesh -Mesh GenMeshSphere(float radius, int rings, int slices); // Generate sphere mesh (standard sphere) -Mesh GenMeshHemiSphere(float radius, int rings, int slices); // Generate half-sphere mesh (no bottom cap) -Mesh GenMeshCylinder(float radius, float height, int slices); // Generate cylinder mesh -Mesh GenMeshCone(float radius, float height, int slices); // Generate cone/pyramid mesh -Mesh GenMeshTorus(float radius, float size, int radSeg, int sides); // Generate torus mesh -Mesh GenMeshKnot(float radius, float size, int radSeg, int sides); // Generate trefoil knot mesh -Mesh GenMeshHeightmap(Image heightmap, Vector3 size); // Generate heightmap mesh from image data -Mesh GenMeshCubicmap(Image cubicmap, Vector3 cubeSize); // Generate cubes-based map mesh from image data +RLAPI Mesh GenMeshPoly(int sides, float radius); // Generate polygonal mesh +RLAPI Mesh GenMeshPlane(float width, float length, int resX, int resZ); // Generate plane mesh (with subdivisions) +RLAPI Mesh GenMeshCube(float width, float height, float length); // Generate cuboid mesh +RLAPI Mesh GenMeshSphere(float radius, int rings, int slices); // Generate sphere mesh (standard sphere) +RLAPI Mesh GenMeshHemiSphere(float radius, int rings, int slices); // Generate half-sphere mesh (no bottom cap) +RLAPI Mesh GenMeshCylinder(float radius, float height, int slices); // Generate cylinder mesh +RLAPI Mesh GenMeshCone(float radius, float height, int slices); // Generate cone/pyramid mesh +RLAPI Mesh GenMeshTorus(float radius, float size, int radSeg, int sides); // Generate torus mesh +RLAPI Mesh GenMeshKnot(float radius, float size, int radSeg, int sides); // Generate trefoil knot mesh +RLAPI Mesh GenMeshHeightmap(Image heightmap, Vector3 size); // Generate heightmap mesh from image data +RLAPI Mesh GenMeshCubicmap(Image cubicmap, Vector3 cubeSize); // Generate cubes-based map mesh from image data // Material loading/unloading functions -Material *LoadMaterials(const char *fileName, int *materialCount); // Load materials from model file -Material LoadMaterialDefault(void); // Load default material (Supports: DIFFUSE, SPECULAR, NORMAL maps) -void UnloadMaterial(Material material); // Unload material from GPU memory (VRAM) -void SetMaterialTexture(Material *material, int mapType, Texture2D texture); // Set texture for a material map type (MATERIAL_MAP_DIFFUSE, MATERIAL_MAP_SPECULAR...) -void SetModelMeshMaterial(Model *model, int meshId, int materialId); // Set material for a mesh +RLAPI Material *LoadMaterials(const char *fileName, int *materialCount); // Load materials from model file +RLAPI Material LoadMaterialDefault(void); // Load default material (Supports: DIFFUSE, SPECULAR, NORMAL maps) +RLAPI void UnloadMaterial(Material material); // Unload material from GPU memory (VRAM) +RLAPI void SetMaterialTexture(Material *material, int mapType, Texture2D texture); // Set texture for a material map type (MATERIAL_MAP_DIFFUSE, MATERIAL_MAP_SPECULAR...) +RLAPI void SetModelMeshMaterial(Model *model, int meshId, int materialId); // Set material for a mesh // Model animations loading/unloading functions -ModelAnimation *LoadModelAnimations(const char *fileName, unsigned int *animCount); // Load model animations from file -void UpdateModelAnimation(Model model, ModelAnimation anim, int frame); // Update model animation pose -void UnloadModelAnimation(ModelAnimation anim); // Unload animation data -void UnloadModelAnimations(ModelAnimation* animations, unsigned int count); // Unload animation array data -bool IsModelAnimationValid(Model model, ModelAnimation anim); // Check model animation skeleton match +RLAPI ModelAnimation *LoadModelAnimations(const char *fileName, unsigned int *animCount); // Load model animations from file +RLAPI void UpdateModelAnimation(Model model, ModelAnimation anim, int frame); // Update model animation pose +RLAPI void UnloadModelAnimation(ModelAnimation anim); // Unload animation data +RLAPI void UnloadModelAnimations(ModelAnimation *animations, unsigned int count); // Unload animation array data +RLAPI bool IsModelAnimationValid(Model model, ModelAnimation anim); // Check model animation skeleton match // Collision detection functions -bool CheckCollisionSpheres(Vector3 center1, float radius1, Vector3 center2, float radius2); // Check collision between two spheres -bool CheckCollisionBoxes(BoundingBox box1, BoundingBox box2); // Check collision between two bounding boxes -bool CheckCollisionBoxSphere(BoundingBox box, Vector3 center, float radius); // Check collision between box and sphere -RayCollision GetRayCollisionSphere(Ray ray, Vector3 center, float radius); // Get collision info between ray and sphere -RayCollision GetRayCollisionBox(Ray ray, BoundingBox box); // Get collision info between ray and box -RayCollision GetRayCollisionModel(Ray ray, Model model); // Get collision info between ray and model -RayCollision GetRayCollisionMesh(Ray ray, Mesh mesh, Matrix transform); // Get collision info between ray and mesh -RayCollision GetRayCollisionTriangle(Ray ray, Vector3 p1, Vector3 p2, Vector3 p3); // Get collision info between ray and triangle -RayCollision GetRayCollisionQuad(Ray ray, Vector3 p1, Vector3 p2, Vector3 p3, Vector3 p4); // Get collision info between ray and quad +RLAPI bool CheckCollisionSpheres(Vector3 center1, float radius1, Vector3 center2, float radius2); // Check collision between two spheres +RLAPI bool CheckCollisionBoxes(BoundingBox box1, BoundingBox box2); // Check collision between two bounding boxes +RLAPI bool CheckCollisionBoxSphere(BoundingBox box, Vector3 center, float radius); // Check collision between box and sphere +RLAPI RayCollision GetRayCollisionSphere(Ray ray, Vector3 center, float radius); // Get collision info between ray and sphere +RLAPI RayCollision GetRayCollisionBox(Ray ray, BoundingBox box); // Get collision info between ray and box +RLAPI RayCollision GetRayCollisionModel(Ray ray, Model model); // Get collision info between ray and model +RLAPI RayCollision GetRayCollisionMesh(Ray ray, Mesh mesh, Matrix transform); // Get collision info between ray and mesh +RLAPI RayCollision GetRayCollisionTriangle(Ray ray, Vector3 p1, Vector3 p2, Vector3 p3); // Get collision info between ray and triangle +RLAPI RayCollision GetRayCollisionQuad(Ray ray, Vector3 p1, Vector3 p2, Vector3 p3, Vector3 p4); // Get collision info between ray and quad //------------------------------------------------------------------------------------ // Audio Loading and Playing Functions (Module: audio) //------------------------------------------------------------------------------------ // Audio device management functions -void InitAudioDevice(void); // Initialize audio device and context -void CloseAudioDevice(void); // Close the audio device and context -bool IsAudioDeviceReady(void); // Check if audio device has been initialized successfully -void SetMasterVolume(float volume); // Set master volume (listener) +RLAPI void InitAudioDevice(void); // Initialize audio device and context +RLAPI void CloseAudioDevice(void); // Close the audio device and context +RLAPI bool IsAudioDeviceReady(void); // Check if audio device has been initialized successfully +RLAPI void SetMasterVolume(float volume); // Set master volume (listener) // Wave/Sound loading/unloading functions -Wave LoadWave(const char *fileName); // Load wave data from file -Wave LoadWaveFromMemory(const char *fileType, const unsigned char *fileData, int dataSize); // Load wave from memory buffer, fileType refers to extension: i.e. '.wav' -Sound LoadSound(const char *fileName); // Load sound from file -Sound LoadSoundFromWave(Wave wave); // Load sound from wave data -void UpdateSound(Sound sound, const void *data, int sampleCount); // Update sound buffer with new data -void UnloadWave(Wave wave); // Unload wave data -void UnloadSound(Sound sound); // Unload sound -bool ExportWave(Wave wave, const char *fileName); // Export wave data to file, returns true on success -bool ExportWaveAsCode(Wave wave, const char *fileName); // Export wave sample data to code (.h), returns true on success +RLAPI Wave LoadWave(const char *fileName); // Load wave data from file +RLAPI Wave LoadWaveFromMemory(const char *fileType, const unsigned char *fileData, int dataSize); // Load wave from memory buffer, fileType refers to extension: i.e. '.wav' +RLAPI Sound LoadSound(const char *fileName); // Load sound from file +RLAPI Sound LoadSoundFromWave(Wave wave); // Load sound from wave data +RLAPI void UpdateSound(Sound sound, const void *data, int sampleCount); // Update sound buffer with new data +RLAPI void UnloadWave(Wave wave); // Unload wave data +RLAPI void UnloadSound(Sound sound); // Unload sound +RLAPI bool ExportWave(Wave wave, const char *fileName); // Export wave data to file, returns true on success +RLAPI bool ExportWaveAsCode(Wave wave, const char *fileName); // Export wave sample data to code (.h), returns true on success // Wave/Sound management functions -void PlaySound(Sound sound); // Play a sound -void StopSound(Sound sound); // Stop playing a sound -void PauseSound(Sound sound); // Pause a sound -void ResumeSound(Sound sound); // Resume a paused sound -void PlaySoundMulti(Sound sound); // Play a sound (using multichannel buffer pool) -void StopSoundMulti(void); // Stop any sound playing (using multichannel buffer pool) -int GetSoundsPlaying(void); // Get number of sounds playing in the multichannel -bool IsSoundPlaying(Sound sound); // Check if a sound is currently playing -void SetSoundVolume(Sound sound, float volume); // Set volume for a sound (1.0 is max level) -void SetSoundPitch(Sound sound, float pitch); // Set pitch for a sound (1.0 is base level) -void WaveFormat(Wave *wave, int sampleRate, int sampleSize, int channels); // Convert wave data to desired format -Wave WaveCopy(Wave wave); // Copy a wave to a new wave -void WaveCrop(Wave *wave, int initSample, int finalSample); // Crop a wave to defined samples range -float *LoadWaveSamples(Wave wave); // Load samples data from wave as a floats array -void UnloadWaveSamples(float *samples); // Unload samples data loaded with LoadWaveSamples() +RLAPI void PlaySound(Sound sound); // Play a sound +RLAPI void StopSound(Sound sound); // Stop playing a sound +RLAPI void PauseSound(Sound sound); // Pause a sound +RLAPI void ResumeSound(Sound sound); // Resume a paused sound +RLAPI void PlaySoundMulti(Sound sound); // Play a sound (using multichannel buffer pool) +RLAPI void StopSoundMulti(void); // Stop any sound playing (using multichannel buffer pool) +RLAPI int GetSoundsPlaying(void); // Get number of sounds playing in the multichannel +RLAPI bool IsSoundPlaying(Sound sound); // Check if a sound is currently playing +RLAPI void SetSoundVolume(Sound sound, float volume); // Set volume for a sound (1.0 is max level) +RLAPI void SetSoundPitch(Sound sound, float pitch); // Set pitch for a sound (1.0 is base level) +RLAPI void SetSoundPan(Sound sound, float pan); // Set pan for a sound (0.5 is center) +RLAPI Wave WaveCopy(Wave wave); // Copy a wave to a new wave +RLAPI void WaveCrop(Wave *wave, int initSample, int finalSample); // Crop a wave to defined samples range +RLAPI void WaveFormat(Wave *wave, int sampleRate, int sampleSize, int channels); // Convert wave data to desired format +RLAPI float *LoadWaveSamples(Wave wave); // Load samples data from wave as a 32bit float data array +RLAPI void UnloadWaveSamples(float *samples); // Unload samples data loaded with LoadWaveSamples() // Music management functions -Music LoadMusicStream(const char *fileName); // Load music stream from file -Music LoadMusicStreamFromMemory(const char *fileType, unsigned char *data, int dataSize); // Load music stream from data -void UnloadMusicStream(Music music); // Unload music stream -void PlayMusicStream(Music music); // Start music playing -bool IsMusicStreamPlaying(Music music); // Check if music is playing -void UpdateMusicStream(Music music); // Updates buffers for music streaming -void StopMusicStream(Music music); // Stop music playing -void PauseMusicStream(Music music); // Pause music playing -void ResumeMusicStream(Music music); // Resume playing paused music -void SeekMusicStream(Music music, float position); // Seek music to a position (in seconds) -void SetMusicVolume(Music music, float volume); // Set volume for music (1.0 is max level) -void SetMusicPitch(Music music, float pitch); // Set pitch for a music (1.0 is base level) -float GetMusicTimeLength(Music music); // Get music time length (in seconds) -float GetMusicTimePlayed(Music music); // Get current music time played (in seconds) +RLAPI Music LoadMusicStream(const char *fileName); // Load music stream from file +RLAPI Music LoadMusicStreamFromMemory(const char *fileType, const unsigned char *data, int dataSize); // Load music stream from data +RLAPI void UnloadMusicStream(Music music); // Unload music stream +RLAPI void PlayMusicStream(Music music); // Start music playing +RLAPI bool IsMusicStreamPlaying(Music music); // Check if music is playing +RLAPI void UpdateMusicStream(Music music); // Updates buffers for music streaming +RLAPI void StopMusicStream(Music music); // Stop music playing +RLAPI void PauseMusicStream(Music music); // Pause music playing +RLAPI void ResumeMusicStream(Music music); // Resume playing paused music +RLAPI void SeekMusicStream(Music music, float position); // Seek music to a position (in seconds) +RLAPI void SetMusicVolume(Music music, float volume); // Set volume for music (1.0 is max level) +RLAPI void SetMusicPitch(Music music, float pitch); // Set pitch for a music (1.0 is base level) +RLAPI void SetMusicPan(Music music, float pan); // Set pan for a music (0.5 is center) +RLAPI float GetMusicTimeLength(Music music); // Get music time length (in seconds) +RLAPI float GetMusicTimePlayed(Music music); // Get current music time played (in seconds) // AudioStream management functions -AudioStream LoadAudioStream(unsigned int sampleRate, unsigned int sampleSize, unsigned int channels); // Load audio stream (to stream raw audio pcm data) -void UnloadAudioStream(AudioStream stream); // Unload audio stream and free memory -void UpdateAudioStream(AudioStream stream, const void *data, int frameCount); // Update audio stream buffers with data -bool IsAudioStreamProcessed(AudioStream stream); // Check if any audio stream buffers requires refill -void PlayAudioStream(AudioStream stream); // Play audio stream -void PauseAudioStream(AudioStream stream); // Pause audio stream -void ResumeAudioStream(AudioStream stream); // Resume audio stream -bool IsAudioStreamPlaying(AudioStream stream); // Check if audio stream is playing -void StopAudioStream(AudioStream stream); // Stop audio stream -void SetAudioStreamVolume(AudioStream stream, float volume); // Set volume for audio stream (1.0 is max level) -void SetAudioStreamPitch(AudioStream stream, float pitch); // Set pitch for audio stream (1.0 is base level) -void SetAudioStreamBufferSizeDefault(int size); // Default size for new audio streams +RLAPI AudioStream LoadAudioStream(unsigned int sampleRate, unsigned int sampleSize, unsigned int channels); // Load audio stream (to stream raw audio pcm data) +RLAPI void UnloadAudioStream(AudioStream stream); // Unload audio stream and free memory +RLAPI void UpdateAudioStream(AudioStream stream, const void *data, int frameCount); // Update audio stream buffers with data +RLAPI bool IsAudioStreamProcessed(AudioStream stream); // Check if any audio stream buffers requires refill +RLAPI void PlayAudioStream(AudioStream stream); // Play audio stream +RLAPI void PauseAudioStream(AudioStream stream); // Pause audio stream +RLAPI void ResumeAudioStream(AudioStream stream); // Resume audio stream +RLAPI bool IsAudioStreamPlaying(AudioStream stream); // Check if audio stream is playing +RLAPI void StopAudioStream(AudioStream stream); // Stop audio stream +RLAPI void SetAudioStreamVolume(AudioStream stream, float volume); // Set volume for audio stream (1.0 is max level) +RLAPI void SetAudioStreamPitch(AudioStream stream, float pitch); // Set pitch for audio stream (1.0 is base level) +RLAPI void SetAudioStreamPan(AudioStream stream, float pan); // Set pan for audio stream (0.5 is centered) +RLAPI void SetAudioStreamBufferSizeDefault(int size); // Default size for new audio streams + +#if defined(__cplusplus) +} +#endif + +#endif // RAYLIB_H diff --git a/resources/raylib_api.json b/resources/raylib_api.json new file mode 100644 index 0000000..5f703a7 --- /dev/null +++ b/resources/raylib_api.json @@ -0,0 +1,10023 @@ +{ + "structs": [ + { + "name": "Vector2", + "description": "Vector2, 2 components", + "fields": [ + { + "type": "float", + "name": "x", + "description": "Vector x component" + }, + { + "type": "float", + "name": "y", + "description": "Vector y component" + } + ] + }, + { + "name": "Vector3", + "description": "Vector3, 3 components", + "fields": [ + { + "type": "float", + "name": "x", + "description": "Vector x component" + }, + { + "type": "float", + "name": "y", + "description": "Vector y component" + }, + { + "type": "float", + "name": "z", + "description": "Vector z component" + } + ] + }, + { + "name": "Vector4", + "description": "Vector4, 4 components", + "fields": [ + { + "type": "float", + "name": "x", + "description": "Vector x component" + }, + { + "type": "float", + "name": "y", + "description": "Vector y component" + }, + { + "type": "float", + "name": "z", + "description": "Vector z component" + }, + { + "type": "float", + "name": "w", + "description": "Vector w component" + } + ] + }, + { + "name": "Matrix", + "description": "Matrix, 4x4 components, column major, OpenGL style, right handed", + "fields": [ + { + "type": "float", + "name": "m0, m4, m8, m12", + "description": "Matrix first row (4 components)" + }, + { + "type": "float", + "name": "m1, m5, m9, m13", + "description": "Matrix second row (4 components)" + }, + { + "type": "float", + "name": "m2, m6, m10, m14", + "description": "Matrix third row (4 components)" + }, + { + "type": "float", + "name": "m3, m7, m11, m15", + "description": "Matrix fourth row (4 components)" + } + ] + }, + { + "name": "Color", + "description": "Color, 4 components, R8G8B8A8 (32bit)", + "fields": [ + { + "type": "unsigned char", + "name": "r", + "description": "Color red value" + }, + { + "type": "unsigned char", + "name": "g", + "description": "Color green value" + }, + { + "type": "unsigned char", + "name": "b", + "description": "Color blue value" + }, + { + "type": "unsigned char", + "name": "a", + "description": "Color alpha value" + } + ] + }, + { + "name": "Rectangle", + "description": "Rectangle, 4 components", + "fields": [ + { + "type": "float", + "name": "x", + "description": "Rectangle top-left corner position x" + }, + { + "type": "float", + "name": "y", + "description": "Rectangle top-left corner position y" + }, + { + "type": "float", + "name": "width", + "description": "Rectangle width" + }, + { + "type": "float", + "name": "height", + "description": "Rectangle height" + } + ] + }, + { + "name": "Image", + "description": "Image, pixel data stored in CPU memory (RAM)", + "fields": [ + { + "type": "void *", + "name": "data", + "description": "Image raw data" + }, + { + "type": "int", + "name": "width", + "description": "Image base width" + }, + { + "type": "int", + "name": "height", + "description": "Image base height" + }, + { + "type": "int", + "name": "mipmaps", + "description": "Mipmap levels, 1 by default" + }, + { + "type": "int", + "name": "format", + "description": "Data format (PixelFormat type)" + } + ] + }, + { + "name": "Texture", + "description": "Texture, tex data stored in GPU memory (VRAM)", + "fields": [ + { + "type": "unsigned int", + "name": "id", + "description": "OpenGL texture id" + }, + { + "type": "int", + "name": "width", + "description": "Texture base width" + }, + { + "type": "int", + "name": "height", + "description": "Texture base height" + }, + { + "type": "int", + "name": "mipmaps", + "description": "Mipmap levels, 1 by default" + }, + { + "type": "int", + "name": "format", + "description": "Data format (PixelFormat type)" + } + ] + }, + { + "name": "RenderTexture", + "description": "RenderTexture, fbo for texture rendering", + "fields": [ + { + "type": "unsigned int", + "name": "id", + "description": "OpenGL framebuffer object id" + }, + { + "type": "Texture", + "name": "texture", + "description": "Color buffer attachment texture" + }, + { + "type": "Texture", + "name": "depth", + "description": "Depth buffer attachment texture" + } + ] + }, + { + "name": "NPatchInfo", + "description": "NPatchInfo, n-patch layout info", + "fields": [ + { + "type": "Rectangle", + "name": "source", + "description": "Texture source rectangle" + }, + { + "type": "int", + "name": "left", + "description": "Left border offset" + }, + { + "type": "int", + "name": "top", + "description": "Top border offset" + }, + { + "type": "int", + "name": "right", + "description": "Right border offset" + }, + { + "type": "int", + "name": "bottom", + "description": "Bottom border offset" + }, + { + "type": "int", + "name": "layout", + "description": "Layout of the n-patch: 3x3, 1x3 or 3x1" + } + ] + }, + { + "name": "GlyphInfo", + "description": "GlyphInfo, font characters glyphs info", + "fields": [ + { + "type": "int", + "name": "value", + "description": "Character value (Unicode)" + }, + { + "type": "int", + "name": "offsetX", + "description": "Character offset X when drawing" + }, + { + "type": "int", + "name": "offsetY", + "description": "Character offset Y when drawing" + }, + { + "type": "int", + "name": "advanceX", + "description": "Character advance position X" + }, + { + "type": "Image", + "name": "image", + "description": "Character image data" + } + ] + }, + { + "name": "Font", + "description": "Font, font texture and GlyphInfo array data", + "fields": [ + { + "type": "int", + "name": "baseSize", + "description": "Base size (default chars height)" + }, + { + "type": "int", + "name": "glyphCount", + "description": "Number of glyph characters" + }, + { + "type": "int", + "name": "glyphPadding", + "description": "Padding around the glyph characters" + }, + { + "type": "Texture2D", + "name": "texture", + "description": "Texture atlas containing the glyphs" + }, + { + "type": "Rectangle *", + "name": "recs", + "description": "Rectangles in texture for the glyphs" + }, + { + "type": "GlyphInfo *", + "name": "glyphs", + "description": "Glyphs info data" + } + ] + }, + { + "name": "Camera3D", + "description": "Camera, defines position/orientation in 3d space", + "fields": [ + { + "type": "Vector3", + "name": "position", + "description": "Camera position" + }, + { + "type": "Vector3", + "name": "target", + "description": "Camera target it looks-at" + }, + { + "type": "Vector3", + "name": "up", + "description": "Camera up vector (rotation over its axis)" + }, + { + "type": "float", + "name": "fovy", + "description": "Camera field-of-view apperture in Y (degrees) in perspective, used as near plane width in orthographic" + }, + { + "type": "int", + "name": "projection", + "description": "Camera projection: CAMERA_PERSPECTIVE or CAMERA_ORTHOGRAPHIC" + } + ] + }, + { + "name": "Camera2D", + "description": "Camera2D, defines position/orientation in 2d space", + "fields": [ + { + "type": "Vector2", + "name": "offset", + "description": "Camera offset (displacement from target)" + }, + { + "type": "Vector2", + "name": "target", + "description": "Camera target (rotation and zoom origin)" + }, + { + "type": "float", + "name": "rotation", + "description": "Camera rotation in degrees" + }, + { + "type": "float", + "name": "zoom", + "description": "Camera zoom (scaling), should be 1.0f by default" + } + ] + }, + { + "name": "Mesh", + "description": "Mesh, vertex data and vao/vbo", + "fields": [ + { + "type": "int", + "name": "vertexCount", + "description": "Number of vertices stored in arrays" + }, + { + "type": "int", + "name": "triangleCount", + "description": "Number of triangles stored (indexed or not)" + }, + { + "type": "float *", + "name": "vertices", + "description": "Vertex position (XYZ - 3 components per vertex) (shader-location = 0)" + }, + { + "type": "float *", + "name": "texcoords", + "description": "Vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1)" + }, + { + "type": "float *", + "name": "texcoords2", + "description": "Vertex second texture coordinates (useful for lightmaps) (shader-location = 5)" + }, + { + "type": "float *", + "name": "normals", + "description": "Vertex normals (XYZ - 3 components per vertex) (shader-location = 2)" + }, + { + "type": "float *", + "name": "tangents", + "description": "Vertex tangents (XYZW - 4 components per vertex) (shader-location = 4)" + }, + { + "type": "unsigned char *", + "name": "colors", + "description": "Vertex colors (RGBA - 4 components per vertex) (shader-location = 3)" + }, + { + "type": "unsigned short *", + "name": "indices", + "description": "Vertex indices (in case vertex data comes indexed)" + }, + { + "type": "float *", + "name": "animVertices", + "description": "Animated vertex positions (after bones transformations)" + }, + { + "type": "float *", + "name": "animNormals", + "description": "Animated normals (after bones transformations)" + }, + { + "type": "unsigned char *", + "name": "boneIds", + "description": "Vertex bone ids, max 255 bone ids, up to 4 bones influence by vertex (skinning)" + }, + { + "type": "float *", + "name": "boneWeights", + "description": "Vertex bone weight, up to 4 bones influence by vertex (skinning)" + }, + { + "type": "unsigned int", + "name": "vaoId", + "description": "OpenGL Vertex Array Object id" + }, + { + "type": "unsigned int *", + "name": "vboId", + "description": "OpenGL Vertex Buffer Objects id (default vertex data)" + } + ] + }, + { + "name": "Shader", + "description": "Shader", + "fields": [ + { + "type": "unsigned int", + "name": "id", + "description": "Shader program id" + }, + { + "type": "int *", + "name": "locs", + "description": "Shader locations array (RL_MAX_SHADER_LOCATIONS)" + } + ] + }, + { + "name": "MaterialMap", + "description": "MaterialMap", + "fields": [ + { + "type": "Texture2D", + "name": "texture", + "description": "Material map texture" + }, + { + "type": "Color", + "name": "color", + "description": "Material map color" + }, + { + "type": "float", + "name": "value", + "description": "Material map value" + } + ] + }, + { + "name": "Material", + "description": "Material, includes shader and maps", + "fields": [ + { + "type": "Shader", + "name": "shader", + "description": "Material shader" + }, + { + "type": "MaterialMap *", + "name": "maps", + "description": "Material maps array (MAX_MATERIAL_MAPS)" + }, + { + "type": "float", + "name": "params[4]", + "description": "Material generic parameters (if required)" + } + ] + }, + { + "name": "Transform", + "description": "Transform, vectex transformation data", + "fields": [ + { + "type": "Vector3", + "name": "translation", + "description": "Translation" + }, + { + "type": "Quaternion", + "name": "rotation", + "description": "Rotation" + }, + { + "type": "Vector3", + "name": "scale", + "description": "Scale" + } + ] + }, + { + "name": "BoneInfo", + "description": "Bone, skeletal animation bone", + "fields": [ + { + "type": "char", + "name": "name[32]", + "description": "Bone name" + }, + { + "type": "int", + "name": "parent", + "description": "Bone parent" + } + ] + }, + { + "name": "Model", + "description": "Model, meshes, materials and animation data", + "fields": [ + { + "type": "Matrix", + "name": "transform", + "description": "Local transform matrix" + }, + { + "type": "int", + "name": "meshCount", + "description": "Number of meshes" + }, + { + "type": "int", + "name": "materialCount", + "description": "Number of materials" + }, + { + "type": "Mesh *", + "name": "meshes", + "description": "Meshes array" + }, + { + "type": "Material *", + "name": "materials", + "description": "Materials array" + }, + { + "type": "int *", + "name": "meshMaterial", + "description": "Mesh material number" + }, + { + "type": "int", + "name": "boneCount", + "description": "Number of bones" + }, + { + "type": "BoneInfo *", + "name": "bones", + "description": "Bones information (skeleton)" + }, + { + "type": "Transform *", + "name": "bindPose", + "description": "Bones base transformation (pose)" + } + ] + }, + { + "name": "ModelAnimation", + "description": "ModelAnimation", + "fields": [ + { + "type": "int", + "name": "boneCount", + "description": "Number of bones" + }, + { + "type": "int", + "name": "frameCount", + "description": "Number of animation frames" + }, + { + "type": "BoneInfo *", + "name": "bones", + "description": "Bones information (skeleton)" + }, + { + "type": "Transform **", + "name": "framePoses", + "description": "Poses array by frame" + } + ] + }, + { + "name": "Ray", + "description": "Ray, ray for raycasting", + "fields": [ + { + "type": "Vector3", + "name": "position", + "description": "Ray position (origin)" + }, + { + "type": "Vector3", + "name": "direction", + "description": "Ray direction" + } + ] + }, + { + "name": "RayCollision", + "description": "RayCollision, ray hit information", + "fields": [ + { + "type": "bool", + "name": "hit", + "description": "Did the ray hit something?" + }, + { + "type": "float", + "name": "distance", + "description": "Distance to nearest hit" + }, + { + "type": "Vector3", + "name": "point", + "description": "Point of nearest hit" + }, + { + "type": "Vector3", + "name": "normal", + "description": "Surface normal of hit" + } + ] + }, + { + "name": "BoundingBox", + "description": "BoundingBox", + "fields": [ + { + "type": "Vector3", + "name": "min", + "description": "Minimum vertex box-corner" + }, + { + "type": "Vector3", + "name": "max", + "description": "Maximum vertex box-corner" + } + ] + }, + { + "name": "Wave", + "description": "Wave, audio wave data", + "fields": [ + { + "type": "unsigned int", + "name": "frameCount", + "description": "Total number of frames (considering channels)" + }, + { + "type": "unsigned int", + "name": "sampleRate", + "description": "Frequency (samples per second)" + }, + { + "type": "unsigned int", + "name": "sampleSize", + "description": "Bit depth (bits per sample): 8, 16, 32 (24 not supported)" + }, + { + "type": "unsigned int", + "name": "channels", + "description": "Number of channels (1-mono, 2-stereo, ...)" + }, + { + "type": "void *", + "name": "data", + "description": "Buffer data pointer" + } + ] + }, + { + "name": "AudioStream", + "description": "AudioStream, custom audio stream", + "fields": [ + { + "type": "rAudioBuffer *", + "name": "buffer", + "description": "Pointer to internal data used by the audio system" + }, + { + "type": "unsigned int", + "name": "sampleRate", + "description": "Frequency (samples per second)" + }, + { + "type": "unsigned int", + "name": "sampleSize", + "description": "Bit depth (bits per sample): 8, 16, 32 (24 not supported)" + }, + { + "type": "unsigned int", + "name": "channels", + "description": "Number of channels (1-mono, 2-stereo, ...)" + } + ] + }, + { + "name": "Sound", + "description": "Sound", + "fields": [ + { + "type": "AudioStream", + "name": "stream", + "description": "Audio stream" + }, + { + "type": "unsigned int", + "name": "frameCount", + "description": "Total number of frames (considering channels)" + } + ] + }, + { + "name": "Music", + "description": "Music, audio stream, anything longer than ~10 seconds should be streamed", + "fields": [ + { + "type": "AudioStream", + "name": "stream", + "description": "Audio stream" + }, + { + "type": "unsigned int", + "name": "frameCount", + "description": "Total number of frames (considering channels)" + }, + { + "type": "bool", + "name": "looping", + "description": "Music looping enable" + }, + { + "type": "int", + "name": "ctxType", + "description": "Type of music context (audio filetype)" + }, + { + "type": "void *", + "name": "ctxData", + "description": "Audio context data, depends on type" + } + ] + }, + { + "name": "VrDeviceInfo", + "description": "VrDeviceInfo, Head-Mounted-Display device parameters", + "fields": [ + { + "type": "int", + "name": "hResolution", + "description": "Horizontal resolution in pixels" + }, + { + "type": "int", + "name": "vResolution", + "description": "Vertical resolution in pixels" + }, + { + "type": "float", + "name": "hScreenSize", + "description": "Horizontal size in meters" + }, + { + "type": "float", + "name": "vScreenSize", + "description": "Vertical size in meters" + }, + { + "type": "float", + "name": "vScreenCenter", + "description": "Screen center in meters" + }, + { + "type": "float", + "name": "eyeToScreenDistance", + "description": "Distance between eye and display in meters" + }, + { + "type": "float", + "name": "lensSeparationDistance", + "description": "Lens separation distance in meters" + }, + { + "type": "float", + "name": "interpupillaryDistance", + "description": "IPD (distance between pupils) in meters" + }, + { + "type": "float", + "name": "lensDistortionValues[4]", + "description": "Lens distortion constant parameters" + }, + { + "type": "float", + "name": "chromaAbCorrection[4]", + "description": "Chromatic aberration correction parameters" + } + ] + }, + { + "name": "VrStereoConfig", + "description": "VrStereoConfig, VR stereo rendering configuration for simulator", + "fields": [ + { + "type": "Matrix", + "name": "projection[2]", + "description": "VR projection matrices (per eye)" + }, + { + "type": "Matrix", + "name": "viewOffset[2]", + "description": "VR view offset matrices (per eye)" + }, + { + "type": "float", + "name": "leftLensCenter[2]", + "description": "VR left lens center" + }, + { + "type": "float", + "name": "rightLensCenter[2]", + "description": "VR right lens center" + }, + { + "type": "float", + "name": "leftScreenCenter[2]", + "description": "VR left screen center" + }, + { + "type": "float", + "name": "rightScreenCenter[2]", + "description": "VR right screen center" + }, + { + "type": "float", + "name": "scale[2]", + "description": "VR distortion scale" + }, + { + "type": "float", + "name": "scaleIn[2]", + "description": "VR distortion scale in" + } + ] + } + ], + "enums": [ + { + "name": "ConfigFlags", + "description": "System/Window config flags", + "values": [ + { + "name": "FLAG_VSYNC_HINT", + "value": 64, + "description": "Set to try enabling V-Sync on GPU" + }, + { + "name": "FLAG_FULLSCREEN_MODE", + "value": 2, + "description": "Set to run program in fullscreen" + }, + { + "name": "FLAG_WINDOW_RESIZABLE", + "value": 4, + "description": "Set to allow resizable window" + }, + { + "name": "FLAG_WINDOW_UNDECORATED", + "value": 8, + "description": "Set to disable window decoration (frame and buttons)" + }, + { + "name": "FLAG_WINDOW_HIDDEN", + "value": 128, + "description": "Set to hide window" + }, + { + "name": "FLAG_WINDOW_MINIMIZED", + "value": 512, + "description": "Set to minimize window (iconify)" + }, + { + "name": "FLAG_WINDOW_MAXIMIZED", + "value": 1024, + "description": "Set to maximize window (expanded to monitor)" + }, + { + "name": "FLAG_WINDOW_UNFOCUSED", + "value": 2048, + "description": "Set to window non focused" + }, + { + "name": "FLAG_WINDOW_TOPMOST", + "value": 4096, + "description": "Set to window always on top" + }, + { + "name": "FLAG_WINDOW_ALWAYS_RUN", + "value": 256, + "description": "Set to allow windows running while minimized" + }, + { + "name": "FLAG_WINDOW_TRANSPARENT", + "value": 16, + "description": "Set to allow transparent framebuffer" + }, + { + "name": "FLAG_WINDOW_HIGHDPI", + "value": 8192, + "description": "Set to support HighDPI" + }, + { + "name": "FLAG_MSAA_4X_HINT", + "value": 32, + "description": "Set to try enabling MSAA 4X" + }, + { + "name": "FLAG_INTERLACED_HINT", + "value": 65536, + "description": "Set to try enabling interlaced video format (for V3D)" + } + ] + }, + { + "name": "TraceLogLevel", + "description": "Trace log level", + "values": [ + { + "name": "LOG_ALL", + "value": 0, + "description": "Display all logs" + }, + { + "name": "LOG_TRACE", + "value": 1, + "description": "Trace logging, intended for internal use only" + }, + { + "name": "LOG_DEBUG", + "value": 2, + "description": "Debug logging, used for internal debugging, it should be disabled on release builds" + }, + { + "name": "LOG_INFO", + "value": 3, + "description": "Info logging, used for program execution info" + }, + { + "name": "LOG_WARNING", + "value": 4, + "description": "Warning logging, used on recoverable failures" + }, + { + "name": "LOG_ERROR", + "value": 5, + "description": "Error logging, used on unrecoverable failures" + }, + { + "name": "LOG_FATAL", + "value": 6, + "description": "Fatal logging, used to abort program: exit(EXIT_FAILURE)" + }, + { + "name": "LOG_NONE", + "value": 7, + "description": "Disable logging" + } + ] + }, + { + "name": "KeyboardKey", + "description": "Keyboard keys (US keyboard layout)", + "values": [ + { + "name": "KEY_NULL", + "value": 0, + "description": "Key: NULL, used for no key pressed" + }, + { + "name": "KEY_APOSTROPHE", + "value": 39, + "description": "Key: '" + }, + { + "name": "KEY_COMMA", + "value": 44, + "description": "Key: ," + }, + { + "name": "KEY_MINUS", + "value": 45, + "description": "Key: -" + }, + { + "name": "KEY_PERIOD", + "value": 46, + "description": "Key: ." + }, + { + "name": "KEY_SLASH", + "value": 47, + "description": "Key: /" + }, + { + "name": "KEY_ZERO", + "value": 48, + "description": "Key: 0" + }, + { + "name": "KEY_ONE", + "value": 49, + "description": "Key: 1" + }, + { + "name": "KEY_TWO", + "value": 50, + "description": "Key: 2" + }, + { + "name": "KEY_THREE", + "value": 51, + "description": "Key: 3" + }, + { + "name": "KEY_FOUR", + "value": 52, + "description": "Key: 4" + }, + { + "name": "KEY_FIVE", + "value": 53, + "description": "Key: 5" + }, + { + "name": "KEY_SIX", + "value": 54, + "description": "Key: 6" + }, + { + "name": "KEY_SEVEN", + "value": 55, + "description": "Key: 7" + }, + { + "name": "KEY_EIGHT", + "value": 56, + "description": "Key: 8" + }, + { + "name": "KEY_NINE", + "value": 57, + "description": "Key: 9" + }, + { + "name": "KEY_SEMICOLON", + "value": 59, + "description": "Key: ;" + }, + { + "name": "KEY_EQUAL", + "value": 61, + "description": "Key: =" + }, + { + "name": "KEY_A", + "value": 65, + "description": "Key: A | a" + }, + { + "name": "KEY_B", + "value": 66, + "description": "Key: B | b" + }, + { + "name": "KEY_C", + "value": 67, + "description": "Key: C | c" + }, + { + "name": "KEY_D", + "value": 68, + "description": "Key: D | d" + }, + { + "name": "KEY_E", + "value": 69, + "description": "Key: E | e" + }, + { + "name": "KEY_F", + "value": 70, + "description": "Key: F | f" + }, + { + "name": "KEY_G", + "value": 71, + "description": "Key: G | g" + }, + { + "name": "KEY_H", + "value": 72, + "description": "Key: H | h" + }, + { + "name": "KEY_I", + "value": 73, + "description": "Key: I | i" + }, + { + "name": "KEY_J", + "value": 74, + "description": "Key: J | j" + }, + { + "name": "KEY_K", + "value": 75, + "description": "Key: K | k" + }, + { + "name": "KEY_L", + "value": 76, + "description": "Key: L | l" + }, + { + "name": "KEY_M", + "value": 77, + "description": "Key: M | m" + }, + { + "name": "KEY_N", + "value": 78, + "description": "Key: N | n" + }, + { + "name": "KEY_O", + "value": 79, + "description": "Key: O | o" + }, + { + "name": "KEY_P", + "value": 80, + "description": "Key: P | p" + }, + { + "name": "KEY_Q", + "value": 81, + "description": "Key: Q | q" + }, + { + "name": "KEY_R", + "value": 82, + "description": "Key: R | r" + }, + { + "name": "KEY_S", + "value": 83, + "description": "Key: S | s" + }, + { + "name": "KEY_T", + "value": 84, + "description": "Key: T | t" + }, + { + "name": "KEY_U", + "value": 85, + "description": "Key: U | u" + }, + { + "name": "KEY_V", + "value": 86, + "description": "Key: V | v" + }, + { + "name": "KEY_W", + "value": 87, + "description": "Key: W | w" + }, + { + "name": "KEY_X", + "value": 88, + "description": "Key: X | x" + }, + { + "name": "KEY_Y", + "value": 89, + "description": "Key: Y | y" + }, + { + "name": "KEY_Z", + "value": 90, + "description": "Key: Z | z" + }, + { + "name": "KEY_LEFT_BRACKET", + "value": 91, + "description": "Key: [" + }, + { + "name": "KEY_BACKSLASH", + "value": 92, + "description": "Key: '\\'" + }, + { + "name": "KEY_RIGHT_BRACKET", + "value": 93, + "description": "Key: ]" + }, + { + "name": "KEY_GRAVE", + "value": 96, + "description": "Key: `" + }, + { + "name": "KEY_SPACE", + "value": 32, + "description": "Key: Space" + }, + { + "name": "KEY_ESCAPE", + "value": 256, + "description": "Key: Esc" + }, + { + "name": "KEY_ENTER", + "value": 257, + "description": "Key: Enter" + }, + { + "name": "KEY_TAB", + "value": 258, + "description": "Key: Tab" + }, + { + "name": "KEY_BACKSPACE", + "value": 259, + "description": "Key: Backspace" + }, + { + "name": "KEY_INSERT", + "value": 260, + "description": "Key: Ins" + }, + { + "name": "KEY_DELETE", + "value": 261, + "description": "Key: Del" + }, + { + "name": "KEY_RIGHT", + "value": 262, + "description": "Key: Cursor right" + }, + { + "name": "KEY_LEFT", + "value": 263, + "description": "Key: Cursor left" + }, + { + "name": "KEY_DOWN", + "value": 264, + "description": "Key: Cursor down" + }, + { + "name": "KEY_UP", + "value": 265, + "description": "Key: Cursor up" + }, + { + "name": "KEY_PAGE_UP", + "value": 266, + "description": "Key: Page up" + }, + { + "name": "KEY_PAGE_DOWN", + "value": 267, + "description": "Key: Page down" + }, + { + "name": "KEY_HOME", + "value": 268, + "description": "Key: Home" + }, + { + "name": "KEY_END", + "value": 269, + "description": "Key: End" + }, + { + "name": "KEY_CAPS_LOCK", + "value": 280, + "description": "Key: Caps lock" + }, + { + "name": "KEY_SCROLL_LOCK", + "value": 281, + "description": "Key: Scroll down" + }, + { + "name": "KEY_NUM_LOCK", + "value": 282, + "description": "Key: Num lock" + }, + { + "name": "KEY_PRINT_SCREEN", + "value": 283, + "description": "Key: Print screen" + }, + { + "name": "KEY_PAUSE", + "value": 284, + "description": "Key: Pause" + }, + { + "name": "KEY_F1", + "value": 290, + "description": "Key: F1" + }, + { + "name": "KEY_F2", + "value": 291, + "description": "Key: F2" + }, + { + "name": "KEY_F3", + "value": 292, + "description": "Key: F3" + }, + { + "name": "KEY_F4", + "value": 293, + "description": "Key: F4" + }, + { + "name": "KEY_F5", + "value": 294, + "description": "Key: F5" + }, + { + "name": "KEY_F6", + "value": 295, + "description": "Key: F6" + }, + { + "name": "KEY_F7", + "value": 296, + "description": "Key: F7" + }, + { + "name": "KEY_F8", + "value": 297, + "description": "Key: F8" + }, + { + "name": "KEY_F9", + "value": 298, + "description": "Key: F9" + }, + { + "name": "KEY_F10", + "value": 299, + "description": "Key: F10" + }, + { + "name": "KEY_F11", + "value": 300, + "description": "Key: F11" + }, + { + "name": "KEY_F12", + "value": 301, + "description": "Key: F12" + }, + { + "name": "KEY_LEFT_SHIFT", + "value": 340, + "description": "Key: Shift left" + }, + { + "name": "KEY_LEFT_CONTROL", + "value": 341, + "description": "Key: Control left" + }, + { + "name": "KEY_LEFT_ALT", + "value": 342, + "description": "Key: Alt left" + }, + { + "name": "KEY_LEFT_SUPER", + "value": 343, + "description": "Key: Super left" + }, + { + "name": "KEY_RIGHT_SHIFT", + "value": 344, + "description": "Key: Shift right" + }, + { + "name": "KEY_RIGHT_CONTROL", + "value": 345, + "description": "Key: Control right" + }, + { + "name": "KEY_RIGHT_ALT", + "value": 346, + "description": "Key: Alt right" + }, + { + "name": "KEY_RIGHT_SUPER", + "value": 347, + "description": "Key: Super right" + }, + { + "name": "KEY_KB_MENU", + "value": 348, + "description": "Key: KB menu" + }, + { + "name": "KEY_KP_0", + "value": 320, + "description": "Key: Keypad 0" + }, + { + "name": "KEY_KP_1", + "value": 321, + "description": "Key: Keypad 1" + }, + { + "name": "KEY_KP_2", + "value": 322, + "description": "Key: Keypad 2" + }, + { + "name": "KEY_KP_3", + "value": 323, + "description": "Key: Keypad 3" + }, + { + "name": "KEY_KP_4", + "value": 324, + "description": "Key: Keypad 4" + }, + { + "name": "KEY_KP_5", + "value": 325, + "description": "Key: Keypad 5" + }, + { + "name": "KEY_KP_6", + "value": 326, + "description": "Key: Keypad 6" + }, + { + "name": "KEY_KP_7", + "value": 327, + "description": "Key: Keypad 7" + }, + { + "name": "KEY_KP_8", + "value": 328, + "description": "Key: Keypad 8" + }, + { + "name": "KEY_KP_9", + "value": 329, + "description": "Key: Keypad 9" + }, + { + "name": "KEY_KP_DECIMAL", + "value": 330, + "description": "Key: Keypad ." + }, + { + "name": "KEY_KP_DIVIDE", + "value": 331, + "description": "Key: Keypad /" + }, + { + "name": "KEY_KP_MULTIPLY", + "value": 332, + "description": "Key: Keypad *" + }, + { + "name": "KEY_KP_SUBTRACT", + "value": 333, + "description": "Key: Keypad -" + }, + { + "name": "KEY_KP_ADD", + "value": 334, + "description": "Key: Keypad +" + }, + { + "name": "KEY_KP_ENTER", + "value": 335, + "description": "Key: Keypad Enter" + }, + { + "name": "KEY_KP_EQUAL", + "value": 336, + "description": "Key: Keypad =" + }, + { + "name": "KEY_BACK", + "value": 4, + "description": "Key: Android back button" + }, + { + "name": "KEY_MENU", + "value": 82, + "description": "Key: Android menu button" + }, + { + "name": "KEY_VOLUME_UP", + "value": 24, + "description": "Key: Android volume up button" + }, + { + "name": "KEY_VOLUME_DOWN", + "value": 25, + "description": "Key: Android volume down button" + } + ] + }, + { + "name": "MouseButton", + "description": "Mouse buttons", + "values": [ + { + "name": "MOUSE_BUTTON_LEFT", + "value": 0, + "description": "Mouse button left" + }, + { + "name": "MOUSE_BUTTON_RIGHT", + "value": 1, + "description": "Mouse button right" + }, + { + "name": "MOUSE_BUTTON_MIDDLE", + "value": 2, + "description": "Mouse button middle (pressed wheel)" + }, + { + "name": "MOUSE_BUTTON_SIDE", + "value": 3, + "description": "Mouse button side (advanced mouse device)" + }, + { + "name": "MOUSE_BUTTON_EXTRA", + "value": 4, + "description": "Mouse button extra (advanced mouse device)" + }, + { + "name": "MOUSE_BUTTON_FORWARD", + "value": 5, + "description": "Mouse button fordward (advanced mouse device)" + }, + { + "name": "MOUSE_BUTTON_BACK", + "value": 6, + "description": "Mouse button back (advanced mouse device)" + } + ] + }, + { + "name": "MouseCursor", + "description": "Mouse cursor", + "values": [ + { + "name": "MOUSE_CURSOR_DEFAULT", + "value": 0, + "description": "Default pointer shape" + }, + { + "name": "MOUSE_CURSOR_ARROW", + "value": 1, + "description": "Arrow shape" + }, + { + "name": "MOUSE_CURSOR_IBEAM", + "value": 2, + "description": "Text writing cursor shape" + }, + { + "name": "MOUSE_CURSOR_CROSSHAIR", + "value": 3, + "description": "Cross shape" + }, + { + "name": "MOUSE_CURSOR_POINTING_HAND", + "value": 4, + "description": "Pointing hand cursor" + }, + { + "name": "MOUSE_CURSOR_RESIZE_EW", + "value": 5, + "description": "Horizontal resize/move arrow shape" + }, + { + "name": "MOUSE_CURSOR_RESIZE_NS", + "value": 6, + "description": "Vertical resize/move arrow shape" + }, + { + "name": "MOUSE_CURSOR_RESIZE_NWSE", + "value": 7, + "description": "Top-left to bottom-right diagonal resize/move arrow shape" + }, + { + "name": "MOUSE_CURSOR_RESIZE_NESW", + "value": 8, + "description": "The top-right to bottom-left diagonal resize/move arrow shape" + }, + { + "name": "MOUSE_CURSOR_RESIZE_ALL", + "value": 9, + "description": "The omni-directional resize/move cursor shape" + }, + { + "name": "MOUSE_CURSOR_NOT_ALLOWED", + "value": 10, + "description": "The operation-not-allowed shape" + } + ] + }, + { + "name": "GamepadButton", + "description": "Gamepad buttons", + "values": [ + { + "name": "GAMEPAD_BUTTON_UNKNOWN", + "value": 0, + "description": "Unknown button, just for error checking" + }, + { + "name": "GAMEPAD_BUTTON_LEFT_FACE_UP", + "value": 1, + "description": "Gamepad left DPAD up button" + }, + { + "name": "GAMEPAD_BUTTON_LEFT_FACE_RIGHT", + "value": 2, + "description": "Gamepad left DPAD right button" + }, + { + "name": "GAMEPAD_BUTTON_LEFT_FACE_DOWN", + "value": 3, + "description": "Gamepad left DPAD down button" + }, + { + "name": "GAMEPAD_BUTTON_LEFT_FACE_LEFT", + "value": 4, + "description": "Gamepad left DPAD left button" + }, + { + "name": "GAMEPAD_BUTTON_RIGHT_FACE_UP", + "value": 5, + "description": "Gamepad right button up (i.e. PS3: Triangle, Xbox: Y)" + }, + { + "name": "GAMEPAD_BUTTON_RIGHT_FACE_RIGHT", + "value": 6, + "description": "Gamepad right button right (i.e. PS3: Square, Xbox: X)" + }, + { + "name": "GAMEPAD_BUTTON_RIGHT_FACE_DOWN", + "value": 7, + "description": "Gamepad right button down (i.e. PS3: Cross, Xbox: A)" + }, + { + "name": "GAMEPAD_BUTTON_RIGHT_FACE_LEFT", + "value": 8, + "description": "Gamepad right button left (i.e. PS3: Circle, Xbox: B)" + }, + { + "name": "GAMEPAD_BUTTON_LEFT_TRIGGER_1", + "value": 9, + "description": "Gamepad top/back trigger left (first), it could be a trailing button" + }, + { + "name": "GAMEPAD_BUTTON_LEFT_TRIGGER_2", + "value": 10, + "description": "Gamepad top/back trigger left (second), it could be a trailing button" + }, + { + "name": "GAMEPAD_BUTTON_RIGHT_TRIGGER_1", + "value": 11, + "description": "Gamepad top/back trigger right (one), it could be a trailing button" + }, + { + "name": "GAMEPAD_BUTTON_RIGHT_TRIGGER_2", + "value": 12, + "description": "Gamepad top/back trigger right (second), it could be a trailing button" + }, + { + "name": "GAMEPAD_BUTTON_MIDDLE_LEFT", + "value": 13, + "description": "Gamepad center buttons, left one (i.e. PS3: Select)" + }, + { + "name": "GAMEPAD_BUTTON_MIDDLE", + "value": 14, + "description": "Gamepad center buttons, middle one (i.e. PS3: PS, Xbox: XBOX)" + }, + { + "name": "GAMEPAD_BUTTON_MIDDLE_RIGHT", + "value": 15, + "description": "Gamepad center buttons, right one (i.e. PS3: Start)" + }, + { + "name": "GAMEPAD_BUTTON_LEFT_THUMB", + "value": 16, + "description": "Gamepad joystick pressed button left" + }, + { + "name": "GAMEPAD_BUTTON_RIGHT_THUMB", + "value": 17, + "description": "Gamepad joystick pressed button right" + } + ] + }, + { + "name": "GamepadAxis", + "description": "Gamepad axis", + "values": [ + { + "name": "GAMEPAD_AXIS_LEFT_X", + "value": 0, + "description": "Gamepad left stick X axis" + }, + { + "name": "GAMEPAD_AXIS_LEFT_Y", + "value": 1, + "description": "Gamepad left stick Y axis" + }, + { + "name": "GAMEPAD_AXIS_RIGHT_X", + "value": 2, + "description": "Gamepad right stick X axis" + }, + { + "name": "GAMEPAD_AXIS_RIGHT_Y", + "value": 3, + "description": "Gamepad right stick Y axis" + }, + { + "name": "GAMEPAD_AXIS_LEFT_TRIGGER", + "value": 4, + "description": "Gamepad back trigger left, pressure level: [1..-1]" + }, + { + "name": "GAMEPAD_AXIS_RIGHT_TRIGGER", + "value": 5, + "description": "Gamepad back trigger right, pressure level: [1..-1]" + } + ] + }, + { + "name": "MaterialMapIndex", + "description": "Material map index", + "values": [ + { + "name": "MATERIAL_MAP_ALBEDO", + "value": 0, + "description": "Albedo material (same as: MATERIAL_MAP_DIFFUSE)" + }, + { + "name": "MATERIAL_MAP_METALNESS", + "value": 1, + "description": "Metalness material (same as: MATERIAL_MAP_SPECULAR)" + }, + { + "name": "MATERIAL_MAP_NORMAL", + "value": 2, + "description": "Normal material" + }, + { + "name": "MATERIAL_MAP_ROUGHNESS", + "value": 3, + "description": "Roughness material" + }, + { + "name": "MATERIAL_MAP_OCCLUSION", + "value": 4, + "description": "Ambient occlusion material" + }, + { + "name": "MATERIAL_MAP_EMISSION", + "value": 5, + "description": "Emission material" + }, + { + "name": "MATERIAL_MAP_HEIGHT", + "value": 6, + "description": "Heightmap material" + }, + { + "name": "MATERIAL_MAP_CUBEMAP", + "value": 7, + "description": "Cubemap material (NOTE: Uses GL_TEXTURE_CUBE_MAP)" + }, + { + "name": "MATERIAL_MAP_IRRADIANCE", + "value": 8, + "description": "Irradiance material (NOTE: Uses GL_TEXTURE_CUBE_MAP)" + }, + { + "name": "MATERIAL_MAP_PREFILTER", + "value": 9, + "description": "Prefilter material (NOTE: Uses GL_TEXTURE_CUBE_MAP)" + }, + { + "name": "MATERIAL_MAP_BRDF", + "value": 10, + "description": "Brdf material" + } + ] + }, + { + "name": "ShaderLocationIndex", + "description": "Shader location index", + "values": [ + { + "name": "SHADER_LOC_VERTEX_POSITION", + "value": 0, + "description": "Shader location: vertex attribute: position" + }, + { + "name": "SHADER_LOC_VERTEX_TEXCOORD01", + "value": 1, + "description": "Shader location: vertex attribute: texcoord01" + }, + { + "name": "SHADER_LOC_VERTEX_TEXCOORD02", + "value": 2, + "description": "Shader location: vertex attribute: texcoord02" + }, + { + "name": "SHADER_LOC_VERTEX_NORMAL", + "value": 3, + "description": "Shader location: vertex attribute: normal" + }, + { + "name": "SHADER_LOC_VERTEX_TANGENT", + "value": 4, + "description": "Shader location: vertex attribute: tangent" + }, + { + "name": "SHADER_LOC_VERTEX_COLOR", + "value": 5, + "description": "Shader location: vertex attribute: color" + }, + { + "name": "SHADER_LOC_MATRIX_MVP", + "value": 6, + "description": "Shader location: matrix uniform: model-view-projection" + }, + { + "name": "SHADER_LOC_MATRIX_VIEW", + "value": 7, + "description": "Shader location: matrix uniform: view (camera transform)" + }, + { + "name": "SHADER_LOC_MATRIX_PROJECTION", + "value": 8, + "description": "Shader location: matrix uniform: projection" + }, + { + "name": "SHADER_LOC_MATRIX_MODEL", + "value": 9, + "description": "Shader location: matrix uniform: model (transform)" + }, + { + "name": "SHADER_LOC_MATRIX_NORMAL", + "value": 10, + "description": "Shader location: matrix uniform: normal" + }, + { + "name": "SHADER_LOC_VECTOR_VIEW", + "value": 11, + "description": "Shader location: vector uniform: view" + }, + { + "name": "SHADER_LOC_COLOR_DIFFUSE", + "value": 12, + "description": "Shader location: vector uniform: diffuse color" + }, + { + "name": "SHADER_LOC_COLOR_SPECULAR", + "value": 13, + "description": "Shader location: vector uniform: specular color" + }, + { + "name": "SHADER_LOC_COLOR_AMBIENT", + "value": 14, + "description": "Shader location: vector uniform: ambient color" + }, + { + "name": "SHADER_LOC_MAP_ALBEDO", + "value": 15, + "description": "Shader location: sampler2d texture: albedo (same as: SHADER_LOC_MAP_DIFFUSE)" + }, + { + "name": "SHADER_LOC_MAP_METALNESS", + "value": 16, + "description": "Shader location: sampler2d texture: metalness (same as: SHADER_LOC_MAP_SPECULAR)" + }, + { + "name": "SHADER_LOC_MAP_NORMAL", + "value": 17, + "description": "Shader location: sampler2d texture: normal" + }, + { + "name": "SHADER_LOC_MAP_ROUGHNESS", + "value": 18, + "description": "Shader location: sampler2d texture: roughness" + }, + { + "name": "SHADER_LOC_MAP_OCCLUSION", + "value": 19, + "description": "Shader location: sampler2d texture: occlusion" + }, + { + "name": "SHADER_LOC_MAP_EMISSION", + "value": 20, + "description": "Shader location: sampler2d texture: emission" + }, + { + "name": "SHADER_LOC_MAP_HEIGHT", + "value": 21, + "description": "Shader location: sampler2d texture: height" + }, + { + "name": "SHADER_LOC_MAP_CUBEMAP", + "value": 22, + "description": "Shader location: samplerCube texture: cubemap" + }, + { + "name": "SHADER_LOC_MAP_IRRADIANCE", + "value": 23, + "description": "Shader location: samplerCube texture: irradiance" + }, + { + "name": "SHADER_LOC_MAP_PREFILTER", + "value": 24, + "description": "Shader location: samplerCube texture: prefilter" + }, + { + "name": "SHADER_LOC_MAP_BRDF", + "value": 25, + "description": "Shader location: sampler2d texture: brdf" + } + ] + }, + { + "name": "ShaderUniformDataType", + "description": "Shader uniform data type", + "values": [ + { + "name": "SHADER_UNIFORM_FLOAT", + "value": 0, + "description": "Shader uniform type: float" + }, + { + "name": "SHADER_UNIFORM_VEC2", + "value": 1, + "description": "Shader uniform type: vec2 (2 float)" + }, + { + "name": "SHADER_UNIFORM_VEC3", + "value": 2, + "description": "Shader uniform type: vec3 (3 float)" + }, + { + "name": "SHADER_UNIFORM_VEC4", + "value": 3, + "description": "Shader uniform type: vec4 (4 float)" + }, + { + "name": "SHADER_UNIFORM_INT", + "value": 4, + "description": "Shader uniform type: int" + }, + { + "name": "SHADER_UNIFORM_IVEC2", + "value": 5, + "description": "Shader uniform type: ivec2 (2 int)" + }, + { + "name": "SHADER_UNIFORM_IVEC3", + "value": 6, + "description": "Shader uniform type: ivec3 (3 int)" + }, + { + "name": "SHADER_UNIFORM_IVEC4", + "value": 7, + "description": "Shader uniform type: ivec4 (4 int)" + }, + { + "name": "SHADER_UNIFORM_SAMPLER2D", + "value": 8, + "description": "Shader uniform type: sampler2d" + } + ] + }, + { + "name": "ShaderAttributeDataType", + "description": "Shader attribute data types", + "values": [ + { + "name": "SHADER_ATTRIB_FLOAT", + "value": 0, + "description": "Shader attribute type: float" + }, + { + "name": "SHADER_ATTRIB_VEC2", + "value": 1, + "description": "Shader attribute type: vec2 (2 float)" + }, + { + "name": "SHADER_ATTRIB_VEC3", + "value": 2, + "description": "Shader attribute type: vec3 (3 float)" + }, + { + "name": "SHADER_ATTRIB_VEC4", + "value": 3, + "description": "Shader attribute type: vec4 (4 float)" + } + ] + }, + { + "name": "PixelFormat", + "description": "Pixel formats", + "values": [ + { + "name": "PIXELFORMAT_UNCOMPRESSED_GRAYSCALE", + "value": 1, + "description": "8 bit per pixel (no alpha)" + }, + { + "name": "PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA", + "value": 2, + "description": "8*2 bpp (2 channels)" + }, + { + "name": "PIXELFORMAT_UNCOMPRESSED_R5G6B5", + "value": 3, + "description": "16 bpp" + }, + { + "name": "PIXELFORMAT_UNCOMPRESSED_R8G8B8", + "value": 4, + "description": "24 bpp" + }, + { + "name": "PIXELFORMAT_UNCOMPRESSED_R5G5B5A1", + "value": 5, + "description": "16 bpp (1 bit alpha)" + }, + { + "name": "PIXELFORMAT_UNCOMPRESSED_R4G4B4A4", + "value": 6, + "description": "16 bpp (4 bit alpha)" + }, + { + "name": "PIXELFORMAT_UNCOMPRESSED_R8G8B8A8", + "value": 7, + "description": "32 bpp" + }, + { + "name": "PIXELFORMAT_UNCOMPRESSED_R32", + "value": 8, + "description": "32 bpp (1 channel - float)" + }, + { + "name": "PIXELFORMAT_UNCOMPRESSED_R32G32B32", + "value": 9, + "description": "32*3 bpp (3 channels - float)" + }, + { + "name": "PIXELFORMAT_UNCOMPRESSED_R32G32B32A32", + "value": 10, + "description": "32*4 bpp (4 channels - float)" + }, + { + "name": "PIXELFORMAT_COMPRESSED_DXT1_RGB", + "value": 11, + "description": "4 bpp (no alpha)" + }, + { + "name": "PIXELFORMAT_COMPRESSED_DXT1_RGBA", + "value": 12, + "description": "4 bpp (1 bit alpha)" + }, + { + "name": "PIXELFORMAT_COMPRESSED_DXT3_RGBA", + "value": 13, + "description": "8 bpp" + }, + { + "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, + "description": "8 bpp" + }, + { + "name": "PIXELFORMAT_COMPRESSED_PVRT_RGB", + "value": 18, + "description": "4 bpp" + }, + { + "name": "PIXELFORMAT_COMPRESSED_PVRT_RGBA", + "value": 19, + "description": "4 bpp" + }, + { + "name": "PIXELFORMAT_COMPRESSED_ASTC_4x4_RGBA", + "value": 20, + "description": "8 bpp" + }, + { + "name": "PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA", + "value": 21, + "description": "2 bpp" + } + ] + }, + { + "name": "TextureFilter", + "description": "Texture parameters: filter mode", + "values": [ + { + "name": "TEXTURE_FILTER_POINT", + "value": 0, + "description": "No filter, just pixel approximation" + }, + { + "name": "TEXTURE_FILTER_BILINEAR", + "value": 1, + "description": "Linear filtering" + }, + { + "name": "TEXTURE_FILTER_TRILINEAR", + "value": 2, + "description": "Trilinear filtering (linear with mipmaps)" + }, + { + "name": "TEXTURE_FILTER_ANISOTROPIC_4X", + "value": 3, + "description": "Anisotropic filtering 4x" + }, + { + "name": "TEXTURE_FILTER_ANISOTROPIC_8X", + "value": 4, + "description": "Anisotropic filtering 8x" + }, + { + "name": "TEXTURE_FILTER_ANISOTROPIC_16X", + "value": 5, + "description": "Anisotropic filtering 16x" + } + ] + }, + { + "name": "TextureWrap", + "description": "Texture parameters: wrap mode", + "values": [ + { + "name": "TEXTURE_WRAP_REPEAT", + "value": 0, + "description": "Repeats texture in tiled mode" + }, + { + "name": "TEXTURE_WRAP_CLAMP", + "value": 1, + "description": "Clamps texture to edge pixel in tiled mode" + }, + { + "name": "TEXTURE_WRAP_MIRROR_REPEAT", + "value": 2, + "description": "Mirrors and repeats the texture in tiled mode" + }, + { + "name": "TEXTURE_WRAP_MIRROR_CLAMP", + "value": 3, + "description": "Mirrors and clamps to border the texture in tiled mode" + } + ] + }, + { + "name": "CubemapLayout", + "description": "Cubemap layouts", + "values": [ + { + "name": "CUBEMAP_LAYOUT_AUTO_DETECT", + "value": 0, + "description": "Automatically detect layout type" + }, + { + "name": "CUBEMAP_LAYOUT_LINE_VERTICAL", + "value": 1, + "description": "Layout is defined by a vertical line with faces" + }, + { + "name": "CUBEMAP_LAYOUT_LINE_HORIZONTAL", + "value": 2, + "description": "Layout is defined by an horizontal line with faces" + }, + { + "name": "CUBEMAP_LAYOUT_CROSS_THREE_BY_FOUR", + "value": 3, + "description": "Layout is defined by a 3x4 cross with cubemap faces" + }, + { + "name": "CUBEMAP_LAYOUT_CROSS_FOUR_BY_THREE", + "value": 4, + "description": "Layout is defined by a 4x3 cross with cubemap faces" + }, + { + "name": "CUBEMAP_LAYOUT_PANORAMA", + "value": 5, + "description": "Layout is defined by a panorama image (equirectangular map)" + } + ] + }, + { + "name": "FontType", + "description": "Font type, defines generation method", + "values": [ + { + "name": "FONT_DEFAULT", + "value": 0, + "description": "Default font generation, anti-aliased" + }, + { + "name": "FONT_BITMAP", + "value": 1, + "description": "Bitmap font generation, no anti-aliasing" + }, + { + "name": "FONT_SDF", + "value": 2, + "description": "SDF font generation, requires external shader" + } + ] + }, + { + "name": "BlendMode", + "description": "Color blending modes (pre-defined)", + "values": [ + { + "name": "BLEND_ALPHA", + "value": 0, + "description": "Blend textures considering alpha (default)" + }, + { + "name": "BLEND_ADDITIVE", + "value": 1, + "description": "Blend textures adding colors" + }, + { + "name": "BLEND_MULTIPLIED", + "value": 2, + "description": "Blend textures multiplying colors" + }, + { + "name": "BLEND_ADD_COLORS", + "value": 3, + "description": "Blend textures adding colors (alternative)" + }, + { + "name": "BLEND_SUBTRACT_COLORS", + "value": 4, + "description": "Blend textures subtracting colors (alternative)" + }, + { + "name": "BLEND_CUSTOM", + "value": 5, + "description": "Belnd textures using custom src/dst factors (use rlSetBlendMode())" + } + ] + }, + { + "name": "Gesture", + "description": "Gesture", + "values": [ + { + "name": "GESTURE_NONE", + "value": 0, + "description": "No gesture" + }, + { + "name": "GESTURE_TAP", + "value": 1, + "description": "Tap gesture" + }, + { + "name": "GESTURE_DOUBLETAP", + "value": 2, + "description": "Double tap gesture" + }, + { + "name": "GESTURE_HOLD", + "value": 4, + "description": "Hold gesture" + }, + { + "name": "GESTURE_DRAG", + "value": 8, + "description": "Drag gesture" + }, + { + "name": "GESTURE_SWIPE_RIGHT", + "value": 16, + "description": "Swipe right gesture" + }, + { + "name": "GESTURE_SWIPE_LEFT", + "value": 32, + "description": "Swipe left gesture" + }, + { + "name": "GESTURE_SWIPE_UP", + "value": 64, + "description": "Swipe up gesture" + }, + { + "name": "GESTURE_SWIPE_DOWN", + "value": 128, + "description": "Swipe down gesture" + }, + { + "name": "GESTURE_PINCH_IN", + "value": 256, + "description": "Pinch in gesture" + }, + { + "name": "GESTURE_PINCH_OUT", + "value": 512, + "description": "Pinch out gesture" + } + ] + }, + { + "name": "CameraMode", + "description": "Camera system modes", + "values": [ + { + "name": "CAMERA_CUSTOM", + "value": 0, + "description": "Custom camera" + }, + { + "name": "CAMERA_FREE", + "value": 1, + "description": "Free camera" + }, + { + "name": "CAMERA_ORBITAL", + "value": 2, + "description": "Orbital camera" + }, + { + "name": "CAMERA_FIRST_PERSON", + "value": 3, + "description": "First person camera" + }, + { + "name": "CAMERA_THIRD_PERSON", + "value": 4, + "description": "Third person camera" + } + ] + }, + { + "name": "CameraProjection", + "description": "Camera projection", + "values": [ + { + "name": "CAMERA_PERSPECTIVE", + "value": 0, + "description": "Perspective projection" + }, + { + "name": "CAMERA_ORTHOGRAPHIC", + "value": 1, + "description": "Orthographic projection" + } + ] + }, + { + "name": "NPatchLayout", + "description": "N-patch layout", + "values": [ + { + "name": "NPATCH_NINE_PATCH", + "value": 0, + "description": "Npatch layout: 3x3 tiles" + }, + { + "name": "NPATCH_THREE_PATCH_VERTICAL", + "value": 1, + "description": "Npatch layout: 1x3 tiles" + }, + { + "name": "NPATCH_THREE_PATCH_HORIZONTAL", + "value": 2, + "description": "Npatch layout: 3x1 tiles" + } + ] + } + ], + "functions": [ + { + "name": "InitWindow", + "description": "Initialize window and OpenGL context", + "returnType": "void", + "params": [ + { + "type": "int", + "name": "width" + }, + { + "type": "int", + "name": "height" + }, + { + "type": "const char *", + "name": "title" + } + ] + }, + { + "name": "WindowShouldClose", + "description": "Check if KEY_ESCAPE pressed or Close icon pressed", + "returnType": "bool" + }, + { + "name": "CloseWindow", + "description": "Close window and unload OpenGL context", + "returnType": "void" + }, + { + "name": "IsWindowReady", + "description": "Check if window has been initialized successfully", + "returnType": "bool" + }, + { + "name": "IsWindowFullscreen", + "description": "Check if window is currently fullscreen", + "returnType": "bool" + }, + { + "name": "IsWindowHidden", + "description": "Check if window is currently hidden (only PLATFORM_DESKTOP)", + "returnType": "bool" + }, + { + "name": "IsWindowMinimized", + "description": "Check if window is currently minimized (only PLATFORM_DESKTOP)", + "returnType": "bool" + }, + { + "name": "IsWindowMaximized", + "description": "Check if window is currently maximized (only PLATFORM_DESKTOP)", + "returnType": "bool" + }, + { + "name": "IsWindowFocused", + "description": "Check if window is currently focused (only PLATFORM_DESKTOP)", + "returnType": "bool" + }, + { + "name": "IsWindowResized", + "description": "Check if window has been resized last frame", + "returnType": "bool" + }, + { + "name": "IsWindowState", + "description": "Check if one specific window flag is enabled", + "returnType": "bool", + "params": [ + { + "type": "unsigned int", + "name": "flag" + } + ] + }, + { + "name": "SetWindowState", + "description": "Set window configuration state using flags (only PLATFORM_DESKTOP)", + "returnType": "void", + "params": [ + { + "type": "unsigned int", + "name": "flags" + } + ] + }, + { + "name": "ClearWindowState", + "description": "Clear window configuration state flags", + "returnType": "void", + "params": [ + { + "type": "unsigned int", + "name": "flags" + } + ] + }, + { + "name": "ToggleFullscreen", + "description": "Toggle window state: fullscreen/windowed (only PLATFORM_DESKTOP)", + "returnType": "void" + }, + { + "name": "MaximizeWindow", + "description": "Set window state: maximized, if resizable (only PLATFORM_DESKTOP)", + "returnType": "void" + }, + { + "name": "MinimizeWindow", + "description": "Set window state: minimized, if resizable (only PLATFORM_DESKTOP)", + "returnType": "void" + }, + { + "name": "RestoreWindow", + "description": "Set window state: not minimized/maximized (only PLATFORM_DESKTOP)", + "returnType": "void" + }, + { + "name": "SetWindowIcon", + "description": "Set icon for window (only PLATFORM_DESKTOP)", + "returnType": "void", + "params": [ + { + "type": "Image", + "name": "image" + } + ] + }, + { + "name": "SetWindowTitle", + "description": "Set title for window (only PLATFORM_DESKTOP)", + "returnType": "void", + "params": [ + { + "type": "const char *", + "name": "title" + } + ] + }, + { + "name": "SetWindowPosition", + "description": "Set window position on screen (only PLATFORM_DESKTOP)", + "returnType": "void", + "params": [ + { + "type": "int", + "name": "x" + }, + { + "type": "int", + "name": "y" + } + ] + }, + { + "name": "SetWindowMonitor", + "description": "Set monitor for the current window (fullscreen mode)", + "returnType": "void", + "params": [ + { + "type": "int", + "name": "monitor" + } + ] + }, + { + "name": "SetWindowMinSize", + "description": "Set window minimum dimensions (for FLAG_WINDOW_RESIZABLE)", + "returnType": "void", + "params": [ + { + "type": "int", + "name": "width" + }, + { + "type": "int", + "name": "height" + } + ] + }, + { + "name": "SetWindowSize", + "description": "Set window dimensions", + "returnType": "void", + "params": [ + { + "type": "int", + "name": "width" + }, + { + "type": "int", + "name": "height" + } + ] + }, + { + "name": "SetWindowOpacity", + "description": "Set window opacity [0.0f..1.0f] (only PLATFORM_DESKTOP)", + "returnType": "void", + "params": [ + { + "type": "float", + "name": "opacity" + } + ] + }, + { + "name": "GetWindowHandle", + "description": "Get native window handle", + "returnType": "void *" + }, + { + "name": "GetScreenWidth", + "description": "Get current screen width", + "returnType": "int" + }, + { + "name": "GetScreenHeight", + "description": "Get current screen height", + "returnType": "int" + }, + { + "name": "GetRenderWidth", + "description": "Get current render width (it considers HiDPI)", + "returnType": "int" + }, + { + "name": "GetRenderHeight", + "description": "Get current render height (it considers HiDPI)", + "returnType": "int" + }, + { + "name": "GetMonitorCount", + "description": "Get number of connected monitors", + "returnType": "int" + }, + { + "name": "GetCurrentMonitor", + "description": "Get current connected monitor", + "returnType": "int" + }, + { + "name": "GetMonitorPosition", + "description": "Get specified monitor position", + "returnType": "Vector2", + "params": [ + { + "type": "int", + "name": "monitor" + } + ] + }, + { + "name": "GetMonitorWidth", + "description": "Get specified monitor width (max available by monitor)", + "returnType": "int", + "params": [ + { + "type": "int", + "name": "monitor" + } + ] + }, + { + "name": "GetMonitorHeight", + "description": "Get specified monitor height (max available by monitor)", + "returnType": "int", + "params": [ + { + "type": "int", + "name": "monitor" + } + ] + }, + { + "name": "GetMonitorPhysicalWidth", + "description": "Get specified monitor physical width in millimetres", + "returnType": "int", + "params": [ + { + "type": "int", + "name": "monitor" + } + ] + }, + { + "name": "GetMonitorPhysicalHeight", + "description": "Get specified monitor physical height in millimetres", + "returnType": "int", + "params": [ + { + "type": "int", + "name": "monitor" + } + ] + }, + { + "name": "GetMonitorRefreshRate", + "description": "Get specified monitor refresh rate", + "returnType": "int", + "params": [ + { + "type": "int", + "name": "monitor" + } + ] + }, + { + "name": "GetWindowPosition", + "description": "Get window position XY on monitor", + "returnType": "Vector2" + }, + { + "name": "GetWindowScaleDPI", + "description": "Get window scale DPI factor", + "returnType": "Vector2" + }, + { + "name": "GetMonitorName", + "description": "Get the human-readable, UTF-8 encoded name of the primary monitor", + "returnType": "const char *", + "params": [ + { + "type": "int", + "name": "monitor" + } + ] + }, + { + "name": "SetClipboardText", + "description": "Set clipboard text content", + "returnType": "void", + "params": [ + { + "type": "const char *", + "name": "text" + } + ] + }, + { + "name": "GetClipboardText", + "description": "Get clipboard text content", + "returnType": "const char *" + }, + { + "name": "SwapScreenBuffer", + "description": "Swap back buffer with front buffer (screen drawing)", + "returnType": "void" + }, + { + "name": "PollInputEvents", + "description": "Register all input events", + "returnType": "void" + }, + { + "name": "WaitTime", + "description": "Wait for some milliseconds (halt program execution)", + "returnType": "void", + "params": [ + { + "type": "float", + "name": "ms" + } + ] + }, + { + "name": "ShowCursor", + "description": "Shows cursor", + "returnType": "void" + }, + { + "name": "HideCursor", + "description": "Hides cursor", + "returnType": "void" + }, + { + "name": "IsCursorHidden", + "description": "Check if cursor is not visible", + "returnType": "bool" + }, + { + "name": "EnableCursor", + "description": "Enables cursor (unlock cursor)", + "returnType": "void" + }, + { + "name": "DisableCursor", + "description": "Disables cursor (lock cursor)", + "returnType": "void" + }, + { + "name": "IsCursorOnScreen", + "description": "Check if cursor is on the screen", + "returnType": "bool" + }, + { + "name": "ClearBackground", + "description": "Set background color (framebuffer clear color)", + "returnType": "void", + "params": [ + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "BeginDrawing", + "description": "Setup canvas (framebuffer) to start drawing", + "returnType": "void" + }, + { + "name": "EndDrawing", + "description": "End canvas drawing and swap buffers (double buffering)", + "returnType": "void" + }, + { + "name": "BeginMode2D", + "description": "Begin 2D mode with custom camera (2D)", + "returnType": "void", + "params": [ + { + "type": "Camera2D", + "name": "camera" + } + ] + }, + { + "name": "EndMode2D", + "description": "Ends 2D mode with custom camera", + "returnType": "void" + }, + { + "name": "BeginMode3D", + "description": "Begin 3D mode with custom camera (3D)", + "returnType": "void", + "params": [ + { + "type": "Camera3D", + "name": "camera" + } + ] + }, + { + "name": "EndMode3D", + "description": "Ends 3D mode and returns to default 2D orthographic mode", + "returnType": "void" + }, + { + "name": "BeginTextureMode", + "description": "Begin drawing to render texture", + "returnType": "void", + "params": [ + { + "type": "RenderTexture2D", + "name": "target" + } + ] + }, + { + "name": "EndTextureMode", + "description": "Ends drawing to render texture", + "returnType": "void" + }, + { + "name": "BeginShaderMode", + "description": "Begin custom shader drawing", + "returnType": "void", + "params": [ + { + "type": "Shader", + "name": "shader" + } + ] + }, + { + "name": "EndShaderMode", + "description": "End custom shader drawing (use default shader)", + "returnType": "void" + }, + { + "name": "BeginBlendMode", + "description": "Begin blending mode (alpha, additive, multiplied, subtract, custom)", + "returnType": "void", + "params": [ + { + "type": "int", + "name": "mode" + } + ] + }, + { + "name": "EndBlendMode", + "description": "End blending mode (reset to default: alpha blending)", + "returnType": "void" + }, + { + "name": "BeginScissorMode", + "description": "Begin scissor mode (define screen area for following drawing)", + "returnType": "void", + "params": [ + { + "type": "int", + "name": "x" + }, + { + "type": "int", + "name": "y" + }, + { + "type": "int", + "name": "width" + }, + { + "type": "int", + "name": "height" + } + ] + }, + { + "name": "EndScissorMode", + "description": "End scissor mode", + "returnType": "void" + }, + { + "name": "BeginVrStereoMode", + "description": "Begin stereo rendering (requires VR simulator)", + "returnType": "void", + "params": [ + { + "type": "VrStereoConfig", + "name": "config" + } + ] + }, + { + "name": "EndVrStereoMode", + "description": "End stereo rendering (requires VR simulator)", + "returnType": "void" + }, + { + "name": "LoadVrStereoConfig", + "description": "Load VR stereo config for VR simulator device parameters", + "returnType": "VrStereoConfig", + "params": [ + { + "type": "VrDeviceInfo", + "name": "device" + } + ] + }, + { + "name": "UnloadVrStereoConfig", + "description": "Unload VR stereo config", + "returnType": "void", + "params": [ + { + "type": "VrStereoConfig", + "name": "config" + } + ] + }, + { + "name": "LoadShader", + "description": "Load shader from files and bind default locations", + "returnType": "Shader", + "params": [ + { + "type": "const char *", + "name": "vsFileName" + }, + { + "type": "const char *", + "name": "fsFileName" + } + ] + }, + { + "name": "LoadShaderFromMemory", + "description": "Load shader from code strings and bind default locations", + "returnType": "Shader", + "params": [ + { + "type": "const char *", + "name": "vsCode" + }, + { + "type": "const char *", + "name": "fsCode" + } + ] + }, + { + "name": "GetShaderLocation", + "description": "Get shader uniform location", + "returnType": "int", + "params": [ + { + "type": "Shader", + "name": "shader" + }, + { + "type": "const char *", + "name": "uniformName" + } + ] + }, + { + "name": "GetShaderLocationAttrib", + "description": "Get shader attribute location", + "returnType": "int", + "params": [ + { + "type": "Shader", + "name": "shader" + }, + { + "type": "const char *", + "name": "attribName" + } + ] + }, + { + "name": "SetShaderValue", + "description": "Set shader uniform value", + "returnType": "void", + "params": [ + { + "type": "Shader", + "name": "shader" + }, + { + "type": "int", + "name": "locIndex" + }, + { + "type": "const void *", + "name": "value" + }, + { + "type": "int", + "name": "uniformType" + } + ] + }, + { + "name": "SetShaderValueV", + "description": "Set shader uniform value vector", + "returnType": "void", + "params": [ + { + "type": "Shader", + "name": "shader" + }, + { + "type": "int", + "name": "locIndex" + }, + { + "type": "const void *", + "name": "value" + }, + { + "type": "int", + "name": "uniformType" + }, + { + "type": "int", + "name": "count" + } + ] + }, + { + "name": "SetShaderValueMatrix", + "description": "Set shader uniform value (matrix 4x4)", + "returnType": "void", + "params": [ + { + "type": "Shader", + "name": "shader" + }, + { + "type": "int", + "name": "locIndex" + }, + { + "type": "Matrix", + "name": "mat" + } + ] + }, + { + "name": "SetShaderValueTexture", + "description": "Set shader uniform value for texture (sampler2d)", + "returnType": "void", + "params": [ + { + "type": "Shader", + "name": "shader" + }, + { + "type": "int", + "name": "locIndex" + }, + { + "type": "Texture2D", + "name": "texture" + } + ] + }, + { + "name": "UnloadShader", + "description": "Unload shader from GPU memory (VRAM)", + "returnType": "void", + "params": [ + { + "type": "Shader", + "name": "shader" + } + ] + }, + { + "name": "GetMouseRay", + "description": "Get a ray trace from mouse position", + "returnType": "Ray", + "params": [ + { + "type": "Vector2", + "name": "mousePosition" + }, + { + "type": "Camera", + "name": "camera" + } + ] + }, + { + "name": "GetCameraMatrix", + "description": "Get camera transform matrix (view matrix)", + "returnType": "Matrix", + "params": [ + { + "type": "Camera", + "name": "camera" + } + ] + }, + { + "name": "GetCameraMatrix2D", + "description": "Get camera 2d transform matrix", + "returnType": "Matrix", + "params": [ + { + "type": "Camera2D", + "name": "camera" + } + ] + }, + { + "name": "GetWorldToScreen", + "description": "Get the screen space position for a 3d world space position", + "returnType": "Vector2", + "params": [ + { + "type": "Vector3", + "name": "position" + }, + { + "type": "Camera", + "name": "camera" + } + ] + }, + { + "name": "GetWorldToScreenEx", + "description": "Get size position for a 3d world space position", + "returnType": "Vector2", + "params": [ + { + "type": "Vector3", + "name": "position" + }, + { + "type": "Camera", + "name": "camera" + }, + { + "type": "int", + "name": "width" + }, + { + "type": "int", + "name": "height" + } + ] + }, + { + "name": "GetWorldToScreen2D", + "description": "Get the screen space position for a 2d camera world space position", + "returnType": "Vector2", + "params": [ + { + "type": "Vector2", + "name": "position" + }, + { + "type": "Camera2D", + "name": "camera" + } + ] + }, + { + "name": "GetScreenToWorld2D", + "description": "Get the world space position for a 2d camera screen space position", + "returnType": "Vector2", + "params": [ + { + "type": "Vector2", + "name": "position" + }, + { + "type": "Camera2D", + "name": "camera" + } + ] + }, + { + "name": "SetTargetFPS", + "description": "Set target FPS (maximum)", + "returnType": "void", + "params": [ + { + "type": "int", + "name": "fps" + } + ] + }, + { + "name": "GetFPS", + "description": "Get current FPS", + "returnType": "int" + }, + { + "name": "GetFrameTime", + "description": "Get time in seconds for last frame drawn (delta time)", + "returnType": "float" + }, + { + "name": "GetTime", + "description": "Get elapsed time in seconds since InitWindow()", + "returnType": "double" + }, + { + "name": "GetRandomValue", + "description": "Get a random value between min and max (both included)", + "returnType": "int", + "params": [ + { + "type": "int", + "name": "min" + }, + { + "type": "int", + "name": "max" + } + ] + }, + { + "name": "SetRandomSeed", + "description": "Set the seed for the random number generator", + "returnType": "void", + "params": [ + { + "type": "unsigned int", + "name": "seed" + } + ] + }, + { + "name": "TakeScreenshot", + "description": "Takes a screenshot of current screen (filename extension defines format)", + "returnType": "void", + "params": [ + { + "type": "const char *", + "name": "fileName" + } + ] + }, + { + "name": "SetConfigFlags", + "description": "Setup init configuration flags (view FLAGS)", + "returnType": "void", + "params": [ + { + "type": "unsigned int", + "name": "flags" + } + ] + }, + { + "name": "TraceLog", + "description": "Show trace log messages (LOG_DEBUG, LOG_INFO, LOG_WARNING, LOG_ERROR...)", + "returnType": "void", + "params": [ + { + "type": "int", + "name": "logLevel" + }, + { + "type": "const char *", + "name": "text" + }, + { + "type": "", + "name": "" + } + ] + }, + { + "name": "SetTraceLogLevel", + "description": "Set the current threshold (minimum) log level", + "returnType": "void", + "params": [ + { + "type": "int", + "name": "logLevel" + } + ] + }, + { + "name": "MemAlloc", + "description": "Internal memory allocator", + "returnType": "void *", + "params": [ + { + "type": "int", + "name": "size" + } + ] + }, + { + "name": "MemRealloc", + "description": "Internal memory reallocator", + "returnType": "void *", + "params": [ + { + "type": "void *", + "name": "ptr" + }, + { + "type": "int", + "name": "size" + } + ] + }, + { + "name": "MemFree", + "description": "Internal memory free", + "returnType": "void", + "params": [ + { + "type": "void *", + "name": "ptr" + } + ] + }, + { + "name": "SetTraceLogCallback", + "description": "Set custom trace log", + "returnType": "void", + "params": [ + { + "type": "TraceLogCallback", + "name": "callback" + } + ] + }, + { + "name": "SetLoadFileDataCallback", + "description": "Set custom file binary data loader", + "returnType": "void", + "params": [ + { + "type": "LoadFileDataCallback", + "name": "callback" + } + ] + }, + { + "name": "SetSaveFileDataCallback", + "description": "Set custom file binary data saver", + "returnType": "void", + "params": [ + { + "type": "SaveFileDataCallback", + "name": "callback" + } + ] + }, + { + "name": "SetLoadFileTextCallback", + "description": "Set custom file text data loader", + "returnType": "void", + "params": [ + { + "type": "LoadFileTextCallback", + "name": "callback" + } + ] + }, + { + "name": "SetSaveFileTextCallback", + "description": "Set custom file text data saver", + "returnType": "void", + "params": [ + { + "type": "SaveFileTextCallback", + "name": "callback" + } + ] + }, + { + "name": "LoadFileData", + "description": "Load file data as byte array (read)", + "returnType": "unsigned char *", + "params": [ + { + "type": "const char *", + "name": "fileName" + }, + { + "type": "unsigned int *", + "name": "bytesRead" + } + ] + }, + { + "name": "UnloadFileData", + "description": "Unload file data allocated by LoadFileData()", + "returnType": "void", + "params": [ + { + "type": "unsigned char *", + "name": "data" + } + ] + }, + { + "name": "SaveFileData", + "description": "Save data to file from byte array (write), returns true on success", + "returnType": "bool", + "params": [ + { + "type": "const char *", + "name": "fileName" + }, + { + "type": "void *", + "name": "data" + }, + { + "type": "unsigned int", + "name": "bytesToWrite" + } + ] + }, + { + "name": "LoadFileText", + "description": "Load text data from file (read), returns a '\\0' terminated string", + "returnType": "char *", + "params": [ + { + "type": "const char *", + "name": "fileName" + } + ] + }, + { + "name": "UnloadFileText", + "description": "Unload file text data allocated by LoadFileText()", + "returnType": "void", + "params": [ + { + "type": "char *", + "name": "text" + } + ] + }, + { + "name": "SaveFileText", + "description": "Save text data to file (write), string must be '\\0' terminated, returns true on success", + "returnType": "bool", + "params": [ + { + "type": "const char *", + "name": "fileName" + }, + { + "type": "char *", + "name": "text" + } + ] + }, + { + "name": "FileExists", + "description": "Check if file exists", + "returnType": "bool", + "params": [ + { + "type": "const char *", + "name": "fileName" + } + ] + }, + { + "name": "DirectoryExists", + "description": "Check if a directory path exists", + "returnType": "bool", + "params": [ + { + "type": "const char *", + "name": "dirPath" + } + ] + }, + { + "name": "IsFileExtension", + "description": "Check file extension (including point: .png, .wav)", + "returnType": "bool", + "params": [ + { + "type": "const char *", + "name": "fileName" + }, + { + "type": "const char *", + "name": "ext" + } + ] + }, + { + "name": "GetFileExtension", + "description": "Get pointer to extension for a filename string (includes dot: '.png')", + "returnType": "const char *", + "params": [ + { + "type": "const char *", + "name": "fileName" + } + ] + }, + { + "name": "GetFileName", + "description": "Get pointer to filename for a path string", + "returnType": "const char *", + "params": [ + { + "type": "const char *", + "name": "filePath" + } + ] + }, + { + "name": "GetFileNameWithoutExt", + "description": "Get filename string without extension (uses static string)", + "returnType": "const char *", + "params": [ + { + "type": "const char *", + "name": "filePath" + } + ] + }, + { + "name": "GetDirectoryPath", + "description": "Get full path for a given fileName with path (uses static string)", + "returnType": "const char *", + "params": [ + { + "type": "const char *", + "name": "filePath" + } + ] + }, + { + "name": "GetPrevDirectoryPath", + "description": "Get previous directory path for a given path (uses static string)", + "returnType": "const char *", + "params": [ + { + "type": "const char *", + "name": "dirPath" + } + ] + }, + { + "name": "GetWorkingDirectory", + "description": "Get current working directory (uses static string)", + "returnType": "const char *" + }, + { + "name": "GetDirectoryFiles", + "description": "Get filenames in a directory path (memory should be freed)", + "returnType": "char **", + "params": [ + { + "type": "const char *", + "name": "dirPath" + }, + { + "type": "int *", + "name": "count" + } + ] + }, + { + "name": "ClearDirectoryFiles", + "description": "Clear directory files paths buffers (free memory)", + "returnType": "void" + }, + { + "name": "ChangeDirectory", + "description": "Change working directory, return true on success", + "returnType": "bool", + "params": [ + { + "type": "const char *", + "name": "dir" + } + ] + }, + { + "name": "IsFileDropped", + "description": "Check if a file has been dropped into window", + "returnType": "bool" + }, + { + "name": "GetDroppedFiles", + "description": "Get dropped files names (memory should be freed)", + "returnType": "char **", + "params": [ + { + "type": "int *", + "name": "count" + } + ] + }, + { + "name": "ClearDroppedFiles", + "description": "Clear dropped files paths buffer (free memory)", + "returnType": "void" + }, + { + "name": "GetFileModTime", + "description": "Get file modification time (last write time)", + "returnType": "long", + "params": [ + { + "type": "const char *", + "name": "fileName" + } + ] + }, + { + "name": "CompressData", + "description": "Compress data (DEFLATE algorithm)", + "returnType": "unsigned char *", + "params": [ + { + "type": "unsigned char *", + "name": "data" + }, + { + "type": "int", + "name": "dataLength" + }, + { + "type": "int *", + "name": "compDataLength" + } + ] + }, + { + "name": "DecompressData", + "description": "Decompress data (DEFLATE algorithm)", + "returnType": "unsigned char *", + "params": [ + { + "type": "unsigned char *", + "name": "compData" + }, + { + "type": "int", + "name": "compDataLength" + }, + { + "type": "int *", + "name": "dataLength" + } + ] + }, + { + "name": "EncodeDataBase64", + "description": "Encode data to Base64 string", + "returnType": "char *", + "params": [ + { + "type": "const unsigned char *", + "name": "data" + }, + { + "type": "int", + "name": "dataLength" + }, + { + "type": "int *", + "name": "outputLength" + } + ] + }, + { + "name": "DecodeDataBase64", + "description": "Decode Base64 string data", + "returnType": "unsigned char *", + "params": [ + { + "type": "unsigned char *", + "name": "data" + }, + { + "type": "int *", + "name": "outputLength" + } + ] + }, + { + "name": "SaveStorageValue", + "description": "Save integer value to storage file (to defined position), returns true on success", + "returnType": "bool", + "params": [ + { + "type": "unsigned int", + "name": "position" + }, + { + "type": "int", + "name": "value" + } + ] + }, + { + "name": "LoadStorageValue", + "description": "Load integer value from storage file (from defined position)", + "returnType": "int", + "params": [ + { + "type": "unsigned int", + "name": "position" + } + ] + }, + { + "name": "OpenURL", + "description": "Open URL with default system browser (if available)", + "returnType": "void", + "params": [ + { + "type": "const char *", + "name": "url" + } + ] + }, + { + "name": "IsKeyPressed", + "description": "Check if a key has been pressed once", + "returnType": "bool", + "params": [ + { + "type": "int", + "name": "key" + } + ] + }, + { + "name": "IsKeyDown", + "description": "Check if a key is being pressed", + "returnType": "bool", + "params": [ + { + "type": "int", + "name": "key" + } + ] + }, + { + "name": "IsKeyReleased", + "description": "Check if a key has been released once", + "returnType": "bool", + "params": [ + { + "type": "int", + "name": "key" + } + ] + }, + { + "name": "IsKeyUp", + "description": "Check if a key is NOT being pressed", + "returnType": "bool", + "params": [ + { + "type": "int", + "name": "key" + } + ] + }, + { + "name": "SetExitKey", + "description": "Set a custom key to exit program (default is ESC)", + "returnType": "void", + "params": [ + { + "type": "int", + "name": "key" + } + ] + }, + { + "name": "GetKeyPressed", + "description": "Get key pressed (keycode), call it multiple times for keys queued, returns 0 when the queue is empty", + "returnType": "int" + }, + { + "name": "GetCharPressed", + "description": "Get char pressed (unicode), call it multiple times for chars queued, returns 0 when the queue is empty", + "returnType": "int" + }, + { + "name": "IsGamepadAvailable", + "description": "Check if a gamepad is available", + "returnType": "bool", + "params": [ + { + "type": "int", + "name": "gamepad" + } + ] + }, + { + "name": "GetGamepadName", + "description": "Get gamepad internal name id", + "returnType": "const char *", + "params": [ + { + "type": "int", + "name": "gamepad" + } + ] + }, + { + "name": "IsGamepadButtonPressed", + "description": "Check if a gamepad button has been pressed once", + "returnType": "bool", + "params": [ + { + "type": "int", + "name": "gamepad" + }, + { + "type": "int", + "name": "button" + } + ] + }, + { + "name": "IsGamepadButtonDown", + "description": "Check if a gamepad button is being pressed", + "returnType": "bool", + "params": [ + { + "type": "int", + "name": "gamepad" + }, + { + "type": "int", + "name": "button" + } + ] + }, + { + "name": "IsGamepadButtonReleased", + "description": "Check if a gamepad button has been released once", + "returnType": "bool", + "params": [ + { + "type": "int", + "name": "gamepad" + }, + { + "type": "int", + "name": "button" + } + ] + }, + { + "name": "IsGamepadButtonUp", + "description": "Check if a gamepad button is NOT being pressed", + "returnType": "bool", + "params": [ + { + "type": "int", + "name": "gamepad" + }, + { + "type": "int", + "name": "button" + } + ] + }, + { + "name": "GetGamepadButtonPressed", + "description": "Get the last gamepad button pressed", + "returnType": "int" + }, + { + "name": "GetGamepadAxisCount", + "description": "Get gamepad axis count for a gamepad", + "returnType": "int", + "params": [ + { + "type": "int", + "name": "gamepad" + } + ] + }, + { + "name": "GetGamepadAxisMovement", + "description": "Get axis movement value for a gamepad axis", + "returnType": "float", + "params": [ + { + "type": "int", + "name": "gamepad" + }, + { + "type": "int", + "name": "axis" + } + ] + }, + { + "name": "SetGamepadMappings", + "description": "Set internal gamepad mappings (SDL_GameControllerDB)", + "returnType": "int", + "params": [ + { + "type": "const char *", + "name": "mappings" + } + ] + }, + { + "name": "IsMouseButtonPressed", + "description": "Check if a mouse button has been pressed once", + "returnType": "bool", + "params": [ + { + "type": "int", + "name": "button" + } + ] + }, + { + "name": "IsMouseButtonDown", + "description": "Check if a mouse button is being pressed", + "returnType": "bool", + "params": [ + { + "type": "int", + "name": "button" + } + ] + }, + { + "name": "IsMouseButtonReleased", + "description": "Check if a mouse button has been released once", + "returnType": "bool", + "params": [ + { + "type": "int", + "name": "button" + } + ] + }, + { + "name": "IsMouseButtonUp", + "description": "Check if a mouse button is NOT being pressed", + "returnType": "bool", + "params": [ + { + "type": "int", + "name": "button" + } + ] + }, + { + "name": "GetMouseX", + "description": "Get mouse position X", + "returnType": "int" + }, + { + "name": "GetMouseY", + "description": "Get mouse position Y", + "returnType": "int" + }, + { + "name": "GetMousePosition", + "description": "Get mouse position XY", + "returnType": "Vector2" + }, + { + "name": "GetMouseDelta", + "description": "Get mouse delta between frames", + "returnType": "Vector2" + }, + { + "name": "SetMousePosition", + "description": "Set mouse position XY", + "returnType": "void", + "params": [ + { + "type": "int", + "name": "x" + }, + { + "type": "int", + "name": "y" + } + ] + }, + { + "name": "SetMouseOffset", + "description": "Set mouse offset", + "returnType": "void", + "params": [ + { + "type": "int", + "name": "offsetX" + }, + { + "type": "int", + "name": "offsetY" + } + ] + }, + { + "name": "SetMouseScale", + "description": "Set mouse scaling", + "returnType": "void", + "params": [ + { + "type": "float", + "name": "scaleX" + }, + { + "type": "float", + "name": "scaleY" + } + ] + }, + { + "name": "GetMouseWheelMove", + "description": "Get mouse wheel movement Y", + "returnType": "float" + }, + { + "name": "SetMouseCursor", + "description": "Set mouse cursor", + "returnType": "void", + "params": [ + { + "type": "int", + "name": "cursor" + } + ] + }, + { + "name": "GetTouchX", + "description": "Get touch position X for touch point 0 (relative to screen size)", + "returnType": "int" + }, + { + "name": "GetTouchY", + "description": "Get touch position Y for touch point 0 (relative to screen size)", + "returnType": "int" + }, + { + "name": "GetTouchPosition", + "description": "Get touch position XY for a touch point index (relative to screen size)", + "returnType": "Vector2", + "params": [ + { + "type": "int", + "name": "index" + } + ] + }, + { + "name": "GetTouchPointId", + "description": "Get touch point identifier for given index", + "returnType": "int", + "params": [ + { + "type": "int", + "name": "index" + } + ] + }, + { + "name": "GetTouchPointCount", + "description": "Get number of touch points", + "returnType": "int" + }, + { + "name": "SetGesturesEnabled", + "description": "Enable a set of gestures using flags", + "returnType": "void", + "params": [ + { + "type": "unsigned int", + "name": "flags" + } + ] + }, + { + "name": "IsGestureDetected", + "description": "Check if a gesture have been detected", + "returnType": "bool", + "params": [ + { + "type": "int", + "name": "gesture" + } + ] + }, + { + "name": "GetGestureDetected", + "description": "Get latest detected gesture", + "returnType": "int" + }, + { + "name": "GetGestureHoldDuration", + "description": "Get gesture hold time in milliseconds", + "returnType": "float" + }, + { + "name": "GetGestureDragVector", + "description": "Get gesture drag vector", + "returnType": "Vector2" + }, + { + "name": "GetGestureDragAngle", + "description": "Get gesture drag angle", + "returnType": "float" + }, + { + "name": "GetGesturePinchVector", + "description": "Get gesture pinch delta", + "returnType": "Vector2" + }, + { + "name": "GetGesturePinchAngle", + "description": "Get gesture pinch angle", + "returnType": "float" + }, + { + "name": "SetCameraMode", + "description": "Set camera mode (multiple camera modes available)", + "returnType": "void", + "params": [ + { + "type": "Camera", + "name": "camera" + }, + { + "type": "int", + "name": "mode" + } + ] + }, + { + "name": "UpdateCamera", + "description": "Update camera position for selected mode", + "returnType": "void", + "params": [ + { + "type": "Camera *", + "name": "camera" + } + ] + }, + { + "name": "SetCameraPanControl", + "description": "Set camera pan key to combine with mouse movement (free camera)", + "returnType": "void", + "params": [ + { + "type": "int", + "name": "keyPan" + } + ] + }, + { + "name": "SetCameraAltControl", + "description": "Set camera alt key to combine with mouse movement (free camera)", + "returnType": "void", + "params": [ + { + "type": "int", + "name": "keyAlt" + } + ] + }, + { + "name": "SetCameraSmoothZoomControl", + "description": "Set camera smooth zoom key to combine with mouse (free camera)", + "returnType": "void", + "params": [ + { + "type": "int", + "name": "keySmoothZoom" + } + ] + }, + { + "name": "SetCameraMoveControls", + "description": "Set camera move controls (1st person and 3rd person cameras)", + "returnType": "void", + "params": [ + { + "type": "int", + "name": "keyFront" + }, + { + "type": "int", + "name": "keyBack" + }, + { + "type": "int", + "name": "keyRight" + }, + { + "type": "int", + "name": "keyLeft" + }, + { + "type": "int", + "name": "keyUp" + }, + { + "type": "int", + "name": "keyDown" + } + ] + }, + { + "name": "SetShapesTexture", + "description": "Set texture and rectangle to be used on shapes drawing", + "returnType": "void", + "params": [ + { + "type": "Texture2D", + "name": "texture" + }, + { + "type": "Rectangle", + "name": "source" + } + ] + }, + { + "name": "DrawPixel", + "description": "Draw a pixel", + "returnType": "void", + "params": [ + { + "type": "int", + "name": "posX" + }, + { + "type": "int", + "name": "posY" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "DrawPixelV", + "description": "Draw a pixel (Vector version)", + "returnType": "void", + "params": [ + { + "type": "Vector2", + "name": "position" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "DrawLine", + "description": "Draw a line", + "returnType": "void", + "params": [ + { + "type": "int", + "name": "startPosX" + }, + { + "type": "int", + "name": "startPosY" + }, + { + "type": "int", + "name": "endPosX" + }, + { + "type": "int", + "name": "endPosY" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "DrawLineV", + "description": "Draw a line (Vector version)", + "returnType": "void", + "params": [ + { + "type": "Vector2", + "name": "startPos" + }, + { + "type": "Vector2", + "name": "endPos" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "DrawLineEx", + "description": "Draw a line defining thickness", + "returnType": "void", + "params": [ + { + "type": "Vector2", + "name": "startPos" + }, + { + "type": "Vector2", + "name": "endPos" + }, + { + "type": "float", + "name": "thick" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "DrawLineBezier", + "description": "Draw a line using cubic-bezier curves in-out", + "returnType": "void", + "params": [ + { + "type": "Vector2", + "name": "startPos" + }, + { + "type": "Vector2", + "name": "endPos" + }, + { + "type": "float", + "name": "thick" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "DrawLineBezierQuad", + "description": "Draw line using quadratic bezier curves with a control point", + "returnType": "void", + "params": [ + { + "type": "Vector2", + "name": "startPos" + }, + { + "type": "Vector2", + "name": "endPos" + }, + { + "type": "Vector2", + "name": "controlPos" + }, + { + "type": "float", + "name": "thick" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "DrawLineBezierCubic", + "description": "Draw line using cubic bezier curves with 2 control points", + "returnType": "void", + "params": [ + { + "type": "Vector2", + "name": "startPos" + }, + { + "type": "Vector2", + "name": "endPos" + }, + { + "type": "Vector2", + "name": "startControlPos" + }, + { + "type": "Vector2", + "name": "endControlPos" + }, + { + "type": "float", + "name": "thick" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "DrawLineStrip", + "description": "Draw lines sequence", + "returnType": "void", + "params": [ + { + "type": "Vector2 *", + "name": "points" + }, + { + "type": "int", + "name": "pointCount" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "DrawCircle", + "description": "Draw a color-filled circle", + "returnType": "void", + "params": [ + { + "type": "int", + "name": "centerX" + }, + { + "type": "int", + "name": "centerY" + }, + { + "type": "float", + "name": "radius" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "DrawCircleSector", + "description": "Draw a piece of a circle", + "returnType": "void", + "params": [ + { + "type": "Vector2", + "name": "center" + }, + { + "type": "float", + "name": "radius" + }, + { + "type": "float", + "name": "startAngle" + }, + { + "type": "float", + "name": "endAngle" + }, + { + "type": "int", + "name": "segments" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "DrawCircleSectorLines", + "description": "Draw circle sector outline", + "returnType": "void", + "params": [ + { + "type": "Vector2", + "name": "center" + }, + { + "type": "float", + "name": "radius" + }, + { + "type": "float", + "name": "startAngle" + }, + { + "type": "float", + "name": "endAngle" + }, + { + "type": "int", + "name": "segments" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "DrawCircleGradient", + "description": "Draw a gradient-filled circle", + "returnType": "void", + "params": [ + { + "type": "int", + "name": "centerX" + }, + { + "type": "int", + "name": "centerY" + }, + { + "type": "float", + "name": "radius" + }, + { + "type": "Color", + "name": "color1" + }, + { + "type": "Color", + "name": "color2" + } + ] + }, + { + "name": "DrawCircleV", + "description": "Draw a color-filled circle (Vector version)", + "returnType": "void", + "params": [ + { + "type": "Vector2", + "name": "center" + }, + { + "type": "float", + "name": "radius" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "DrawCircleLines", + "description": "Draw circle outline", + "returnType": "void", + "params": [ + { + "type": "int", + "name": "centerX" + }, + { + "type": "int", + "name": "centerY" + }, + { + "type": "float", + "name": "radius" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "DrawEllipse", + "description": "Draw ellipse", + "returnType": "void", + "params": [ + { + "type": "int", + "name": "centerX" + }, + { + "type": "int", + "name": "centerY" + }, + { + "type": "float", + "name": "radiusH" + }, + { + "type": "float", + "name": "radiusV" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "DrawEllipseLines", + "description": "Draw ellipse outline", + "returnType": "void", + "params": [ + { + "type": "int", + "name": "centerX" + }, + { + "type": "int", + "name": "centerY" + }, + { + "type": "float", + "name": "radiusH" + }, + { + "type": "float", + "name": "radiusV" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "DrawRing", + "description": "Draw ring", + "returnType": "void", + "params": [ + { + "type": "Vector2", + "name": "center" + }, + { + "type": "float", + "name": "innerRadius" + }, + { + "type": "float", + "name": "outerRadius" + }, + { + "type": "float", + "name": "startAngle" + }, + { + "type": "float", + "name": "endAngle" + }, + { + "type": "int", + "name": "segments" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "DrawRingLines", + "description": "Draw ring outline", + "returnType": "void", + "params": [ + { + "type": "Vector2", + "name": "center" + }, + { + "type": "float", + "name": "innerRadius" + }, + { + "type": "float", + "name": "outerRadius" + }, + { + "type": "float", + "name": "startAngle" + }, + { + "type": "float", + "name": "endAngle" + }, + { + "type": "int", + "name": "segments" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "DrawRectangle", + "description": "Draw a color-filled rectangle", + "returnType": "void", + "params": [ + { + "type": "int", + "name": "posX" + }, + { + "type": "int", + "name": "posY" + }, + { + "type": "int", + "name": "width" + }, + { + "type": "int", + "name": "height" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "DrawRectangleV", + "description": "Draw a color-filled rectangle (Vector version)", + "returnType": "void", + "params": [ + { + "type": "Vector2", + "name": "position" + }, + { + "type": "Vector2", + "name": "size" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "DrawRectangleRec", + "description": "Draw a color-filled rectangle", + "returnType": "void", + "params": [ + { + "type": "Rectangle", + "name": "rec" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "DrawRectanglePro", + "description": "Draw a color-filled rectangle with pro parameters", + "returnType": "void", + "params": [ + { + "type": "Rectangle", + "name": "rec" + }, + { + "type": "Vector2", + "name": "origin" + }, + { + "type": "float", + "name": "rotation" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "DrawRectangleGradientV", + "description": "Draw a vertical-gradient-filled rectangle", + "returnType": "void", + "params": [ + { + "type": "int", + "name": "posX" + }, + { + "type": "int", + "name": "posY" + }, + { + "type": "int", + "name": "width" + }, + { + "type": "int", + "name": "height" + }, + { + "type": "Color", + "name": "color1" + }, + { + "type": "Color", + "name": "color2" + } + ] + }, + { + "name": "DrawRectangleGradientH", + "description": "Draw a horizontal-gradient-filled rectangle", + "returnType": "void", + "params": [ + { + "type": "int", + "name": "posX" + }, + { + "type": "int", + "name": "posY" + }, + { + "type": "int", + "name": "width" + }, + { + "type": "int", + "name": "height" + }, + { + "type": "Color", + "name": "color1" + }, + { + "type": "Color", + "name": "color2" + } + ] + }, + { + "name": "DrawRectangleGradientEx", + "description": "Draw a gradient-filled rectangle with custom vertex colors", + "returnType": "void", + "params": [ + { + "type": "Rectangle", + "name": "rec" + }, + { + "type": "Color", + "name": "col1" + }, + { + "type": "Color", + "name": "col2" + }, + { + "type": "Color", + "name": "col3" + }, + { + "type": "Color", + "name": "col4" + } + ] + }, + { + "name": "DrawRectangleLines", + "description": "Draw rectangle outline", + "returnType": "void", + "params": [ + { + "type": "int", + "name": "posX" + }, + { + "type": "int", + "name": "posY" + }, + { + "type": "int", + "name": "width" + }, + { + "type": "int", + "name": "height" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "DrawRectangleLinesEx", + "description": "Draw rectangle outline with extended parameters", + "returnType": "void", + "params": [ + { + "type": "Rectangle", + "name": "rec" + }, + { + "type": "float", + "name": "lineThick" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "DrawRectangleRounded", + "description": "Draw rectangle with rounded edges", + "returnType": "void", + "params": [ + { + "type": "Rectangle", + "name": "rec" + }, + { + "type": "float", + "name": "roundness" + }, + { + "type": "int", + "name": "segments" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "DrawRectangleRoundedLines", + "description": "Draw rectangle with rounded edges outline", + "returnType": "void", + "params": [ + { + "type": "Rectangle", + "name": "rec" + }, + { + "type": "float", + "name": "roundness" + }, + { + "type": "int", + "name": "segments" + }, + { + "type": "float", + "name": "lineThick" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "DrawTriangle", + "description": "Draw a color-filled triangle (vertex in counter-clockwise order!)", + "returnType": "void", + "params": [ + { + "type": "Vector2", + "name": "v1" + }, + { + "type": "Vector2", + "name": "v2" + }, + { + "type": "Vector2", + "name": "v3" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "DrawTriangleLines", + "description": "Draw triangle outline (vertex in counter-clockwise order!)", + "returnType": "void", + "params": [ + { + "type": "Vector2", + "name": "v1" + }, + { + "type": "Vector2", + "name": "v2" + }, + { + "type": "Vector2", + "name": "v3" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "DrawTriangleFan", + "description": "Draw a triangle fan defined by points (first vertex is the center)", + "returnType": "void", + "params": [ + { + "type": "Vector2 *", + "name": "points" + }, + { + "type": "int", + "name": "pointCount" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "DrawTriangleStrip", + "description": "Draw a triangle strip defined by points", + "returnType": "void", + "params": [ + { + "type": "Vector2 *", + "name": "points" + }, + { + "type": "int", + "name": "pointCount" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "DrawPoly", + "description": "Draw a regular polygon (Vector version)", + "returnType": "void", + "params": [ + { + "type": "Vector2", + "name": "center" + }, + { + "type": "int", + "name": "sides" + }, + { + "type": "float", + "name": "radius" + }, + { + "type": "float", + "name": "rotation" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "DrawPolyLines", + "description": "Draw a polygon outline of n sides", + "returnType": "void", + "params": [ + { + "type": "Vector2", + "name": "center" + }, + { + "type": "int", + "name": "sides" + }, + { + "type": "float", + "name": "radius" + }, + { + "type": "float", + "name": "rotation" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "DrawPolyLinesEx", + "description": "Draw a polygon outline of n sides with extended parameters", + "returnType": "void", + "params": [ + { + "type": "Vector2", + "name": "center" + }, + { + "type": "int", + "name": "sides" + }, + { + "type": "float", + "name": "radius" + }, + { + "type": "float", + "name": "rotation" + }, + { + "type": "float", + "name": "lineThick" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "CheckCollisionRecs", + "description": "Check collision between two rectangles", + "returnType": "bool", + "params": [ + { + "type": "Rectangle", + "name": "rec1" + }, + { + "type": "Rectangle", + "name": "rec2" + } + ] + }, + { + "name": "CheckCollisionCircles", + "description": "Check collision between two circles", + "returnType": "bool", + "params": [ + { + "type": "Vector2", + "name": "center1" + }, + { + "type": "float", + "name": "radius1" + }, + { + "type": "Vector2", + "name": "center2" + }, + { + "type": "float", + "name": "radius2" + } + ] + }, + { + "name": "CheckCollisionCircleRec", + "description": "Check collision between circle and rectangle", + "returnType": "bool", + "params": [ + { + "type": "Vector2", + "name": "center" + }, + { + "type": "float", + "name": "radius" + }, + { + "type": "Rectangle", + "name": "rec" + } + ] + }, + { + "name": "CheckCollisionPointRec", + "description": "Check if point is inside rectangle", + "returnType": "bool", + "params": [ + { + "type": "Vector2", + "name": "point" + }, + { + "type": "Rectangle", + "name": "rec" + } + ] + }, + { + "name": "CheckCollisionPointCircle", + "description": "Check if point is inside circle", + "returnType": "bool", + "params": [ + { + "type": "Vector2", + "name": "point" + }, + { + "type": "Vector2", + "name": "center" + }, + { + "type": "float", + "name": "radius" + } + ] + }, + { + "name": "CheckCollisionPointTriangle", + "description": "Check if point is inside a triangle", + "returnType": "bool", + "params": [ + { + "type": "Vector2", + "name": "point" + }, + { + "type": "Vector2", + "name": "p1" + }, + { + "type": "Vector2", + "name": "p2" + }, + { + "type": "Vector2", + "name": "p3" + } + ] + }, + { + "name": "CheckCollisionLines", + "description": "Check the collision between two lines defined by two points each, returns collision point by reference", + "returnType": "bool", + "params": [ + { + "type": "Vector2", + "name": "startPos1" + }, + { + "type": "Vector2", + "name": "endPos1" + }, + { + "type": "Vector2", + "name": "startPos2" + }, + { + "type": "Vector2", + "name": "endPos2" + }, + { + "type": "Vector2 *", + "name": "collisionPoint" + } + ] + }, + { + "name": "CheckCollisionPointLine", + "description": "Check if point belongs to line created between two points [p1] and [p2] with defined margin in pixels [threshold]", + "returnType": "bool", + "params": [ + { + "type": "Vector2", + "name": "point" + }, + { + "type": "Vector2", + "name": "p1" + }, + { + "type": "Vector2", + "name": "p2" + }, + { + "type": "int", + "name": "threshold" + } + ] + }, + { + "name": "GetCollisionRec", + "description": "Get collision rectangle for two rectangles collision", + "returnType": "Rectangle", + "params": [ + { + "type": "Rectangle", + "name": "rec1" + }, + { + "type": "Rectangle", + "name": "rec2" + } + ] + }, + { + "name": "LoadImage", + "description": "Load image from file into CPU memory (RAM)", + "returnType": "Image", + "params": [ + { + "type": "const char *", + "name": "fileName" + } + ] + }, + { + "name": "LoadImageRaw", + "description": "Load image from RAW file data", + "returnType": "Image", + "params": [ + { + "type": "const char *", + "name": "fileName" + }, + { + "type": "int", + "name": "width" + }, + { + "type": "int", + "name": "height" + }, + { + "type": "int", + "name": "format" + }, + { + "type": "int", + "name": "headerSize" + } + ] + }, + { + "name": "LoadImageAnim", + "description": "Load image sequence from file (frames appended to image.data)", + "returnType": "Image", + "params": [ + { + "type": "const char *", + "name": "fileName" + }, + { + "type": "int *", + "name": "frames" + } + ] + }, + { + "name": "LoadImageFromMemory", + "description": "Load image from memory buffer, fileType refers to extension: i.e. '.png'", + "returnType": "Image", + "params": [ + { + "type": "const char *", + "name": "fileType" + }, + { + "type": "const unsigned char *", + "name": "fileData" + }, + { + "type": "int", + "name": "dataSize" + } + ] + }, + { + "name": "LoadImageFromTexture", + "description": "Load image from GPU texture data", + "returnType": "Image", + "params": [ + { + "type": "Texture2D", + "name": "texture" + } + ] + }, + { + "name": "LoadImageFromScreen", + "description": "Load image from screen buffer and (screenshot)", + "returnType": "Image" + }, + { + "name": "UnloadImage", + "description": "Unload image from CPU memory (RAM)", + "returnType": "void", + "params": [ + { + "type": "Image", + "name": "image" + } + ] + }, + { + "name": "ExportImage", + "description": "Export image data to file, returns true on success", + "returnType": "bool", + "params": [ + { + "type": "Image", + "name": "image" + }, + { + "type": "const char *", + "name": "fileName" + } + ] + }, + { + "name": "ExportImageAsCode", + "description": "Export image as code file defining an array of bytes, returns true on success", + "returnType": "bool", + "params": [ + { + "type": "Image", + "name": "image" + }, + { + "type": "const char *", + "name": "fileName" + } + ] + }, + { + "name": "GenImageColor", + "description": "Generate image: plain color", + "returnType": "Image", + "params": [ + { + "type": "int", + "name": "width" + }, + { + "type": "int", + "name": "height" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "GenImageGradientV", + "description": "Generate image: vertical gradient", + "returnType": "Image", + "params": [ + { + "type": "int", + "name": "width" + }, + { + "type": "int", + "name": "height" + }, + { + "type": "Color", + "name": "top" + }, + { + "type": "Color", + "name": "bottom" + } + ] + }, + { + "name": "GenImageGradientH", + "description": "Generate image: horizontal gradient", + "returnType": "Image", + "params": [ + { + "type": "int", + "name": "width" + }, + { + "type": "int", + "name": "height" + }, + { + "type": "Color", + "name": "left" + }, + { + "type": "Color", + "name": "right" + } + ] + }, + { + "name": "GenImageGradientRadial", + "description": "Generate image: radial gradient", + "returnType": "Image", + "params": [ + { + "type": "int", + "name": "width" + }, + { + "type": "int", + "name": "height" + }, + { + "type": "float", + "name": "density" + }, + { + "type": "Color", + "name": "inner" + }, + { + "type": "Color", + "name": "outer" + } + ] + }, + { + "name": "GenImageChecked", + "description": "Generate image: checked", + "returnType": "Image", + "params": [ + { + "type": "int", + "name": "width" + }, + { + "type": "int", + "name": "height" + }, + { + "type": "int", + "name": "checksX" + }, + { + "type": "int", + "name": "checksY" + }, + { + "type": "Color", + "name": "col1" + }, + { + "type": "Color", + "name": "col2" + } + ] + }, + { + "name": "GenImageWhiteNoise", + "description": "Generate image: white noise", + "returnType": "Image", + "params": [ + { + "type": "int", + "name": "width" + }, + { + "type": "int", + "name": "height" + }, + { + "type": "float", + "name": "factor" + } + ] + }, + { + "name": "GenImageCellular", + "description": "Generate image: cellular algorithm, bigger tileSize means bigger cells", + "returnType": "Image", + "params": [ + { + "type": "int", + "name": "width" + }, + { + "type": "int", + "name": "height" + }, + { + "type": "int", + "name": "tileSize" + } + ] + }, + { + "name": "ImageCopy", + "description": "Create an image duplicate (useful for transformations)", + "returnType": "Image", + "params": [ + { + "type": "Image", + "name": "image" + } + ] + }, + { + "name": "ImageFromImage", + "description": "Create an image from another image piece", + "returnType": "Image", + "params": [ + { + "type": "Image", + "name": "image" + }, + { + "type": "Rectangle", + "name": "rec" + } + ] + }, + { + "name": "ImageText", + "description": "Create an image from text (default font)", + "returnType": "Image", + "params": [ + { + "type": "const char *", + "name": "text" + }, + { + "type": "int", + "name": "fontSize" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "ImageTextEx", + "description": "Create an image from text (custom sprite font)", + "returnType": "Image", + "params": [ + { + "type": "Font", + "name": "font" + }, + { + "type": "const char *", + "name": "text" + }, + { + "type": "float", + "name": "fontSize" + }, + { + "type": "float", + "name": "spacing" + }, + { + "type": "Color", + "name": "tint" + } + ] + }, + { + "name": "ImageFormat", + "description": "Convert image data to desired format", + "returnType": "void", + "params": [ + { + "type": "Image *", + "name": "image" + }, + { + "type": "int", + "name": "newFormat" + } + ] + }, + { + "name": "ImageToPOT", + "description": "Convert image to POT (power-of-two)", + "returnType": "void", + "params": [ + { + "type": "Image *", + "name": "image" + }, + { + "type": "Color", + "name": "fill" + } + ] + }, + { + "name": "ImageCrop", + "description": "Crop an image to a defined rectangle", + "returnType": "void", + "params": [ + { + "type": "Image *", + "name": "image" + }, + { + "type": "Rectangle", + "name": "crop" + } + ] + }, + { + "name": "ImageAlphaCrop", + "description": "Crop image depending on alpha value", + "returnType": "void", + "params": [ + { + "type": "Image *", + "name": "image" + }, + { + "type": "float", + "name": "threshold" + } + ] + }, + { + "name": "ImageAlphaClear", + "description": "Clear alpha channel to desired color", + "returnType": "void", + "params": [ + { + "type": "Image *", + "name": "image" + }, + { + "type": "Color", + "name": "color" + }, + { + "type": "float", + "name": "threshold" + } + ] + }, + { + "name": "ImageAlphaMask", + "description": "Apply alpha mask to image", + "returnType": "void", + "params": [ + { + "type": "Image *", + "name": "image" + }, + { + "type": "Image", + "name": "alphaMask" + } + ] + }, + { + "name": "ImageAlphaPremultiply", + "description": "Premultiply alpha channel", + "returnType": "void", + "params": [ + { + "type": "Image *", + "name": "image" + } + ] + }, + { + "name": "ImageResize", + "description": "Resize image (Bicubic scaling algorithm)", + "returnType": "void", + "params": [ + { + "type": "Image *", + "name": "image" + }, + { + "type": "int", + "name": "newWidth" + }, + { + "type": "int", + "name": "newHeight" + } + ] + }, + { + "name": "ImageResizeNN", + "description": "Resize image (Nearest-Neighbor scaling algorithm)", + "returnType": "void", + "params": [ + { + "type": "Image *", + "name": "image" + }, + { + "type": "int", + "name": "newWidth" + }, + { + "type": "int", + "name": "newHeight" + } + ] + }, + { + "name": "ImageResizeCanvas", + "description": "Resize canvas and fill with color", + "returnType": "void", + "params": [ + { + "type": "Image *", + "name": "image" + }, + { + "type": "int", + "name": "newWidth" + }, + { + "type": "int", + "name": "newHeight" + }, + { + "type": "int", + "name": "offsetX" + }, + { + "type": "int", + "name": "offsetY" + }, + { + "type": "Color", + "name": "fill" + } + ] + }, + { + "name": "ImageMipmaps", + "description": "Compute all mipmap levels for a provided image", + "returnType": "void", + "params": [ + { + "type": "Image *", + "name": "image" + } + ] + }, + { + "name": "ImageDither", + "description": "Dither image data to 16bpp or lower (Floyd-Steinberg dithering)", + "returnType": "void", + "params": [ + { + "type": "Image *", + "name": "image" + }, + { + "type": "int", + "name": "rBpp" + }, + { + "type": "int", + "name": "gBpp" + }, + { + "type": "int", + "name": "bBpp" + }, + { + "type": "int", + "name": "aBpp" + } + ] + }, + { + "name": "ImageFlipVertical", + "description": "Flip image vertically", + "returnType": "void", + "params": [ + { + "type": "Image *", + "name": "image" + } + ] + }, + { + "name": "ImageFlipHorizontal", + "description": "Flip image horizontally", + "returnType": "void", + "params": [ + { + "type": "Image *", + "name": "image" + } + ] + }, + { + "name": "ImageRotateCW", + "description": "Rotate image clockwise 90deg", + "returnType": "void", + "params": [ + { + "type": "Image *", + "name": "image" + } + ] + }, + { + "name": "ImageRotateCCW", + "description": "Rotate image counter-clockwise 90deg", + "returnType": "void", + "params": [ + { + "type": "Image *", + "name": "image" + } + ] + }, + { + "name": "ImageColorTint", + "description": "Modify image color: tint", + "returnType": "void", + "params": [ + { + "type": "Image *", + "name": "image" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "ImageColorInvert", + "description": "Modify image color: invert", + "returnType": "void", + "params": [ + { + "type": "Image *", + "name": "image" + } + ] + }, + { + "name": "ImageColorGrayscale", + "description": "Modify image color: grayscale", + "returnType": "void", + "params": [ + { + "type": "Image *", + "name": "image" + } + ] + }, + { + "name": "ImageColorContrast", + "description": "Modify image color: contrast (-100 to 100)", + "returnType": "void", + "params": [ + { + "type": "Image *", + "name": "image" + }, + { + "type": "float", + "name": "contrast" + } + ] + }, + { + "name": "ImageColorBrightness", + "description": "Modify image color: brightness (-255 to 255)", + "returnType": "void", + "params": [ + { + "type": "Image *", + "name": "image" + }, + { + "type": "int", + "name": "brightness" + } + ] + }, + { + "name": "ImageColorReplace", + "description": "Modify image color: replace color", + "returnType": "void", + "params": [ + { + "type": "Image *", + "name": "image" + }, + { + "type": "Color", + "name": "color" + }, + { + "type": "Color", + "name": "replace" + } + ] + }, + { + "name": "LoadImageColors", + "description": "Load color data from image as a Color array (RGBA - 32bit)", + "returnType": "Color *", + "params": [ + { + "type": "Image", + "name": "image" + } + ] + }, + { + "name": "LoadImagePalette", + "description": "Load colors palette from image as a Color array (RGBA - 32bit)", + "returnType": "Color *", + "params": [ + { + "type": "Image", + "name": "image" + }, + { + "type": "int", + "name": "maxPaletteSize" + }, + { + "type": "int *", + "name": "colorCount" + } + ] + }, + { + "name": "UnloadImageColors", + "description": "Unload color data loaded with LoadImageColors()", + "returnType": "void", + "params": [ + { + "type": "Color *", + "name": "colors" + } + ] + }, + { + "name": "UnloadImagePalette", + "description": "Unload colors palette loaded with LoadImagePalette()", + "returnType": "void", + "params": [ + { + "type": "Color *", + "name": "colors" + } + ] + }, + { + "name": "GetImageAlphaBorder", + "description": "Get image alpha border rectangle", + "returnType": "Rectangle", + "params": [ + { + "type": "Image", + "name": "image" + }, + { + "type": "float", + "name": "threshold" + } + ] + }, + { + "name": "GetImageColor", + "description": "Get image pixel color at (x, y) position", + "returnType": "Color", + "params": [ + { + "type": "Image", + "name": "image" + }, + { + "type": "int", + "name": "x" + }, + { + "type": "int", + "name": "y" + } + ] + }, + { + "name": "ImageClearBackground", + "description": "Clear image background with given color", + "returnType": "void", + "params": [ + { + "type": "Image *", + "name": "dst" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "ImageDrawPixel", + "description": "Draw pixel within an image", + "returnType": "void", + "params": [ + { + "type": "Image *", + "name": "dst" + }, + { + "type": "int", + "name": "posX" + }, + { + "type": "int", + "name": "posY" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "ImageDrawPixelV", + "description": "Draw pixel within an image (Vector version)", + "returnType": "void", + "params": [ + { + "type": "Image *", + "name": "dst" + }, + { + "type": "Vector2", + "name": "position" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "ImageDrawLine", + "description": "Draw line within an image", + "returnType": "void", + "params": [ + { + "type": "Image *", + "name": "dst" + }, + { + "type": "int", + "name": "startPosX" + }, + { + "type": "int", + "name": "startPosY" + }, + { + "type": "int", + "name": "endPosX" + }, + { + "type": "int", + "name": "endPosY" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "ImageDrawLineV", + "description": "Draw line within an image (Vector version)", + "returnType": "void", + "params": [ + { + "type": "Image *", + "name": "dst" + }, + { + "type": "Vector2", + "name": "start" + }, + { + "type": "Vector2", + "name": "end" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "ImageDrawCircle", + "description": "Draw circle within an image", + "returnType": "void", + "params": [ + { + "type": "Image *", + "name": "dst" + }, + { + "type": "int", + "name": "centerX" + }, + { + "type": "int", + "name": "centerY" + }, + { + "type": "int", + "name": "radius" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "ImageDrawCircleV", + "description": "Draw circle within an image (Vector version)", + "returnType": "void", + "params": [ + { + "type": "Image *", + "name": "dst" + }, + { + "type": "Vector2", + "name": "center" + }, + { + "type": "int", + "name": "radius" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "ImageDrawRectangle", + "description": "Draw rectangle within an image", + "returnType": "void", + "params": [ + { + "type": "Image *", + "name": "dst" + }, + { + "type": "int", + "name": "posX" + }, + { + "type": "int", + "name": "posY" + }, + { + "type": "int", + "name": "width" + }, + { + "type": "int", + "name": "height" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "ImageDrawRectangleV", + "description": "Draw rectangle within an image (Vector version)", + "returnType": "void", + "params": [ + { + "type": "Image *", + "name": "dst" + }, + { + "type": "Vector2", + "name": "position" + }, + { + "type": "Vector2", + "name": "size" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "ImageDrawRectangleRec", + "description": "Draw rectangle within an image", + "returnType": "void", + "params": [ + { + "type": "Image *", + "name": "dst" + }, + { + "type": "Rectangle", + "name": "rec" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "ImageDrawRectangleLines", + "description": "Draw rectangle lines within an image", + "returnType": "void", + "params": [ + { + "type": "Image *", + "name": "dst" + }, + { + "type": "Rectangle", + "name": "rec" + }, + { + "type": "int", + "name": "thick" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "ImageDraw", + "description": "Draw a source image within a destination image (tint applied to source)", + "returnType": "void", + "params": [ + { + "type": "Image *", + "name": "dst" + }, + { + "type": "Image", + "name": "src" + }, + { + "type": "Rectangle", + "name": "srcRec" + }, + { + "type": "Rectangle", + "name": "dstRec" + }, + { + "type": "Color", + "name": "tint" + } + ] + }, + { + "name": "ImageDrawText", + "description": "Draw text (using default font) within an image (destination)", + "returnType": "void", + "params": [ + { + "type": "Image *", + "name": "dst" + }, + { + "type": "const char *", + "name": "text" + }, + { + "type": "int", + "name": "posX" + }, + { + "type": "int", + "name": "posY" + }, + { + "type": "int", + "name": "fontSize" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "ImageDrawTextEx", + "description": "Draw text (custom sprite font) within an image (destination)", + "returnType": "void", + "params": [ + { + "type": "Image *", + "name": "dst" + }, + { + "type": "Font", + "name": "font" + }, + { + "type": "const char *", + "name": "text" + }, + { + "type": "Vector2", + "name": "position" + }, + { + "type": "float", + "name": "fontSize" + }, + { + "type": "float", + "name": "spacing" + }, + { + "type": "Color", + "name": "tint" + } + ] + }, + { + "name": "LoadTexture", + "description": "Load texture from file into GPU memory (VRAM)", + "returnType": "Texture2D", + "params": [ + { + "type": "const char *", + "name": "fileName" + } + ] + }, + { + "name": "LoadTextureFromImage", + "description": "Load texture from image data", + "returnType": "Texture2D", + "params": [ + { + "type": "Image", + "name": "image" + } + ] + }, + { + "name": "LoadTextureCubemap", + "description": "Load cubemap from image, multiple image cubemap layouts supported", + "returnType": "TextureCubemap", + "params": [ + { + "type": "Image", + "name": "image" + }, + { + "type": "int", + "name": "layout" + } + ] + }, + { + "name": "LoadRenderTexture", + "description": "Load texture for rendering (framebuffer)", + "returnType": "RenderTexture2D", + "params": [ + { + "type": "int", + "name": "width" + }, + { + "type": "int", + "name": "height" + } + ] + }, + { + "name": "UnloadTexture", + "description": "Unload texture from GPU memory (VRAM)", + "returnType": "void", + "params": [ + { + "type": "Texture2D", + "name": "texture" + } + ] + }, + { + "name": "UnloadRenderTexture", + "description": "Unload render texture from GPU memory (VRAM)", + "returnType": "void", + "params": [ + { + "type": "RenderTexture2D", + "name": "target" + } + ] + }, + { + "name": "UpdateTexture", + "description": "Update GPU texture with new data", + "returnType": "void", + "params": [ + { + "type": "Texture2D", + "name": "texture" + }, + { + "type": "const void *", + "name": "pixels" + } + ] + }, + { + "name": "UpdateTextureRec", + "description": "Update GPU texture rectangle with new data", + "returnType": "void", + "params": [ + { + "type": "Texture2D", + "name": "texture" + }, + { + "type": "Rectangle", + "name": "rec" + }, + { + "type": "const void *", + "name": "pixels" + } + ] + }, + { + "name": "GenTextureMipmaps", + "description": "Generate GPU mipmaps for a texture", + "returnType": "void", + "params": [ + { + "type": "Texture2D *", + "name": "texture" + } + ] + }, + { + "name": "SetTextureFilter", + "description": "Set texture scaling filter mode", + "returnType": "void", + "params": [ + { + "type": "Texture2D", + "name": "texture" + }, + { + "type": "int", + "name": "filter" + } + ] + }, + { + "name": "SetTextureWrap", + "description": "Set texture wrapping mode", + "returnType": "void", + "params": [ + { + "type": "Texture2D", + "name": "texture" + }, + { + "type": "int", + "name": "wrap" + } + ] + }, + { + "name": "DrawTexture", + "description": "Draw a Texture2D", + "returnType": "void", + "params": [ + { + "type": "Texture2D", + "name": "texture" + }, + { + "type": "int", + "name": "posX" + }, + { + "type": "int", + "name": "posY" + }, + { + "type": "Color", + "name": "tint" + } + ] + }, + { + "name": "DrawTextureV", + "description": "Draw a Texture2D with position defined as Vector2", + "returnType": "void", + "params": [ + { + "type": "Texture2D", + "name": "texture" + }, + { + "type": "Vector2", + "name": "position" + }, + { + "type": "Color", + "name": "tint" + } + ] + }, + { + "name": "DrawTextureEx", + "description": "Draw a Texture2D with extended parameters", + "returnType": "void", + "params": [ + { + "type": "Texture2D", + "name": "texture" + }, + { + "type": "Vector2", + "name": "position" + }, + { + "type": "float", + "name": "rotation" + }, + { + "type": "float", + "name": "scale" + }, + { + "type": "Color", + "name": "tint" + } + ] + }, + { + "name": "DrawTextureRec", + "description": "Draw a part of a texture defined by a rectangle", + "returnType": "void", + "params": [ + { + "type": "Texture2D", + "name": "texture" + }, + { + "type": "Rectangle", + "name": "source" + }, + { + "type": "Vector2", + "name": "position" + }, + { + "type": "Color", + "name": "tint" + } + ] + }, + { + "name": "DrawTextureQuad", + "description": "Draw texture quad with tiling and offset parameters", + "returnType": "void", + "params": [ + { + "type": "Texture2D", + "name": "texture" + }, + { + "type": "Vector2", + "name": "tiling" + }, + { + "type": "Vector2", + "name": "offset" + }, + { + "type": "Rectangle", + "name": "quad" + }, + { + "type": "Color", + "name": "tint" + } + ] + }, + { + "name": "DrawTextureTiled", + "description": "Draw part of a texture (defined by a rectangle) with rotation and scale tiled into dest.", + "returnType": "void", + "params": [ + { + "type": "Texture2D", + "name": "texture" + }, + { + "type": "Rectangle", + "name": "source" + }, + { + "type": "Rectangle", + "name": "dest" + }, + { + "type": "Vector2", + "name": "origin" + }, + { + "type": "float", + "name": "rotation" + }, + { + "type": "float", + "name": "scale" + }, + { + "type": "Color", + "name": "tint" + } + ] + }, + { + "name": "DrawTexturePro", + "description": "Draw a part of a texture defined by a rectangle with 'pro' parameters", + "returnType": "void", + "params": [ + { + "type": "Texture2D", + "name": "texture" + }, + { + "type": "Rectangle", + "name": "source" + }, + { + "type": "Rectangle", + "name": "dest" + }, + { + "type": "Vector2", + "name": "origin" + }, + { + "type": "float", + "name": "rotation" + }, + { + "type": "Color", + "name": "tint" + } + ] + }, + { + "name": "DrawTextureNPatch", + "description": "Draws a texture (or part of it) that stretches or shrinks nicely", + "returnType": "void", + "params": [ + { + "type": "Texture2D", + "name": "texture" + }, + { + "type": "NPatchInfo", + "name": "nPatchInfo" + }, + { + "type": "Rectangle", + "name": "dest" + }, + { + "type": "Vector2", + "name": "origin" + }, + { + "type": "float", + "name": "rotation" + }, + { + "type": "Color", + "name": "tint" + } + ] + }, + { + "name": "DrawTexturePoly", + "description": "Draw a textured polygon", + "returnType": "void", + "params": [ + { + "type": "Texture2D", + "name": "texture" + }, + { + "type": "Vector2", + "name": "center" + }, + { + "type": "Vector2 *", + "name": "points" + }, + { + "type": "Vector2 *", + "name": "texcoords" + }, + { + "type": "int", + "name": "pointCount" + }, + { + "type": "Color", + "name": "tint" + } + ] + }, + { + "name": "Fade", + "description": "Get color with alpha applied, alpha goes from 0.0f to 1.0f", + "returnType": "Color", + "params": [ + { + "type": "Color", + "name": "color" + }, + { + "type": "float", + "name": "alpha" + } + ] + }, + { + "name": "ColorToInt", + "description": "Get hexadecimal value for a Color", + "returnType": "int", + "params": [ + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "ColorNormalize", + "description": "Get Color normalized as float [0..1]", + "returnType": "Vector4", + "params": [ + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "ColorFromNormalized", + "description": "Get Color from normalized values [0..1]", + "returnType": "Color", + "params": [ + { + "type": "Vector4", + "name": "normalized" + } + ] + }, + { + "name": "ColorToHSV", + "description": "Get HSV values for a Color, hue [0..360], saturation/value [0..1]", + "returnType": "Vector3", + "params": [ + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "ColorFromHSV", + "description": "Get a Color from HSV values, hue [0..360], saturation/value [0..1]", + "returnType": "Color", + "params": [ + { + "type": "float", + "name": "hue" + }, + { + "type": "float", + "name": "saturation" + }, + { + "type": "float", + "name": "value" + } + ] + }, + { + "name": "ColorAlpha", + "description": "Get color with alpha applied, alpha goes from 0.0f to 1.0f", + "returnType": "Color", + "params": [ + { + "type": "Color", + "name": "color" + }, + { + "type": "float", + "name": "alpha" + } + ] + }, + { + "name": "ColorAlphaBlend", + "description": "Get src alpha-blended into dst color with tint", + "returnType": "Color", + "params": [ + { + "type": "Color", + "name": "dst" + }, + { + "type": "Color", + "name": "src" + }, + { + "type": "Color", + "name": "tint" + } + ] + }, + { + "name": "GetColor", + "description": "Get Color structure from hexadecimal value", + "returnType": "Color", + "params": [ + { + "type": "unsigned int", + "name": "hexValue" + } + ] + }, + { + "name": "GetPixelColor", + "description": "Get Color from a source pixel pointer of certain format", + "returnType": "Color", + "params": [ + { + "type": "void *", + "name": "srcPtr" + }, + { + "type": "int", + "name": "format" + } + ] + }, + { + "name": "SetPixelColor", + "description": "Set color formatted into destination pixel pointer", + "returnType": "void", + "params": [ + { + "type": "void *", + "name": "dstPtr" + }, + { + "type": "Color", + "name": "color" + }, + { + "type": "int", + "name": "format" + } + ] + }, + { + "name": "GetPixelDataSize", + "description": "Get pixel data size in bytes for certain format", + "returnType": "int", + "params": [ + { + "type": "int", + "name": "width" + }, + { + "type": "int", + "name": "height" + }, + { + "type": "int", + "name": "format" + } + ] + }, + { + "name": "GetFontDefault", + "description": "Get the default Font", + "returnType": "Font" + }, + { + "name": "LoadFont", + "description": "Load font from file into GPU memory (VRAM)", + "returnType": "Font", + "params": [ + { + "type": "const char *", + "name": "fileName" + } + ] + }, + { + "name": "LoadFontEx", + "description": "Load font from file with extended parameters, use NULL for fontChars and 0 for glyphCount to load the default character set", + "returnType": "Font", + "params": [ + { + "type": "const char *", + "name": "fileName" + }, + { + "type": "int", + "name": "fontSize" + }, + { + "type": "int *", + "name": "fontChars" + }, + { + "type": "int", + "name": "glyphCount" + } + ] + }, + { + "name": "LoadFontFromImage", + "description": "Load font from Image (XNA style)", + "returnType": "Font", + "params": [ + { + "type": "Image", + "name": "image" + }, + { + "type": "Color", + "name": "key" + }, + { + "type": "int", + "name": "firstChar" + } + ] + }, + { + "name": "LoadFontFromMemory", + "description": "Load font from memory buffer, fileType refers to extension: i.e. '.ttf'", + "returnType": "Font", + "params": [ + { + "type": "const char *", + "name": "fileType" + }, + { + "type": "const unsigned char *", + "name": "fileData" + }, + { + "type": "int", + "name": "dataSize" + }, + { + "type": "int", + "name": "fontSize" + }, + { + "type": "int *", + "name": "fontChars" + }, + { + "type": "int", + "name": "glyphCount" + } + ] + }, + { + "name": "LoadFontData", + "description": "Load font data for further use", + "returnType": "GlyphInfo *", + "params": [ + { + "type": "const unsigned char *", + "name": "fileData" + }, + { + "type": "int", + "name": "dataSize" + }, + { + "type": "int", + "name": "fontSize" + }, + { + "type": "int *", + "name": "fontChars" + }, + { + "type": "int", + "name": "glyphCount" + }, + { + "type": "int", + "name": "type" + } + ] + }, + { + "name": "GenImageFontAtlas", + "description": "Generate image font atlas using chars info", + "returnType": "Image", + "params": [ + { + "type": "const GlyphInfo *", + "name": "chars" + }, + { + "type": "Rectangle **", + "name": "recs" + }, + { + "type": "int", + "name": "glyphCount" + }, + { + "type": "int", + "name": "fontSize" + }, + { + "type": "int", + "name": "padding" + }, + { + "type": "int", + "name": "packMethod" + } + ] + }, + { + "name": "UnloadFontData", + "description": "Unload font chars info data (RAM)", + "returnType": "void", + "params": [ + { + "type": "GlyphInfo *", + "name": "chars" + }, + { + "type": "int", + "name": "glyphCount" + } + ] + }, + { + "name": "UnloadFont", + "description": "Unload font from GPU memory (VRAM)", + "returnType": "void", + "params": [ + { + "type": "Font", + "name": "font" + } + ] + }, + { + "name": "ExportFontAsCode", + "description": "Export font as code file, returns true on success", + "returnType": "bool", + "params": [ + { + "type": "Font", + "name": "font" + }, + { + "type": "const char *", + "name": "fileName" + } + ] + }, + { + "name": "DrawFPS", + "description": "Draw current FPS", + "returnType": "void", + "params": [ + { + "type": "int", + "name": "posX" + }, + { + "type": "int", + "name": "posY" + } + ] + }, + { + "name": "DrawText", + "description": "Draw text (using default font)", + "returnType": "void", + "params": [ + { + "type": "const char *", + "name": "text" + }, + { + "type": "int", + "name": "posX" + }, + { + "type": "int", + "name": "posY" + }, + { + "type": "int", + "name": "fontSize" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "DrawTextEx", + "description": "Draw text using font and additional parameters", + "returnType": "void", + "params": [ + { + "type": "Font", + "name": "font" + }, + { + "type": "const char *", + "name": "text" + }, + { + "type": "Vector2", + "name": "position" + }, + { + "type": "float", + "name": "fontSize" + }, + { + "type": "float", + "name": "spacing" + }, + { + "type": "Color", + "name": "tint" + } + ] + }, + { + "name": "DrawTextPro", + "description": "Draw text using Font and pro parameters (rotation)", + "returnType": "void", + "params": [ + { + "type": "Font", + "name": "font" + }, + { + "type": "const char *", + "name": "text" + }, + { + "type": "Vector2", + "name": "position" + }, + { + "type": "Vector2", + "name": "origin" + }, + { + "type": "float", + "name": "rotation" + }, + { + "type": "float", + "name": "fontSize" + }, + { + "type": "float", + "name": "spacing" + }, + { + "type": "Color", + "name": "tint" + } + ] + }, + { + "name": "DrawTextCodepoint", + "description": "Draw one character (codepoint)", + "returnType": "void", + "params": [ + { + "type": "Font", + "name": "font" + }, + { + "type": "int", + "name": "codepoint" + }, + { + "type": "Vector2", + "name": "position" + }, + { + "type": "float", + "name": "fontSize" + }, + { + "type": "Color", + "name": "tint" + } + ] + }, + { + "name": "MeasureText", + "description": "Measure string width for default font", + "returnType": "int", + "params": [ + { + "type": "const char *", + "name": "text" + }, + { + "type": "int", + "name": "fontSize" + } + ] + }, + { + "name": "MeasureTextEx", + "description": "Measure string size for Font", + "returnType": "Vector2", + "params": [ + { + "type": "Font", + "name": "font" + }, + { + "type": "const char *", + "name": "text" + }, + { + "type": "float", + "name": "fontSize" + }, + { + "type": "float", + "name": "spacing" + } + ] + }, + { + "name": "GetGlyphIndex", + "description": "Get glyph index position in font for a codepoint (unicode character), fallback to '?' if not found", + "returnType": "int", + "params": [ + { + "type": "Font", + "name": "font" + }, + { + "type": "int", + "name": "codepoint" + } + ] + }, + { + "name": "GetGlyphInfo", + "description": "Get glyph font info data for a codepoint (unicode character), fallback to '?' if not found", + "returnType": "GlyphInfo", + "params": [ + { + "type": "Font", + "name": "font" + }, + { + "type": "int", + "name": "codepoint" + } + ] + }, + { + "name": "GetGlyphAtlasRec", + "description": "Get glyph rectangle in font atlas for a codepoint (unicode character), fallback to '?' if not found", + "returnType": "Rectangle", + "params": [ + { + "type": "Font", + "name": "font" + }, + { + "type": "int", + "name": "codepoint" + } + ] + }, + { + "name": "LoadCodepoints", + "description": "Load all codepoints from a UTF-8 text string, codepoints count returned by parameter", + "returnType": "int *", + "params": [ + { + "type": "const char *", + "name": "text" + }, + { + "type": "int *", + "name": "count" + } + ] + }, + { + "name": "UnloadCodepoints", + "description": "Unload codepoints data from memory", + "returnType": "void", + "params": [ + { + "type": "int *", + "name": "codepoints" + } + ] + }, + { + "name": "GetCodepointCount", + "description": "Get total number of codepoints in a UTF-8 encoded string", + "returnType": "int", + "params": [ + { + "type": "const char *", + "name": "text" + } + ] + }, + { + "name": "GetCodepoint", + "description": "Get next codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure", + "returnType": "int", + "params": [ + { + "type": "const char *", + "name": "text" + }, + { + "type": "int *", + "name": "bytesProcessed" + } + ] + }, + { + "name": "CodepointToUTF8", + "description": "Encode one codepoint into UTF-8 byte array (array length returned as parameter)", + "returnType": "const char *", + "params": [ + { + "type": "int", + "name": "codepoint" + }, + { + "type": "int *", + "name": "byteSize" + } + ] + }, + { + "name": "TextCodepointsToUTF8", + "description": "Encode text as codepoints array into UTF-8 text string (WARNING: memory must be freed!)", + "returnType": "char *", + "params": [ + { + "type": "int *", + "name": "codepoints" + }, + { + "type": "int", + "name": "length" + } + ] + }, + { + "name": "TextCopy", + "description": "Copy one string to another, returns bytes copied", + "returnType": "int", + "params": [ + { + "type": "char *", + "name": "dst" + }, + { + "type": "const char *", + "name": "src" + } + ] + }, + { + "name": "TextIsEqual", + "description": "Check if two text string are equal", + "returnType": "bool", + "params": [ + { + "type": "const char *", + "name": "text1" + }, + { + "type": "const char *", + "name": "text2" + } + ] + }, + { + "name": "TextLength", + "description": "Get text length, checks for '\\0' ending", + "returnType": "unsigned int", + "params": [ + { + "type": "const char *", + "name": "text" + } + ] + }, + { + "name": "TextFormat", + "description": "Text formatting with variables (sprintf() style)", + "returnType": "const char *", + "params": [ + { + "type": "const char *", + "name": "text" + }, + { + "type": "", + "name": "" + } + ] + }, + { + "name": "TextSubtext", + "description": "Get a piece of a text string", + "returnType": "const char *", + "params": [ + { + "type": "const char *", + "name": "text" + }, + { + "type": "int", + "name": "position" + }, + { + "type": "int", + "name": "length" + } + ] + }, + { + "name": "TextReplace", + "description": "Replace text string (WARNING: memory must be freed!)", + "returnType": "char *", + "params": [ + { + "type": "char *", + "name": "text" + }, + { + "type": "const char *", + "name": "replace" + }, + { + "type": "const char *", + "name": "by" + } + ] + }, + { + "name": "TextInsert", + "description": "Insert text in a position (WARNING: memory must be freed!)", + "returnType": "char *", + "params": [ + { + "type": "const char *", + "name": "text" + }, + { + "type": "const char *", + "name": "insert" + }, + { + "type": "int", + "name": "position" + } + ] + }, + { + "name": "TextJoin", + "description": "Join text strings with delimiter", + "returnType": "const char *", + "params": [ + { + "type": "const char **", + "name": "textList" + }, + { + "type": "int", + "name": "count" + }, + { + "type": "const char *", + "name": "delimiter" + } + ] + }, + { + "name": "TextSplit", + "description": "Split text into multiple strings", + "returnType": "const char **", + "params": [ + { + "type": "const char *", + "name": "text" + }, + { + "type": "char", + "name": "delimiter" + }, + { + "type": "int *", + "name": "count" + } + ] + }, + { + "name": "TextAppend", + "description": "Append text at specific position and move cursor!", + "returnType": "void", + "params": [ + { + "type": "char *", + "name": "text" + }, + { + "type": "const char *", + "name": "append" + }, + { + "type": "int *", + "name": "position" + } + ] + }, + { + "name": "TextFindIndex", + "description": "Find first text occurrence within a string", + "returnType": "int", + "params": [ + { + "type": "const char *", + "name": "text" + }, + { + "type": "const char *", + "name": "find" + } + ] + }, + { + "name": "TextToUpper", + "description": "Get upper case version of provided string", + "returnType": "const char *", + "params": [ + { + "type": "const char *", + "name": "text" + } + ] + }, + { + "name": "TextToLower", + "description": "Get lower case version of provided string", + "returnType": "const char *", + "params": [ + { + "type": "const char *", + "name": "text" + } + ] + }, + { + "name": "TextToPascal", + "description": "Get Pascal case notation version of provided string", + "returnType": "const char *", + "params": [ + { + "type": "const char *", + "name": "text" + } + ] + }, + { + "name": "TextToInteger", + "description": "Get integer value from text (negative values not supported)", + "returnType": "int", + "params": [ + { + "type": "const char *", + "name": "text" + } + ] + }, + { + "name": "DrawLine3D", + "description": "Draw a line in 3D world space", + "returnType": "void", + "params": [ + { + "type": "Vector3", + "name": "startPos" + }, + { + "type": "Vector3", + "name": "endPos" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "DrawPoint3D", + "description": "Draw a point in 3D space, actually a small line", + "returnType": "void", + "params": [ + { + "type": "Vector3", + "name": "position" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "DrawCircle3D", + "description": "Draw a circle in 3D world space", + "returnType": "void", + "params": [ + { + "type": "Vector3", + "name": "center" + }, + { + "type": "float", + "name": "radius" + }, + { + "type": "Vector3", + "name": "rotationAxis" + }, + { + "type": "float", + "name": "rotationAngle" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "DrawTriangle3D", + "description": "Draw a color-filled triangle (vertex in counter-clockwise order!)", + "returnType": "void", + "params": [ + { + "type": "Vector3", + "name": "v1" + }, + { + "type": "Vector3", + "name": "v2" + }, + { + "type": "Vector3", + "name": "v3" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "DrawTriangleStrip3D", + "description": "Draw a triangle strip defined by points", + "returnType": "void", + "params": [ + { + "type": "Vector3 *", + "name": "points" + }, + { + "type": "int", + "name": "pointCount" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "DrawCube", + "description": "Draw cube", + "returnType": "void", + "params": [ + { + "type": "Vector3", + "name": "position" + }, + { + "type": "float", + "name": "width" + }, + { + "type": "float", + "name": "height" + }, + { + "type": "float", + "name": "length" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "DrawCubeV", + "description": "Draw cube (Vector version)", + "returnType": "void", + "params": [ + { + "type": "Vector3", + "name": "position" + }, + { + "type": "Vector3", + "name": "size" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "DrawCubeWires", + "description": "Draw cube wires", + "returnType": "void", + "params": [ + { + "type": "Vector3", + "name": "position" + }, + { + "type": "float", + "name": "width" + }, + { + "type": "float", + "name": "height" + }, + { + "type": "float", + "name": "length" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "DrawCubeWiresV", + "description": "Draw cube wires (Vector version)", + "returnType": "void", + "params": [ + { + "type": "Vector3", + "name": "position" + }, + { + "type": "Vector3", + "name": "size" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "DrawCubeTexture", + "description": "Draw cube textured", + "returnType": "void", + "params": [ + { + "type": "Texture2D", + "name": "texture" + }, + { + "type": "Vector3", + "name": "position" + }, + { + "type": "float", + "name": "width" + }, + { + "type": "float", + "name": "height" + }, + { + "type": "float", + "name": "length" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "DrawCubeTextureRec", + "description": "Draw cube with a region of a texture", + "returnType": "void", + "params": [ + { + "type": "Texture2D", + "name": "texture" + }, + { + "type": "Rectangle", + "name": "source" + }, + { + "type": "Vector3", + "name": "position" + }, + { + "type": "float", + "name": "width" + }, + { + "type": "float", + "name": "height" + }, + { + "type": "float", + "name": "length" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "DrawSphere", + "description": "Draw sphere", + "returnType": "void", + "params": [ + { + "type": "Vector3", + "name": "centerPos" + }, + { + "type": "float", + "name": "radius" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "DrawSphereEx", + "description": "Draw sphere with extended parameters", + "returnType": "void", + "params": [ + { + "type": "Vector3", + "name": "centerPos" + }, + { + "type": "float", + "name": "radius" + }, + { + "type": "int", + "name": "rings" + }, + { + "type": "int", + "name": "slices" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "DrawSphereWires", + "description": "Draw sphere wires", + "returnType": "void", + "params": [ + { + "type": "Vector3", + "name": "centerPos" + }, + { + "type": "float", + "name": "radius" + }, + { + "type": "int", + "name": "rings" + }, + { + "type": "int", + "name": "slices" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "DrawCylinder", + "description": "Draw a cylinder/cone", + "returnType": "void", + "params": [ + { + "type": "Vector3", + "name": "position" + }, + { + "type": "float", + "name": "radiusTop" + }, + { + "type": "float", + "name": "radiusBottom" + }, + { + "type": "float", + "name": "height" + }, + { + "type": "int", + "name": "slices" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "DrawCylinderEx", + "description": "Draw a cylinder with base at startPos and top at endPos", + "returnType": "void", + "params": [ + { + "type": "Vector3", + "name": "startPos" + }, + { + "type": "Vector3", + "name": "endPos" + }, + { + "type": "float", + "name": "startRadius" + }, + { + "type": "float", + "name": "endRadius" + }, + { + "type": "int", + "name": "sides" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "DrawCylinderWires", + "description": "Draw a cylinder/cone wires", + "returnType": "void", + "params": [ + { + "type": "Vector3", + "name": "position" + }, + { + "type": "float", + "name": "radiusTop" + }, + { + "type": "float", + "name": "radiusBottom" + }, + { + "type": "float", + "name": "height" + }, + { + "type": "int", + "name": "slices" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "DrawCylinderWiresEx", + "description": "Draw a cylinder wires with base at startPos and top at endPos", + "returnType": "void", + "params": [ + { + "type": "Vector3", + "name": "startPos" + }, + { + "type": "Vector3", + "name": "endPos" + }, + { + "type": "float", + "name": "startRadius" + }, + { + "type": "float", + "name": "endRadius" + }, + { + "type": "int", + "name": "sides" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "DrawPlane", + "description": "Draw a plane XZ", + "returnType": "void", + "params": [ + { + "type": "Vector3", + "name": "centerPos" + }, + { + "type": "Vector2", + "name": "size" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "DrawRay", + "description": "Draw a ray line", + "returnType": "void", + "params": [ + { + "type": "Ray", + "name": "ray" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "DrawGrid", + "description": "Draw a grid (centered at (0, 0, 0))", + "returnType": "void", + "params": [ + { + "type": "int", + "name": "slices" + }, + { + "type": "float", + "name": "spacing" + } + ] + }, + { + "name": "LoadModel", + "description": "Load model from files (meshes and materials)", + "returnType": "Model", + "params": [ + { + "type": "const char *", + "name": "fileName" + } + ] + }, + { + "name": "LoadModelFromMesh", + "description": "Load model from generated mesh (default material)", + "returnType": "Model", + "params": [ + { + "type": "Mesh", + "name": "mesh" + } + ] + }, + { + "name": "UnloadModel", + "description": "Unload model (including meshes) from memory (RAM and/or VRAM)", + "returnType": "void", + "params": [ + { + "type": "Model", + "name": "model" + } + ] + }, + { + "name": "UnloadModelKeepMeshes", + "description": "Unload model (but not meshes) from memory (RAM and/or VRAM)", + "returnType": "void", + "params": [ + { + "type": "Model", + "name": "model" + } + ] + }, + { + "name": "GetModelBoundingBox", + "description": "Compute model bounding box limits (considers all meshes)", + "returnType": "BoundingBox", + "params": [ + { + "type": "Model", + "name": "model" + } + ] + }, + { + "name": "DrawModel", + "description": "Draw a model (with texture if set)", + "returnType": "void", + "params": [ + { + "type": "Model", + "name": "model" + }, + { + "type": "Vector3", + "name": "position" + }, + { + "type": "float", + "name": "scale" + }, + { + "type": "Color", + "name": "tint" + } + ] + }, + { + "name": "DrawModelEx", + "description": "Draw a model with extended parameters", + "returnType": "void", + "params": [ + { + "type": "Model", + "name": "model" + }, + { + "type": "Vector3", + "name": "position" + }, + { + "type": "Vector3", + "name": "rotationAxis" + }, + { + "type": "float", + "name": "rotationAngle" + }, + { + "type": "Vector3", + "name": "scale" + }, + { + "type": "Color", + "name": "tint" + } + ] + }, + { + "name": "DrawModelWires", + "description": "Draw a model wires (with texture if set)", + "returnType": "void", + "params": [ + { + "type": "Model", + "name": "model" + }, + { + "type": "Vector3", + "name": "position" + }, + { + "type": "float", + "name": "scale" + }, + { + "type": "Color", + "name": "tint" + } + ] + }, + { + "name": "DrawModelWiresEx", + "description": "Draw a model wires (with texture if set) with extended parameters", + "returnType": "void", + "params": [ + { + "type": "Model", + "name": "model" + }, + { + "type": "Vector3", + "name": "position" + }, + { + "type": "Vector3", + "name": "rotationAxis" + }, + { + "type": "float", + "name": "rotationAngle" + }, + { + "type": "Vector3", + "name": "scale" + }, + { + "type": "Color", + "name": "tint" + } + ] + }, + { + "name": "DrawBoundingBox", + "description": "Draw bounding box (wires)", + "returnType": "void", + "params": [ + { + "type": "BoundingBox", + "name": "box" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "DrawBillboard", + "description": "Draw a billboard texture", + "returnType": "void", + "params": [ + { + "type": "Camera", + "name": "camera" + }, + { + "type": "Texture2D", + "name": "texture" + }, + { + "type": "Vector3", + "name": "position" + }, + { + "type": "float", + "name": "size" + }, + { + "type": "Color", + "name": "tint" + } + ] + }, + { + "name": "DrawBillboardRec", + "description": "Draw a billboard texture defined by source", + "returnType": "void", + "params": [ + { + "type": "Camera", + "name": "camera" + }, + { + "type": "Texture2D", + "name": "texture" + }, + { + "type": "Rectangle", + "name": "source" + }, + { + "type": "Vector3", + "name": "position" + }, + { + "type": "Vector2", + "name": "size" + }, + { + "type": "Color", + "name": "tint" + } + ] + }, + { + "name": "DrawBillboardPro", + "description": "Draw a billboard texture defined by source and rotation", + "returnType": "void", + "params": [ + { + "type": "Camera", + "name": "camera" + }, + { + "type": "Texture2D", + "name": "texture" + }, + { + "type": "Rectangle", + "name": "source" + }, + { + "type": "Vector3", + "name": "position" + }, + { + "type": "Vector3", + "name": "up" + }, + { + "type": "Vector2", + "name": "size" + }, + { + "type": "Vector2", + "name": "origin" + }, + { + "type": "float", + "name": "rotation" + }, + { + "type": "Color", + "name": "tint" + } + ] + }, + { + "name": "UploadMesh", + "description": "Upload mesh vertex data in GPU and provide VAO/VBO ids", + "returnType": "void", + "params": [ + { + "type": "Mesh *", + "name": "mesh" + }, + { + "type": "bool", + "name": "dynamic" + } + ] + }, + { + "name": "UpdateMeshBuffer", + "description": "Update mesh vertex data in GPU for a specific buffer index", + "returnType": "void", + "params": [ + { + "type": "Mesh", + "name": "mesh" + }, + { + "type": "int", + "name": "index" + }, + { + "type": "void *", + "name": "data" + }, + { + "type": "int", + "name": "dataSize" + }, + { + "type": "int", + "name": "offset" + } + ] + }, + { + "name": "UnloadMesh", + "description": "Unload mesh data from CPU and GPU", + "returnType": "void", + "params": [ + { + "type": "Mesh", + "name": "mesh" + } + ] + }, + { + "name": "DrawMesh", + "description": "Draw a 3d mesh with material and transform", + "returnType": "void", + "params": [ + { + "type": "Mesh", + "name": "mesh" + }, + { + "type": "Material", + "name": "material" + }, + { + "type": "Matrix", + "name": "transform" + } + ] + }, + { + "name": "DrawMeshInstanced", + "description": "Draw multiple mesh instances with material and different transforms", + "returnType": "void", + "params": [ + { + "type": "Mesh", + "name": "mesh" + }, + { + "type": "Material", + "name": "material" + }, + { + "type": "Matrix *", + "name": "transforms" + }, + { + "type": "int", + "name": "instances" + } + ] + }, + { + "name": "ExportMesh", + "description": "Export mesh data to file, returns true on success", + "returnType": "bool", + "params": [ + { + "type": "Mesh", + "name": "mesh" + }, + { + "type": "const char *", + "name": "fileName" + } + ] + }, + { + "name": "GetMeshBoundingBox", + "description": "Compute mesh bounding box limits", + "returnType": "BoundingBox", + "params": [ + { + "type": "Mesh", + "name": "mesh" + } + ] + }, + { + "name": "GenMeshTangents", + "description": "Compute mesh tangents", + "returnType": "void", + "params": [ + { + "type": "Mesh *", + "name": "mesh" + } + ] + }, + { + "name": "GenMeshBinormals", + "description": "Compute mesh binormals", + "returnType": "void", + "params": [ + { + "type": "Mesh *", + "name": "mesh" + } + ] + }, + { + "name": "GenMeshPoly", + "description": "Generate polygonal mesh", + "returnType": "Mesh", + "params": [ + { + "type": "int", + "name": "sides" + }, + { + "type": "float", + "name": "radius" + } + ] + }, + { + "name": "GenMeshPlane", + "description": "Generate plane mesh (with subdivisions)", + "returnType": "Mesh", + "params": [ + { + "type": "float", + "name": "width" + }, + { + "type": "float", + "name": "length" + }, + { + "type": "int", + "name": "resX" + }, + { + "type": "int", + "name": "resZ" + } + ] + }, + { + "name": "GenMeshCube", + "description": "Generate cuboid mesh", + "returnType": "Mesh", + "params": [ + { + "type": "float", + "name": "width" + }, + { + "type": "float", + "name": "height" + }, + { + "type": "float", + "name": "length" + } + ] + }, + { + "name": "GenMeshSphere", + "description": "Generate sphere mesh (standard sphere)", + "returnType": "Mesh", + "params": [ + { + "type": "float", + "name": "radius" + }, + { + "type": "int", + "name": "rings" + }, + { + "type": "int", + "name": "slices" + } + ] + }, + { + "name": "GenMeshHemiSphere", + "description": "Generate half-sphere mesh (no bottom cap)", + "returnType": "Mesh", + "params": [ + { + "type": "float", + "name": "radius" + }, + { + "type": "int", + "name": "rings" + }, + { + "type": "int", + "name": "slices" + } + ] + }, + { + "name": "GenMeshCylinder", + "description": "Generate cylinder mesh", + "returnType": "Mesh", + "params": [ + { + "type": "float", + "name": "radius" + }, + { + "type": "float", + "name": "height" + }, + { + "type": "int", + "name": "slices" + } + ] + }, + { + "name": "GenMeshCone", + "description": "Generate cone/pyramid mesh", + "returnType": "Mesh", + "params": [ + { + "type": "float", + "name": "radius" + }, + { + "type": "float", + "name": "height" + }, + { + "type": "int", + "name": "slices" + } + ] + }, + { + "name": "GenMeshTorus", + "description": "Generate torus mesh", + "returnType": "Mesh", + "params": [ + { + "type": "float", + "name": "radius" + }, + { + "type": "float", + "name": "size" + }, + { + "type": "int", + "name": "radSeg" + }, + { + "type": "int", + "name": "sides" + } + ] + }, + { + "name": "GenMeshKnot", + "description": "Generate trefoil knot mesh", + "returnType": "Mesh", + "params": [ + { + "type": "float", + "name": "radius" + }, + { + "type": "float", + "name": "size" + }, + { + "type": "int", + "name": "radSeg" + }, + { + "type": "int", + "name": "sides" + } + ] + }, + { + "name": "GenMeshHeightmap", + "description": "Generate heightmap mesh from image data", + "returnType": "Mesh", + "params": [ + { + "type": "Image", + "name": "heightmap" + }, + { + "type": "Vector3", + "name": "size" + } + ] + }, + { + "name": "GenMeshCubicmap", + "description": "Generate cubes-based map mesh from image data", + "returnType": "Mesh", + "params": [ + { + "type": "Image", + "name": "cubicmap" + }, + { + "type": "Vector3", + "name": "cubeSize" + } + ] + }, + { + "name": "LoadMaterials", + "description": "Load materials from model file", + "returnType": "Material *", + "params": [ + { + "type": "const char *", + "name": "fileName" + }, + { + "type": "int *", + "name": "materialCount" + } + ] + }, + { + "name": "LoadMaterialDefault", + "description": "Load default material (Supports: DIFFUSE, SPECULAR, NORMAL maps)", + "returnType": "Material" + }, + { + "name": "UnloadMaterial", + "description": "Unload material from GPU memory (VRAM)", + "returnType": "void", + "params": [ + { + "type": "Material", + "name": "material" + } + ] + }, + { + "name": "SetMaterialTexture", + "description": "Set texture for a material map type (MATERIAL_MAP_DIFFUSE, MATERIAL_MAP_SPECULAR...)", + "returnType": "void", + "params": [ + { + "type": "Material *", + "name": "material" + }, + { + "type": "int", + "name": "mapType" + }, + { + "type": "Texture2D", + "name": "texture" + } + ] + }, + { + "name": "SetModelMeshMaterial", + "description": "Set material for a mesh", + "returnType": "void", + "params": [ + { + "type": "Model *", + "name": "model" + }, + { + "type": "int", + "name": "meshId" + }, + { + "type": "int", + "name": "materialId" + } + ] + }, + { + "name": "LoadModelAnimations", + "description": "Load model animations from file", + "returnType": "ModelAnimation *", + "params": [ + { + "type": "const char *", + "name": "fileName" + }, + { + "type": "unsigned int *", + "name": "animCount" + } + ] + }, + { + "name": "UpdateModelAnimation", + "description": "Update model animation pose", + "returnType": "void", + "params": [ + { + "type": "Model", + "name": "model" + }, + { + "type": "ModelAnimation", + "name": "anim" + }, + { + "type": "int", + "name": "frame" + } + ] + }, + { + "name": "UnloadModelAnimation", + "description": "Unload animation data", + "returnType": "void", + "params": [ + { + "type": "ModelAnimation", + "name": "anim" + } + ] + }, + { + "name": "UnloadModelAnimations", + "description": "Unload animation array data", + "returnType": "void", + "params": [ + { + "type": "ModelAnimation*", + "name": "animations" + }, + { + "type": "unsigned int", + "name": "count" + } + ] + }, + { + "name": "IsModelAnimationValid", + "description": "Check model animation skeleton match", + "returnType": "bool", + "params": [ + { + "type": "Model", + "name": "model" + }, + { + "type": "ModelAnimation", + "name": "anim" + } + ] + }, + { + "name": "CheckCollisionSpheres", + "description": "Check collision between two spheres", + "returnType": "bool", + "params": [ + { + "type": "Vector3", + "name": "center1" + }, + { + "type": "float", + "name": "radius1" + }, + { + "type": "Vector3", + "name": "center2" + }, + { + "type": "float", + "name": "radius2" + } + ] + }, + { + "name": "CheckCollisionBoxes", + "description": "Check collision between two bounding boxes", + "returnType": "bool", + "params": [ + { + "type": "BoundingBox", + "name": "box1" + }, + { + "type": "BoundingBox", + "name": "box2" + } + ] + }, + { + "name": "CheckCollisionBoxSphere", + "description": "Check collision between box and sphere", + "returnType": "bool", + "params": [ + { + "type": "BoundingBox", + "name": "box" + }, + { + "type": "Vector3", + "name": "center" + }, + { + "type": "float", + "name": "radius" + } + ] + }, + { + "name": "GetRayCollisionSphere", + "description": "Get collision info between ray and sphere", + "returnType": "RayCollision", + "params": [ + { + "type": "Ray", + "name": "ray" + }, + { + "type": "Vector3", + "name": "center" + }, + { + "type": "float", + "name": "radius" + } + ] + }, + { + "name": "GetRayCollisionBox", + "description": "Get collision info between ray and box", + "returnType": "RayCollision", + "params": [ + { + "type": "Ray", + "name": "ray" + }, + { + "type": "BoundingBox", + "name": "box" + } + ] + }, + { + "name": "GetRayCollisionModel", + "description": "Get collision info between ray and model", + "returnType": "RayCollision", + "params": [ + { + "type": "Ray", + "name": "ray" + }, + { + "type": "Model", + "name": "model" + } + ] + }, + { + "name": "GetRayCollisionMesh", + "description": "Get collision info between ray and mesh", + "returnType": "RayCollision", + "params": [ + { + "type": "Ray", + "name": "ray" + }, + { + "type": "Mesh", + "name": "mesh" + }, + { + "type": "Matrix", + "name": "transform" + } + ] + }, + { + "name": "GetRayCollisionTriangle", + "description": "Get collision info between ray and triangle", + "returnType": "RayCollision", + "params": [ + { + "type": "Ray", + "name": "ray" + }, + { + "type": "Vector3", + "name": "p1" + }, + { + "type": "Vector3", + "name": "p2" + }, + { + "type": "Vector3", + "name": "p3" + } + ] + }, + { + "name": "GetRayCollisionQuad", + "description": "Get collision info between ray and quad", + "returnType": "RayCollision", + "params": [ + { + "type": "Ray", + "name": "ray" + }, + { + "type": "Vector3", + "name": "p1" + }, + { + "type": "Vector3", + "name": "p2" + }, + { + "type": "Vector3", + "name": "p3" + }, + { + "type": "Vector3", + "name": "p4" + } + ] + }, + { + "name": "InitAudioDevice", + "description": "Initialize audio device and context", + "returnType": "void" + }, + { + "name": "CloseAudioDevice", + "description": "Close the audio device and context", + "returnType": "void" + }, + { + "name": "IsAudioDeviceReady", + "description": "Check if audio device has been initialized successfully", + "returnType": "bool" + }, + { + "name": "SetMasterVolume", + "description": "Set master volume (listener)", + "returnType": "void", + "params": [ + { + "type": "float", + "name": "volume" + } + ] + }, + { + "name": "LoadWave", + "description": "Load wave data from file", + "returnType": "Wave", + "params": [ + { + "type": "const char *", + "name": "fileName" + } + ] + }, + { + "name": "LoadWaveFromMemory", + "description": "Load wave from memory buffer, fileType refers to extension: i.e. '.wav'", + "returnType": "Wave", + "params": [ + { + "type": "const char *", + "name": "fileType" + }, + { + "type": "const unsigned char *", + "name": "fileData" + }, + { + "type": "int", + "name": "dataSize" + } + ] + }, + { + "name": "LoadSound", + "description": "Load sound from file", + "returnType": "Sound", + "params": [ + { + "type": "const char *", + "name": "fileName" + } + ] + }, + { + "name": "LoadSoundFromWave", + "description": "Load sound from wave data", + "returnType": "Sound", + "params": [ + { + "type": "Wave", + "name": "wave" + } + ] + }, + { + "name": "UpdateSound", + "description": "Update sound buffer with new data", + "returnType": "void", + "params": [ + { + "type": "Sound", + "name": "sound" + }, + { + "type": "const void *", + "name": "data" + }, + { + "type": "int", + "name": "sampleCount" + } + ] + }, + { + "name": "UnloadWave", + "description": "Unload wave data", + "returnType": "void", + "params": [ + { + "type": "Wave", + "name": "wave" + } + ] + }, + { + "name": "UnloadSound", + "description": "Unload sound", + "returnType": "void", + "params": [ + { + "type": "Sound", + "name": "sound" + } + ] + }, + { + "name": "ExportWave", + "description": "Export wave data to file, returns true on success", + "returnType": "bool", + "params": [ + { + "type": "Wave", + "name": "wave" + }, + { + "type": "const char *", + "name": "fileName" + } + ] + }, + { + "name": "ExportWaveAsCode", + "description": "Export wave sample data to code (.h), returns true on success", + "returnType": "bool", + "params": [ + { + "type": "Wave", + "name": "wave" + }, + { + "type": "const char *", + "name": "fileName" + } + ] + }, + { + "name": "PlaySound", + "description": "Play a sound", + "returnType": "void", + "params": [ + { + "type": "Sound", + "name": "sound" + } + ] + }, + { + "name": "StopSound", + "description": "Stop playing a sound", + "returnType": "void", + "params": [ + { + "type": "Sound", + "name": "sound" + } + ] + }, + { + "name": "PauseSound", + "description": "Pause a sound", + "returnType": "void", + "params": [ + { + "type": "Sound", + "name": "sound" + } + ] + }, + { + "name": "ResumeSound", + "description": "Resume a paused sound", + "returnType": "void", + "params": [ + { + "type": "Sound", + "name": "sound" + } + ] + }, + { + "name": "PlaySoundMulti", + "description": "Play a sound (using multichannel buffer pool)", + "returnType": "void", + "params": [ + { + "type": "Sound", + "name": "sound" + } + ] + }, + { + "name": "StopSoundMulti", + "description": "Stop any sound playing (using multichannel buffer pool)", + "returnType": "void" + }, + { + "name": "GetSoundsPlaying", + "description": "Get number of sounds playing in the multichannel", + "returnType": "int" + }, + { + "name": "IsSoundPlaying", + "description": "Check if a sound is currently playing", + "returnType": "bool", + "params": [ + { + "type": "Sound", + "name": "sound" + } + ] + }, + { + "name": "SetSoundVolume", + "description": "Set volume for a sound (1.0 is max level)", + "returnType": "void", + "params": [ + { + "type": "Sound", + "name": "sound" + }, + { + "type": "float", + "name": "volume" + } + ] + }, + { + "name": "SetSoundPitch", + "description": "Set pitch for a sound (1.0 is base level)", + "returnType": "void", + "params": [ + { + "type": "Sound", + "name": "sound" + }, + { + "type": "float", + "name": "pitch" + } + ] + }, + { + "name": "WaveFormat", + "description": "Convert wave data to desired format", + "returnType": "void", + "params": [ + { + "type": "Wave *", + "name": "wave" + }, + { + "type": "int", + "name": "sampleRate" + }, + { + "type": "int", + "name": "sampleSize" + }, + { + "type": "int", + "name": "channels" + } + ] + }, + { + "name": "WaveCopy", + "description": "Copy a wave to a new wave", + "returnType": "Wave", + "params": [ + { + "type": "Wave", + "name": "wave" + } + ] + }, + { + "name": "WaveCrop", + "description": "Crop a wave to defined samples range", + "returnType": "void", + "params": [ + { + "type": "Wave *", + "name": "wave" + }, + { + "type": "int", + "name": "initSample" + }, + { + "type": "int", + "name": "finalSample" + } + ] + }, + { + "name": "LoadWaveSamples", + "description": "Load samples data from wave as a floats array", + "returnType": "float *", + "params": [ + { + "type": "Wave", + "name": "wave" + } + ] + }, + { + "name": "UnloadWaveSamples", + "description": "Unload samples data loaded with LoadWaveSamples()", + "returnType": "void", + "params": [ + { + "type": "float *", + "name": "samples" + } + ] + }, + { + "name": "LoadMusicStream", + "description": "Load music stream from file", + "returnType": "Music", + "params": [ + { + "type": "const char *", + "name": "fileName" + } + ] + }, + { + "name": "LoadMusicStreamFromMemory", + "description": "Load music stream from data", + "returnType": "Music", + "params": [ + { + "type": "const char *", + "name": "fileType" + }, + { + "type": "unsigned char *", + "name": "data" + }, + { + "type": "int", + "name": "dataSize" + } + ] + }, + { + "name": "UnloadMusicStream", + "description": "Unload music stream", + "returnType": "void", + "params": [ + { + "type": "Music", + "name": "music" + } + ] + }, + { + "name": "PlayMusicStream", + "description": "Start music playing", + "returnType": "void", + "params": [ + { + "type": "Music", + "name": "music" + } + ] + }, + { + "name": "IsMusicStreamPlaying", + "description": "Check if music is playing", + "returnType": "bool", + "params": [ + { + "type": "Music", + "name": "music" + } + ] + }, + { + "name": "UpdateMusicStream", + "description": "Updates buffers for music streaming", + "returnType": "void", + "params": [ + { + "type": "Music", + "name": "music" + } + ] + }, + { + "name": "StopMusicStream", + "description": "Stop music playing", + "returnType": "void", + "params": [ + { + "type": "Music", + "name": "music" + } + ] + }, + { + "name": "PauseMusicStream", + "description": "Pause music playing", + "returnType": "void", + "params": [ + { + "type": "Music", + "name": "music" + } + ] + }, + { + "name": "ResumeMusicStream", + "description": "Resume playing paused music", + "returnType": "void", + "params": [ + { + "type": "Music", + "name": "music" + } + ] + }, + { + "name": "SeekMusicStream", + "description": "Seek music to a position (in seconds)", + "returnType": "void", + "params": [ + { + "type": "Music", + "name": "music" + }, + { + "type": "float", + "name": "position" + } + ] + }, + { + "name": "SetMusicVolume", + "description": "Set volume for music (1.0 is max level)", + "returnType": "void", + "params": [ + { + "type": "Music", + "name": "music" + }, + { + "type": "float", + "name": "volume" + } + ] + }, + { + "name": "SetMusicPitch", + "description": "Set pitch for a music (1.0 is base level)", + "returnType": "void", + "params": [ + { + "type": "Music", + "name": "music" + }, + { + "type": "float", + "name": "pitch" + } + ] + }, + { + "name": "GetMusicTimeLength", + "description": "Get music time length (in seconds)", + "returnType": "float", + "params": [ + { + "type": "Music", + "name": "music" + } + ] + }, + { + "name": "GetMusicTimePlayed", + "description": "Get current music time played (in seconds)", + "returnType": "float", + "params": [ + { + "type": "Music", + "name": "music" + } + ] + }, + { + "name": "LoadAudioStream", + "description": "Load audio stream (to stream raw audio pcm data)", + "returnType": "AudioStream", + "params": [ + { + "type": "unsigned int", + "name": "sampleRate" + }, + { + "type": "unsigned int", + "name": "sampleSize" + }, + { + "type": "unsigned int", + "name": "channels" + } + ] + }, + { + "name": "UnloadAudioStream", + "description": "Unload audio stream and free memory", + "returnType": "void", + "params": [ + { + "type": "AudioStream", + "name": "stream" + } + ] + }, + { + "name": "UpdateAudioStream", + "description": "Update audio stream buffers with data", + "returnType": "void", + "params": [ + { + "type": "AudioStream", + "name": "stream" + }, + { + "type": "const void *", + "name": "data" + }, + { + "type": "int", + "name": "frameCount" + } + ] + }, + { + "name": "IsAudioStreamProcessed", + "description": "Check if any audio stream buffers requires refill", + "returnType": "bool", + "params": [ + { + "type": "AudioStream", + "name": "stream" + } + ] + }, + { + "name": "PlayAudioStream", + "description": "Play audio stream", + "returnType": "void", + "params": [ + { + "type": "AudioStream", + "name": "stream" + } + ] + }, + { + "name": "PauseAudioStream", + "description": "Pause audio stream", + "returnType": "void", + "params": [ + { + "type": "AudioStream", + "name": "stream" + } + ] + }, + { + "name": "ResumeAudioStream", + "description": "Resume audio stream", + "returnType": "void", + "params": [ + { + "type": "AudioStream", + "name": "stream" + } + ] + }, + { + "name": "IsAudioStreamPlaying", + "description": "Check if audio stream is playing", + "returnType": "bool", + "params": [ + { + "type": "AudioStream", + "name": "stream" + } + ] + }, + { + "name": "StopAudioStream", + "description": "Stop audio stream", + "returnType": "void", + "params": [ + { + "type": "AudioStream", + "name": "stream" + } + ] + }, + { + "name": "SetAudioStreamVolume", + "description": "Set volume for audio stream (1.0 is max level)", + "returnType": "void", + "params": [ + { + "type": "AudioStream", + "name": "stream" + }, + { + "type": "float", + "name": "volume" + } + ] + }, + { + "name": "SetAudioStreamPitch", + "description": "Set pitch for audio stream (1.0 is base level)", + "returnType": "void", + "params": [ + { + "type": "AudioStream", + "name": "stream" + }, + { + "type": "float", + "name": "pitch" + } + ] + }, + { + "name": "SetAudioStreamBufferSizeDefault", + "description": "Default size for new audio streams", + "returnType": "void", + "params": [ + { + "type": "int", + "name": "size" + } + ] + } + ] +} diff --git a/src/HasRaylibBlendModeConstants.php b/src/HasRaylibBlendModeConstants.php deleted file mode 100644 index d57cdbb..0000000 --- a/src/HasRaylibBlendModeConstants.php +++ /dev/null @@ -1,15 +0,0 @@ -ffi = $ffi; - } - - public function beginBlendMode(int $mode): void - { - $this->ffi->BeginBlendMode($mode); - } - - public function beginDrawing(): void - { - $this->ffi->BeginDrawing(); - } - - public function beginMode2D(Types\Camera2D $camera): void - { - $this->ffi->BeginMode2D($camera->toCData($this->ffi)); - } - - public function beginMode3D(Types\Camera3D $camera): void - { - $this->ffi->BeginMode3D($camera->toCData($this->ffi)); - } - - public function beginScissorMode(int $x, int $y, int $width, int $height): void - { - $this->ffi->BeginScissorMode($x, $y, $width, $height); - } - - public function beginTextureMode(Types\RenderTexture2D $target): void - { - $this->ffi->BeginTextureMode($target->toCData($this->ffi)); - } - - public function checkCollisionBoxes(Types\BoundingBox $box1, Types\BoundingBox $box2): bool - { - return $this->ffi->CheckCollisionBoxes( - $box1->toCData($this->ffi), - $box2->toCData($this->ffi), - ); - } - - public function checkCollisionBoxSphere(Types\BoundingBox $box, Types\Vector3 $center, float $radius): bool - { - return $this->ffi->CheckCollisionBoxSphere( - $box->toCData($this->ffi), - $center->toCData($this->ffi), - $radius, - ); - } - - public function checkCollisionPointCircle(Types\Vector2 $point, Types\Vector2 $center, float $radius): bool - { - return $this->ffi->CheckCollisionPointCircle( - $point->toCData($this->ffi), - $center->toCData($this->ffi), - $radius, - ); - } - - public function checkCollisionPointRec(Types\Vector2 $point, Types\Rectangle $rec): bool - { - return $this->ffi->CheckCollisionPointRec($point->toCData($this->ffi), $rec->toCData($this->ffi)); - } - - public function checkCollisionRayBox(Types\Ray $ray, Types\BoundingBox $box): bool - { - return $this->ffi->CheckCollisionRayBox($ray->toCData($this->ffi), $box->toCData($this->ffi)); - } - - public function checkCollisionRecs(Types\Rectangle $rec1, Types\Rectangle $rec2): bool - { - return $this->ffi->CheckCollisionRecs($rec1->toCData($this->ffi), $rec2->toCData($this->ffi)); - } - - public function checkCollisionCircles( - Types\Vector2 $center1, - float $radius1, - Types\Vector2 $center2, - float $radius2 - ): bool { - return $this->ffi->CheckCollisionCircles( - $center1->toCData($this->ffi), - $radius1, - $center2->toCData($this->ffi), - $radius2, - ); - } - - public function checkCollisionCircleRec(Types\Vector2 $center, float $radius, Types\Rectangle $rec): bool - { - return $this->ffi->CheckCollisionCircleRec( - $center->toCData($this->ffi), - $radius, - $rec->toCData($this->ffi), - ); - } - - public function checkCollisionPointTriangle( - Types\Vector2 $point, - Types\Vector2 $p1, - Types\Vector2 $p2, - Types\Vector2 $p3, - ): bool { - return $this->ffi->CheckCollisionPointTriangle( - $point->toCData($this->ffi), - $p1->toCData($this->ffi), - $p2->toCData($this->ffi), - $p3->toCData($this->ffi), - ); - } - - /** - * @psalm-suppress UndefinedPropertyFetch - * @psalm-suppress MixedArgument - * @psalm-suppress MixedAssignment - */ - public function checkCollisionLines( - Types\Vector2 $startPos1, - Types\Vector2 $endPos1, - Types\Vector2 $startPos2, - Types\Vector2 $endPos2, - Types\Vector2 $mutCollisionPoint, - ): bool { - $vec = $this->ffi->new('Vector2'); - $vecPointer = FFI::addr($vec); - - $collides = $this->ffi->CheckCollisionLines( - $startPos1->toCData($this->ffi), - $endPos1->toCData($this->ffi), - $startPos2->toCData($this->ffi), - $endPos2->toCData($this->ffi), - $vecPointer, - ); - - if ($collides) { - $mutCollisionPoint->x = $vec->x; - $mutCollisionPoint->y = $vec->y; - } - - return $collides; - } - - public function clearBackground(Types\Color $color): void - { - $this->ffi->ClearBackground($color->toCData($this->ffi)); - } - - public function clearWindowState(int $flags): void - { - $this->ffi->ClearWindowState($flags); - } - - public function closeAudioDevice(): void - { - $this->ffi->CloseAudioDevice(); - } - - public function closeWindow(): void - { - $this->ffi->CloseWindow(); - } - - /** - * @psalm-suppress UndefinedPropertyFetch - * @psalm-suppress MixedArgument - */ - public function colorAlpha(Types\Color $color, float $alpha): Types\Color - { - $c = $this->ffi->ColorAlpha($color->toCData($this->ffi), $alpha); - - return new Types\Color($c->r, $c->g, $c->b, $c->a); - } - - /** - * @psalm-suppress UndefinedPropertyFetch - */ - public function colorAlphaBlend(Types\Color $dst, Types\Color $src, Types\Color $tint): Types\Color - { - $color = $this->ffi->ColorAlphaBlend( - $dst->toCData($this->ffi), - $src->toCData($this->ffi), - $tint->toCData($this->ffi), - ); - - return new Types\Color( - $color->r, - $color->g, - $color->b, - $color->a, - ); - } - - public function drawBillboard( - Types\Camera3D $camera, - Types\Texture2D $texture, - Types\Vector3 $center, - float $size, - Types\Color $tint - ): void { - $this->ffi->DrawBillboard( - $camera->toCData($this->ffi), - $texture->toCData($this->ffi), - $center->toCData($this->ffi), - $size, - $tint->toCData($this->ffi), - ); - } - - public function drawCircle(int $centerX, int $centerY, float $radius, Types\Color $color): void - { - $this->ffi->DrawCircle($centerX, $centerY, $radius, $color->toCData($this->ffi)); - } - - public function drawCircleGradient( - int $centerX, - int $centerY, - float $radius, - Types\Color $color1, - Types\Color $color2 - ): void { - $this->ffi->DrawCircleGradient( - $centerX, - $centerY, - $radius, - $color1->toCData($this->ffi), - $color2->toCData($this->ffi), - ); - } - - public function drawCircleLines(int $centerX, int $centerY, float $radius, Types\Color $color): void - { - $this->ffi->DrawCircleLines($centerX, $centerY, $radius, $color->toCData($this->ffi)); - } - - public function drawCircleSector( - Types\Vector2 $center, - float $radius, - int $startAngle, - int $endAngle, - int $segments, - Types\Color $color - ): void { - $this->ffi->DrawCircleSector( - $center->toCData($this->ffi), - $radius, - $startAngle, - $endAngle, - $segments, - $color->toCData($this->ffi) - ); - } - - public function drawCircleSectorLines( - Types\Vector2 $center, - float $radius, - int $startAngle, - int $endAngle, - int $segments, - Types\Color $color - ): void { - $this->ffi->DrawCircleSectorLines( - $center->toCData($this->ffi), - $radius, - $startAngle, - $endAngle, - $segments, - $color->toCData($this->ffi) - ); - } - - public function drawCircleV(Types\Vector2 $center, float $radius, Types\Color $color): void - { - $this->ffi->DrawCircleV($center->toCData($this->ffi), $radius, $color->toCData($this->ffi)); - } - - public function drawCube( - Types\Vector3 $position, - float $width, - float $height, - float $length, - Types\Color $color - ): void { - $this->ffi->DrawCube($position->toCData($this->ffi), $width, $height, $length, $color->toCData($this->ffi)); - } - - public function drawCubeV(Types\Vector3 $position, Types\Vector3 $size, Types\Color $color): void - { - $this->ffi->DrawCubeV( - $position->toCData($this->ffi), - $size->toCData($this->ffi), - $color->toCData($this->ffi), - ); - } - - public function drawCubeWires( - Types\Vector3 $position, - float $width, - float $height, - float $length, - Types\Color $color - ): void { - $this->ffi->DrawCubeWires( - $position->toCData($this->ffi), - $width, - $height, - $length, - $color->toCData($this->ffi) - ); - } - - public function drawEllipse(int $centerX, int $centerY, float $radiusH, float $radiusV, Types\Color $color): void - { - $this->ffi->DrawEllipse($centerX, $centerY, $radiusH, $radiusV, $color->toCData($this->ffi)); - } - - public function drawEllipseLines( - int $centerX, - int $centerY, - float $radiusH, - float $radiusV, - Types\Color $color - ): void { - $this->ffi->DrawEllipseLines($centerX, $centerY, $radiusH, $radiusV, $color->toCData($this->ffi)); - } - - public function drawFPS(int $posX, int $posY): void - { - $this->ffi->DrawFPS($posX, $posY); - } - - public function drawGrid(int $slices, float $spacing): void - { - $this->ffi->DrawGrid($slices, $spacing); - } - - public function drawLine(int $x0, int $y0, int $x1, int $y1, Types\Color $color): void - { - $this->ffi->DrawLine($x0, $y0, $x1, $y1, $color->toCData($this->ffi)); - } - - /** - * @param array $points - * @param Types\Color $color - */ - public function drawLineStrip(array $points, Types\Color $color): void - { - $pointsCount = count($points); - if ($pointsCount === 0) { - return; - } - - $cdataPointsArray = $this->ffi->new(FFI::arrayType($this->ffi->type('Vector2'), [$pointsCount])); - - foreach ($points as $i => $vector2) { - $cdataPointsArray[$i] = $vector2->toCData($this->ffi); - } - - $this->ffi->DrawLineStrip( - $cdataPointsArray, - $pointsCount, - $color->toCData($this->ffi), - ); - } - - public function drawLineV(Types\Vector2 $startPos, Types\Vector2 $endPos, Types\Color $color): void - { - $this->ffi->DrawLineV( - $startPos->toCData($this->ffi), - $endPos->toCData($this->ffi), - $color->toCData($this->ffi) - ); - } - - public function drawLineEx(Types\Vector2 $startPos, Types\Vector2 $endPos, float $thick, Types\Color $color): void - { - $this->ffi->DrawLineEx( - $startPos->toCData($this->ffi), - $endPos->toCData($this->ffi), - $thick, - $color->toCData($this->ffi) - ); - } - - public function drawLineBezier( - Types\Vector2 $startPos, - Types\Vector2 $endPos, - float $thick, - Types\Color $color - ): void { - $this->ffi->DrawLineBezier( - $startPos->toCData($this->ffi), - $endPos->toCData($this->ffi), - $thick, - $color->toCData($this->ffi), - ); - } - - public function drawModelEx( - Types\Model $model, - Types\Vector3 $position, - Types\Vector3 $rotationAxis, - float $rotationAngle, - Types\Vector3 $scale, - Types\Color $tint - ): void { - $this->ffi->DrawModelEx( - $model->toCData($this->ffi), - $position->toCData($this->ffi), - $rotationAxis->toCData($this->ffi), - $rotationAngle, - $scale->toCData($this->ffi), - $tint->toCData($this->ffi), - ); - } - - public function drawPixel(int $posX, int $posY, Types\Color $color): void - { - $this->ffi->DrawPixel($posX, $posY, $color->toCData($this->ffi)); - } - - public function drawPixelV(Types\Vector2 $position, Types\Color $color): void - { - $this->ffi->DrawPixelV($position->toCData($this->ffi), $color->toCData($this->ffi)); - } - - public function drawPlane(Types\Vector3 $center, Types\Vector2 $size, Types\Color $color): void - { - $this->ffi->DrawPlane( - $center->toCData($this->ffi), - $size->toCData($this->ffi), - $color->toCData($this->ffi), - ); - } - - public function drawPoly( - Types\Vector2 $center, - int $sides, - float $radius, - float $rotation, - Types\Color $color - ): void { - $this->ffi->DrawPoly($center->toCData($this->ffi), $sides, $radius, $rotation, $color->toCData($this->ffi)); - } - - public function drawPolyLines( - Types\Vector2 $center, - int $sides, - float $radius, - float $rotation, - Types\Color $color - ): void { - $this->ffi->DrawPolyLines( - $center->toCData($this->ffi), - $sides, - $radius, - $rotation, - $color->toCData($this->ffi), - ); - } - - public function drawRay(Types\Ray $ray, Types\Color $color): void - { - $this->ffi->DrawRay($ray->toCData($this->ffi), $color->toCData($this->ffi)); - } - - public function drawRectangle(float $x, float $y, float $width, float $height, Types\Color $color): void - { - $this->ffi->DrawRectangle($x, $y, $width, $height, $color->toCData($this->ffi)); - } - - public function drawRectangleV(Types\Vector2 $position, Types\Vector2 $size, Types\Color $color): void - { - $this->ffi->DrawRectangleV( - $position->toCData($this->ffi), - $size->toCData($this->ffi), - $color->toCData($this->ffi) - ); - } - - public function drawRectangleGradientV( - int $posX, - int $posY, - int $width, - int $height, - Types\Color $color1, - Types\Color $color2, - ): void { - $this->ffi->DrawRectangleGradientV( - $posX, - $posY, - $width, - $height, - $color1->toCData($this->ffi), - $color2->toCData($this->ffi) - ); - } - - public function drawRectangleGradientH( - float $x, - float $y, - float $width, - float $height, - Types\Color $color1, - Types\Color $color2 - ): void { - $this->ffi->DrawRectangleGradientH( - $x, - $y, - $width, - $height, - $color1->toCData($this->ffi), - $color2->toCData($this->ffi) - ); - } - - public function drawRectangleGradientEx( - Types\Rectangle $rec, - Types\Color $col1, - Types\Color $col2, - Types\Color $col3, - Types\Color $col4 - ): void { - $this->ffi->DrawRectangleGradientEx( - $rec->toCData($this->ffi), - $col1->toCData($this->ffi), - $col2->toCData($this->ffi), - $col3->toCData($this->ffi), - $col4->toCData($this->ffi), - ); - } - - public function drawRectangleLines(float $x, float $y, float $width, float $height, Types\Color $color): void - { - $this->ffi->DrawRectangleLines($x, $y, $width, $height, $color->toCData($this->ffi)); - } - - public function drawRectangleLinesEx(Types\Rectangle $rectangle, int $lineThick, Types\Color $color): void - { - $this->ffi->DrawRectangleLinesEx($rectangle->toCData($this->ffi), $lineThick, $color->toCData($this->ffi)); - } - - public function drawRectangleRounded( - Types\Rectangle $rec, - float $roundness, - int $segments, - Types\Color $color - ): void { - $this->ffi->DrawRectangleRounded( - $rec->toCData($this->ffi), - $roundness, - $segments, - $color->toCData($this->ffi), - ); - } - - public function drawRectangleRoundedLines( - Types\Rectangle $rec, - float $roundness, - int $segments, - int $lineThick, - Types\Color $color - ): void { - $this->ffi->DrawRectangleRoundedLines( - $rec->toCData($this->ffi), - $roundness, - $segments, - $lineThick, - $color->toCData($this->ffi), - ); - } - - public function drawRectanglePro( - Types\Rectangle $rectangle, - Types\Vector2 $origin, - float $rotation, - Types\Color $color - ): void { - $this->ffi->DrawRectanglePro( - $rectangle->toCData($this->ffi), - $origin->toCData($this->ffi), - $rotation, - $color->toCData($this->ffi) - ); - } - - public function drawRectangleRec(Types\Rectangle $rec, Types\Color $color): void - { - $this->ffi->DrawRectangleRec($rec->toCData($this->ffi), $color->toCData($this->ffi)); - } - - public function drawRing( - Types\Vector2 $center, - float $innerRadius, - float $outerRadius, - int $startAngle, - int $endAngle, - int $segments, - Types\Color $color - ): void { - $this->ffi->DrawRing( - $center->toCData($this->ffi), - $innerRadius, - $outerRadius, - $startAngle, - $endAngle, - $segments, - $color->toCData($this->ffi) - ); - } - - public function drawRingLines( - Types\Vector2 $center, - float $innerRadius, - float $outerRadius, - int $startAngle, - int $endAngle, - int $segments, - Types\Color $color - ): void { - $this->ffi->DrawRingLines( - $center->toCData($this->ffi), - $innerRadius, - $outerRadius, - $startAngle, - $endAngle, - $segments, - $color->toCData($this->ffi) - ); - } - - public function drawSphere(Types\Vector3 $centerPos, float $radius, Types\Color $color): void - { - $this->ffi->DrawSphere( - $centerPos->toCData($this->ffi), - $radius, - $color->toCData($this->ffi), - ); - } - - public function drawSphereWires( - Types\Vector3 $centerPos, - float $radius, - int $rings, - int $slices, - Types\Color $color - ): void { - $this->ffi->DrawSphereWires( - $centerPos->toCData($this->ffi), - $radius, - $rings, - $slices, - $color->toCData($this->ffi), - ); - } - - public function drawText(string $text, int $x, int $y, int $fontSize, Types\Color $color): void - { - $this->ffi->DrawText($text, $x, $y, $fontSize, $color->toCData($this->ffi)); - } - - public function drawTextEx( - Types\Font $font, - string $text, - Types\Vector2 $position, - float $fontSize, - float $spacing, - Types\Color $tint - ): void { - $this->ffi->DrawTextEx( - $font->toCData($this->ffi), - $text, - $position->toCData($this->ffi), - $fontSize, - $spacing, - $tint->toCData($this->ffi) - ); - } - - public function drawTextRec( - Types\Font $font, - string $text, - Types\Rectangle $rec, - float $fontSize, - float $spacing, - bool $wordWrap, - Types\Color $tint - ): void { - $this->ffi->DrawTextRec( - $font->toCData($this->ffi), - $text, - $rec->toCData($this->ffi), - $fontSize, - $spacing, - $wordWrap, - $tint->toCData($this->ffi), - ); - } - - public function drawTextRecEx( - Types\Font $font, - string $text, - Types\Rectangle $rec, - float $fontSize, - float $spacing, - bool $wordWrap, - Types\Color $tint, - int $selectStart, - int $selectLength, - Types\Color $selectTint, - Types\Color $selectBackTint - ): void { - $this->ffi->DrawTextRecEx( - $font->toCData($this->ffi), - $text, - $rec->toCData($this->ffi), - $fontSize, - $spacing, - $wordWrap, - $tint->toCData($this->ffi), - $selectStart, - $selectLength, - $selectTint->toCData($this->ffi), - $selectBackTint->toCData($this->ffi), - ); - } - - public function drawTextCodepoint( - Types\Font $font, - int $codepoint, - Types\Vector2 $position, - float $fontSize, - Types\Color $tint - ): void { - $this->ffi->DrawTextCodepoint( - $font->toCData($this->ffi), - $codepoint, - $position->toCData($this->ffi), - $fontSize, - $tint->toCData($this->ffi), - ); - } - - public function drawTexture(Types\Texture2D $texture, int $posX, int $posY, Types\Color $tint): void - { - $this->ffi->DrawTexture($texture->toCData($this->ffi), $posX, $posY, $tint->toCData($this->ffi)); - } - - public function drawTextureEx( - Types\Texture2D $texture, - Types\Vector2 $position, - float $rotation, - float $scale, - Types\Color $tint - ): void { - $this->ffi->DrawTextureEx( - $texture->toCData($this->ffi), - $position->toCData($this->ffi), - $rotation, - $scale, - $tint->toCData($this->ffi), - ); - } - - public function drawTextureRec( - Types\Texture2D $texture, - Types\Rectangle $source, - Types\Vector2 $position, - Types\Color $tint - ): void { - $this->ffi->DrawTextureRec( - $texture->toCData($this->ffi), - $source->toCData($this->ffi), - $position->toCData($this->ffi), - $tint->toCData($this->ffi) - ); - } - - public function drawTexturePro( - Types\Texture2D $texture, - Types\Rectangle $source, - Types\Rectangle $dest, - Types\Vector2 $origin, - float $rotation, - Types\Color $tint - ): void { - $this->ffi->DrawTexturePro( - $texture->toCData($this->ffi), - $source->toCData($this->ffi), - $dest->toCData($this->ffi), - $origin->toCData($this->ffi), - $rotation, - $tint->toCData($this->ffi) - ); - } - - public function drawTextureTiled( - Types\Texture2D $texture, - Types\Rectangle $source, - Types\Rectangle $dest, - Types\Vector2 $origin, - float $rotation, - float $scale, - Types\Color $tint - ): void { - $this->ffi->DrawTextureTiled( - $texture->toCData($this->ffi), - $source->toCData($this->ffi), - $dest->toCData($this->ffi), - $origin->toCData($this->ffi), - $rotation, - $scale, - $tint->toCData($this->ffi), - ); - } - - public function drawTextureV( - Types\Texture2D $texture, - Types\Vector2 $position, - Types\Color $tint - ): void { - $this->ffi->DrawTextureV( - $texture->toCData($this->ffi), - $position->toCData($this->ffi), - $tint->toCData($this->ffi) - ); - } - - public function drawTriangle(Types\Vector2 $v1, Types\Vector2 $v2, Types\Vector2 $v3, Types\Color $color): void - { - $this->ffi->DrawTriangle( - $v1->toCData($this->ffi), - $v2->toCData($this->ffi), - $v3->toCData($this->ffi), - $color->toCData($this->ffi), - ); - } - - public function drawTriangleLines(Types\Vector2 $v1, Types\Vector2 $v2, Types\Vector2 $v3, Types\Color $color): void - { - $this->ffi->DrawTriangleLines( - $v1->toCData($this->ffi), - $v2->toCData($this->ffi), - $v3->toCData($this->ffi), - $color->toCData($this->ffi), - ); - } - - /** - * @param array $points - * @param Types\Color $color - */ - public function drawTriangleFan(array $points, Types\Color $color): void - { - $pointsCount = count($points); - if ($pointsCount === 0) { - return; - } - - $cdataPointsArray = $this->ffi->new(FFI::arrayType($this->ffi->type('Vector2'), [$pointsCount])); - - foreach ($points as $i => $vector2) { - $cdataPointsArray[$i] = $vector2->toCData($this->ffi); - } - - $this->ffi->DrawTriangleFan( - $cdataPointsArray, - $pointsCount, - $color->toCData($this->ffi), - ); - } - - /** - * @param array $points - * @param Types\Color $color - */ - public function drawTriangleStrip(array $points, Types\Color $color): void - { - $pointsCount = count($points); - if ($pointsCount === 0) { - return; - } - - $cdataPointsArray = $this->ffi->new(FFI::arrayType($this->ffi->type('Vector2'), [$pointsCount])); - - foreach ($points as $i => $vector2) { - $cdataPointsArray[$i] = $vector2->toCData($this->ffi); - } - - $this->ffi->DrawTriangleStrip( - $cdataPointsArray, - $pointsCount, - $color->toCData($this->ffi), - ); - } - - public function endBlendMode(): void - { - $this->ffi->EndBlendMode(); - } - - public function endDrawing(): void - { - $this->ffi->EndDrawing(); - } - - public function endMode2D(): void - { - $this->ffi->EndMode2D(); - } - - public function endMode3D(): void - { - $this->ffi->EndMode3D(); - } - - public function endScissorMode(): void - { - $this->ffi->EndScissorMode(); - } - - public function endTextureMode(): void - { - $this->ffi->EndTextureMode(); - } - - public function exportImage(Types\Image $image, string $fileName): bool - { - return $this->ffi->ExportImage($image->toCData($this->ffi), $fileName); - } - - /** - * @psalm-suppress UndefinedPropertyFetch - * @psalm-suppress MixedArgument - */ - public function fade(Types\Color $color, float $alpha): Types\Color - { - $colorStruct = $this->ffi->Fade($color->toCData($this->ffi), $alpha); - - return new Types\Color($colorStruct->r, $colorStruct->g, $colorStruct->b, $colorStruct->a); - } - - public function colorToInt(Types\Color $color): int - { - return $this->ffi->ColorToInt($color->toCData($this->ffi)); - } - - /** - * @psalm-suppress UndefinedPropertyFetch - */ - public function colorNormalize(Types\Color $color): Types\Vector4 - { - $vec4 = $this->ffi->ColorNormalize($color->toCData($this->ffi)); - - return new Types\Vector4( - $vec4->x, - $vec4->y, - $vec4->z, - $vec4->w, - ); - } - - /** - * @psalm-suppress UndefinedPropertyFetch - */ - public function colorFromNormalized(Types\Vector4 $normalized): Types\Color - { - $color = $this->ffi->ColorFromNormalized($normalized->toCData($this->ffi)); - - return new Types\Color( - $color->r, - $color->g, - $color->b, - $color->a, - ); - } - - /** - * @psalm-suppress UndefinedPropertyFetch - */ - public function colorToHSV(Types\Color $color): Types\Vector3 - { - $vec3 = $this->ffi->ColorToHSV($color->toCData($this->ffi)); - - return new Types\Vector3( - $vec3->x, - $vec3->y, - $vec3->z, - ); - } - - /** - * @psalm-suppress UndefinedPropertyFetch - */ - public function colorFromHSV(float $hue, float $saturation, float $value): Types\Color - { - $color = $this->ffi->ColorFromHSV($hue, $saturation, $value); - - return new Types\Color( - $color->r, - $color->g, - $color->b, - $color->a, - ); - } - - /** - * @psalm-suppress UndefinedPropertyFetch - * @psalm-suppress MixedArgument - */ - public function genImageCellular(int $width, int $height, int $tileSize): Types\Image - { - $image = $this->ffi->GenImageCellular($width, $height, $tileSize); - - return new Types\Image( - $image->data, - $image->width, - $image->height, - $image->mipmaps, - $image->format - ); - } - - /** - * @psalm-suppress UndefinedPropertyFetch - * @psalm-suppress MixedArgument - */ - public function genImageChecked( - int $width, - int $height, - int $checksX, - int $checksY, - Types\Color $col1, - Types\Color $col2 - ): Types\Image { - $image = $this->ffi->GenImageChecked( - $width, - $height, - $checksX, - $checksY, - $col1->toCData($this->ffi), - $col2->toCData($this->ffi) - ); - - return new Types\Image( - $image->data, - $image->width, - $image->height, - $image->mipmaps, - $image->format - ); - } - - /** - * @psalm-suppress UndefinedPropertyFetch - * @psalm-suppress MixedArgument - */ - public function genImageGradientH( - int $width, - int $height, - Types\Color $left, - Types\Color $right - ): Types\Image { - $image = $this->ffi->GenImageGradientH( - $width, - $height, - $left->toCData($this->ffi), - $right->toCData($this->ffi) - ); - - return new Types\Image( - $image->data, - $image->width, - $image->height, - $image->mipmaps, - $image->format - ); - } - - /** - * @psalm-suppress UndefinedPropertyFetch - * @psalm-suppress MixedArgument - */ - public function genImageGradientRadial( - int $width, - int $height, - float $density, - Types\Color $inner, - Types\Color $outer - ): Types\Image { - $image = $this->ffi->GenImageGradientRadial( - $width, - $height, - $density, - $inner->toCData($this->ffi), - $outer->toCData($this->ffi) - ); - - return new Types\Image( - $image->data, - $image->width, - $image->height, - $image->mipmaps, - $image->format - ); - } - - /** - * @psalm-suppress UndefinedPropertyFetch - * @psalm-suppress MixedArgument - */ - public function genImageGradientV( - int $width, - int $height, - Types\Color $top, - Types\Color $bottom - ): Types\Image { - $image = $this->ffi->GenImageGradientV( - $width, - $height, - $top->toCData($this->ffi), - $bottom->toCData($this->ffi) - ); - - return new Types\Image( - $image->data, - $image->width, - $image->height, - $image->mipmaps, - $image->format - ); - } - - /** - * @psalm-suppress UndefinedPropertyFetch - * @psalm-suppress MixedArgument - */ - public function genImagePerlinNoise( - int $width, - int $height, - int $offsetX, - int $offsetY, - float $scale - ): Types\Image { - $image = $this->ffi->GenImagePerlinNoise( - $width, - $height, - $offsetX, - $offsetY, - $scale - ); - - return new Types\Image( - $image->data, - $image->width, - $image->height, - $image->mipmaps, - $image->format - ); - } - - /** - * @psalm-suppress UndefinedPropertyFetch - * @psalm-suppress MixedArgument - */ - public function genImageWhiteNoise(int $width, int $height, float $factor): Types\Image - { - $image = $this->ffi->GenImageWhiteNoise( - $width, - $height, - $factor - ); - - return new Types\Image( - $image->data, - $image->width, - $image->height, - $image->mipmaps, - $image->format - ); - } - - public function getClipboardText(): string - { - return $this->ffi->GetClipboardText(); - } - - /** - * @psalm-suppress UndefinedPropertyFetch - * @psalm-suppress MixedArgument - */ - public function getColor(int $hex): Types\Color - { - $color = $this->ffi->GetColor($hex); - - return new Types\Color($color->r, $color->g, $color->b, $color->a); - } - - /** - * @psalm-suppress UndefinedPropertyFetch - * @psalm-suppress MixedArgument - */ - public function getCollisionRec(Types\Rectangle $rec1, Types\Rectangle $rec2): Types\Rectangle - { - $rec = $this->ffi->GetCollisionRec($rec1->toCData($this->ffi), $rec2->toCData($this->ffi)); - - return new Types\Rectangle($rec->x, $rec->y, $rec->width, $rec->height); - } - - public function getCameraMatrix(Types\Camera3D $camera): Types\Matrix - { - $matrixCData = $this->ffi->GetCameraMatrix($camera->toCData($this->ffi)); - $matrix = new Types\Matrix(...array_fill(0, 16, 0.0)); - - for ($i = 0; $i < 15; ++$i) { - $matrix->{"m{$i}"} = $matrixCData->{"m{$i}"}; - } - - return $matrix; - } - - public function getCameraMatrix2D(Types\Camera2D $camera): Types\Matrix - { - $matrixCData = $this->ffi->GetCameraMatrix2D($camera->toCData($this->ffi)); - $matrix = new Types\Matrix(...array_fill(0, 16, 0.0)); - - for ($i = 0; $i < 15; ++$i) { - $matrix->{"m{$i}"} = $matrixCData->{"m{$i}"}; - } - - return $matrix; - } - - public function getFPS(): int - { - return $this->ffi->GetFPS(); - } - - public function getFrameTime(): float - { - return $this->ffi->GetFrameTime(); - } - - /** - * @deprecated Please, use method loadImageColors() - */ - public function getImageData(Types\Image $image): CData - { - return $this->loadImageColors($image); - } - - public function getGestureDetected(): int - { - return $this->ffi->GetGestureDetected(); - } - - public function getKeyPressed(): int - { - return $this->ffi->GetKeyPressed(); - } - - public function getCharPressed(): int - { - return $this->ffi->GetCharPressed(); - } - - /** - * @psalm-suppress MixedArgument - * @psalm-suppress UndefinedPropertyFetch - */ - public function getMousePosition(): Types\Vector2 - { - $vec2Struct = $this->ffi->GetMousePosition(); - - return new Types\Vector2($vec2Struct->x, $vec2Struct->y); - } - - /** - * @psalm-suppress MixedArgument - * @psalm-suppress MixedAssignment - * @psalm-suppress MixedPropertyFetch - * @psalm-suppress UndefinedPropertyFetch - */ - public function getMouseRay(Types\Vector2 $mousePosition, Types\Camera3D $camera): Types\Ray - { - $rayStruct = $this->ffi->GetMouseRay($mousePosition->toCData($this->ffi), $camera->toCData($this->ffi)); - - return new Types\Ray( - new Types\Vector3($rayStruct->position->x, $rayStruct->position->y, $rayStruct->position->z), - new Types\Vector3($rayStruct->direction->x, $rayStruct->direction->y, $rayStruct->direction->z), - ); - } - - public function getMouseWheelMove(): float - { - return $this->ffi->GetMouseWheelMove(); - } - - public function getMouseX(): int - { - return $this->ffi->GetMouseX(); - } - - public function getMouseY(): int - { - return $this->ffi->GetMouseY(); - } - - public function getMusicTimeLength(Types\Music $music): float - { - return $this->ffi->GetMusicTimeLength($music->toCData($this->ffi)); - } - - public function getMusicTimePlayed(Types\Music $music): float - { - return $this->ffi->GetMusicTimePlayed($music->toCData($this->ffi)); - } - - public function getRandomValue(int $min, int $max): int - { - return $this->ffi->GetRandomValue($min, $max); - } - - public function getMonitorCount(): int - { - return $this->ffi->GetMonitorCount(); - } - - public function getMonitorName(int $monitor): string - { - return $this->ffi->GetMonitorName($monitor); - } - - /** - * @psalm-suppress MixedArgument - * @psalm-suppress MixedPropertyFetch - * @psalm-suppress UndefinedPropertyFetch - */ - public function getMonitorPosition(int $monitor): Types\Vector2 - { - $vec = $this->ffi->GetMonitorPosition($monitor); - - return new Types\Vector2($vec->x, $vec->y); - } - - public function getMonitorWidth(int $monitor): int - { - return $this->ffi->GetMonitorWidth($monitor); - } - - public function getMonitorHeight(int $monitor): int - { - return $this->ffi->GetMonitorHeight($monitor); - } - - public function getMonitorPhysicalWidth(int $monitor): int - { - return $this->ffi->GetMonitorPhysicalWidth($monitor); - } - - public function getMonitorPhysicalHeight(int $monitor): int - { - return $this->ffi->GetMonitorPhysicalHeight($monitor); - } - - public function getMonitorRefreshRate(int $monitor): int - { - return $this->ffi->GetMonitorRefreshRate($monitor); - } - - /** - * @psalm-suppress MixedArgument - * @psalm-suppress MixedPropertyFetch - * @psalm-suppress UndefinedPropertyFetch - */ - public function getWindowPosition(): Types\Vector2 - { - $vec = $this->ffi->GetWindowPosition(); - - return new Types\Vector2($vec->x, $vec->y); - } - - /** - * @psalm-suppress MixedArgument - * @psalm-suppress MixedPropertyFetch - * @psalm-suppress UndefinedPropertyFetch - */ - public function getWindowScaleDPI(): Types\Vector2 - { - $vec = $this->ffi->GetWindowScaleDPI(); - - return new Types\Vector2($vec->x, $vec->y); - } - - /** - * @psalm-suppress UndefinedPropertyFetch - * @psalm-suppress MixedArgument - */ - public function getScreenToWorld2D(Types\Vector2 $position, Types\Camera2D $camera): Types\Vector2 - { - $vec = $this->ffi->GetScreenToWorld2D($position->toCData($this->ffi), $camera->toCData($this->ffi)); - - return new Types\Vector2($vec->x, $vec->y); - } - - public function getScreenWidth(): int - { - return $this->ffi->GetScreenWidth(); - } - - public function getScreenHeight(): int - { - return $this->ffi->GetScreenHeight(); - } - - public function getSoundsPlaying(): int - { - return $this->ffi->GetSoundsPlaying(); - } - - /** - * @psalm-suppress UndefinedPropertyFetch - * @psalm-suppress MixedArgument - */ - public function getTextureData(Types\Texture2D $texture): Types\Image - { - $texture = $this->ffi->GetTextureData($texture->toCData($this->ffi)); - - return new Types\Image( - $texture->data, - $texture->width, - $texture->height, - $texture->mipmaps, - $texture->format, - ); - } - - public function getTime(): float - { - return $this->ffi->GetTime(); - } - - /** - * @psalm-suppress UndefinedPropertyFetch - * @psalm-suppress MixedArgument - */ - public function getTouchPosition(int $index): Types\Vector2 - { - $vec = $this->ffi->GetTouchPosition($index); - - return new Types\Vector2($vec->x, $vec->y); - } - - /** - * @psalm-suppress UndefinedPropertyFetch - * @psalm-suppress MixedArgument - */ - public function getWorldToScreen(Types\Vector3 $position, Types\Camera3D $camera): Types\Vector2 - { - $vec = $this->ffi->GetWorldToScreen($position->toCData($this->ffi), $camera->toCData($this->ffi)); - - return new Types\Vector2($vec->x, $vec->y); - } - - /** - * @psalm-suppress UndefinedPropertyFetch - * @psalm-suppress MixedArgument - */ - public function getWorldToScreen2D(Types\Vector2 $position, Types\Camera2D $camera): Types\Vector2 - { - $vec = $this->ffi->GetWorldToScreen2D($position->toCData($this->ffi), $camera->toCData($this->ffi)); - - return new Types\Vector2($vec->x, $vec->y); - } - - /** - * @psalm-suppress InvalidPassByReference - * @psalm-suppress MixedArgument - * @psalm-suppress MixedAssignment - * @psalm-suppress UndefinedPropertyFetch - */ - public function imageColorBrightness(Types\Image $image, int $brightness): void - { - $imageStruct = $image->toCData($this->ffi); - $this->ffi->ImageColorBrightness(FFI::addr($imageStruct), $brightness); - - $image->updateImageObject($image, $imageStruct); - } - - /** - * @psalm-suppress InvalidPassByReference - * @psalm-suppress MixedArgument - * @psalm-suppress MixedAssignment - * @psalm-suppress UndefinedPropertyFetch - */ - public function imageColorContrast(Types\Image $image, float $contrast): void - { - $imageStruct = $image->toCData($this->ffi); - $this->ffi->ImageColorContrast(FFI::addr($imageStruct), $contrast); - - $image->updateImageObject($image, $imageStruct); - } - - /** - * @psalm-suppress InvalidPassByReference - * @psalm-suppress MixedArgument - * @psalm-suppress MixedAssignment - * @psalm-suppress UndefinedPropertyFetch - */ - public function imageColorGrayscale(Types\Image $image): void - { - $imageStruct = $image->toCData($this->ffi); - $this->ffi->ImageColorGrayscale(FFI::addr($imageStruct)); - - $image->updateImageObject($image, $imageStruct); - } - - /** - * @psalm-suppress InvalidPassByReference - * @psalm-suppress MixedArgument - * @psalm-suppress MixedAssignment - * @psalm-suppress UndefinedPropertyFetch - */ - public function imageColorInvert(Types\Image $image): void - { - $imageStruct = $image->toCData($this->ffi); - $this->ffi->ImageColorInvert(FFI::addr($imageStruct)); - - $image->updateImageObject($image, $imageStruct); - } - - /** - * @psalm-suppress InvalidPassByReference - * @psalm-suppress MixedArgument - * @psalm-suppress MixedAssignment - * @psalm-suppress UndefinedPropertyFetch - */ - public function imageColorTint(Types\Image $image, Types\Color $color): void - { - $imageStruct = $image->toCData($this->ffi); - $this->ffi->ImageColorTint(FFI::addr($imageStruct), $color->toCData($this->ffi)); - - $image->updateImageObject($image, $imageStruct); - } - - /** - * @psalm-suppress InvalidPassByReference - * @psalm-suppress MixedArgument - * @psalm-suppress MixedAssignment - * @psalm-suppress UndefinedPropertyFetch - */ - public function imageCrop(Types\Image $image, Types\Rectangle $crop): void - { - $imageStruct = $image->toCData($this->ffi); - $this->ffi->ImageCrop(FFI::addr($imageStruct), $crop->toCData($this->ffi)); - - $image->updateImageObject($image, $imageStruct); - } - - /** - * @psalm-suppress InvalidPassByReference - * @psalm-suppress MixedArgument - * @psalm-suppress MixedAssignment - * @psalm-suppress UndefinedPropertyFetch - */ - public function imageDraw( - Types\Image $dst, - Types\Image $src, - Types\Rectangle $srcRec, - Types\Rectangle $dstRec, - Types\Color $tint - ): void { - $imageStruct = $dst->toCData($this->ffi); - $this->ffi->ImageDraw( - FFI::addr($imageStruct), - $src->toCData($this->ffi), - $srcRec->toCData($this->ffi), - $dstRec->toCData($this->ffi), - $tint->toCData($this->ffi) - ); - - $dst->updateImageObject($dst, $imageStruct); - } - - /** - * @psalm-suppress InvalidPassByReference - * @psalm-suppress MixedArgument - * @psalm-suppress MixedAssignment - * @psalm-suppress UndefinedPropertyFetch - */ - public function imageDrawCircle( - Types\Image $dst, - int $centerX, - int $centerY, - int $radius, - Types\Color $color - ): void { - $imageStruct = $dst->toCData($this->ffi); - $this->ffi->ImageDrawCircle( - FFI::addr($imageStruct), - $centerX, - $centerY, - $radius, - $color->toCData($this->ffi) - ); - - $dst->updateImageObject($dst, $imageStruct); - } - - /** - * @psalm-suppress InvalidPassByReference - * @psalm-suppress MixedArgument - * @psalm-suppress MixedAssignment - * @psalm-suppress UndefinedPropertyFetch - */ - public function imageDrawPixel( - Types\Image $dst, - int $posX, - int $posY, - Types\Color $tint - ): void { - $imageStruct = $dst->toCData($this->ffi); - $this->ffi->ImageDrawPixel( - FFI::addr($imageStruct), - $posX, - $posY, - $tint->toCData($this->ffi) - ); - - $dst->updateImageObject($dst, $imageStruct); - } - - /** - * @psalm-suppress InvalidPassByReference - * @psalm-suppress MixedArgument - * @psalm-suppress MixedAssignment - * @psalm-suppress UndefinedPropertyFetch - */ - public function imageDrawRectangle( - Types\Image $dst, - int $posX, - int $posY, - int $width, - int $height, - Types\Color $color - ): void { - $imageStruct = $dst->toCData($this->ffi); - $this->ffi->ImageDrawRectangle( - FFI::addr($imageStruct), - $posX, - $posY, - $width, - $height, - $color->toCData($this->ffi) - ); - - $dst->updateImageObject($dst, $imageStruct); - } - - /** - * @psalm-suppress InvalidPassByReference - * @psalm-suppress MixedArgument - * @psalm-suppress MixedAssignment - * @psalm-suppress UndefinedPropertyFetch - */ - public function imageDrawTextEx( - Types\Image $dst, - Types\Font $font, - string $text, - Types\Vector2 $position, - float $fontSize, - float $spacing, - Types\Color $tint - ): void { - $imageStruct = $dst->toCData($this->ffi); - $this->ffi->ImageDrawTextEx( - FFI::addr($imageStruct), - $font->toCData($this->ffi), - $text, - $position->toCData($this->ffi), - $fontSize, - $spacing, - $tint->toCData($this->ffi) - ); - } - - /** - * @psalm-suppress InvalidPassByReference - * @psalm-suppress MixedArgument - * @psalm-suppress MixedAssignment - * @psalm-suppress UndefinedPropertyFetch - */ - public function imageFlipHorizontal(Types\Image $image): void - { - $imageStruct = $image->toCData($this->ffi); - $this->ffi->ImageFlipHorizontal(FFI::addr($imageStruct)); - - $image->updateImageObject($image, $imageStruct); - } - - /** - * @psalm-suppress InvalidPassByReference - * @psalm-suppress MixedArgument - * @psalm-suppress MixedAssignment - * @psalm-suppress UndefinedPropertyFetch - */ - public function imageFlipVertical(Types\Image $image): void - { - $imageStruct = $image->toCData($this->ffi); - $this->ffi->ImageFlipVertical(FFI::addr($imageStruct)); - - $image->updateImageObject($image, $imageStruct); - } - - /** - * @psalm-suppress InvalidPassByReference - * @psalm-suppress MixedArgument - * @psalm-suppress MixedAssignment - * @psalm-suppress UndefinedPropertyFetch - */ - public function imageFormat(Types\Image $image, int $newFormat): void - { - $imageStruct = $image->toCData($this->ffi); - $this->ffi->ImageFormat(FFI::addr($imageStruct), $newFormat); - - $image->updateImageObject($image, $imageStruct); - } - - /** - * @psalm-suppress InvalidPassByReference - * @psalm-suppress MixedArgument - * @psalm-suppress MixedAssignment - * @psalm-suppress UndefinedPropertyFetch - */ - public function imageResize(Types\Image $image, int $newWidth, int $newHeight): void - { - $imageStruct = $image->toCData($this->ffi); - $this->ffi->ImageResize(FFI::addr($imageStruct), $newWidth, $newHeight); - - $image->updateImageObject($image, $imageStruct); - } - - public function initAudioDevice(): void - { - $this->ffi->InitAudioDevice(); - } - - public function initWindow(int $width, int $height, string $title): void - { - $this->ffi->InitWindow($width, $height, $title); - } - - public function isKeyDown(int $key): bool - { - return $this->ffi->IsKeyDown($key); - } - - public function isKeyPressed(int $key): bool - { - return $this->ffi->IsKeyPressed($key); - } - - public function isKeyReleased(int $key): bool - { - return $this->ffi->IsKeyReleased($key); - } - - public function isKeyUp(int $key): bool - { - return $this->ffi->IsKeyUp($key); - } - - public function isMouseButtonDown(int $button): bool - { - return $this->ffi->IsMouseButtonDown($button); - } - - public function isMouseButtonPressed(int $button): bool - { - return $this->ffi->IsMouseButtonPressed($button); - } - - public function isMouseButtonUp(int $button): bool - { - return $this->ffi->IsMouseButtonUp($button); - } - - public function isMouseButtonReleased(int $button): bool - { - return $this->ffi->IsMouseButtonReleased($button); - } - - public function isWindowFocused(): bool - { - return $this->ffi->IsWindowFocused(); - } - - public function isWindowFullscreen(): bool - { - return $this->ffi->IsWindowFullscreen(); - } - - public function isWindowHidden(): bool - { - return $this->ffi->IsWindowHidden(); - } - - public function isWindowMaximized(): bool - { - return $this->ffi->IsWindowMaximized(); - } - - public function isWindowMinimized(): bool - { - return $this->ffi->IsWindowMinimized(); - } - - public function isWindowReady(): bool - { - return $this->ffi->IsWindowReady(); - } - - public function isWindowResized(): bool - { - return $this->ffi->IsWindowResized(); - } - - public function isWindowState(int $flag): bool - { - return $this->ffi->IsWindowState($flag); - } - - /** - * @psalm-suppress UndefinedPropertyFetch - * @psalm-suppress MixedArgument - * @psalm-suppress MixedPropertyFetch - */ - public function loadFont(string $filename): Types\Font - { - $font = $this->ffi->LoadFont($filename); - $texture = new Types\Texture2D( - $font->texture->id, - $font->texture->width, - $font->texture->height, - $font->texture->mipmaps, - $font->texture->format - ); - - return new Types\Font( - $font->baseSize, - $font->charsCount, - $font->charsPadding, - $texture, - $font->recs, - $font->chars - ); - } - - /** - * @psalm-suppress UndefinedPropertyFetch - * @psalm-suppress InvalidArgument - * @psalm-suppress InvalidPassByReference - * @psalm-suppress MixedArrayAssignment - * @psalm-suppress MixedArgument - * @psalm-suppress MixedAssignment - * @psalm-suppress MixedAssignment - * @psalm-suppress MixedPropertyFetch - */ - public function loadFontEx(string $fileName, int $fontSize, int $fontChars, int $charsCount): Types\Font - { - $fontCharsPointer = $this->ffi->new('int*'); - - $font = $this->ffi->LoadFontEx($fileName, $fontSize, $fontCharsPointer, $charsCount); - - $texture = new Types\Texture2D( - $font->texture->id, - $font->texture->width, - $font->texture->height, - $font->texture->mipmaps, - $font->texture->format, - ); - - return new Types\Font( - $font->baseSize, - $font->charsCount, - $font->charsPadding, - $texture, - $font->recs, - $font->chars - ); - } - - public function loadImageColors(Types\Image $image): CData - { - return $this->ffi->LoadImageColors($image->toCData($this->ffi)); - } - - /** - * @psalm-suppress UndefinedPropertyFetch - * @psalm-suppress MixedArgument - */ - public function loadImage(string $filename): Types\Image - { - $image = $this->ffi->LoadImage($filename); - - return new Types\Image($image->data, $image->width, $image->height, $image->mipmaps, $image->format); - } - - /** - * @psalm-suppress UndefinedPropertyFetch - * @psalm-suppress MixedArgument - * @psalm-suppress MixedPropertyFetch - */ - public function loadModel(string $filename): Types\Model - { - $model = $this->ffi->LoadModel($filename); - - return new Types\Model( - $model->transform, - $model->meshCount, - $model->materialCount, - $model->meshes, - $model->materials, - $model->meshMaterial, - $model->boneCount, - $model->bones, - $model->bindPose, - ); - } - - /** - * @psalm-suppress UndefinedPropertyFetch - * @psalm-suppress MixedArgument - * @psalm-suppress MixedPropertyFetch - */ - public function loadModelAnimations(string $filename, int &$animationsCount): CData - { - $count = $this->ffi->new('int'); - $animations = $this->ffi->LoadModelAnimations($filename, FFI::addr($count)); - $animationsCount = (int) $count->cdata; - - return $animations; - } - - /** - * @psalm-suppress UndefinedPropertyFetch - * @psalm-suppress MixedArgument - * @psalm-suppress MixedPropertyFetch - */ - public function loadMusicStream(string $filename): Types\Music - { - $music = $this->ffi->LoadMusicStream($filename); - - return new Types\Music( - new Types\AudioStream( - $music->stream->buffer, - $music->stream->sampleRate, - $music->stream->sampleSize, - $music->stream->channels, - ), - $music->sampleCount, - $music->looping, - $music->ctxType, - $music->ctxData - ); - } - - /** - * @psalm-suppress UndefinedPropertyFetch - * @psalm-suppress MixedArgument - * @psalm-suppress MixedPropertyFetch - */ - public function loadSound(string $filename): Types\Sound - { - $audio = $this->ffi->LoadSound($filename); - - return new Types\Sound( - new Types\AudioStream( - $audio->stream->buffer, - $audio->stream->sampleRate, - $audio->stream->sampleSize, - $audio->stream->channels, - ), - $audio->sampleCount, - ); - } - - public function loadStorageValue(int $position): int - { - return $this->ffi->LoadStorageValue($position); - } - - /** - * @psalm-suppress UndefinedPropertyFetch - * @psalm-suppress MixedArgument - */ - public function loadTexture(string $path): Types\Texture2D - { - $texture = $this->ffi->LoadTexture($path); - - return new Types\Texture2D( - $texture->id, - $texture->width, - $texture->height, - $texture->mipmaps, - $texture->format, - ); - } - - /** - * @psalm-suppress UndefinedPropertyFetch - * @psalm-suppress MixedArgument - */ - public function loadTextureFromImage(Types\Image $image): Types\Texture2D - { - $texture = $this->ffi->LoadTextureFromImage($image->toCData($this->ffi)); - - return new Types\Texture2D( - $texture->id, - $texture->width, - $texture->height, - $texture->mipmaps, - $texture->format, - ); - } - - /** - * @psalm-suppress InvalidPassByReference - * @psalm-suppress MixedArgument - * @psalm-suppress MixedAssignment - * @psalm-suppress MixedPropertyFetch - * @psalm-suppress UndefinedPropertyFetch - */ - public function loadRenderTexture(int $width, int $height): Types\RenderTexture2D - { - $renderTexture = $this->ffi->LoadRenderTexture($width, $height); - $texture = new Types\Texture2D( - $renderTexture->texture->id, - $renderTexture->texture->width, - $renderTexture->texture->height, - $renderTexture->texture->mipmaps, - $renderTexture->texture->format, - ); - - $depth = new Types\Texture2D( - $renderTexture->depth->id, - $renderTexture->depth->width, - $renderTexture->depth->height, - $renderTexture->depth->mipmaps, - $renderTexture->depth->format, - ); - - return new Types\RenderTexture2D( - $renderTexture->id, - $texture, - $depth - ); - } - - public function maximizeWindow(): void - { - $this->ffi->MaximizeWindow(); - } - - public function measureText(string $text, int $fontSize): int - { - return $this->ffi->MeasureText($text, $fontSize); - } - - public function minimizeWindow(): void - { - $this->ffi->MinimizeWindow(); - } - - public function pauseMusicStream(Types\Music $music): void - { - $this->ffi->PauseMusicStream($music->toCData($this->ffi)); - } - - public function playMusicStream(Types\Music $music): void - { - $this->ffi->PlayMusicStream($music->toCData($this->ffi)); - } - - public function playSound(Types\Sound $sound): void - { - $this->ffi->PlaySound($sound->toCData($this->ffi)); - } - - public function playSoundMulti(Types\Sound $sound): void - { - $this->ffi->PlaySoundMulti($sound->toCData($this->ffi)); - } - - public function resumeMusicStream(Types\Music $music): void - { - $this->ffi->ResumeMusicStream($music->toCData($this->ffi)); - } - - public function restoreWindow(): void - { - $this->ffi->RestoreWindow(); - } - - public function saveStorageValue(int $position, int $value): bool - { - return $this->ffi->SaveStorageValue($position, $value); - } - - public function setCameraMode(Types\Camera3D $camera, int $mode): void - { - $this->ffi->SetCameraMode($camera->toCData($this->ffi), $mode); - } - - public function setClipboardText(string $text): void - { - $this->ffi->SetClipboardText($text); - } - - public function setConfigFlags(int $flags): void - { - $this->ffi->SetConfigFlags($flags); - } - - public function setExitKey(int $key): void - { - $this->ffi->SetExitKey($key); - } - - /** - * @psalm-suppress MixedAssignment - * @psalm-suppress MixedArgument - */ - public function setMaterialTexture(CData $material, int $mapType, Types\Texture2D $texture): void - { - $materialAddr = FFI::addr($material); - $this->ffi->SetMaterialTexture($materialAddr, $mapType, $texture->toCData($this->ffi)); - } - - public function setMousePosition(int $x, int $y): void - { - $this->ffi->SetMousePosition($x, $y); - } - - public function setMouseOffset(int $offsetX, int $offsetY): void - { - $this->SetMouseScale($offsetX, $offsetY); - } - - public function setMouseScale(float $scaleX, float $scaleY): void - { - $this->SetMouseScale($scaleX, $scaleY); - } - - public function setMusicPitch(Types\Music $music, float $pitch): void - { - $this->ffi->SetMusicPitch($music->toCData($this->ffi), $pitch); - } - - public function setSoundVolume(Types\Sound $sound, float $volume): void - { - $this->ffi->SetSoundVolume($sound->toCData($this->ffi), $volume); - } - - public function setTargetFPS(int $fps): void - { - $this->ffi->SetTargetFPS($fps); - } - - public function setTextureFilter(Types\Texture2D $texture, int $filterMode): void - { - $this->ffi->SetTextureFilter($texture->toCData($this->ffi), $filterMode); - } - - public function setWindowIcon(Types\Image $image): void - { - $this->ffi->SetWindowIcon($image->toCData($this->ffi)); - } - - public function setWindowMinSize(int $width, int $height): void - { - $this->ffi->SetWindowMinSize($width, $height); - } - - public function setWindowMonitor(int $monitor): void - { - $this->ffi->SetWindowMonitor($monitor); - } - - public function setWindowPosition(int $x, int $y): void - { - $this->ffi->SetWindowPosition($x, $y); - } - - public function setWindowSize(int $width, int $height): void - { - $this->ffi->SetWindowSize($width, $height); - } - - public function setWindowState(int $flags): void - { - $this->ffi->SetWindowState($flags); - } - - public function setWindowTitle(string $title): void - { - $this->ffi->SetWindowTitle($title); - } - - public function showCursor(): void - { - $this->ffi->ShowCursor(); - } - - public function hideCursor(): void - { - $this->ffi->HideCursor(); - } - - public function isCursorHidden(): bool - { - return $this->ffi->IsCursorHidden(); - } - - public function enableCursor(): void - { - $this->ffi->EnableCursor(); - } - - public function disableCursor(): void - { - $this->ffi->DisableCursor(); - } - - public function isCursorOnScreen(): bool - { - return $this->ffi->IsCursorOnScreen(); - } - - public function stopMusicStream(Types\Music $music): void - { - $this->ffi->StopMusicStream($music->toCData($this->ffi)); - } - - public function stopSoundMulti(): void - { - $this->ffi->StopSoundMulti(); - } - - /** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgument - */ - public function textFormat(string $format, ...$args): string - { - return sprintf($format, ...$args); - } - - /** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgument - * @psalm-suppress MixedAssignment - * @psalm-suppress MixedPropertyFetch - */ - public function updateTexture(Types\Texture2D $texture, CDATA $pixels): void - { - $this->ffi->UpdateTexture($texture->toCData($this->ffi), $pixels); - } - - public function textSubtext(string $text, int $position, int $length): string - { - return $this->ffi->TextSubtext($text, $position, $length); - } - - public function unloadFont(Types\Font $font): void - { - $this->ffi->UnloadFont($font->toCData($this->ffi)); - } - - public function toggleFullscreen(): void - { - $this->ffi->ToggleFullscreen(); - } - - /** - * @param mixed[] $args - */ - public function traceLog(int $type, string $format, ...$args): void - { - $this->ffi->TraceLog($type, $format, ...$args); - } - - public function unloadImage(Types\Image $image): void - { - $this->ffi->UnloadImage($image->toCData($this->ffi)); - } - - public function unloadModel(Types\Model $model): void - { - $this->ffi->UnloadModel($model->toCData($this->ffi)); - } - - public function unloadModelAnimation(CData $animation): void - { - $this->ffi->UnloadModelAnimation($animation); - } - - public function unloadMusicStream(Types\Music $music): void - { - $this->ffi->UnloadMusicStream($music->toCData($this->ffi)); - } - - public function unloadRenderTexture(Types\RenderTexture2D $target): void - { - $this->ffi->UnloadRenderTexture($target->toCData($this->ffi)); - } - - public function unloadSound(Types\Sound $sound): void - { - $this->ffi->UnloadSound($sound->toCData($this->ffi)); - } - - public function unloadTexture(Types\Texture2D $texture): void - { - $this->ffi->UnloadTexture($texture->toCData($this->ffi)); - } - - /** - * @psalm-suppress InvalidPassByReference - * @psalm-suppress MixedArgument - * @psalm-suppress MixedAssignment - * @psalm-suppress MixedPropertyFetch - */ - public function updateCamera(Types\Camera3D $camera): void - { - // Raylib's UpdateCamera() expects a struct *Camera3D - // So we pass by ref here. Given it will write to the - // camera object, we need to update on PHP side as well. - $cdata = FFI::addr($camera->toCData($this->ffi)); - $this->ffi->UpdateCamera($cdata); - - $camera->position->x = $cdata->position->x; - $camera->position->y = $cdata->position->y; - $camera->position->z = $cdata->position->z; - - $camera->target->x = $cdata->target->x; - $camera->target->y = $cdata->target->y; - $camera->target->z = $cdata->target->z; - - $camera->up->x = $cdata->up->x; - $camera->up->y = $cdata->up->y; - $camera->up->z = $cdata->up->z; - - $camera->fovy = $cdata->fovy; - $camera->projection = $cdata->projection; - } - - public function updateModelAnimation(Types\Model $model, CData $animation, int $frame): void - { - $this->ffi->UpdateModelAnimation( - $model->toCData($this->ffi), - $animation, - $frame, - ); - } - - public function updateMusicStream(Types\Music $music): void - { - $this->ffi->UpdateMusicStream($music->toCData($this->ffi)); - } - - public function windowShouldClose(): bool - { - return $this->ffi->WindowShouldClose(); - } - - public function vector2Add(Types\Vector2 $v1, Types\Vector2 $v2): Types\Vector2 - { - return $v1->add($v2); - } - - public function vector2Length(Types\Vector2 $vec): float - { - return $vec->length(); - } - - public function vector2Scale(Types\Vector2 $vec, float $scale): Types\Vector2 - { - return $vec->scale($scale); - } - - public function vector2Subtract(Types\Vector2 $v1, Types\Vector2 $v2): Types\Vector2 - { - return $v1->subtract($v2); - } -} diff --git a/src/RaylibFFIProxy.php b/src/RaylibFFIProxy.php deleted file mode 100644 index 1689327..0000000 --- a/src/RaylibFFIProxy.php +++ /dev/null @@ -1,262 +0,0 @@ -ffi = $ffi; - } - - public function __call(string $method, array $args) - { - $callable = [$this->ffi, $method]; - return $callable(...$args); - } -} diff --git a/src/RaylibFactory.php b/src/RaylibFactory.php deleted file mode 100644 index d876d20..0000000 --- a/src/RaylibFactory.php +++ /dev/null @@ -1,39 +0,0 @@ -buffer = $buffer; - $this->sampleRate = $sampleRate; - $this->sampleSize = $sampleSize; - $this->channels = $channels; - } - - /** - * @psalm-suppress MixedPropertyAssignment - * @psalm-suppress UndefinedPropertyAssignment - */ - public function toCData(RaylibFFIProxy $ffi): CData - { - try { - $stream = $ffi->new('AudioStream'); - } catch (FFI\ParserException $e) { - throw new InvalidArgumentException( - 'Object $ffi does not provide the type "struct AudioStream"' - ); - } - - $stream->buffer = $this->buffer; - $stream->sampleRate = $this->sampleRate; - $stream->sampleSize = $this->sampleSize; - $stream->channels = $this->channels; - - return $stream; - } -} diff --git a/src/Types/BoundingBox.php b/src/Types/BoundingBox.php deleted file mode 100644 index 5d59392..0000000 --- a/src/Types/BoundingBox.php +++ /dev/null @@ -1,47 +0,0 @@ -min = $min; - $this->max = $max; - } - - /** - * @psalm-suppress MixedPropertyAssignment - * @psalm-suppress UndefinedPropertyFetch - */ - public function toCData(RaylibFFIProxy $ffi): CData - { - try { - $box = $ffi->new('BoundingBox'); - } catch (ParserException $e) { - throw new InvalidArgumentException( - 'Object $ffi does not provide the type "struct BoundingBox"' - ); - } - - $box->min->x = $this->min->x; - $box->min->y = $this->min->y; - $box->min->z = $this->min->z; - - $box->max->x = $this->max->x; - $box->max->y = $this->max->y; - $box->max->z = $this->max->z; - - return $box; - } -} diff --git a/src/Types/Camera2D.php b/src/Types/Camera2D.php deleted file mode 100644 index 11f790e..0000000 --- a/src/Types/Camera2D.php +++ /dev/null @@ -1,48 +0,0 @@ -offset = $offset; - $this->target = $target; - $this->rotation = $rotation; - $this->zoom = $zoom; - } - - /** - * @psalm-suppress MixedPropertyAssignment - * @psalm-suppress UndefinedPropertyAssignment - */ - public function toCData(RaylibFFIProxy $ffi): CData - { - try { - $camera = $ffi->new('Camera2D'); - } catch (FFI\ParserException $e) { - throw new InvalidArgumentException( - 'Object $ffi does not provide the type "struct Camera2D"' - ); - } - - $camera->offset = $this->offset->toCData($ffi); - $camera->target = $this->target->toCData($ffi); - $camera->rotation = $this->rotation; - $camera->zoom = $this->zoom; - - return $camera; - } -} diff --git a/src/Types/Camera3D.php b/src/Types/Camera3D.php deleted file mode 100644 index a0778f3..0000000 --- a/src/Types/Camera3D.php +++ /dev/null @@ -1,60 +0,0 @@ -position = $position; - $this->target = $target; - $this->up = $up; - $this->fovy = $fovy; - $this->projection = $projection; - } - - /** - * @psalm-suppress MixedPropertyAssignment - * @psalm-suppress UndefinedPropertyAssignment - */ - public function toCData(RaylibFFIProxy $ffi): CData - { - try { - $camera = $ffi->new('Camera3D'); - } catch (FFI\ParserException $e) { - throw new InvalidArgumentException( - 'Object $ffi does not provide the type "struct Camera3D"' - ); - } - - $camera->position = $this->position->toCData($ffi); - $camera->target = $this->target->toCData($ffi); - $camera->up = $this->up->toCData($ffi); - $camera->fovy = $this->fovy; - $camera->projection = $this->projection; - - return $camera; - } -} diff --git a/src/Types/CharInfo.php b/src/Types/CharInfo.php deleted file mode 100644 index 4c644f9..0000000 --- a/src/Types/CharInfo.php +++ /dev/null @@ -1,56 +0,0 @@ -value = $value; - $this->offsetX = $offsetX; - $this->offsetY = $offsetY; - $this->advanceX = $advanceX; - $this->image = $image; - } - - /** - * @psalm-suppress MixedPropertyAssignment - * @psalm-suppress UndefinedPropertyAssignment - */ - public function toCData(RaylibFFIProxy $ffi): CData - { - try { - $charInfo = $ffi->new('CharInfo'); - } catch (FFI\ParserException $e) { - throw new InvalidArgumentException( - 'Object $ffi does not provide the type "struct CharInfo"' - ); - } - - $charInfo->value = $this->value; - $charInfo->offsetX = $this->offsetX; - $charInfo->offsetY = $this->offsetY; - $charInfo->advanceX = $this->advanceX; - $charInfo->image = $this->image->toCData($ffi); - - return $charInfo; - } -} diff --git a/src/Types/Color.php b/src/Types/Color.php deleted file mode 100644 index c921a9e..0000000 --- a/src/Types/Color.php +++ /dev/null @@ -1,204 +0,0 @@ -red = $red; - $this->green = $green; - $this->blue = $blue; - $this->alpha = $alpha; - } - - private static function assertUint8(int $value): void - { - Assert::greaterThanEq($value, 0); - Assert::lessThanEq($value, 255); - } - - public static function beige(int $alpha = 255): Color - { - self::assertUint8($alpha); - return new self(211, 176, 131, $alpha); - } - - public static function lightGray(int $alpha = 255): Color - { - self::assertUint8($alpha); - return new self(200, 200, 200, $alpha); - } - - public static function gray(int $alpha = 255): Color - { - self::assertUint8($alpha); - return new self(130, 130, 130, $alpha); - } - - public static function darkGray(int $alpha = 255): Color - { - self::assertUint8($alpha); - return new self(80, 80, 80, $alpha); - } - - public static function darkGreen(int $alpha = 255): Color - { - self::assertUint8($alpha); - return new self(0, 117, 44, $alpha); - } - - public static function darkPurple(int $alpha = 255): Color - { - self::assertUint8($alpha); - return new self(112, 31, 126, $alpha); - } - - public static function darkBrown(int $alpha = 255): Color - { - self::assertUint8($alpha); - return new self(76, 63, 47, $alpha); - } - - public static function blue(int $alpha = 255): Color - { - self::assertUint8($alpha); - return new self(0, 121, 241, $alpha); - } - - public static function darkBlue(int $alpha = 255): Color - { - self::assertUint8($alpha); - return new self(0, 82, 172, $alpha); - } - - public static function gold(int $alpha = 255): Color - { - self::assertUint8($alpha); - return new self(255, 203, 0, $alpha); - } - - public static function green(int $alpha = 255): Color - { - self::assertUint8($alpha); - return new self(0, 228, 48, $alpha); - } - - public static function lime(int $alpha = 255): Color - { - self::assertUint8($alpha); - return new self(0, 158, 47, $alpha); - } - - public static function maroon(int $alpha = 255): Color - { - self::assertUint8($alpha); - return new self(190, 33, 55, $alpha); - } - - public static function orange(int $alpha = 255): Color - { - self::assertUint8($alpha); - return new self(255, 161, 0, $alpha); - } - - public static function skyBlue(int $alpha = 255): Color - { - self::assertUint8($alpha); - return new self(102, 191, 255, $alpha); - } - - public static function red(int $alpha = 255): Color - { - self::assertUint8($alpha); - return new self(230, 41, 55, $alpha); - } - - public static function black(int $alpha = 255): Color - { - self::assertUint8($alpha); - return new self(0, 0, 0, $alpha); - } - - public static function blank(int $alpha = 0): Color - { - return self::black($alpha); - } - - public static function rayWhite(int $alpha = 255): Color - { - self::assertUint8($alpha); - return new self(245, 245, 245, $alpha); - } - - public static function white(int $alpha = 255): Color - { - self::assertUint8($alpha); - return new self(255, 255, 255, $alpha); - } - - public static function purple(int $alpha = 255): Color - { - self::assertUint8($alpha); - return new self(200, 122, 255, $alpha); - } - - public static function violet(int $alpha = 255): Color - { - self::assertUint8($alpha); - return new self(135, 60, 190, $alpha); - } - - public static function brown(int $alpha = 255): Color - { - self::assertUint8($alpha); - return new self(127, 106, 79, $alpha); - } - - public static function pink(int $alpha = 255): Color - { - self::assertUint8($alpha); - return new self(255, 109, 194, $alpha); - } - - public static function yellow(int $alpha = 255): Color - { - self::assertUint8($alpha); - return new self(253, 249, 0, $alpha); - } - - /** - * @psalm-suppress MixedPropertyAssignment - * @psalm-suppress UndefinedPropertyAssignment - */ - public function toCData(RaylibFFIProxy $ffi): CData - { - try { - $color = $ffi->new('Color'); - } catch (FFI\ParserException $e) { - throw new InvalidArgumentException( - 'Object $ffi does not provide the type "struct Color"' - ); - } - - $color->r = $this->red; - $color->g = $this->green; - $color->b = $this->blue; - $color->a = $this->alpha; - - return $color; - } -} diff --git a/src/Types/Font.php b/src/Types/Font.php deleted file mode 100644 index 23cb180..0000000 --- a/src/Types/Font.php +++ /dev/null @@ -1,60 +0,0 @@ -baseSize = $baseSize; - $this->charsCount = $charsCount; - $this->charsPadding = $charsPadding; - $this->texture = $texture; - $this->recs = $recs; - $this->chars = $chars; - } - - /** - * @psalm-suppress MixedPropertyAssignment - * @psalm-suppress UndefinedPropertyAssignment - */ - public function toCData(RaylibFFIProxy $ffi): CData - { - try { - $font = $ffi->new('Font'); - } catch (FFI\ParserException $e) { - throw new InvalidArgumentException( - 'Object $ffi does not provide the type "struct Font"' - ); - } - - $font->baseSize = $this->baseSize; - $font->charsCount = $this->charsCount; - $font->charsPadding = $this->charsPadding; - $font->texture = $this->texture->toCData($ffi); - $font->recs = $this->recs; - $font->chars = $this->chars; - - return $font; - } -} diff --git a/src/Types/Image.php b/src/Types/Image.php deleted file mode 100644 index 290208b..0000000 --- a/src/Types/Image.php +++ /dev/null @@ -1,68 +0,0 @@ -data = $data; - $this->width = $width; - $this->height = $height; - $this->mipmaps = $mipmaps; - $this->format = $format; - } - - /** - * @psalm-suppress MixedPropertyAssignment - * @psalm-suppress UndefinedPropertyAssignment - */ - public function toCData(RaylibFFIProxy $ffi): CData - { - try { - $image = $ffi->new('Image'); - } catch (FFI\ParserException $e) { - throw new InvalidArgumentException( - 'Object $ffi does not provide the type "struct Image"' - ); - } - - $image->data = $this->data; - $image->width = $this->width; - $image->height = $this->height; - $image->mipmaps = $this->mipmaps; - $image->format = $this->format; - - return $image; - } - - /** - * @psalm-suppress MixedPropertyAssignment - * @psalm-suppress MixedAssignment - * @psalm-suppress UndefinedPropertyAssignment - * @psalm-suppress UndefinedPropertyFetch - */ - public function updateImageObject(Image $image, CData $imageStruct): Image - { - $image->data = $imageStruct->data; - $image->width = $imageStruct->width; - $image->height = $imageStruct->height; - $image->format = $imageStruct->format; - $image->mipmaps = $imageStruct->mipmaps; - - return $image; - } -} diff --git a/src/Types/Matrix.php b/src/Types/Matrix.php deleted file mode 100644 index 3d6947d..0000000 --- a/src/Types/Matrix.php +++ /dev/null @@ -1,55 +0,0 @@ -new('Matrix'); - } catch (FFI\ParserException $e) { - throw new InvalidArgumentException( - 'Object $ffi does not provide the type "struct Matrix"' - ); - } - - for ($i = 0; $i < 15; ++$i) { - $matrix->{"m{$i}"} = $this->{"m{$i}"}; - } - - return $matrix; - } -} diff --git a/src/Types/Model.php b/src/Types/Model.php deleted file mode 100644 index 4e36f5b..0000000 --- a/src/Types/Model.php +++ /dev/null @@ -1,71 +0,0 @@ -transform = $transform; - $this->meshCount = $meshCount; - $this->materialCount = $materialCount; - $this->meshes = $meshes; - $this->materials = $materials; - $this->meshMaterial = $meshMaterial; - $this->boneCount = $boneCount; - $this->bones = $bones; - $this->bindPose = $bindPose; - } - - /** - * @psalm-suppress UndefinedPropertyAssignment - */ - public function toCData(RaylibFFIProxy $ffi): CData - { - try { - $model = $ffi->new('Model'); - } catch (FFI\ParserException $e) { - throw new InvalidArgumentException( - 'Object $ffi does not provide the type "struct Model"' - ); - } - - $model->transform = $this->transform; - $model->meshCount = $this->meshCount; - $model->materialCount = $this->materialCount; - $model->meshes = $this->meshes; - $model->materials = $this->materials; - $model->meshMaterial = $this->meshMaterial; - $model->boneCount = $this->boneCount; - $model->bones = $this->bones; - $model->bindPose = $this->bindPose; - - return $model; - } -} diff --git a/src/Types/Music.php b/src/Types/Music.php deleted file mode 100644 index b92b58f..0000000 --- a/src/Types/Music.php +++ /dev/null @@ -1,51 +0,0 @@ -stream = $stream; - $this->sampleCount = $sampleCount; - $this->looping = $looping; - $this->ctxType = $ctxType; - $this->ctxData = $ctxData; - } - - /** - * @psalm-suppress MixedPropertyAssignment - * @psalm-suppress UndefinedPropertyAssignment - */ - public function toCData(RaylibFFIProxy $ffi): CData - { - try { - $music = $ffi->new('Music'); - } catch (FFI\ParserException $e) { - throw new InvalidArgumentException( - 'Object $ffi does not provide the type "struct Music"' - ); - } - - $music->stream = $this->stream->toCData($ffi); - $music->sampleCount = $this->sampleCount; - $music->looping = $this->looping; - $music->ctxType = $this->ctxType; - $music->ctxData = $this->ctxData; - - return $music; - } -} diff --git a/src/Types/Ray.php b/src/Types/Ray.php deleted file mode 100644 index ca6ff53..0000000 --- a/src/Types/Ray.php +++ /dev/null @@ -1,48 +0,0 @@ -position = $position; - $this->direction = $direction; - } - - /** - * @psalm-suppress MixedPropertyAssignment - * @psalm-suppress UndefinedPropertyAssignment - * @psalm-suppress UndefinedPropertyFetch - */ - public function toCData(RaylibFFIProxy $ffi): CData - { - try { - $ray = $ffi->new('Ray'); - } catch (ParserException $e) { - throw new InvalidArgumentException( - 'Object $ffi does not provide the type "struct Ray"' - ); - } - - $ray->position->x = $this->position->x; - $ray->position->y = $this->position->y; - $ray->position->z = $this->position->z; - - $ray->direction->x = $this->direction->x; - $ray->direction->y = $this->direction->y; - $ray->direction->z = $this->direction->z; - - return $ray; - } -} diff --git a/src/Types/Rectangle.php b/src/Types/Rectangle.php deleted file mode 100644 index 38cc2dc..0000000 --- a/src/Types/Rectangle.php +++ /dev/null @@ -1,48 +0,0 @@ -x = $x; - $this->y = $y; - $this->width = $width; - $this->height = $height; - } - - /** - * @psalm-suppress MixedPropertyAssignment - * @psalm-suppress UndefinedPropertyAssignment - */ - public function toCData(RaylibFFIProxy $ffi): CData - { - try { - $rec = $ffi->new('Rectangle'); - } catch (FFI\ParserException $e) { - throw new InvalidArgumentException( - 'Object $ffi does not provide the type "struct Rectangle"' - ); - } - - $rec->x = $this->x; - $rec->y = $this->y; - $rec->width = $this->width; - $rec->height = $this->height; - - return $rec; - } -} diff --git a/src/Types/RenderTexture2D.php b/src/Types/RenderTexture2D.php deleted file mode 100644 index 7ccf517..0000000 --- a/src/Types/RenderTexture2D.php +++ /dev/null @@ -1,45 +0,0 @@ -id = $id; - $this->texture = $texture; - $this->depth = $depth; - } - - /** - * @psalm-suppress MixedPropertyAssignment - * @psalm-suppress UndefinedPropertyAssignment - */ - public function toCData(RaylibFFIProxy $ffi): CData - { - try { - $renderTexture = $ffi->new('RenderTexture'); - } catch (FFI\ParserException $e) { - throw new InvalidArgumentException( - 'Object $ffi does not provide the type "struct RenderTexture"' - ); - } - - $renderTexture->id = $this->id; - $renderTexture->texture = $this->texture->toCData($ffi); - $renderTexture->depth = $this->depth->toCData($ffi); - - return $renderTexture; - } -} diff --git a/src/Types/Sound.php b/src/Types/Sound.php deleted file mode 100644 index 1672ae1..0000000 --- a/src/Types/Sound.php +++ /dev/null @@ -1,42 +0,0 @@ -stream = $stream; - $this->sampleCount = $sampleCount; - } - - /** - * @psalm-suppress MixedPropertyAssignment - * @psalm-suppress UndefinedPropertyAssignment - */ - public function toCData(RaylibFFIProxy $ffi): CData - { - try { - $sound = $ffi->new('Sound'); - } catch (FFI\ParserException $e) { - throw new InvalidArgumentException( - 'Object $ffi does not provide the type "struct Sound"' - ); - } - - $sound->stream = $this->stream->toCData($ffi); - $sound->sampleCount = $this->sampleCount; - - return $sound; - } -} diff --git a/src/Types/Texture2D.php b/src/Types/Texture2D.php deleted file mode 100644 index 1ddb923..0000000 --- a/src/Types/Texture2D.php +++ /dev/null @@ -1,51 +0,0 @@ -id = $id; - $this->width = $width; - $this->height = $height; - $this->mipmaps = $mipmaps; - $this->format = $format; - } - - /** - * @psalm-suppress MixedPropertyAssignment - * @psalm-suppress UndefinedPropertyAssignment - */ - public function toCData(RaylibFFIProxy $ffi): CData - { - try { - $texture = $ffi->new('Texture'); - } catch (FFI\ParserException $e) { - throw new InvalidArgumentException( - 'Object $ffi does not provide the type "struct Texture"' - ); - } - - $texture->id = $this->id; - $texture->width = $this->width; - $texture->height = $this->height; - $texture->mipmaps = $this->mipmaps; - $texture->format = $this->format; - - return $texture; - } -} diff --git a/src/Types/Vector2.php b/src/Types/Vector2.php deleted file mode 100644 index 8d96d25..0000000 --- a/src/Types/Vector2.php +++ /dev/null @@ -1,57 +0,0 @@ -x + $vec->x, $this->y + $vec->y); - } - - public function length(): float - { - return sqrt(($this->x * $this->x) + ($this->y * $this->y)); - } - - public function scale(float $scale): Vector2 - { - return new Vector2($this->x * $scale, $this->y * $scale); - } - - public function subtract(Vector2 $vec): Vector2 - { - return new Vector2($this->x - $vec->x, $this->y - $vec->y); - } - - /** - * @psalm-suppress MixedPropertyAssignment - * @psalm-suppress UndefinedPropertyAssignment - */ - public function toCData(RaylibFFIProxy $ffi): CData - { - try { - $vec = $ffi->new('Vector2'); - } catch (FFI\ParserException $e) { - throw new InvalidArgumentException( - 'Object $ffi does not provide the type "struct Vector2"' - ); - } - - $vec->x = $this->x; - $vec->y = $this->y; - - return $vec; - } -} diff --git a/src/Types/Vector3.php b/src/Types/Vector3.php deleted file mode 100644 index b753ad8..0000000 --- a/src/Types/Vector3.php +++ /dev/null @@ -1,38 +0,0 @@ -new('Vector3'); - } catch (FFI\ParserException $e) { - throw new InvalidArgumentException( - 'Object $ffi does not provide the type "struct Vector3"' - ); - } - - $vec->x = $this->x; - $vec->y = $this->y; - $vec->z = $this->z; - - return $vec; - } -} diff --git a/src/Types/Vector4.php b/src/Types/Vector4.php deleted file mode 100644 index fa4905f..0000000 --- a/src/Types/Vector4.php +++ /dev/null @@ -1,39 +0,0 @@ -new('Vector4'); - } catch (FFI\ParserException $e) { - throw new InvalidArgumentException( - 'Object $ffi does not provide the type "struct Vector4"' - ); - } - - $vec->x = $this->x; - $vec->y = $this->y; - $vec->z = $this->z; - $vec->w = $this->w; - - return $vec; - } -} diff --git a/src/Utils/Composer/CommandHandler.php b/src/Utils/Composer/CommandHandler.php deleted file mode 100644 index fbfdad3..0000000 --- a/src/Utils/Composer/CommandHandler.php +++ /dev/null @@ -1,140 +0,0 @@ -setFilename(__DIR__ . '/../../generated-functions.php') - ->setDeclares([DeclareStatement::strictTypes(1)]) - ->setNamespace('Nawarian\\Raylib'); - - // Declare global variable - $body = <<newInstance(); - unset(\$factory); - - - PHP; - - // Declare equivalent raylib functions - $methods = self::fetchRaylibMethods(); - foreach ($methods as $method) { - $name = ucfirst($method->getName()); - - $params = []; - $paramsCall = []; - foreach ($method->getParameters() as $param) { - $type = $param->detectType(); - - // class - if ($type !== null && class_exists($type) && $class = $param->getClass()) { - $file->setUse($class->getName()); - - if ($param->isVariadic()) { - $params[] = "{$class->getShortName()} ...\${$param->getName()}"; - } else { - $params[] = "{$class->getShortName()} \${$param->getName()}"; - } - // primitive - } else { - if ($param->isVariadic()) { - $params[] = "{$type} ...\${$param->getName()}"; - } else { - $params[] = "{$type} \${$param->getName()}"; - } - } - $paramsCall[] = $param->isVariadic() ? "...\${$param->getName()}" : "\${$param->getName()}"; - } - $paramsStr = implode(', ', $params); - $paramCallStr = implode(', ', $paramsCall); - - $returnTypeStr = ''; - $returnStr = ''; - if ($method->hasReturnType() && $returnType = $method->getReturnType()) { - $returnTypeName = (string) $method->getReturnType(); - - // special handling for class - if (class_exists((string) $returnType)) { - /** - * @psalm-suppress ArgumentTypeCoercion - */ - $returnTypeRef = new ClassReflection((string) $method->getReturnType()); - - $file->setUse($returnTypeRef->getName()); - $returnTypeName = $returnTypeRef->getShortName(); - } - - $returnTypeStr .= ': '; - - if ($returnType->allowsNull()) { - $returnTypeStr .= '?'; - } - - $returnTypeStr .= $returnTypeName; - - if ((string) $returnType !== 'void') { - $returnStr = 'return '; - } - } - - $body .= <<{$method->getName()}($paramCallStr); - } - - - PHPFUNCTION; - } - - $body .= PHP_EOL . '// phpcs:enable'; - - $file - ->setBody($body) - ->write(); - } - - /** - * @return iterable - */ - private static function fetchRaylibMethods(): iterable - { - $ref = new ClassReflection(Raylib::class); - foreach ($ref->getMethods() as $method) { - // skip all magic and deprecated methods - if ( - str_starts_with($method->getName(), '__') - || str_contains($method->getDocComment() ?: '', '@deprecated') - ) { - continue; - } - - yield $method; - } - } -} diff --git a/src/generated-functions.php b/src/generated-functions.php deleted file mode 100644 index 8bf9d31..0000000 --- a/src/generated-functions.php +++ /dev/null @@ -1,2416 +0,0 @@ -newInstance(); -unset($factory); - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function BeginBlendMode(int $mode): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->beginBlendMode($mode); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function BeginDrawing(): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->beginDrawing(); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function BeginMode2D(Camera2D $camera): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->beginMode2D($camera); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function BeginMode3D(Camera3D $camera): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->beginMode3D($camera); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function BeginScissorMode(int $x, int $y, int $width, int $height): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->beginScissorMode($x, $y, $width, $height); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function BeginTextureMode(RenderTexture2D $target): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->beginTextureMode($target); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function CheckCollisionBoxes(BoundingBox $box1, BoundingBox $box2): bool -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->checkCollisionBoxes($box1, $box2); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function CheckCollisionBoxSphere(BoundingBox $box, Vector3 $center, float $radius): bool -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->checkCollisionBoxSphere($box, $center, $radius); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function CheckCollisionPointCircle(Vector2 $point, Vector2 $center, float $radius): bool -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->checkCollisionPointCircle($point, $center, $radius); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function CheckCollisionPointRec(Vector2 $point, Rectangle $rec): bool -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->checkCollisionPointRec($point, $rec); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function CheckCollisionRayBox(Ray $ray, BoundingBox $box): bool -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->checkCollisionRayBox($ray, $box); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function CheckCollisionRecs(Rectangle $rec1, Rectangle $rec2): bool -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->checkCollisionRecs($rec1, $rec2); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function CheckCollisionCircles(Vector2 $center1, float $radius1, Vector2 $center2, float $radius2): bool -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->checkCollisionCircles($center1, $radius1, $center2, $radius2); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function CheckCollisionCircleRec(Vector2 $center, float $radius, Rectangle $rec): bool -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->checkCollisionCircleRec($center, $radius, $rec); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function CheckCollisionPointTriangle(Vector2 $point, Vector2 $p1, Vector2 $p2, Vector2 $p3): bool -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->checkCollisionPointTriangle($point, $p1, $p2, $p3); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function CheckCollisionLines(Vector2 $startPos1, Vector2 $endPos1, Vector2 $startPos2, Vector2 $endPos2, Vector2 $mutCollisionPoint): bool -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->checkCollisionLines($startPos1, $endPos1, $startPos2, $endPos2, $mutCollisionPoint); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function ClearBackground(Color $color): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->clearBackground($color); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function ClearWindowState(int $flags): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->clearWindowState($flags); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function CloseAudioDevice(): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->closeAudioDevice(); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function CloseWindow(): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->closeWindow(); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function ColorAlpha(Color $color, float $alpha): Color -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->colorAlpha($color, $alpha); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function ColorAlphaBlend(Color $dst, Color $src, Color $tint): Color -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->colorAlphaBlend($dst, $src, $tint); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function DrawBillboard(Camera3D $camera, Texture2D $texture, Vector3 $center, float $size, Color $tint): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->drawBillboard($camera, $texture, $center, $size, $tint); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function DrawCircle(int $centerX, int $centerY, float $radius, Color $color): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->drawCircle($centerX, $centerY, $radius, $color); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function DrawCircleGradient(int $centerX, int $centerY, float $radius, Color $color1, Color $color2): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->drawCircleGradient($centerX, $centerY, $radius, $color1, $color2); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function DrawCircleLines(int $centerX, int $centerY, float $radius, Color $color): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->drawCircleLines($centerX, $centerY, $radius, $color); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function DrawCircleSector(Vector2 $center, float $radius, int $startAngle, int $endAngle, int $segments, Color $color): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->drawCircleSector($center, $radius, $startAngle, $endAngle, $segments, $color); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function DrawCircleSectorLines(Vector2 $center, float $radius, int $startAngle, int $endAngle, int $segments, Color $color): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->drawCircleSectorLines($center, $radius, $startAngle, $endAngle, $segments, $color); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function DrawCircleV(Vector2 $center, float $radius, Color $color): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->drawCircleV($center, $radius, $color); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function DrawCube(Vector3 $position, float $width, float $height, float $length, Color $color): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->drawCube($position, $width, $height, $length, $color); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function DrawCubeV(Vector3 $position, Vector3 $size, Color $color): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->drawCubeV($position, $size, $color); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function DrawCubeWires(Vector3 $position, float $width, float $height, float $length, Color $color): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->drawCubeWires($position, $width, $height, $length, $color); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function DrawEllipse(int $centerX, int $centerY, float $radiusH, float $radiusV, Color $color): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->drawEllipse($centerX, $centerY, $radiusH, $radiusV, $color); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function DrawEllipseLines(int $centerX, int $centerY, float $radiusH, float $radiusV, Color $color): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->drawEllipseLines($centerX, $centerY, $radiusH, $radiusV, $color); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function DrawFPS(int $posX, int $posY): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->drawFPS($posX, $posY); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function DrawGrid(int $slices, float $spacing): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->drawGrid($slices, $spacing); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function DrawLine(int $x0, int $y0, int $x1, int $y1, Color $color): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->drawLine($x0, $y0, $x1, $y1, $color); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function DrawLineStrip(array $points, Color $color): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->drawLineStrip($points, $color); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function DrawLineV(Vector2 $startPos, Vector2 $endPos, Color $color): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->drawLineV($startPos, $endPos, $color); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function DrawLineEx(Vector2 $startPos, Vector2 $endPos, float $thick, Color $color): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->drawLineEx($startPos, $endPos, $thick, $color); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function DrawLineBezier(Vector2 $startPos, Vector2 $endPos, float $thick, Color $color): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->drawLineBezier($startPos, $endPos, $thick, $color); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function DrawModelEx(Model $model, Vector3 $position, Vector3 $rotationAxis, float $rotationAngle, Vector3 $scale, Color $tint): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->drawModelEx($model, $position, $rotationAxis, $rotationAngle, $scale, $tint); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function DrawPixel(int $posX, int $posY, Color $color): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->drawPixel($posX, $posY, $color); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function DrawPixelV(Vector2 $position, Color $color): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->drawPixelV($position, $color); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function DrawPlane(Vector3 $center, Vector2 $size, Color $color): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->drawPlane($center, $size, $color); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function DrawPoly(Vector2 $center, int $sides, float $radius, float $rotation, Color $color): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->drawPoly($center, $sides, $radius, $rotation, $color); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function DrawPolyLines(Vector2 $center, int $sides, float $radius, float $rotation, Color $color): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->drawPolyLines($center, $sides, $radius, $rotation, $color); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function DrawRay(Ray $ray, Color $color): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->drawRay($ray, $color); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function DrawRectangle(float $x, float $y, float $width, float $height, Color $color): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->drawRectangle($x, $y, $width, $height, $color); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function DrawRectangleV(Vector2 $position, Vector2 $size, Color $color): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->drawRectangleV($position, $size, $color); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function DrawRectangleGradientV(int $posX, int $posY, int $width, int $height, Color $color1, Color $color2): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->drawRectangleGradientV($posX, $posY, $width, $height, $color1, $color2); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function DrawRectangleGradientH(float $x, float $y, float $width, float $height, Color $color1, Color $color2): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->drawRectangleGradientH($x, $y, $width, $height, $color1, $color2); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function DrawRectangleGradientEx(Rectangle $rec, Color $col1, Color $col2, Color $col3, Color $col4): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->drawRectangleGradientEx($rec, $col1, $col2, $col3, $col4); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function DrawRectangleLines(float $x, float $y, float $width, float $height, Color $color): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->drawRectangleLines($x, $y, $width, $height, $color); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function DrawRectangleLinesEx(Rectangle $rectangle, int $lineThick, Color $color): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->drawRectangleLinesEx($rectangle, $lineThick, $color); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function DrawRectangleRounded(Rectangle $rec, float $roundness, int $segments, Color $color): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->drawRectangleRounded($rec, $roundness, $segments, $color); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function DrawRectangleRoundedLines(Rectangle $rec, float $roundness, int $segments, int $lineThick, Color $color): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->drawRectangleRoundedLines($rec, $roundness, $segments, $lineThick, $color); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function DrawRectanglePro(Rectangle $rectangle, Vector2 $origin, float $rotation, Color $color): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->drawRectanglePro($rectangle, $origin, $rotation, $color); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function DrawRectangleRec(Rectangle $rec, Color $color): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->drawRectangleRec($rec, $color); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function DrawRing(Vector2 $center, float $innerRadius, float $outerRadius, int $startAngle, int $endAngle, int $segments, Color $color): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->drawRing($center, $innerRadius, $outerRadius, $startAngle, $endAngle, $segments, $color); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function DrawRingLines(Vector2 $center, float $innerRadius, float $outerRadius, int $startAngle, int $endAngle, int $segments, Color $color): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->drawRingLines($center, $innerRadius, $outerRadius, $startAngle, $endAngle, $segments, $color); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function DrawSphere(Vector3 $centerPos, float $radius, Color $color): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->drawSphere($centerPos, $radius, $color); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function DrawSphereWires(Vector3 $centerPos, float $radius, int $rings, int $slices, Color $color): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->drawSphereWires($centerPos, $radius, $rings, $slices, $color); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function DrawText(string $text, int $x, int $y, int $fontSize, Color $color): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->drawText($text, $x, $y, $fontSize, $color); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function DrawTextEx(Font $font, string $text, Vector2 $position, float $fontSize, float $spacing, Color $tint): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->drawTextEx($font, $text, $position, $fontSize, $spacing, $tint); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function DrawTextRec(Font $font, string $text, Rectangle $rec, float $fontSize, float $spacing, bool $wordWrap, Color $tint): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->drawTextRec($font, $text, $rec, $fontSize, $spacing, $wordWrap, $tint); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function DrawTextRecEx(Font $font, string $text, Rectangle $rec, float $fontSize, float $spacing, bool $wordWrap, Color $tint, int $selectStart, int $selectLength, Color $selectTint, Color $selectBackTint): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->drawTextRecEx($font, $text, $rec, $fontSize, $spacing, $wordWrap, $tint, $selectStart, $selectLength, $selectTint, $selectBackTint); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function DrawTextCodepoint(Font $font, int $codepoint, Vector2 $position, float $fontSize, Color $tint): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->drawTextCodepoint($font, $codepoint, $position, $fontSize, $tint); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function DrawTexture(Texture2D $texture, int $posX, int $posY, Color $tint): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->drawTexture($texture, $posX, $posY, $tint); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function DrawTextureEx(Texture2D $texture, Vector2 $position, float $rotation, float $scale, Color $tint): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->drawTextureEx($texture, $position, $rotation, $scale, $tint); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function DrawTextureRec(Texture2D $texture, Rectangle $source, Vector2 $position, Color $tint): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->drawTextureRec($texture, $source, $position, $tint); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function DrawTexturePro(Texture2D $texture, Rectangle $source, Rectangle $dest, Vector2 $origin, float $rotation, Color $tint): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->drawTexturePro($texture, $source, $dest, $origin, $rotation, $tint); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function DrawTextureTiled(Texture2D $texture, Rectangle $source, Rectangle $dest, Vector2 $origin, float $rotation, float $scale, Color $tint): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->drawTextureTiled($texture, $source, $dest, $origin, $rotation, $scale, $tint); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function DrawTextureV(Texture2D $texture, Vector2 $position, Color $tint): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->drawTextureV($texture, $position, $tint); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function DrawTriangle(Vector2 $v1, Vector2 $v2, Vector2 $v3, Color $color): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->drawTriangle($v1, $v2, $v3, $color); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function DrawTriangleLines(Vector2 $v1, Vector2 $v2, Vector2 $v3, Color $color): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->drawTriangleLines($v1, $v2, $v3, $color); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function DrawTriangleFan(array $points, Color $color): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->drawTriangleFan($points, $color); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function DrawTriangleStrip(array $points, Color $color): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->drawTriangleStrip($points, $color); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function EndBlendMode(): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->endBlendMode(); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function EndDrawing(): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->endDrawing(); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function EndMode2D(): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->endMode2D(); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function EndMode3D(): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->endMode3D(); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function EndScissorMode(): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->endScissorMode(); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function EndTextureMode(): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->endTextureMode(); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function ExportImage(Image $image, string $fileName): bool -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->exportImage($image, $fileName); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function Fade(Color $color, float $alpha): Color -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->fade($color, $alpha); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function ColorToInt(Color $color): int -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->colorToInt($color); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function ColorNormalize(Color $color): Vector4 -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->colorNormalize($color); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function ColorFromNormalized(Vector4 $normalized): Color -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->colorFromNormalized($normalized); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function ColorToHSV(Color $color): Vector3 -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->colorToHSV($color); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function ColorFromHSV(float $hue, float $saturation, float $value): Color -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->colorFromHSV($hue, $saturation, $value); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function GenImageCellular(int $width, int $height, int $tileSize): Image -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->genImageCellular($width, $height, $tileSize); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function GenImageChecked(int $width, int $height, int $checksX, int $checksY, Color $col1, Color $col2): Image -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->genImageChecked($width, $height, $checksX, $checksY, $col1, $col2); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function GenImageGradientH(int $width, int $height, Color $left, Color $right): Image -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->genImageGradientH($width, $height, $left, $right); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function GenImageGradientRadial(int $width, int $height, float $density, Color $inner, Color $outer): Image -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->genImageGradientRadial($width, $height, $density, $inner, $outer); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function GenImageGradientV(int $width, int $height, Color $top, Color $bottom): Image -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->genImageGradientV($width, $height, $top, $bottom); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function GenImagePerlinNoise(int $width, int $height, int $offsetX, int $offsetY, float $scale): Image -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->genImagePerlinNoise($width, $height, $offsetX, $offsetY, $scale); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function GenImageWhiteNoise(int $width, int $height, float $factor): Image -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->genImageWhiteNoise($width, $height, $factor); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function GetClipboardText(): string -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->getClipboardText(); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function GetColor(int $hex): Color -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->getColor($hex); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function GetCollisionRec(Rectangle $rec1, Rectangle $rec2): Rectangle -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->getCollisionRec($rec1, $rec2); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function GetCameraMatrix(Camera3D $camera): Matrix -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->getCameraMatrix($camera); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function GetCameraMatrix2D(Camera2D $camera): Matrix -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->getCameraMatrix2D($camera); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function GetFPS(): int -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->getFPS(); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function GetFrameTime(): float -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->getFrameTime(); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function GetGestureDetected(): int -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->getGestureDetected(); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function GetKeyPressed(): int -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->getKeyPressed(); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function GetCharPressed(): int -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->getCharPressed(); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function GetMousePosition(): Vector2 -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->getMousePosition(); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function GetMouseRay(Vector2 $mousePosition, Camera3D $camera): Ray -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->getMouseRay($mousePosition, $camera); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function GetMouseWheelMove(): float -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->getMouseWheelMove(); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function GetMouseX(): int -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->getMouseX(); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function GetMouseY(): int -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->getMouseY(); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function GetMusicTimeLength(Music $music): float -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->getMusicTimeLength($music); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function GetMusicTimePlayed(Music $music): float -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->getMusicTimePlayed($music); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function GetRandomValue(int $min, int $max): int -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->getRandomValue($min, $max); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function GetMonitorCount(): int -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->getMonitorCount(); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function GetMonitorName(int $monitor): string -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->getMonitorName($monitor); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function GetMonitorPosition(int $monitor): Vector2 -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->getMonitorPosition($monitor); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function GetMonitorWidth(int $monitor): int -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->getMonitorWidth($monitor); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function GetMonitorHeight(int $monitor): int -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->getMonitorHeight($monitor); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function GetMonitorPhysicalWidth(int $monitor): int -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->getMonitorPhysicalWidth($monitor); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function GetMonitorPhysicalHeight(int $monitor): int -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->getMonitorPhysicalHeight($monitor); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function GetMonitorRefreshRate(int $monitor): int -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->getMonitorRefreshRate($monitor); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function GetWindowPosition(): Vector2 -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->getWindowPosition(); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function GetWindowScaleDPI(): Vector2 -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->getWindowScaleDPI(); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function GetScreenToWorld2D(Vector2 $position, Camera2D $camera): Vector2 -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->getScreenToWorld2D($position, $camera); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function GetScreenWidth(): int -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->getScreenWidth(); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function GetScreenHeight(): int -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->getScreenHeight(); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function GetSoundsPlaying(): int -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->getSoundsPlaying(); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function GetTextureData(Texture2D $texture): Image -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->getTextureData($texture); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function GetTime(): float -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->getTime(); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function GetTouchPosition(int $index): Vector2 -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->getTouchPosition($index); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function GetWorldToScreen(Vector3 $position, Camera3D $camera): Vector2 -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->getWorldToScreen($position, $camera); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function GetWorldToScreen2D(Vector2 $position, Camera2D $camera): Vector2 -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->getWorldToScreen2D($position, $camera); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function ImageColorBrightness(Image $image, int $brightness): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->imageColorBrightness($image, $brightness); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function ImageColorContrast(Image $image, float $contrast): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->imageColorContrast($image, $contrast); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function ImageColorGrayscale(Image $image): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->imageColorGrayscale($image); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function ImageColorInvert(Image $image): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->imageColorInvert($image); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function ImageColorTint(Image $image, Color $color): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->imageColorTint($image, $color); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function ImageCrop(Image $image, Rectangle $crop): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->imageCrop($image, $crop); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function ImageDraw(Image $dst, Image $src, Rectangle $srcRec, Rectangle $dstRec, Color $tint): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->imageDraw($dst, $src, $srcRec, $dstRec, $tint); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function ImageDrawCircle(Image $dst, int $centerX, int $centerY, int $radius, Color $color): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->imageDrawCircle($dst, $centerX, $centerY, $radius, $color); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function ImageDrawPixel(Image $dst, int $posX, int $posY, Color $tint): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->imageDrawPixel($dst, $posX, $posY, $tint); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function ImageDrawRectangle(Image $dst, int $posX, int $posY, int $width, int $height, Color $color): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->imageDrawRectangle($dst, $posX, $posY, $width, $height, $color); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function ImageDrawTextEx(Image $dst, Font $font, string $text, Vector2 $position, float $fontSize, float $spacing, Color $tint): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->imageDrawTextEx($dst, $font, $text, $position, $fontSize, $spacing, $tint); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function ImageFlipHorizontal(Image $image): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->imageFlipHorizontal($image); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function ImageFlipVertical(Image $image): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->imageFlipVertical($image); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function ImageFormat(Image $image, int $newFormat): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->imageFormat($image, $newFormat); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function ImageResize(Image $image, int $newWidth, int $newHeight): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->imageResize($image, $newWidth, $newHeight); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function InitAudioDevice(): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->initAudioDevice(); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function InitWindow(int $width, int $height, string $title): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->initWindow($width, $height, $title); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function IsKeyDown(int $key): bool -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->isKeyDown($key); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function IsKeyPressed(int $key): bool -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->isKeyPressed($key); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function IsKeyReleased(int $key): bool -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->isKeyReleased($key); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function IsKeyUp(int $key): bool -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->isKeyUp($key); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function IsMouseButtonDown(int $button): bool -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->isMouseButtonDown($button); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function IsMouseButtonPressed(int $button): bool -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->isMouseButtonPressed($button); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function IsMouseButtonUp(int $button): bool -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->isMouseButtonUp($button); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function IsMouseButtonReleased(int $button): bool -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->isMouseButtonReleased($button); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function IsWindowFocused(): bool -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->isWindowFocused(); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function IsWindowFullscreen(): bool -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->isWindowFullscreen(); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function IsWindowHidden(): bool -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->isWindowHidden(); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function IsWindowMaximized(): bool -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->isWindowMaximized(); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function IsWindowMinimized(): bool -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->isWindowMinimized(); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function IsWindowReady(): bool -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->isWindowReady(); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function IsWindowResized(): bool -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->isWindowResized(); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function IsWindowState(int $flag): bool -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->isWindowState($flag); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function LoadFont(string $filename): Font -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->loadFont($filename); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function LoadFontEx(string $fileName, int $fontSize, int $fontChars, int $charsCount): Font -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->loadFontEx($fileName, $fontSize, $fontChars, $charsCount); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function LoadImageColors(Image $image): CData -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->loadImageColors($image); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function LoadImage(string $filename): Image -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->loadImage($filename); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function LoadModel(string $filename): Model -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->loadModel($filename); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function LoadModelAnimations(string $filename, int $animationsCount): CData -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->loadModelAnimations($filename, $animationsCount); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function LoadMusicStream(string $filename): Music -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->loadMusicStream($filename); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function LoadSound(string $filename): Sound -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->loadSound($filename); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function LoadStorageValue(int $position): int -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->loadStorageValue($position); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function LoadTexture(string $path): Texture2D -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->loadTexture($path); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function LoadTextureFromImage(Image $image): Texture2D -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->loadTextureFromImage($image); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function LoadRenderTexture(int $width, int $height): RenderTexture2D -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->loadRenderTexture($width, $height); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function MaximizeWindow(): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->maximizeWindow(); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function MeasureText(string $text, int $fontSize): int -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->measureText($text, $fontSize); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function MinimizeWindow(): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->minimizeWindow(); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function PauseMusicStream(Music $music): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->pauseMusicStream($music); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function PlayMusicStream(Music $music): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->playMusicStream($music); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function PlaySound(Sound $sound): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->playSound($sound); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function PlaySoundMulti(Sound $sound): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->playSoundMulti($sound); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function ResumeMusicStream(Music $music): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->resumeMusicStream($music); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function RestoreWindow(): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->restoreWindow(); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function SaveStorageValue(int $position, int $value): bool -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->saveStorageValue($position, $value); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function SetCameraMode(Camera3D $camera, int $mode): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->setCameraMode($camera, $mode); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function SetClipboardText(string $text): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->setClipboardText($text); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function SetConfigFlags(int $flags): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->setConfigFlags($flags); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function SetExitKey(int $key): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->setExitKey($key); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function SetMaterialTexture(CData $material, int $mapType, Texture2D $texture): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->setMaterialTexture($material, $mapType, $texture); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function SetMousePosition(int $x, int $y): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->setMousePosition($x, $y); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function SetMouseOffset(int $offsetX, int $offsetY): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->setMouseOffset($offsetX, $offsetY); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function SetMouseScale(float $scaleX, float $scaleY): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->setMouseScale($scaleX, $scaleY); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function SetMusicPitch(Music $music, float $pitch): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->setMusicPitch($music, $pitch); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function SetSoundVolume(Sound $sound, float $volume): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->setSoundVolume($sound, $volume); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function SetTargetFPS(int $fps): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->setTargetFPS($fps); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function SetTextureFilter(Texture2D $texture, int $filterMode): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->setTextureFilter($texture, $filterMode); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function SetWindowIcon(Image $image): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->setWindowIcon($image); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function SetWindowMinSize(int $width, int $height): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->setWindowMinSize($width, $height); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function SetWindowMonitor(int $monitor): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->setWindowMonitor($monitor); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function SetWindowPosition(int $x, int $y): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->setWindowPosition($x, $y); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function SetWindowSize(int $width, int $height): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->setWindowSize($width, $height); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function SetWindowState(int $flags): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->setWindowState($flags); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function SetWindowTitle(string $title): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->setWindowTitle($title); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function ShowCursor(): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->showCursor(); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function HideCursor(): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->hideCursor(); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function IsCursorHidden(): bool -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->isCursorHidden(); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function EnableCursor(): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->enableCursor(); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function DisableCursor(): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->disableCursor(); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function IsCursorOnScreen(): bool -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->isCursorOnScreen(); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function StopMusicStream(Music $music): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->stopMusicStream($music); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function StopSoundMulti(): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->stopSoundMulti(); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function TextFormat(string $format, ...$args): string -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->textFormat($format, ...$args); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function UpdateTexture(Texture2D $texture, CData $pixels): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->updateTexture($texture, $pixels); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function TextSubtext(string $text, int $position, int $length): string -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->textSubtext($text, $position, $length); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function UnloadFont(Font $font): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->unloadFont($font); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function ToggleFullscreen(): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->toggleFullscreen(); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function TraceLog(int $type, string $format, ...$args): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->traceLog($type, $format, ...$args); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function UnloadImage(Image $image): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->unloadImage($image); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function UnloadModel(Model $model): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->unloadModel($model); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function UnloadModelAnimation(CData $animation): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->unloadModelAnimation($animation); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function UnloadMusicStream(Music $music): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->unloadMusicStream($music); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function UnloadRenderTexture(RenderTexture2D $target): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->unloadRenderTexture($target); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function UnloadSound(Sound $sound): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->unloadSound($sound); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function UnloadTexture(Texture2D $texture): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->unloadTexture($texture); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function UpdateCamera(Camera3D $camera): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->updateCamera($camera); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function UpdateModelAnimation(Model $model, CData $animation, int $frame): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->updateModelAnimation($model, $animation, $frame); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function UpdateMusicStream(Music $music): void -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - $raylib_4878fcd84df4c3690086cd1cbfbbfea2->updateMusicStream($music); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function WindowShouldClose(): bool -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->windowShouldClose(); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function Vector2Add(Vector2 $v1, Vector2 $v2): Vector2 -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->vector2Add($v1, $v2); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function Vector2Length(Vector2 $vec): float -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->vector2Length($vec); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function Vector2Scale(Vector2 $vec, float $scale): Vector2 -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->vector2Scale($vec, $scale); -} - -/** - * @psalm-suppress MissingParamType - * @psalm-suppress MixedArgumentTypeCoercion - */ -function Vector2Subtract(Vector2 $v1, Vector2 $v2): Vector2 -{ - global $raylib_4878fcd84df4c3690086cd1cbfbbfea2; - return $raylib_4878fcd84df4c3690086cd1cbfbbfea2->vector2Subtract($v1, $v2); -} - - -// phpcs:enable \ No newline at end of file diff --git a/tests/RaylibFactoryTest.php b/tests/RaylibFactoryTest.php deleted file mode 100644 index 7551515..0000000 --- a/tests/RaylibFactoryTest.php +++ /dev/null @@ -1,25 +0,0 @@ -newInstance(); - - $color = $raylib->fade(new Color(255, 0, 0, 100), .20); - self::assertEquals(255, $color->red); - self::assertEquals(0, $color->green); - self::assertEquals(0, $color->blue); - self::assertEquals(51, $color->alpha); - } -} diff --git a/tests/RaylibTest.php b/tests/RaylibTest.php deleted file mode 100644 index f8c9a78..0000000 --- a/tests/RaylibTest.php +++ /dev/null @@ -1,3228 +0,0 @@ -ffi = $ffi; - $this->ffiProxy = $this->prophesize(RaylibFFIProxy::class); - - $this->ffiProxy->new(Argument::any()) - ->will(function (array $args) use ($ffi) { - return $ffi->new($args[0]); - }); - - $this->raylib = new Raylib( - $this->ffiProxy->reveal(), - ); - } - - public function test_beginBlendMode(): void - { - $this->ffiProxy->BeginBlendMode(Raylib::BLEND_ADDITIVE) - ->shouldBeCalledOnce(); - - $this->raylib->beginBlendMode(Raylib::BLEND_ADDITIVE); - } - - public function test_beginDrawing(): void - { - $this->ffiProxy->BeginDrawing() - ->shouldBeCalledOnce(); - - $this->raylib->beginDrawing(); - } - - public function test_beginMode2D_convertsCamera2DToCData(): void - { - $camera = new Camera2D(new Vector2(0, 0), new Vector2(0, 0), 0.0, 0.0); - - $expectedStruct = $this->ffi->new('Camera2D'); - $this->ffiProxy->BeginMode2D($this->sameCDataCamera2DArgument($expectedStruct)) - ->shouldBeCalledOnce(); - - $this->raylib->beginMode2D($camera); - } - - public function test_beginMode3D_convertsCamera3DToCData(): void - { - $camera = new Camera3D( - new Vector3(0, 0, 0), - new Vector3(1, 1, 1), - new Vector3(2, 2, 2), - 10.0, - 5, - ); - - $expectedStruct = $this->ffi->new('Camera3D'); - $expectedStruct->target->x = 1; - $expectedStruct->target->y = 1; - $expectedStruct->target->z = 1; - $expectedStruct->up->x = 2; - $expectedStruct->up->y = 2; - $expectedStruct->up->z = 2; - $expectedStruct->fovy = 10.0; - $expectedStruct->projection = 5; - - $this->ffiProxy->BeginMode3D( - $this->sameCDataCamera3DArgument($expectedStruct) - )->shouldBeCalledOnce(); - - $this->raylib->beginMode3D($camera); - } - - public function test_beginTextureMode(): void - { - $texture = new Texture2D(10, 100, 100, 1, 1); - $depth = new Texture2D(10, 100, 100, 1, 1); - $renderTexure = new RenderTexture2D(10, $texture, $depth); - - $expectedStruct = $this->ffi->new('RenderTexture'); - $expectedStruct->id = 10; - $expectedStruct->texture = $this->ffi->new('Texture'); - $expectedStruct->depth = $this->ffi->new('Texture'); - - $this->ffiProxy->BeginTextureMode($this->sameCDataRenderTexture2DArgument($expectedStruct)) - ->shouldBeCalledOnce(); - - $this->raylib->beginTextureMode($renderTexure); - } - - public function test_beginScissorMode(): void - { - $this->ffiProxy->BeginScissorMode(10, 20, 30, 40) - ->shouldBeCalledOnce(); - - $this->raylib->beginScissorMode(10, 20, 30,40); - } - - public function test_checkCollisionBoxes_respectsParameterOrderAndConvertsObjectsToCData(): void - { - $expectedBbox1Struct = $this->ffi->new('BoundingBox'); - $expectedBbox2Struct = $this->ffi->new('BoundingBox'); - - $this->ffiProxy->CheckCollisionBoxes( - $this->sameCDataBoundingBoxArgument($expectedBbox1Struct), - $this->sameCDataBoundingBoxArgument($expectedBbox2Struct), - )->shouldBeCalledOnce()->willReturn(true); - - $box1 = new BoundingBox( - new Vector3(0, 0, 0), - new Vector3(0, 0, 0), - ); - $box2 = new BoundingBox( - new Vector3(0, 0, 0), - new Vector3(0, 0, 0), - ); - - self::assertTrue($this->raylib->checkCollisionBoxes($box1, $box2)); - } - - public function test_checkCollisionBoxSphere_respectsParameterOrderAndConvertsObjectsToCData(): void - { - $expectedBboxStruct = $this->ffi->new('BoundingBox'); - $expectedVector3Struct = $this->ffi->new('Vector3'); - - $this->ffiProxy->CheckCollisionBoxSphere( - $this->sameCDataBoundingBoxArgument($expectedBboxStruct), - $this->sameCDataVector3Argument($expectedVector3Struct), - 10, - )->shouldBeCalledOnce()->willReturn(true); - - $box = new BoundingBox( - new Vector3(0, 0, 0), - new Vector3(0, 0, 0), - ); - $center = new Vector3(0, 0, 0); - - self::assertTrue($this->raylib->checkCollisionBoxSphere($box, $center, 10)); - } - - public function test_checkCollisionRayBox_respectsParameterOrderAndConvertsObjectsToCData(): void - { - $ray = new Ray(new Vector3(0, 0, 0), new Vector3(0, 0, 0)); - $box = new BoundingBox(new Vector3(1, 1, 1), new Vector3(1, 1, 1)); - - $expectedRayStruct = $this->ffi->new('Ray'); - $expectedBoxStruct = $this->ffi->new('BoundingBox'); - $expectedBoxStruct->min->x = 1; - $expectedBoxStruct->min->y = 1; - $expectedBoxStruct->min->z = 1; - $expectedBoxStruct->max->x = 1; - $expectedBoxStruct->max->y = 1; - $expectedBoxStruct->max->z = 1; - - $this->ffiProxy->CheckCollisionRayBox( - $this->sameCDataRayArgument($expectedRayStruct), - $this->sameCDataBoundingBoxArgument($expectedBoxStruct), - )->willReturn(true)->shouldBeCalledOnce(); - - self::assertTrue($this->raylib->checkCollisionRayBox($ray, $box)); - } - - public function test_checkCollisionPointCircle_respectsParameterOrderAndConvertsObjectsToCData(): void - { - $point = $this->ffi->new('Vector2'); - $origin = $this->ffi->new('Vector2'); - - $this->ffiProxy->CheckCollisionPointCircle( - $this->sameCDataVector2Argument($point), - $this->sameCDataVector2Argument($origin), - 10.0, - )->shouldBeCalledOnce()->willReturn(true); - - self::assertTrue( - $this->raylib->checkCollisionPointCircle( - new Vector2(0, 0), - new Vector2(0, 0), - 10.0, - ), - ); - } - - public function test_checkCollisionPointRec_respectsParameterOrderAndConvertsObjectsToCData(): void - { - $point = $this->ffi->new('Vector2'); - $rec = $this->ffi->new('Rectangle'); - - $this->ffiProxy->CheckCollisionPointRec( - $this->sameCDataVector2Argument($point), - $this->sameCDataRectangleArgument($rec), - )->shouldBeCalledOnce()->willReturn(true); - - self::assertTrue( - $this->raylib->checkCollisionPointRec( - new Vector2(0, 0), - new Rectangle(0, 0, 0, 0), - ), - ); - } - - public function test_checkCollisionRecs_respectsParameterOrderAndConvertsObjectsToCData(): void - { - $rec1 = $this->ffi->new('Rectangle'); - $rec2 = $this->ffi->new('Rectangle'); - - $this->ffiProxy->CheckCollisionRecs( - $this->sameCDataRectangleArgument($rec1), - $this->sameCDataRectangleArgument($rec2), - )->shouldBeCalledOnce()->willReturn(true); - - self::assertTrue( - $this->raylib->checkCollisionRecs( - new Rectangle(0, 0, 0, 0), - new Rectangle(0, 0, 0, 0), - ), - ); - } - - public function test_checkCollisionCircles_respectsParameterOrderAndConvertsObjectsToCData(): void - { - $center1 = $this->ffi->new('Vector2'); - $center2 = $this->ffi->new('Vector2'); - - $this->ffiProxy->CheckCollisionCircles( - $this->sameCDataVector2Argument($center1), - 10, - $this->sameCDataVector2Argument($center2), - 20, - )->shouldBeCalledOnce()->willReturn(true); - - self::assertTrue( - $this->raylib->checkCollisionCircles( - new Vector2(0, 0), - 10, - new Vector2(0, 0), - 20, - ) - ); - } - - public function test_checkCollisionCircleRec_respectsParameterOrderAndConvertsObjectsToCData(): void - { - $rec = $this->ffi->new('Rectangle'); - $rec->width = 10; - $rec->height = 10; - - $this->ffiProxy->CheckCollisionCircleRec( - $this->sameCDataVector2Argument($this->ffi->new('Vector2')), - 10, - $this->sameCDataRectangleArgument($rec), - )->shouldBeCalledOnce()->willReturn(true); - - self::assertTrue( - $this->raylib->checkCollisionCircleRec( - new Vector2(0, 0), - 10, - new Rectangle(0, 0, 10, 10) - ) - ); - } - - public function test_checkCollisionPointTriangle_respectsParameterOrderAndConvertsObjectsToCData(): void - { - $this->ffiProxy->CheckCollisionPointTriangle( - $this->sameCDataVector2Argument($this->ffi->new('Vector2')), - $this->sameCDataVector2Argument($this->ffi->new('Vector2')), - $this->sameCDataVector2Argument($this->ffi->new('Vector2')), - $this->sameCDataVector2Argument($this->ffi->new('Vector2')), - )->shouldBeCalledOnce()->willReturn(true); - - self::assertTrue( - $this->raylib->checkCollisionPointTriangle( - new Vector2(0, 0), - new Vector2(0, 0), - new Vector2(0, 0), - new Vector2(0, 0), - ) - ); - } - - public function test_checkCollisionLines_respectsParameterOrderAndConvertsObjectsToCData(): void - { - $this->ffiProxy->CheckCollisionLines( - $this->sameCDataVector2Argument($this->ffi->new('Vector2')), - $this->sameCDataVector2Argument($this->ffi->new('Vector2')), - $this->sameCDataVector2Argument($this->ffi->new('Vector2')), - $this->sameCDataVector2Argument($this->ffi->new('Vector2')), - FFI::addr($this->ffi->new('Vector2')), - )->shouldBeCalledOnce()->will(function ($args) { - [,,,, $mutCollisionPointVec] = $args; - $mutCollisionPointVec->x = 10; - $mutCollisionPointVec->y = 20; - - return true; - }); - - $mutCollisionPoint = new Vector2(0, 0); - self::assertTrue( - $this->raylib->checkCollisionLines( - new Vector2(0, 0), - new Vector2(0, 0), - new Vector2(0, 0), - new Vector2(0, 0), - $mutCollisionPoint - ) - ); - self::assertEquals($mutCollisionPoint, new Vector2(10, 20)); - } - - public function test_clearBackground_convertsColorToCData(): void - { - $color = new Color(0, 0, 0, 0); - $expectedStruct = $this->ffi->new('Color'); - - $this->ffiProxy->ClearBackground($this->sameCDataColorArgument($expectedStruct)) - ->shouldBeCalledOnce(); - - $this->raylib->clearBackground($color); - } - - public function test_clearWindowState(): void - { - $this->ffiProxy->ClearWindowState( - Raylib::FLAG_WINDOW_ALWAYS_RUN - )->shouldBeCalledOnce(); - - $this->raylib->clearWindowState(Raylib::FLAG_WINDOW_ALWAYS_RUN); - } - - public function test_closeAudioDevice(): void - { - $this->ffiProxy->CloseAudioDevice() - ->shouldBeCalledOnce(); - - $this->raylib->closeAudioDevice(); - } - - public function test_closeWindow(): void - { - $this->ffiProxy->CloseWindow() - ->shouldBeCalledOnce(); - - $this->raylib->closeWindow(); - } - - public function test_colorAlpha_respectsParameterOrderAndConvertsObjectsToCData(): void - { - $color = Color::black(0); - $expectedColorStruct = $this->ffi->new('Color'); - - $newColorStruct = $this->ffi->new('Color'); - $newColorStruct->r = 255; - $this->ffiProxy->ColorAlpha($this->sameCDataColorArgument($expectedColorStruct), 0.5) - ->shouldBeCalledOnce() - ->willReturn($newColorStruct); - - self::assertEquals( - new Color(255, 0, 0, 0), - $this->raylib->colorAlpha($color, 0.5) - ); - } - - public function test_drawBillboard_respectsParameterOrderAndConvertsObjectsToCData(): void - { - $camera = new Camera3D( - new Vector3(0, 0, 0), - new Vector3(0, 0, 0), - new Vector3(0, 0, 0), - 45, - Camera3D::PROJECTION_PERSPECTIVE, - ); - $texture = new Texture2D(0, 0, 0, 0, 0); - - $expectedCameraStruct = $this->ffi->new('Camera3D'); - $expectedCameraStruct->fovy = 45; - - $expectedTextureStruct = $this->ffi->new('Texture2D'); - $expectedVector3Struct = $this->ffi->new('Vector3'); - $expectedColorStruct = $this->ffi->new('Color'); - $expectedColorStruct->r = 255; - $expectedColorStruct->g = 255; - $expectedColorStruct->b = 255; - $expectedColorStruct->a = 255; - - $this->ffiProxy->DrawBillboard( - $this->sameCDataCamera3DArgument($expectedCameraStruct), - $this->sameCDataTexture2DArgument($expectedTextureStruct), - $this->sameCDataVector3Argument($expectedVector3Struct), - 1, - $this->sameCDataColorArgument($expectedColorStruct), - )->shouldBeCalledOnce(); - - $this->raylib->drawBillboard( - $camera, - $texture, - new Vector3(0, 0, 0), - 1, - Color::white() - ); - } - - public function test_drawCircle_respectsParameterOrderAndConvertsObjectsToCData(): void - { - $expectedColor = $this->ffi->new('Color'); - $this->ffiProxy->DrawCircle(10, 20, 30, $this->sameCDataColorArgument($expectedColor)) - ->shouldBeCalledOnce(); - - $this->raylib->drawCircle(10, 20, 30, Color::black(0)); - } - - public function test_drawCircleGradient_respectsParameterOrderAndConvertsObjectsToCData(): void - { - $expectedColor1 = $this->ffi->new('Color'); - $expectedColor2 = $this->ffi->new('Color'); - $this->ffiProxy->DrawCircleGradient( - 10, - 20, - 30, - $this->sameCDataColorArgument($expectedColor1), - $this->sameCDataColorArgument($expectedColor2), - )->shouldBeCalledOnce(); - - $this->raylib->drawCircleGradient(10, 20, 30, Color::black(0), Color::black(0)); - } - - public function test_drawCircleLines_respectsParameterOrderAndConvertsObjectsToCData(): void - { - $expectedColor = $this->ffi->new('Color'); - $this->ffiProxy->DrawCircleLines(10, 20, 30, $this->sameCDataColorArgument($expectedColor)) - ->shouldBeCalledOnce(); - - $this->raylib->drawCircleLines(10, 20, 30, Color::black(0)); - } - - public function test_drawCubeV_respectsParameterOrderAndConvertsObjectsToCData(): void - { - $position = new Vector3(0, 0, 0); - $size = new Vector3(0, 0, 0); - $color = Color::white(); - - $expectedPositionStruct = $this->ffi->new('Vector3'); - $expectedSizeStruct = $this->ffi->new('Vector3'); - $expectedColorStruct = $this->ffi->new('Color'); - $expectedColorStruct->r = 255; - $expectedColorStruct->g = 255; - $expectedColorStruct->b = 255; - $expectedColorStruct->a = 255; - - $this->ffiProxy->DrawCubeV( - $this->sameCDataVector3Argument($expectedPositionStruct), - $this->sameCDataVector3Argument($expectedSizeStruct), - $this->sameCDataColorArgument($expectedColorStruct), - )->shouldBeCalledOnce(); - - $this->raylib->drawCubeV($position, $size, $color); - } - - public function test_drawCube_respectsParameterOrderAndConvertsObjectsToCData(): void - { - $position = new Vector3(5, 10, 15); - $color = new Color(0, 0, 0, 0); - - $expectedColorStruct = $this->ffi->new('Color'); - $expectedVector3Struct = $this->ffi->new('Vector3'); - $expectedVector3Struct->x = 5; - $expectedVector3Struct->y = 10; - $expectedVector3Struct->z = 15; - - $this->ffiProxy->DrawCube( - $this->sameCDataVector3Argument($expectedVector3Struct), - 10, - 20, - 30, - $this->sameCDataColorArgument($expectedColorStruct), - )->shouldBeCalledOnce(); - - $this->raylib->drawCube($position, 10, 20, 30, $color); - } - - public function test_drawCubeWires_respectsParameterOrderAndConvertsObjectsToCData(): void - { - $position = new Vector3(5, 10, 15); - $color = new Color(0, 0, 0, 0); - - $expectedColorStruct = $this->ffi->new('Color'); - $expectedVector3Struct = $this->ffi->new('Vector3'); - $expectedVector3Struct->x = 5; - $expectedVector3Struct->y = 10; - $expectedVector3Struct->z = 15; - - $this->ffiProxy->DrawCubeWires( - $this->sameCDataVector3Argument($expectedVector3Struct), - 10, - 20, - 30, - $this->sameCDataColorArgument($expectedColorStruct), - )->shouldBeCalledOnce(); - - $this->raylib->drawCubeWires($position, 10, 20, 30, $color); - } - - public function test_drawFPS_respectsParameterOrder(): void - { - $this->ffiProxy->DrawFPS(15, 30) - ->shouldBeCalledOnce(); - - $this->raylib->drawFPS(15, 30); - } - - public function test_drawGrid_respectsParameterOrder(): void - { - $this->ffiProxy->DrawGrid(10, 20.0) - ->shouldBeCalledOnce(); - - $this->raylib->drawGrid(10, 20.0); - } - - public function test_drawLine_respectsParameterOrderAndConvertsColorToCData(): void - { - $color = new Color(0, 0, 0, 0); - - $expectedStruct = $this->ffi->new('Color'); - $this->ffiProxy->DrawLine(10, 20,30, 40, $this->sameCDataColorArgument($expectedStruct)) - ->shouldBeCalledOnce(); - - $this->raylib->drawLine(10, 20, 30 ,40, $color); - } - - public function test_drawLineBezier_respectsParameterOrderAndConvertsColorToCData(): void - { - $start = new Vector2(0, 0); - $end = new Vector2(100, 100); - - $expectedStart = $this->ffi->new('Vector2'); - $expectedEnd = $this->ffi->new('Vector2'); - $expectedEnd->x = 100; - $expectedEnd->y = 100; - $expectedColor = $this->ffi->new('Color'); - $expectedColor->a = 255; - - $this->ffiProxy->DrawLineBezier( - $this->sameCDataVector2Argument($expectedStart), - $this->sameCDataVector2Argument($expectedEnd), - 10, - $this->sameCDataColorArgument($expectedColor), - )->shouldBeCalledOnce(); - - $this->raylib->drawLineBezier($start, $end, 10, Color::black()); - } - - public function test_drawModelEx_respectsParameterOrderAndConvertsColorToCData(): void - { - $transform = $this->ffi->new('Matrix'); - $meshes = $this->ffi->new('Mesh*'); - $materials = $this->ffi->new('Material*'); - $meshMaterial = $this->ffi->new('int*'); - $bones = $this->ffi->new('BoneInfo*'); - $bindPose = $this->ffi->new('Transform*'); - $model = new Model( - $transform, - 0, - 0, - $meshes, - $materials, - $meshMaterial, - 0, - $bones, - $bindPose, - ); - - $expectedModel = $this->ffi->new('Model'); - $expectedPosition = $this->ffi->new('Vector3'); - $expectedRotationAxis = $this->ffi->new('Vector3'); - $expectedScale = $this->ffi->new('Vector3'); - $expectedColor = $this->ffi->new('Color'); - - $this->ffiProxy->DrawModelEx( - $expectedModel, - $this->sameCDataVector3Argument($expectedPosition), - $this->sameCDataVector3Argument($expectedRotationAxis), - 0, - $this->sameCDataVector3Argument($expectedScale), - $this->sameCDataColorArgument($expectedColor), - )->shouldBeCalledOnce(); - - $this->raylib->drawModelEx( - $model, - new Vector3(0, 0, 0), - new Vector3(0, 0, 0), - 0, - new Vector3(0, 0, 0), - Color::blank(0), - ); - } - - public function test_drawPlane_respectsParameterOrderAndConvertsColorToCData(): void - { - $center = new Vector3(5, 10, 15); - $size = new Vector2(20, 40); - $color = new Color(0, 0, 0, 0); - - $expectedCenterStruct = $this->ffi->new('Vector3'); - $expectedCenterStruct->x = 5; - $expectedCenterStruct->y = 10; - $expectedCenterStruct->z = 15; - $expectedSizeStruct = $this->ffi->new('Vector2'); - $expectedSizeStruct->x = 20; - $expectedSizeStruct->y = 40; - $expectedColorStruct = $this->ffi->new('Color'); - - $this->ffiProxy->DrawPlane( - $this->sameCDataVector3Argument($expectedCenterStruct), - $this->sameCDataVector2Argument($expectedSizeStruct), - $this->sameCDataColorArgument($expectedColorStruct), - )->shouldBeCalledOnce(); - - $this->raylib->drawPlane($center, $size, $color); - } - - public function test_drawPoly_respectsParameterOrderAndConvertsColorToCData(): void - { - $expectedVector = $this->ffi->new('Vector2'); - $expectedColor = $this->ffi->new('Color'); - - $this->ffiProxy->DrawPoly( - $this->sameCDataVector2Argument($expectedVector), - 10, - 20, - 30, - $this->sameCDataColorArgument($expectedColor), - )->shouldBeCalledOnce(); - - $this->raylib->drawPoly(new Vector2(0, 0), 10, 20, 30, Color::black(0)); - } - - public function test_drawRay_respectsParameterOrderAndConvertsColorToCData(): void - { - $ray = new Ray(new Vector3(0, 0, 0), new Vector3(0, 0, 0)); - $color = new Color(0, 0, 0, 0); - - $expectedRay = $this->ffi->new('Ray'); - $expectedColor = $this->ffi->new('Color'); - - $this->ffiProxy->DrawRay( - $this->sameCDataRayArgument($expectedRay), - $this->sameCDataColorArgument($expectedColor), - )->shouldBeCalledOnce(); - - $this->raylib->drawRay($ray, $color); - } - - public function test_drawRectangle_respectsParameterOrderAndConvertsColorToCData(): void - { - $color = new Color(0, 0, 0, 0); - - $expectedStruct = $this->ffi->new('Color'); - $this->ffiProxy->DrawRectangle(10, 20, 30, 40, $this->sameCDataColorArgument($expectedStruct)) - ->shouldBeCalledOnce(); - - $this->raylib->drawRectangle(10, 20, 30, 40, $color); - } - - public function test_drawRectangleGradientH_respectsParameterOrderAndConvertsColorToCData(): void - { - $expectedColor1 = $this->ffi->new('Color'); - $expectedColor2 = $this->ffi->new('Color'); - $expectedColor2->a = 255; - - $this->ffiProxy->DrawRectangleGradientH( - 0, - 10, - 20, - 30, - $this->sameCDataColorArgument($expectedColor1), - $this->sameCDataColorArgument($expectedColor2), - )->shouldBeCalledOnce(); - - $this->raylib->DrawRectangleGradientH( - 0, - 10, - 20, - 30, - Color::black(0), - Color::black(255), - ); - } - - public function test_drawRectangleLines_respectsParameterOrderAndConvertsColorToCData(): void - { - $color = new Color(0, 0, 0, 0); - - $expectedStruct = $this->ffi->new('Color'); - $this->ffiProxy->DrawRectangleLines(10, 20, 30, 40, $this->sameCDataColorArgument($expectedStruct)) - ->shouldBeCalledOnce(); - - $this->raylib->drawRectangleLines(10, 20, 30, 40, $color); - } - - public function test_drawRectangleLinesEx_respectsParameterOrderAndConvertsObjectsToCData(): void - { - $rectangle = new Rectangle(10, 20, 30, 40); - $color = new Color(0, 0, 0, 0); - - $expectedRectangle = $this->ffi->new('Rectangle'); - $expectedRectangle->x = 10; - $expectedRectangle->y = 20; - $expectedRectangle->width = 30; - $expectedRectangle->height = 40; - $expectedColor = $this->ffi->new('Color'); - $this->ffiProxy->DrawRectangleLinesEx( - $this->sameCDataRectangleArgument($expectedRectangle), - 10, - $this->sameCDataColorArgument($expectedColor) - )->shouldBeCalledOnce(); - - $this->raylib->drawRectangleLinesEx($rectangle, 10, $color); - } - - public function test_drawRectanglePro_respectsParameterOrderAndConvertsObjectsToCData(): void - { - $rectangle = new Rectangle(10, 20, 30, 40); - $vector2 = new Vector2(0, 0); - $color = new Color(0, 0, 0, 0); - - $expectedRectangle = $this->ffi->new('Rectangle'); - $expectedRectangle->x = 10; - $expectedRectangle->y = 20; - $expectedRectangle->width = 30; - $expectedRectangle->height = 40; - $expectedVector2 = $this->ffi->new('Vector2'); - $expectedColor = $this->ffi->new('Color'); - $this->ffiProxy->DrawRectanglePro( - $this->sameCDataRectangleArgument($expectedRectangle), - $this->sameCDataVector2Argument($expectedVector2), - 10.0, - $this->sameCDataColorArgument($expectedColor) - )->shouldBeCalledOnce(); - - $this->raylib->drawRectanglePro($rectangle, $vector2, 10.0, $color); - } - - public function test_drawRectangleRec_respectsParameterOrderAndConvertsObjectsToCData(): void - { - $rectangle = new Rectangle(0, 0, 0, 0); - $color = new Color(0, 0, 0, 0); - - $expectedRectangleStruct = $this->ffi->new('Rectangle'); - $expectedColorStruct = $this->ffi->new('Color'); - $this->ffiProxy->DrawRectangleRec( - $this->sameCDataRectangleArgument($expectedRectangleStruct), - $this->sameCDataColorArgument($expectedColorStruct), - )->shouldBeCalledOnce(); - - $this->raylib->drawRectangleRec($rectangle, $color); - } - - public function test_drawSphere_respectsParameterOrderAndConvertsObjectsToCData(): void - { - $expectedVector3Struct = $this->ffi->new('Vector3'); - $expectedColorStruct = $this->ffi->new('Color'); - $expectedColorStruct->r = 255; - $expectedColorStruct->g = 255; - $expectedColorStruct->b = 255; - $expectedColorStruct->a = 255; - - $this->ffiProxy->DrawSphere( - $this->sameCDataVector3Argument($expectedVector3Struct), - 10, - $this->sameCDataColorArgument($expectedColorStruct), - )->shouldBeCalledOnce(); - - $center = new Vector3(0, 0, 0); - $this->raylib->drawSphere($center, 10, Color::white()); - } - - public function test_drawSphereWires_respectsParameterOrderAndConvertsObjectsToCData(): void - { - $expectedVector3Struct = $this->ffi->new('Vector3'); - $expectedColorStruct = $this->ffi->new('Color'); - $expectedColorStruct->r = 255; - $expectedColorStruct->g = 255; - $expectedColorStruct->b = 255; - $expectedColorStruct->a = 255; - - $this->ffiProxy->DrawSphereWires( - $this->sameCDataVector3Argument($expectedVector3Struct), - 10.0, - 5, - 1, - $this->sameCDataColorArgument($expectedColorStruct), - )->shouldBeCalledOnce(); - - $center = new Vector3(0, 0, 0); - $this->raylib->drawSphereWires($center, 10, 5, 1, Color::white()); - } - - public function test_drawText_respectsParameterOrderAndConvertsObjectsToCData(): void - { - $color = new Color(0, 0, 0, 0); - - $expectedStruct = $this->ffi->new('Color'); - $this->ffiProxy->DrawText('abc', 10, 20, 30, $this->sameCDataColorArgument($expectedStruct)) - ->shouldBeCalledOnce(); - - $this->raylib->drawText('abc', 10, 20, 30, $color); - } - - public function test_drawTextureRec(): void - { - $texture = new Texture2D(0, 0, 0, 0, 0); - $source = new Rectangle(0, 0, 0, 0); - $position = new Vector2(0, 0); - $tint = new Color(255, 0, 0, 0); - - $expectedTexture = $this->ffi->new('Texture'); - $expectedSource = $this->ffi->new('Rectangle'); - $expectedPosition = $this->ffi->new('Vector2'); - $expectedTint = $this->ffi->new('Color'); - $expectedTint->r = 255; - - $this->ffiProxy->DrawTextureRec( - $this->sameCDataTexture2DArgument($expectedTexture), - $this->sameCDataRectangleArgument($expectedSource), - $this->sameCDataVector2Argument($expectedPosition), - $this->sameCDataColorArgument($expectedTint), - )->shouldBeCalledOnce(); - - $this->raylib->drawTextureRec($texture, $source, $position, $tint); - } - - public function test_drawTexture_respectsParameterOrderAndConvertsObjectsToCData(): void - { - $texture = new Texture2D(0, 0, 0, 0, 0); - $tint = new Color(255, 0, 0, 0); - - $expectedTexture = $this->ffi->new('Texture'); - $expectedTint = $this->ffi->new('Color'); - $expectedTint->r = 255; - - $this->ffiProxy->DrawTexture( - $this->sameCDataTexture2DArgument($expectedTexture), - 10, - 20, - $this->sameCDataColorArgument($expectedTint), - )->shouldBeCalledOnce(); - - $this->raylib->drawTexture($texture, 10, 20, $tint); - } - - public function test_drawTextureEx_respectsParameterOrderAndConvertsObjectsToCData(): void - { - $texture = new Texture2D(0, 0, 0, 0, 0); - $position = new Vector2(0, 0); - $tint = new Color(255, 0, 0, 0); - - $expectedTexture = $this->ffi->new('Texture'); - $expectedPosition = $this->ffi->new('Vector2'); - $expectedTint = $this->ffi->new('Color'); - $expectedTint->r = 255; - - $this->ffiProxy->DrawTextureEx( - $this->sameCDataTexture2DArgument($expectedTexture), - $this->sameCDataVector2Argument($expectedPosition), - 20, - 30, - $this->sameCDataColorArgument($expectedTint), - )->shouldBeCalledOnce(); - - $this->raylib->drawTextureEx($texture, $position, 20, 30, $tint); - } - - public function test_drawTexturePro_respectsParameterOrderAndConvertsObjectsToCData(): void - { - $texture = new Texture2D(0, 0, 0, 0, 0); - $source = new Rectangle(0, 0, 0, 0); - $dest = new Rectangle(0, 0, 0, 0); - $origin = new Vector2(0, 0); - $rotation = 0.0; - $tint = new Color(255, 0, 0, 0); - - $expectedTexture = $this->ffi->new('Texture'); - $expectedSource = $this->ffi->new('Rectangle'); - $expectedDest = $this->ffi->new('Rectangle'); - $expectedOrigin = $this->ffi->new('Vector2'); - $expectedTint = $this->ffi->new('Color'); - $expectedTint->r = 255; - - $this->ffiProxy->DrawTexturePro( - $this->sameCDataTexture2DArgument($expectedTexture), - $this->sameCDataRectangleArgument($expectedSource), - $this->sameCDataRectangleArgument($expectedDest), - $this->sameCDataVector2Argument($expectedOrigin), - $rotation, - $this->sameCDataColorArgument($expectedTint), - )->shouldBeCalledOnce(); - - $this->raylib->drawTexturePro($texture, $source, $dest, $origin, $rotation, $tint); - } - - public function test_drawTextureTiled_respectsParameterOrderAndConvertsObjectsToCData(): void - { - $texture = new Texture2D(0, 0, 0, 0, 0); - $source = new Rectangle(0, 0, 0, 0); - $dest = new Rectangle(0, 0, 0, 0); - $origin = new Vector2(0, 0); - $tint = new Color(255, 0, 0, 0); - - $expectedTexture = $this->ffi->new('Texture'); - $expectedSource = $this->ffi->new('Rectangle'); - $expectedDest = $this->ffi->new('Rectangle'); - $expectedOrigin = $this->ffi->new('Vector2'); - $expectedTint = $this->ffi->new('Color'); - $expectedTint->r = 255; - - $this->ffiProxy->DrawTextureTiled( - $this->sameCDataTexture2DArgument($expectedTexture), - $this->sameCDataRectangleArgument($expectedSource), - $this->sameCDataRectangleArgument($expectedDest), - $this->sameCDataVector2Argument($expectedOrigin), - 20, - 30, - $this->sameCDataColorArgument($expectedTint), - )->shouldBeCalledOnce(); - - $this->raylib->drawTextureTiled($texture, $source, $dest, $origin, 20, 30, $tint); - } - - public function test_drawTextureV(): void - { - $texture = new Texture2D(0, 0, 0, 0, 0); - $position = new Vector2(0, 0); - $tint = new Color(255, 0, 0, 0); - - $expectedTexture = $this->ffi->new('Texture'); - $expectedPosition = $this->ffi->new('Vector2'); - $expectedTint = $this->ffi->new('Color'); - $expectedTint->r = 255; - - $this->ffiProxy->DrawTextureV( - $this->sameCDataTexture2DArgument($expectedTexture), - $this->sameCDataVector2Argument($expectedPosition), - $this->sameCDataColorArgument($expectedTint), - )->shouldBeCalledOnce(); - - $this->raylib->drawTextureV($texture, $position, $tint); - } - - public function test_drawTriangle_respectsParameterOrderAndConvertsObjectsToCData(): void - { - $expectedVec1 = $this->ffi->new('Vector2'); - $expectedVec2 = $this->ffi->new('Vector2'); - $expectedVec2->x = 1; - $expectedVec2->y = 1; - $expectedVec3 = $this->ffi->new('Vector2'); - $expectedVec3->x = 2; - $expectedVec3->y = 2; - $expectedColor = $this->ffi->new('Color'); - - $this->ffiProxy->DrawTriangle( - $this->sameCDataVector2Argument($expectedVec1), - $this->sameCDataVector2Argument($expectedVec2), - $this->sameCDataVector2Argument($expectedVec3), - $this->sameCDataColorArgument($expectedColor) - )->shouldBeCalledOnce(); - - $this->raylib->drawTriangle(new Vector2(0, 0), new Vector2(1, 1), new Vector2(2, 2), Color::black(0)); - } - - public function test_drawTriangleLines_respectsParameterOrderAndConvertsObjectsToCData(): void - { - $expectedVec1 = $this->ffi->new('Vector2'); - $expectedVec2 = $this->ffi->new('Vector2'); - $expectedVec2->x = 1; - $expectedVec2->y = 1; - $expectedVec3 = $this->ffi->new('Vector2'); - $expectedVec3->x = 2; - $expectedVec3->y = 2; - $expectedColor = $this->ffi->new('Color'); - - $this->ffiProxy->DrawTriangleLines( - $this->sameCDataVector2Argument($expectedVec1), - $this->sameCDataVector2Argument($expectedVec2), - $this->sameCDataVector2Argument($expectedVec3), - $this->sameCDataColorArgument($expectedColor) - )->shouldBeCalledOnce(); - - $this->raylib->drawTriangleLines( - new Vector2(0, 0), - new Vector2(1, 1), - new Vector2(2, 2), - Color::black(0), - ); - } - - public function test_endBlendMode(): void - { - $this->ffiProxy->EndBlendMode() - ->shouldBeCalledOnce(); - - $this->raylib->endBlendMode(); - } - - public function test_endDrawing(): void - { - $this->ffiProxy->EndDrawing() - ->shouldBeCalledOnce(); - - $this->raylib->endDrawing(); - } - - public function test_endMode2D(): void - { - $this->ffiProxy->EndMode2D() - ->shouldBeCalledOnce(); - - $this->raylib->endMode2D(); - } - - public function test_endMode3D(): void - { - $this->ffiProxy->EndMode3D() - ->shouldBeCalledOnce(); - - $this->raylib->endMode3D(); - } - - public function test_endScissorMode(): void - { - $this->ffiProxy->EndScissorMode() - ->shouldBeCalledOnce(); - - $this->raylib->endScissorMode(); - } - - public function test_endTextureMode(): void - { - $this->ffiProxy->EndTextureMode() - ->shouldBeCalledOnce(); - - $this->raylib->endTextureMode(); - } - - public function test_ExportImage(): void - { - $expectedImage = $this->ffi->new('Image'); - $imageData = FFI::addr($this->ffi->new('void *')); - - $expectedImage->data = $imageData; - $expectedImage->width = 10; - $expectedImage->height = 10; - $expectedImage->mipmaps = 5; - $expectedImage->format = 5; - - $image = new Image( - $imageData, - 10, - 10, - 5, - 5 - ); - - $this->ffiProxy->ExportImage($this->sameCDataImageArgument($expectedImage), 'new_image.png') - ->shouldBeCalledOnce() - ->willReturn(true); - - $result = $this->raylib->exportImage($image, 'new_image.png'); - - $this->assertEquals(true, $result); - } - - public function test_fade_respectsParameterOrderAndConvertsObjectsToCData(): void - { - $color = new Color(255, 0, 0, 155); - $expectedStruct = $this->ffi->new('Color'); - $this->ffiProxy->Fade($expectedStruct, 20) - ->shouldBeCalledOnce() - ->willReturn($expectedStruct); - - self::assertEquals( - new Color(0, 0, 0, 0), - $this->raylib->fade($color, 20), - ); - } - - public function test_GenImageCellular(): void - { - $expectedImage = $this->ffi->new('Image'); - $imageData = FFI::addr($this->ffi->new('void *')); - - $expectedImage->data = $imageData; - $expectedImage->width = 10; - $expectedImage->height = 10; - $expectedImage->mipmaps = 5; - $expectedImage->format = 5; - - $this->ffiProxy->GenImageCellular(200, 200, 32) - ->shouldBeCalledOnce() - ->willReturn($expectedImage); - - $image = $this->raylib->genImageCellular(200, 200, 32); - - self::assertEquals($expectedImage->data, $image->data); - self::assertEquals($expectedImage->width, $image->width); - self::assertEquals($expectedImage->height, $image->height); - self::assertEquals($expectedImage->mipmaps, $image->mipmaps); - self::assertEquals($expectedImage->format, $image->format); - } - - public function test_GenImageChecked(): void - { - $expectedImage = $this->ffi->new('Image'); - $imageData = FFI::addr($this->ffi->new('void *')); - - $expectedImage->data = $imageData; - $expectedImage->width = 10; - $expectedImage->height = 10; - $expectedImage->mipmaps = 5; - $expectedImage->format = 5; - - $colorCol1Struct = $this->ffi->new('Color'); - $colorCol1Struct->r = 230; - $colorCol1Struct->g = 41; - $colorCol1Struct->b = 55; - $colorCol1Struct->a = 255; - - $colorCol2Struct = $this->ffi->new('Color'); - $colorCol2Struct->r = 0; - $colorCol2Struct->g = 121; - $colorCol2Struct->b = 241; - $colorCol2Struct->a = 255; - - $this->ffiProxy->GenImageChecked( - 200, - 200, - 32, - 32, - $this->sameCDataColorArgument($colorCol1Struct), - $this->sameCDataColorArgument($colorCol2Struct), - ) - ->shouldBeCalledOnce() - ->willReturn($expectedImage); - - $image = $this->raylib->genImageChecked(200, 200, 32, 32, Color::red(), Color::blue()); - - self::assertEquals($expectedImage->data, $image->data); - self::assertEquals($expectedImage->width, $image->width); - self::assertEquals($expectedImage->height, $image->height); - self::assertEquals($expectedImage->mipmaps, $image->mipmaps); - self::assertEquals($expectedImage->format, $image->format); - } - - public function test_GenImageGradientH(): void - { - $expectedImage = $this->ffi->new('Image'); - $imageData = FFI::addr($this->ffi->new('void *')); - - $expectedImage->data = $imageData; - $expectedImage->width = 10; - $expectedImage->height = 10; - $expectedImage->mipmaps = 5; - $expectedImage->format = 5; - - $colorCol1Struct = $this->ffi->new('Color'); - $colorCol1Struct->r = 230; - $colorCol1Struct->g = 41; - $colorCol1Struct->b = 55; - $colorCol1Struct->a = 255; - - $colorCol2Struct = $this->ffi->new('Color'); - $colorCol2Struct->r = 0; - $colorCol2Struct->g = 121; - $colorCol2Struct->b = 241; - $colorCol2Struct->a = 255; - - $this->ffiProxy->GenImageGradientH( - 200, - 200, - $this->sameCDataColorArgument($colorCol1Struct), - $this->sameCDataColorArgument($colorCol2Struct), - ) - ->shouldBeCalledOnce() - ->willReturn($expectedImage); - - $image = $this->raylib->genImageGradientH(200, 200, Color::red(), Color::blue()); - - self::assertEquals($expectedImage->data, $image->data); - self::assertEquals($expectedImage->width, $image->width); - self::assertEquals($expectedImage->height, $image->height); - self::assertEquals($expectedImage->mipmaps, $image->mipmaps); - self::assertEquals($expectedImage->format, $image->format); - } - - public function test_GenImageGradientRadial(): void - { - $expectedImage = $this->ffi->new('Image'); - $imageData = FFI::addr($this->ffi->new('void *')); - - $expectedImage->data = $imageData; - $expectedImage->width = 10; - $expectedImage->height = 10; - $expectedImage->mipmaps = 5; - $expectedImage->format = 5; - - $colorCol1Struct = $this->ffi->new('Color'); - $colorCol1Struct->r = 230; - $colorCol1Struct->g = 41; - $colorCol1Struct->b = 55; - $colorCol1Struct->a = 255; - - $colorCol2Struct = $this->ffi->new('Color'); - $colorCol2Struct->r = 0; - $colorCol2Struct->g = 121; - $colorCol2Struct->b = 241; - $colorCol2Struct->a = 255; - - $this->ffiProxy->GenImageGradientRadial( - 200, - 200, - 0.5, - $this->sameCDataColorArgument($colorCol1Struct), - $this->sameCDataColorArgument($colorCol2Struct), - ) - ->shouldBeCalledOnce() - ->willReturn($expectedImage); - - $image = $this->raylib->genImageGradientRadial(200, 200, 0.5, Color::red(), Color::blue()); - - self::assertEquals($expectedImage->data, $image->data); - self::assertEquals($expectedImage->width, $image->width); - self::assertEquals($expectedImage->height, $image->height); - self::assertEquals($expectedImage->mipmaps, $image->mipmaps); - self::assertEquals($expectedImage->format, $image->format); - } - - public function test_GenImageGradientV(): void - { - $expectedImage = $this->ffi->new('Image'); - $imageData = FFI::addr($this->ffi->new('void *')); - - $expectedImage->data = $imageData; - $expectedImage->width = 10; - $expectedImage->height = 10; - $expectedImage->mipmaps = 5; - $expectedImage->format = 5; - - $colorCol1Struct = $this->ffi->new('Color'); - $colorCol1Struct->r = 230; - $colorCol1Struct->g = 41; - $colorCol1Struct->b = 55; - $colorCol1Struct->a = 255; - - $colorCol2Struct = $this->ffi->new('Color'); - $colorCol2Struct->r = 0; - $colorCol2Struct->g = 121; - $colorCol2Struct->b = 241; - $colorCol2Struct->a = 255; - - $this->ffiProxy->GenImageGradientV( - 200, - 200, - $this->sameCDataColorArgument($colorCol1Struct), - $this->sameCDataColorArgument($colorCol2Struct), - ) - ->shouldBeCalledOnce() - ->willReturn($expectedImage); - - $image = $this->raylib->genImageGradientV(200, 200, Color::red(), Color::blue()); - - self::assertEquals($expectedImage->data, $image->data); - self::assertEquals($expectedImage->width, $image->width); - self::assertEquals($expectedImage->height, $image->height); - self::assertEquals($expectedImage->mipmaps, $image->mipmaps); - self::assertEquals($expectedImage->format, $image->format); - } - - public function test_GenImagePerlinNoise(): void - { - $expectedImage = $this->ffi->new('Image'); - $imageData = FFI::addr($this->ffi->new('void *')); - - $expectedImage->data = $imageData; - $expectedImage->width = 10; - $expectedImage->height = 10; - $expectedImage->mipmaps = 5; - $expectedImage->format = 5; - - $this->ffiProxy->GenImagePerlinNoise(200, 200, 1, 1, 1.5) - ->shouldBeCalledOnce() - ->willReturn($expectedImage); - - $image = $this->raylib->genImagePerlinNoise(200, 200, 1, 1, 1.5); - - self::assertEquals($expectedImage->data, $image->data); - self::assertEquals($expectedImage->width, $image->width); - self::assertEquals($expectedImage->height, $image->height); - self::assertEquals($expectedImage->mipmaps, $image->mipmaps); - self::assertEquals($expectedImage->format, $image->format); - } - - public function test_GenImageWhiteNoise(): void - { - $expectedImage = $this->ffi->new('Image'); - $imageData = FFI::addr($this->ffi->new('void *')); - - $expectedImage->data = $imageData; - $expectedImage->width = 10; - $expectedImage->height = 10; - $expectedImage->mipmaps = 5; - $expectedImage->format = 5; - - $this->ffiProxy->GenImageWhiteNoise(200, 200, 1.5) - ->shouldBeCalledOnce() - ->willReturn($expectedImage); - - $image = $this->raylib->genImageWhiteNoise(200, 200, 1.5); - - self::assertEquals($expectedImage->data, $image->data); - self::assertEquals($expectedImage->width, $image->width); - self::assertEquals($expectedImage->height, $image->height); - self::assertEquals($expectedImage->mipmaps, $image->mipmaps); - self::assertEquals($expectedImage->format, $image->format); - } - - public function test_getClipboardText(): void - { - $this->ffiProxy->GetClipboardText() - ->shouldBeCalledOnce() - ->willReturn('Clipboard text'); - - self::assertEquals('Clipboard text', $this->raylib->getClipboardText()); - } - - public function test_getColor(): void - { - $expectedColor = $this->ffi->new('Color'); - $expectedColor->g = 255; - $expectedColor->a = 255; - - $this->ffiProxy->GetColor(0x00ff00ff) - ->shouldBeCalledOnce() - ->willReturn($expectedColor); - - self::assertEquals(new Color(0, 255,0, 255), $this->raylib->getColor(0x00ff00ff)); - } - - public function test_getCollisionRec_respectsParameterOrderAndConvertsObjectsToCData(): void - { - $expectedRec = $this->ffi->new('Rectangle'); - $expectedRec->x = 100; - - $this->ffiProxy->GetCollisionRec( - $this->ffi->new('Rectangle'), - $this->ffi->new('Rectangle'), - )->shouldBeCalledOnce()->willReturn($expectedRec); - - $collsionRec = $this->raylib->getCollisionRec( - new Rectangle(0, 0, 10, 10), - new Rectangle(0, 0, 20, 20), - ); - - self::assertEquals(100, $collsionRec->x); - self::assertEquals(0, $collsionRec->y); - self::assertEquals(0, $collsionRec->width); - self::assertEquals(0, $collsionRec->height); - } - - public function test_getFPS(): void - { - $this->ffiProxy->GetFPS() - ->shouldBeCalledOnce() - ->willReturn(10); - - self::assertEquals(10, $this->raylib->getFPS()); - } - - public function test_getFrameTime(): void - { - $this->ffiProxy->GetFrameTime() - ->shouldBeCalledOnce() - ->willReturn(10.0); - - self::assertEquals(10.0, $this->raylib->getFrameTime()); - } - - public function test_getImageData(): void - { - $colorStruct = $this->ffi->new('Color'); - $colorStruct->r = 255; - $colorStruct->g = 255; - $colorStruct->b = 255; - $colorStruct->a = 255; - - $imageStruct = $this->ffi->new('Image'); - $data = FFI::addr($this->ffi->new('void *')); - - $imageStruct->data = $data; - $imageStruct->width = 10; - $imageStruct->height = 20; - $imageStruct->mipmaps = 30; - $imageStruct->format = 40; - - $this->ffiProxy->LoadImageColors($this->sameCDataImageArgument($imageStruct)) - ->shouldBeCalledOnce() - ->willReturn($colorStruct); - - $image = new Image( - $imageStruct->data, - $imageStruct->width, - $imageStruct->height, - $imageStruct->mipmaps, - $imageStruct->format, - ); - - self::assertEquals($colorStruct, $this->raylib->getImageData($image)); - } - - public function test_getKeyPressed(): void - { - $this->ffiProxy->GetKeyPressed() - ->shouldBeCalledOnce() - ->willReturn(Raylib::KEY_N); - - self::assertEquals(Raylib::KEY_N, $this->raylib->getKeyPressed()); - } - - public function test_getCharPressed(): void - { - $this->ffiProxy->GetCharPressed() - ->shouldBeCalledOnce() - ->willReturn(Raylib::KEY_N); - - self::assertEquals(Raylib::KEY_N, $this->raylib->getCharPressed()); - } - - public function test_getMousePosition(): void - { - $vector2Struct = $this->ffi->new('Vector2'); - $vector2Struct->x = 10; - - $this->ffiProxy->GetMousePosition() - ->shouldBeCalledOnce() - ->willReturn($vector2Struct); - - self::assertEquals(new Vector2(10, 0), $this->raylib->getMousePosition()); - } - - public function test_GetMouseRay(): void - { - $mousePosition = new Vector2(0, 0); - $camera = new Camera3D( - new Vector3(0, 0, 0), - new Vector3(0, 0, 0), - new Vector3(0, 0, 0), - 10.0, - Camera3D::PROJECTION_PERSPECTIVE, - ); - - $mousePositionStruct = $this->ffi->new('Vector2'); - $cameraStruct = $this->ffi->new('Camera3D'); - $cameraStruct->fovy = 10.0; - - $expectedRayStruct = $this->ffi->new('Ray'); - - $this->ffiProxy->GetMouseRay( - $this->sameCDataVector2Argument($mousePositionStruct), - $this->sameCDataCamera3DArgument($cameraStruct), - )->willReturn($expectedRayStruct)->shouldBeCalledOnce(); - - $ray = $this->raylib->getMouseRay($mousePosition, $camera); - self::assertEquals(new Ray(new Vector3(0, 0, 0), new Vector3(0, 0, 0)), $ray); - } - - public function test_getMouseWheelMove(): void - { - $this->ffiProxy->GetMouseWheelMove() - ->shouldBeCalledOnce() - ->willReturn(1.0); - - self::assertEquals(1.0, $this->raylib->getMouseWheelMove()); - } - - public function test_getMouseX(): void - { - $this->ffiProxy->GetMouseX() - ->shouldBeCalledOnce() - ->willReturn(10); - - self::assertEquals(10, $this->raylib->getMouseX()); - } - - public function test_getMouseY(): void - { - $this->ffiProxy->GetMouseY() - ->shouldBeCalledOnce() - ->willReturn(10); - - self::assertEquals(10, $this->raylib->getMouseY()); - } - - /** - * @method DrawText(string $text, int $x, int $y, int $fontSize, FFI\CData $color): void - * @method Fade(FFI\CData $color, float $alpha): FFI\CData - */ - public function test_getRandomValue_respectsParameterOrder(): void - { - $this->ffiProxy->GetRandomValue(10, 20) - ->shouldBeCalledOnce() - ->willReturn(15); - - self::assertEquals(15, $this->raylib->getRandomValue(10, 20)); - } - - public function test_getMonitorCount(): void - { - $this->ffiProxy->GetMonitorCount() - ->shouldBeCalledOnce() - ->willReturn(2); - - self::assertEquals(2, $this->raylib->getMonitorCount()); - } - - public function test_getMonitorName(): void - { - $this->ffiProxy->GetMonitorName(0) - ->shouldBeCalledOnce() - ->willReturn('Color LCD'); - - self::assertEquals('Color LCD', $this->raylib->getMonitorName(0)); - } - - public function test_getMonitorPosition(): void - { - $vec = $this->ffi->new('Vector2'); - $vec->x = 10; - $vec->y = 20; - $this->ffiProxy->GetMonitorPosition(0) - ->shouldBeCalledOnce() - ->willReturn($vec); - - self::assertEquals(new Vector2(10, 20), $this->raylib->getMonitorPosition(0)); - } - - public function test_getMonitorWidth(): void - { - $this->ffiProxy->GetMonitorWidth(0) - ->shouldBeCalledOnce() - ->willReturn(200); - - self::assertEquals(200, $this->raylib->getMonitorWidth(0)); - } - - public function test_getMonitorHeight(): void - { - $this->ffiProxy->GetMonitorHeight(0) - ->shouldBeCalledOnce() - ->willReturn(200); - - self::assertEquals(200, $this->raylib->getMonitorHeight(0)); - } - - public function test_getMonitorPhysicalWidth(): void - { - $this->ffiProxy->GetMonitorPhysicalWidth(0) - ->shouldBeCalledOnce() - ->willReturn(200); - - self::assertEquals(200, $this->raylib->getMonitorPhysicalWidth(0)); - } - - public function test_getMonitorPhysicalHeight(): void - { - $this->ffiProxy->GetMonitorPhysicalHeight(0) - ->shouldBeCalledOnce() - ->willReturn(200); - - self::assertEquals(200, $this->raylib->getMonitorPhysicalHeight(0)); - } - - public function test_getMonitorRefreshRate(): void - { - $this->ffiProxy->GetMonitorRefreshRate(0) - ->shouldBeCalledOnce() - ->willReturn(200); - - self::assertEquals(200, $this->raylib->getMonitorRefreshRate(0)); - } - - public function test_getWindowPosition(): void - { - $vec = $this->ffi->new('Vector2'); - $vec->x = 10; - $vec->y = 20; - $this->ffiProxy->GetWindowPosition() - ->shouldBeCalledOnce() - ->willReturn($vec); - - self::assertEquals(new Vector2(10, 20), $this->raylib->getWindowPosition()); - } - - public function test_getWindowScaleDPI(): void - { - $vec = $this->ffi->new('Vector2'); - $vec->x = 10; - $vec->y = 20; - $this->ffiProxy->GetWindowScaleDPI() - ->shouldBeCalledOnce() - ->willReturn($vec); - - self::assertEquals(new Vector2(10, 20), $this->raylib->getWindowScaleDPI()); - } - - public function test_getScreenToWorld2D_respectsParameterOrderAndConvertsObjectsToCData(): void - { - $expectedPosition = $this->ffi->new('Vector2'); - $expectedPosition->x = 5; - $expectedPosition->y = 5; - - $expectedStruct = $this->ffi->new('Vector2'); - $expectedStruct->x = 10; - $expectedStruct->y = 20; - - $this->ffiProxy->GetScreenToWorld2D( - $this->sameCDataVector2Argument($expectedPosition), - $this->sameCDataCamera2DArgument($this->ffi->new('Camera2D')), - )->shouldBeCalledOnce()->willReturn($expectedStruct); - - $position = new Vector2(5, 5); - $camera = new Camera2D(new Vector2(0, 0), new Vector2(0, 0), 0, 0); - self::assertEquals(new Vector2(10, 20), $this->raylib->getScreenToWorld2D($position, $camera)); - } - - public function test_getSoundsPlaying(): void - { - $this->ffiProxy->GetSoundsPlaying() - ->shouldBeCalledOnce() - ->willReturn(10); - - self::assertEquals(10, $this->raylib->getSoundsPlaying()); - } - - public function test_getTextureData(): void - { - $expectedTextureStruct = $this->ffi->new('Texture'); - $image = new Image( - FFI::addr($expectedTextureStruct), - 0, - 0, - 0, - 0 - ); - - $texture = new Texture2D( - $expectedTextureStruct->id, - $expectedTextureStruct->width, - $expectedTextureStruct->height, - $expectedTextureStruct->mipmaps, - $expectedTextureStruct->format, - ); - - $this->ffiProxy->GetTextureData($this->sameCDataTexture2DArgument($expectedTextureStruct)) - ->shouldBeCalledOnce() - ->willReturn($image); - - self::assertEquals($image, $this->raylib->getTextureData($texture)); - } - - public function test_getWorldToScreen_respectsParameterOrderAndConvertsObjectsToCData(): void - { - $expectedPosition = $this->ffi->new('Vector3'); - $expectedPosition->x = 5; - $expectedPosition->y = 5; - $expectedPosition->z = 5; - - $expectedStruct = $this->ffi->new('Vector2'); - $expectedStruct->x = 10; - $expectedStruct->y = 20; - - $this->ffiProxy->GetWorldToScreen( - $this->sameCDataVector3Argument($expectedPosition), - $this->sameCDataCamera3DArgument($this->ffi->new('Camera3D')), - )->shouldBeCalledOnce()->willReturn($expectedStruct); - - $position = new Vector3(5, 5, 5); - $camera = new Camera3D(new Vector3(0, 0, 0), new Vector3(0, 0, 0), new Vector3(0, 0, 0), 0, 0); - self::assertEquals(new Vector2(10, 20), $this->raylib->getWorldToScreen($position, $camera)); - } - - public function test_getWorldToScreen2D_respectsParameterOrderAndConvertsObjectsToCData(): void - { - $expectedPosition = $this->ffi->new('Vector2'); - $expectedPosition->x = 5; - $expectedPosition->y = 5; - - $expectedStruct = $this->ffi->new('Vector2'); - $expectedStruct->x = 10; - $expectedStruct->y = 20; - - $this->ffiProxy->GetWorldToScreen2D( - $this->sameCDataVector2Argument($expectedPosition), - $this->sameCDataCamera2DArgument($this->ffi->new('Camera2D')), - )->shouldBeCalledOnce()->willReturn($expectedStruct); - - $position = new Vector2(5, 5); - $camera = new Camera2D(new Vector2(0, 0), new Vector2(0, 0), 0, 0); - self::assertEquals(new Vector2(10, 20), $this->raylib->getWorldToScreen2D($position, $camera)); - } - - public function test_getScreenWidth(): void - { - $this->ffiProxy->GetScreenWidth() - ->shouldBeCalledOnce() - ->willReturn(10); - - self::assertEquals(10, $this->raylib->getScreenWidth()); - } - - public function test_getScreenHeight(): void - { - $this->ffiProxy->GetScreenHeight() - ->shouldBeCalledOnce() - ->willReturn(10); - - self::assertEquals(10, $this->raylib->getScreenHeight()); - } - - public function test_imageColorBrightness(): void - { - $imageStruct = $this->ffi->new('Image'); - $data = FFI::addr($this->ffi->new('void *')); - - $imageStruct->data = $data; - $imageStruct->width = 10; - $imageStruct->height = 20; - $imageStruct->mipmaps = 30; - $imageStruct->format = 40; - - $this->ffiProxy->ImageColorBrightness( - $this->sameCDataImageArgument($imageStruct), - -40 - ) - ->willReturn($imageStruct); - - $image = new Image( - $data, - $imageStruct->width, - $imageStruct->height, - $imageStruct->mipmaps, - $imageStruct->format - ); - - $this->raylib->imageColorBrightness($image, -40); - } - - public function test_imageColorContrast(): void - { - $imageStruct = $this->ffi->new('Image'); - $data = FFI::addr($this->ffi->new('void *')); - - $imageStruct->data = $data; - $imageStruct->width = 10; - $imageStruct->height = 20; - $imageStruct->mipmaps = 30; - $imageStruct->format = 40; - - $this->ffiProxy->ImageColorContrast( - $this->sameCDataImageArgument($imageStruct), - -40.0 - ) - ->willReturn($imageStruct); - - $image = new Image( - $data, - $imageStruct->width, - $imageStruct->height, - $imageStruct->mipmaps, - $imageStruct->format - ); - - $this->raylib->imageColorContrast($image, -40.0); - } - - public function test_imageColorGrayscale(): void - { - $imageStruct = $this->ffi->new('Image'); - $data = FFI::addr($this->ffi->new('void *')); - - $imageStruct->data = $data; - $imageStruct->width = 10; - $imageStruct->height = 20; - $imageStruct->mipmaps = 30; - $imageStruct->format = 40; - - $this->ffiProxy->ImageColorGrayscale( - $this->sameCDataImageArgument($imageStruct) - ) - ->willReturn($imageStruct); - - $image = new Image( - $data, - $imageStruct->width, - $imageStruct->height, - $imageStruct->mipmaps, - $imageStruct->format - ); - - $this->raylib->imageColorGrayscale($image); - } - - public function test_imageColorInvert(): void - { - $imageStruct = $this->ffi->new('Image'); - $data = FFI::addr($this->ffi->new('void *')); - - $imageStruct->data = $data; - $imageStruct->width = 10; - $imageStruct->height = 20; - $imageStruct->mipmaps = 30; - $imageStruct->format = 40; - - $this->ffiProxy->ImageColorInvert( - $this->sameCDataImageArgument($imageStruct) - ) - ->willReturn($imageStruct); - - $image = new Image( - $data, - $imageStruct->width, - $imageStruct->height, - $imageStruct->mipmaps, - $imageStruct->format - ); - - $this->raylib->imageColorInvert($image); - } - - public function test_imageColorTint(): void - { - $imageStruct = $this->ffi->new('Image'); - $data = FFI::addr($this->ffi->new('void *')); - - $imageStruct->data = $data; - $imageStruct->width = 10; - $imageStruct->height = 20; - $imageStruct->mipmaps = 30; - $imageStruct->format = 40; - - $colorStruct = $this->ffi->new('Color'); - $colorStruct->r = 255; - $colorStruct->g = 255; - $colorStruct->b = 255; - $colorStruct->a = 255; - - $this->ffiProxy->ImageColorTint( - $this->sameCDataImageArgument($imageStruct), - $this->sameCDataColorArgument($colorStruct) - ) - ->willReturn($imageStruct); - - $image = new Image( - $data, - $imageStruct->width, - $imageStruct->height, - $imageStruct->mipmaps, - $imageStruct->format - ); - - $color = new Color( - $colorStruct->r, - $colorStruct->g, - $colorStruct->b, - $colorStruct->a, - ); - - $this->raylib->imageColorTint($image, $color); - } - - public function test_imageCrop(): void - { - $rec1 = $this->ffi->new('Rectangle'); - $rec1->x = 10.0; - $rec1->y = 5.0; - $rec1->width = 100.0; - $rec1->height = 50.0; - - $imageStruct = $this->ffi->new('Image'); - $data = FFI::addr($imageStruct); - - $imageStruct->data = $data; - $imageStruct->width = 10; - $imageStruct->height = 20; - $imageStruct->mipmaps = 30; - $imageStruct->format = 40; - - $this->ffiProxy->ImageCrop( - $this->sameCDataImageArgument($imageStruct), - $this->sameCDataRectangleArgument($rec1) - ) - ->willReturn($imageStruct); - - $image = new Image( - $data, - $imageStruct->width, - $imageStruct->height, - $imageStruct->mipmaps, - $imageStruct->format - ); - - $rectangle = new Rectangle( - $rec1->x, - $rec1->y, - $rec1->width, - $rec1->height - ); - - $this->raylib->imageCrop($image, $rectangle); - } - - public function test_imageDraw(): void - { - $imageStruct = $this->ffi->new('Image'); - $data = FFI::addr($imageStruct); - - $imageStruct->data = $data; - $imageStruct->width = 10; - $imageStruct->height = 20; - $imageStruct->mipmaps = 30; - $imageStruct->format = 40; - - $imageSrcStruct = $this->ffi->new('Image'); - $dataSrc = FFI::addr($imageSrcStruct); - - $imageSrcStruct->data = $dataSrc; - $imageSrcStruct->width = 10; - $imageSrcStruct->height = 20; - $imageSrcStruct->mipmaps = 30; - $imageSrcStruct->format = 40; - - $colorStruct = $this->ffi->new('Color'); - $colorStruct->r = 255; - $colorStruct->g = 255; - $colorStruct->b = 255; - $colorStruct->a = 255; - - $recDstStruct = $this->ffi->new('Rectangle'); - $recSrcStruct = $this->ffi->new('Rectangle'); - - $this->ffiProxy->ImageDraw( - $this->sameCDataImageArgument($imageStruct), - $this->sameCDataImageArgument($imageSrcStruct), - $this->sameCDataRectangleArgument($recSrcStruct), - $this->sameCDataRectangleArgument($recDstStruct), - $this->sameCDataColorArgument($colorStruct) - ) - ->willReturn($imageStruct); - - $imageDst = new Image( - $data, - $imageStruct->width, - $imageStruct->height, - $imageStruct->mipmaps, - $imageStruct->format - ); - - $imageSrc = new Image( - $dataSrc, - $imageSrcStruct->width, - $imageSrcStruct->height, - $imageSrcStruct->mipmaps, - $imageSrcStruct->format - ); - - $srcRec = new Rectangle(0, 0, 0, 0); - $dstRec = new Rectangle(0, 0, 0, 0); - - $this->raylib->imageDraw($imageDst, $imageSrc, $srcRec, $dstRec, Color::white()); - } - - public function test_imageDrawCircle(): void - { - $imageStruct = $this->ffi->new('Image'); - $data = FFI::addr($imageStruct); - - $imageStruct->data = $data; - $imageStruct->width = 10; - $imageStruct->height = 20; - $imageStruct->mipmaps = 30; - $imageStruct->format = 40; - - $colorStruct = $this->ffi->new('Color'); - $colorStruct->r = 255; - $colorStruct->g = 255; - $colorStruct->b = 255; - $colorStruct->a = 255; - - $this->ffiProxy->ImageDrawCircle( - $this->sameCDataImageArgument($imageStruct), - 10, - 10, - 2, - $this->sameCDataColorArgument($colorStruct) - ) - ->willReturn($imageStruct); - - $image = new Image( - $data, - $imageStruct->width, - $imageStruct->height, - $imageStruct->mipmaps, - $imageStruct->format - ); - - $this->raylib->imageDrawCircle($image, 10, 10, 2, Color::white()); - } - - public function test_imageDrawPixel(): void - { - $imageStruct = $this->ffi->new('Image'); - $data = FFI::addr($imageStruct); - - $imageStruct->data = $data; - $imageStruct->width = 10; - $imageStruct->height = 20; - $imageStruct->mipmaps = 30; - $imageStruct->format = 40; - - $colorStruct = $this->ffi->new('Color'); - $colorStruct->r = 255; - $colorStruct->g = 255; - $colorStruct->b = 255; - $colorStruct->a = 255; - - $this->ffiProxy->ImageDrawPixel( - $this->sameCDataImageArgument($imageStruct), - 10, - 10, - $this->sameCDataColorArgument($colorStruct) - ) - ->willReturn($imageStruct); - - $image = new Image( - $data, - $imageStruct->width, - $imageStruct->height, - $imageStruct->mipmaps, - $imageStruct->format - ); - - $this->raylib->imageDrawPixel($image, 10, 10, Color::white()); - } - - public function test_imageDrawRectangle(): void - { - $imageStruct = $this->ffi->new('Image'); - $data = FFI::addr($imageStruct); - - $imageStruct->data = $data; - $imageStruct->width = 10; - $imageStruct->height = 20; - $imageStruct->mipmaps = 30; - $imageStruct->format = 40; - - $colorStruct = $this->ffi->new('Color'); - $colorStruct->r = 255; - $colorStruct->g = 255; - $colorStruct->b = 255; - $colorStruct->a = 255; - - $this->ffiProxy->ImageDrawRectangle( - $this->sameCDataImageArgument($imageStruct), - 10, - 10, - 20, - 20, - $this->sameCDataColorArgument($colorStruct) - ) - ->willReturn($imageStruct); - - $image = new Image( - $data, - $imageStruct->width, - $imageStruct->height, - $imageStruct->mipmaps, - $imageStruct->format - ); - - $this->raylib->imageDrawRectangle($image, 10, 10, 20, 20, Color::white()); - } - - public function test_imageDrawTextEx(): void - { - $imageStruct = $this->ffi->new('Image'); - $data = FFI::addr($imageStruct); - - $imageStruct->data = $data; - $imageStruct->width = 10; - $imageStruct->height = 20; - $imageStruct->mipmaps = 30; - $imageStruct->format = 40; - - $recStruct = $this->ffi->new('Rectangle'); - $dataRec = FFI::addr($recStruct); - - $charInfoStruct = $this->ffi->new('CharInfo'); - $dataCharInfo = FFI::addr($charInfoStruct); - $dataCharInfo->value = 10; - $dataCharInfo->offsetX = 10; - $dataCharInfo->offsetY = 10; - $dataCharInfo->advanceX = 10; - $dataCharInfo->image = $imageStruct; - - $fontStruct = $this->ffi->new('Font'); - $fontStruct->recs = $dataRec; - $fontStruct->chars = $dataCharInfo; - - $position = $this->ffi->new('Vector2'); - - $textureStruct = $this->ffi->new('Texture'); - $textureStruct->id = 10; - $textureStruct->width = 10; - $textureStruct->height = 10; - $textureStruct->mipmaps = 10; - $textureStruct->format = 10; - - $texture = new Texture2D( - $textureStruct->id, - $textureStruct->width, - $textureStruct->height, - $textureStruct->mipmaps, - $textureStruct->format, - ); - - $colorStruct = $this->ffi->new('Color'); - $colorStruct->r = 255; - $colorStruct->g = 255; - $colorStruct->b = 255; - $colorStruct->a = 255; - - $this->ffiProxy->ImageDrawTextEx( - $this->sameCDataImageArgument($imageStruct), - $this->sameCDataFontArgument($fontStruct), - 'Text', - $this->sameCDataVector2Argument($position), - 20.0, - 1.5, - $this->sameCDataColorArgument($colorStruct) - ) - ->willReturn($imageStruct); - - $image = new Image( - $imageStruct->data, - $imageStruct->width, - $imageStruct->height, - $imageStruct->mipmaps, - $imageStruct->format - ); - - $font = new Font( - $fontStruct->baseSize, - $fontStruct->charsCount, - $fontStruct->charsPadding, - $texture, - $dataRec, - $dataCharInfo - ); - - $this->raylib->imageDrawTextEx( - $image, - $font, - 'Text', - new Vector2(0, 0), - 20, - 1.5, - Color::white() - ); - } - - public function test_imageFlipHorizontal(): void - { - $imageStruct = $this->ffi->new('Image'); - $data = FFI::addr($imageStruct); - - $imageStruct->data = $data; - $imageStruct->width = 10; - $imageStruct->height = 20; - $imageStruct->mipmaps = 30; - $imageStruct->format = 40; - - $this->ffiProxy->ImageFlipHorizontal( - $this->sameCDataImageArgument($imageStruct) - ) - ->willReturn($imageStruct); - - $image = new Image( - $data, - $imageStruct->width, - $imageStruct->height, - $imageStruct->mipmaps, - $imageStruct->format - ); - - $this->raylib->imageFlipHorizontal($image); - } - - public function test_imageFlipVertical(): void - { - $imageStruct = $this->ffi->new('Image'); - $data = FFI::addr($imageStruct); - - $imageStruct->data = $data; - $imageStruct->width = 10; - $imageStruct->height = 20; - $imageStruct->mipmaps = 30; - $imageStruct->format = 40; - - $this->ffiProxy->ImageFlipVertical( - $this->sameCDataImageArgument($imageStruct) - ) - ->willReturn($imageStruct); - - $image = new Image( - $data, - $imageStruct->width, - $imageStruct->height, - $imageStruct->mipmaps, - $imageStruct->format - ); - - $this->raylib->imageFlipVertical($image); - } - - public function test_imageFormat(): void - { - $imageStruct = $this->ffi->new('Image'); - $data = FFI::addr($imageStruct); - - $imageStruct->data = $data; - $imageStruct->width = 10; - $imageStruct->height = 20; - $imageStruct->mipmaps = 30; - $imageStruct->format = 40; - - $this->ffiProxy->ImageFormat( - $this->sameCDataImageArgument($imageStruct), - Raylib::UNCOMPRESSED_R8G8B8A8 - ) - ->willReturn($imageStruct); - - $image = new Image( - $data, - $imageStruct->width, - $imageStruct->height, - $imageStruct->mipmaps, - $imageStruct->format - ); - - $this->raylib->imageFormat($image, Raylib::UNCOMPRESSED_R8G8B8A8); - } - - public function test_imageResize(): void - { - $imageStruct = $this->ffi->new('Image'); - $data = FFI::addr($imageStruct); - - $imageStruct->data = $data; - $imageStruct->width = 10; - $imageStruct->height = 20; - $imageStruct->mipmaps = 30; - $imageStruct->format = 40; - - $this->ffiProxy->ImageResize( - $this->sameCDataImageArgument($imageStruct), - 200, - 200 - ) - ->willReturn($imageStruct); - - $image = new Image( - $data, - $imageStruct->width, - $imageStruct->height, - $imageStruct->mipmaps, - $imageStruct->format - ); - - $this->raylib->imageResize($image, 200, 200); - } - - public function test_initAudioDevice(): void - { - $this->ffiProxy->InitAudioDevice() - ->shouldBeCalledOnce(); - - $this->raylib->initAudioDevice(); - } - - public function test_initWindow_respectsParameterOrder(): void - { - $this->ffiProxy->InitWindow(800, 600, 'My Test') - ->shouldBeCalledOnce(); - - $this->raylib->initWindow(800, 600, 'My Test'); - } - - public function test_isKeyDown(): void - { - $this->ffiProxy->IsKeyDown(10) - ->shouldBeCalledOnce() - ->willReturn(true); - - self::assertTrue($this->raylib->isKeyDown(10)); - } - - public function test_isKeyPressed(): void - { - $this->ffiProxy->IsKeyPressed(10) - ->shouldBeCalledOnce() - ->willReturn(true); - - self::assertTrue($this->raylib->isKeyPressed(10)); - } - - public function test_isMouseButtonDown(): void - { - $this->ffiProxy->IsMouseButtonDown(10) - ->shouldBeCalledOnce() - ->willReturn(true); - - self::assertTrue($this->raylib->isMouseButtonDown(10)); - } - - public function test_isMouseButtonPressed(): void - { - $this->ffiProxy->IsMouseButtonPressed(10) - ->shouldBeCalledOnce() - ->willReturn(true); - - self::assertTrue($this->raylib->isMouseButtonPressed(10)); - } - - public function test_isMouseButtonReleased(): void - { - $this->ffiProxy->IsMouseButtonReleased(10) - ->shouldBeCalledOnce() - ->willReturn(true); - - self::assertTrue($this->raylib->isMouseButtonReleased(10)); - } - - public function test_isWindowFocused(): void - { - $this->ffiProxy->IsWindowFocused() - ->shouldBeCalledOnce() - ->willReturn(true); - - self::assertTrue($this->raylib->isWindowFocused()); - } - - public function test_isWindowFullscreen(): void - { - $this->ffiProxy->IsWindowFullscreen() - ->shouldBeCalledOnce() - ->willReturn(true); - - self::assertTrue($this->raylib->isWindowFullscreen()); - } - - public function test_isWindowHidden(): void - { - $this->ffiProxy->IsWindowHidden() - ->shouldBeCalledOnce() - ->willReturn(true); - - self::assertTrue($this->raylib->isWindowHidden()); - } - - public function test_isWindowMaximized(): void - { - $this->ffiProxy->IsWindowMaximized() - ->shouldBeCalledOnce() - ->willReturn(true); - - self::assertTrue($this->raylib->isWindowMaximized()); - } - - public function test_isWindowMinimized(): void - { - $this->ffiProxy->IsWindowMinimized() - ->shouldBeCalledOnce() - ->willReturn(true); - - self::assertTrue($this->raylib->isWindowMinimized()); - } - - public function test_isWindowReady(): void - { - $this->ffiProxy->IsWindowReady() - ->shouldBeCalledOnce() - ->willReturn(true); - - self::assertTrue($this->raylib->isWindowReady()); - } - - public function test_isWindowResized(): void - { - $this->ffiProxy->IsWindowResized() - ->shouldBeCalledOnce() - ->willReturn(true); - - self::assertTrue($this->raylib->isWindowResized()); - } - - public function test_isWindowState(): void - { - $this->ffiProxy->IsWindowState(Raylib::FLAG_WINDOW_ALWAYS_RUN) - ->shouldBeCalledOnce() - ->willReturn(true); - - self::assertTrue($this->raylib->isWindowState(Raylib::FLAG_WINDOW_ALWAYS_RUN)); - } - - public function test_loadImage(): void - { - $imageCData = $this->ffi->new('Image'); - $data = FFI::addr($this->ffi->new('void *')); - - $imageCData->data = $data; - $imageCData->width = 10; - $imageCData->height = 20; - $imageCData->mipmaps = 30; - $imageCData->format = 40; - - $this->ffiProxy->LoadImage('image001.png') - ->shouldBeCalledOnce() - ->willReturn($imageCData); - - $expectedImage = new Image($data, 10, 20, 30, 40); - - self::assertEquals($expectedImage, $this->raylib->loadImage('image001.png')); - } - - public function test_loadImageColors(): void - { - $colorStruct = $this->ffi->new('Color'); - $colorStruct->r = 255; - $colorStruct->g = 255; - $colorStruct->b = 255; - $colorStruct->a = 255; - - $imageStruct = $this->ffi->new('Image'); - $data = FFI::addr($this->ffi->new('void *')); - - $imageStruct->data = $data; - $imageStruct->width = 10; - $imageStruct->height = 20; - $imageStruct->mipmaps = 30; - $imageStruct->format = 40; - - $this->ffiProxy->LoadImageColors($this->sameCDataImageArgument($imageStruct)) - ->shouldBeCalledOnce() - ->willReturn($colorStruct); - - $image = new Image( - $imageStruct->data, - $imageStruct->width, - $imageStruct->height, - $imageStruct->mipmaps, - $imageStruct->format, - ); - - self::assertEquals($colorStruct, $this->raylib->loadImageColors($image)); - } - - public function test_loadModel(): void - { - $cdataModel = $this->ffi->new('Model'); - $cdataModel->transform = $this->ffi->new('Matrix'); - $cdataModel->meshCount = 0; - $cdataModel->materialCount = 0; - $cdataModel->meshes = FFI::addr($this->ffi->new('Mesh')); - $cdataModel->materials = FFI::addr($this->ffi->new('Material')); - $cdataModel->meshMaterial = FFI::addr($this->ffi->new('int')); - $cdataModel->boneCount = 0; - $cdataModel->bones = FFI::addr($this->ffi->new('BoneInfo')); - $cdataModel->bindPose = FFI::addr($this->ffi->new('Transform')); - - $this->ffiProxy->LoadModel('anymodel') - ->shouldBeCalledOnce() - ->willReturn($cdataModel); - - $this->raylib->loadModel('anymodel'); - } - - public function test_loadModelAnimation(): void - { - $animationsCount = 0; - - $expectedModelAnimation = $this->ffi->new('ModelAnimation*'); - $this->ffiProxy->LoadModelAnimations('anymodel', FFI::addr($this->ffi->new('int'))) - ->shouldBeCalledOnce() - ->will(function (array $args) use ($expectedModelAnimation) { - [, $countPointer] = $args; - $countPointer[0] = 10; - - return $expectedModelAnimation; - }); - - $this->raylib->loadModelAnimations('anymodel', $animationsCount); - self::assertEquals(10, $animationsCount); - } - - public function test_loadMusicStream(): void - { - $expectedMusicStruct = $this->ffi->new('Music'); - $expectedMusicStruct->stream->buffer = FFI::addr($this->ffi->new('struct rAudioBuffer { void* ptr; }')); - $expectedMusicStruct->ctxData = FFI::addr($this->ffi->new('struct { void* ptr; }')); - - $this->ffiProxy->LoadMusicStream('music001.xm') - ->shouldBeCalledOnce() - ->willReturn($expectedMusicStruct); - - $this->raylib->loadMusicStream('music001.xm'); - } - - public function test_loadRenderTexture(): void - { - $expectedRenderTexture = $this->ffi->new('RenderTexture'); - - $this->ffiProxy->LoadRenderTexture(0, 0) - ->shouldBeCalledOnce() - ->willReturn($expectedRenderTexture); - - $texture = new Texture2D(0, 0, 0, 0, 0); - $depth = new Texture2D(0, 0, 0, 0, 0); - $renderTexture = new RenderTexture2D(0, $texture, $depth); - - self::assertEquals($renderTexture, $this->raylib->loadRenderTexture(0, 0)); - } - - public function test_loadStorageValue(): void - { - $this->ffiProxy->LoadStorageValue(10) - ->shouldBeCalledOnce() - ->willReturn(20); - - self::assertEquals(20, $this->raylib->loadStorageValue(10)); - } - - public function test_loadTexture(): void - { - $texture = $this->ffi->new('Texture'); - $this->ffiProxy->LoadTexture('unknown.png') - ->shouldBeCalledOnce() - ->willReturn($texture); - - self::assertEquals(new Texture2D(0, 0, 0, 0, 0), $this->raylib->loadTexture('unknown.png')); - } - - public function test_loadTextureFromImage(): void - { - $imageStruct = $this->ffi->new('Image'); - $data = FFI::addr($imageStruct); - - $imageStruct->data = $data; - $imageStruct->width = 10; - $imageStruct->height = 20; - $imageStruct->mipmaps = 30; - $imageStruct->format = 40; - - $textureStruct = $this->ffi->new('Texture'); - $textureStruct->id = 10; - $textureStruct->width = 10; - $textureStruct->height = 10; - $textureStruct->mipmaps = 10; - $textureStruct->format = 10; - - $texture = new Texture2D( - $textureStruct->id, - $textureStruct->width, - $textureStruct->height, - $textureStruct->mipmaps, - $textureStruct->format, - ); - - $this->ffiProxy->LoadTextureFromImage( - $this->sameCDataImageArgument($imageStruct) - ) - ->willReturn($texture); - - $image = new Image( - $imageStruct->data, - $imageStruct->width, - $imageStruct->height, - $imageStruct->mipmaps, - $imageStruct->format - ); - - self::assertEquals($texture, $this->raylib->loadTextureFromImage($image)); - } - - public function test_maximizeWindow(): void - { - $this->ffiProxy->MaximizeWindow() - ->shouldBeCalledOnce(); - - $this->raylib->maximizeWindow(); - } - - public function test_measureText(): void - { - $this->ffiProxy->MeasureText('Tiny Text', 20) - ->shouldBeCalledOnce() - ->willReturn(2000); - - self::assertEquals(2000, $this->raylib->measureText('Tiny Text', 20)); - } - - public function test_minimizeWindow(): void - { - $this->ffiProxy->MinimizeWindow() - ->shouldBeCalledOnce(); - - $this->raylib->minimizeWindow(); - } - - public function test_playSound(): void - { - $buffer = FFI::addr($this->ffi->new('struct rAudioBuffer { void* ptr; }')); - $stream = new AudioStream($buffer, 0, 0, 0); - $sound = new Sound($stream, 0); - - $this->ffiProxy->PlaySound($buffer) - ->shouldBeCalledOnce(); - - $this->raylib->playSound($sound); - } - - public function test_playSoundMulti(): void - { - $buffer = FFI::addr($this->ffi->new('struct rAudioBuffer { void* ptr; }')); - $stream = new AudioStream($buffer, 0, 0, 0); - $sound = new Sound($stream, 0); - - $this->ffiProxy->PlaySoundMulti($buffer) - ->shouldBeCalledOnce(); - - $this->raylib->playSoundMulti($sound); - } - - public function test_restoreWindow(): void - { - $this->ffiProxy->RestoreWindow() - ->shouldBeCalledOnce(); - - $this->raylib->restoreWindow(); - } - - public function test_saveStorageValue(): void - { - $this->ffiProxy->SaveStorageValue(0, 200) - ->shouldBeCalledOnce() - ->willReturn(true); - - self::assertTrue($this->raylib->saveStorageValue(0, 200)); - } - - public function test_setCameraMode_respectsParameterOrderAndConvertsObjectsToCData(): void - { - $camera = new Camera3D( - new Vector3(0, 0, 0), - new Vector3(0, 0, 0), - new Vector3(0, 0, 0), - 15.0, - 5, - ); - - $expectedStruct = $this->ffi->new('Camera3D'); - $expectedStruct->fovy = 15.0; - $expectedStruct->projection = 5; - - $this->ffiProxy->SetCameraMode( - $this->sameCDataCamera3DArgument($expectedStruct), - Camera3D::MODE_FIRST_PERSON, - )->shouldBeCalledOnce(); - - $this->raylib->setCameraMode($camera, Camera3D::MODE_FIRST_PERSON); - } - - public function test_setClipboardText(): void - { - $this->ffiProxy->SetClipboardText('MyClipboardText') - ->shouldBeCalledOnce(); - - $this->raylib->setClipboardText('MyClipboardText'); - } - - public function test_setConfigFlags(): void - { - $this->ffiProxy->SetConfigFlags(10) - ->shouldBeCalledOnce(); - - $this->raylib->setConfigFlags(10); - } - - public function test_setExitKey(): void - { - $this->ffiProxy->SetExitKey(0) - ->shouldBeCalledOnce(); - - $this->raylib->setExitKey(0); - } - - public function test_setMaterialTexture_respectsParameterOrderAndConvertsObjectsToCData(): void - { - $material = $this->ffi->new('Material'); - $texture = new Texture2D(0, 0, 0, 0, 0); - - $this->ffiProxy->SetMaterialTexture( - FFI::addr($material), - Raylib::MAP_ALBEDO, - $this->sameCDataTexture2DArgument($this->ffi->new('Texture')), - )->shouldBeCalledOnce(); - - $this->raylib->setMaterialTexture($material, Raylib::MAP_ALBEDO, $texture); - } - - public function test_setSoundVolume_respectsParameterOrder(): void - { - $buffer = FFI::addr($this->ffi->new('struct rAudioBuffer { void* ptr; }')); - $stream = new AudioStream($buffer, 0, 0, 0); - $sound = new Sound($stream, 0); - - $this->ffiProxy->SetSoundVolume($this->ffi->new('Sound'), 10)->shouldBeCalledOnce(); - - $this->raylib->setSoundVolume($sound, 10.0); - } - - public function test_setTargetFPS_respectsParameterOrder(): void - { - $this->ffiProxy->SetTargetFPS(45) - ->shouldBeCalledOnce(); - - $this->raylib->setTargetFPS(45); - } - - public function test_setTextureFilter_respectsParameterOrder(): void - { - $tex = new Texture2D(0, 0, 0, 0, 0); - $texStruct = $this->ffi->new('Texture'); - - $this->ffiProxy->SetTextureFilter( - $this->sameCDataTexture2DArgument($texStruct), - 10 - )->shouldBeCalledOnce(); - - $this->raylib->setTextureFilter($tex, 10); - } - - public function test_setWindowState(): void - { - $data = $this->ffi->new('void *'); - $expectedImage = $this->ffi->new('Image'); - $expectedImage->data = $data; - - $this->ffiProxy->setWindowIcon( - $this->sameCDataImageArgument($expectedImage) - )->shouldBeCalledOnce(); - - $image = new Image($data, 0, 0, 0, 0); - $this->raylib->setWindowIcon($image); - } - - public function test_setWindowMinSize(): void - { - $this->ffiProxy->SetWindowMinSize(100, 200) - ->shouldBeCalledOnce(); - - $this->raylib->setWindowMinSize(100, 200); - } - - public function test_setWindowMonitor(): void - { - $this->ffiProxy->SetWindowMonitor(200) - ->shouldBeCalledOnce(); - - $this->raylib->setWindowMonitor(200); - } - - public function test_setWindowPosition(): void - { - $this->ffiProxy->SetWindowPosition(100, 200) - ->shouldBeCalledOnce(); - - $this->raylib->setWindowPosition(100, 200); - } - - public function test_setWindowSize(): void - { - $this->ffiProxy->SetWindowSize(100, 200) - ->shouldBeCalledOnce(); - - $this->raylib->setWindowSize(100, 200); - } - - public function test_setWindowTitle(): void - { - $this->ffiProxy->SetWindowTitle('title') - ->shouldBeCalledOnce(); - - $this->raylib->setWindowTitle('title'); - } - - public function test_stopSoundMulti(): void - { - $this->ffiProxy->StopSoundMulti() - ->shouldBeCalledOnce(); - - $this->raylib->stopSoundMulti(); - } - - public function test_textSubtext(): void - { - $this->ffiProxy->TextSubtext('blah', 10, 20) - ->shouldBeCalledOnce() - ->willReturn('somethingelseactually'); - - self::assertEquals( - 'somethingelseactually', - $this->raylib->textSubtext('blah', 10, 20) - ); - } - - public function test_toggleFullscreen(): void - { - $this->ffiProxy->ToggleFullscreen() - ->shouldBeCalledOnce(); - - $this->raylib->toggleFullscreen(); - } - - public function test_unloadImage(): void - { - $expectedImage = $this->ffi->new('Image'); - $data = FFI::addr($this->ffi->new('void *')); - $expectedImage->data = $data; - $image = new Image($data, 0, 0, 0, 0); - - $this->ffiProxy->UnloadImage( - $this->sameCDataImageArgument($expectedImage) - )->shouldBeCalledOnce(); - - $this->raylib->unloadImage($image); - } - - public function test_unloadRenderTexture(): void - { - $expectedRenderTexture = $this->ffi->new('RenderTexture'); - $this->ffiProxy->UnloadRenderTexture( - $this->sameCDataRenderTexture2DArgument($expectedRenderTexture) - )->shouldBeCalledOnce(); - - $texture = new Texture2D(0, 0, 0, 0, 0); - $depth = new Texture2D(0, 0, 0, 0, 0); - $renderTexture = new RenderTexture2D(0, $texture, $depth); - - $this->raylib->unloadRenderTexture($renderTexture); - } - - public function test_unloadModel(): void - { - $transform = $this->ffi->new('Matrix'); - $meshes = $this->ffi->new('Mesh*'); - $materials = $this->ffi->new('Material*'); - $meshMaterial = $this->ffi->new('int*'); - $bones = $this->ffi->new('BoneInfo*'); - $bindPose = $this->ffi->new('Transform*'); - $model = new Model( - $transform, - 0, - 0, - $meshes, - $materials, - $meshMaterial, - 0, - $bones, - $bindPose, - ); - - $expectedModel = $this->ffi->new('Model'); - - $this->ffiProxy->UnloadModel($expectedModel)->shouldBeCalledOnce(); - - $this->raylib->unloadModel($model); - } - - public function test_unloadModelAnimation(): void - { - $animation = $this->ffi->new('ModelAnimation'); - - $this->ffiProxy->UnloadModelAnimation($animation) - ->shouldBeCalledOnce(); - - $this->raylib->unloadModelAnimation($animation); - } - - public function test_unloadSound_respectsParameterOrder(): void - { - $buffer = FFI::addr($this->ffi->new('struct rAudioBuffer { void* ptr; }')); - $stream = new AudioStream($buffer, 0, 0, 0); - $sound = new Sound($stream, 0); - - $this->ffiProxy->UnloadSound($this->ffi->new('Sound')) - ->shouldBeCalledOnce(); - - $this->raylib->unloadSound($sound); - } - - public function test_unloadTexture(): void - { - $texture = $this->ffi->new('Texture'); - $this->ffiProxy->UnloadTexture( - $this->sameCDataTexture2DArgument($texture) - )->shouldBeCalledOnce(); - - $this->raylib->unloadTexture(new Texture2D(0, 0, 0, 0, 0)); - } - - public function test_updateCamera_respectsParameterOrderAndConvertsObjectsToCDataAndUpdatesOriginalObject(): void - { - $camera = new Camera3D( - new Vector3(0, 0, 0), - new Vector3(0, 0, 0), - new Vector3(0, 0, 0), - 15.0, - 5, - ); - - $expectedStruct = $this->ffi->new('Camera3D'); - $expectedStruct->fovy = 15.0; - $expectedStruct->projection = 5; - - $this->ffiProxy->UpdateCamera( - $this->sameCDataCamera3DArgument($expectedStruct) - )->will(function (array $args) { - /** @var CData $cdata */ - [$cdata] = $args; - - $cdata->position->x = 10; - $cdata->target->x = 15; - $cdata->up->x = 20; - $cdata->fovy = 30.0; - })->shouldBeCalledOnce(); - - $this->raylib->updateCamera($camera); - - self::assertEquals(10, $camera->position->x); - self::assertEquals(15, $camera->target->x); - self::assertEquals(20, $camera->up->x); - self::assertEquals(30.0, $camera->fovy); - } - - public function test_updateTexture(): void - { - $textureStruct = $this->ffi->new('Texture'); - $textureStruct->id = 10; - $textureStruct->width = 10; - $textureStruct->height = 10; - $textureStruct->mipmaps = 10; - $textureStruct->format = 10; - - $colorStruct = $this->ffi->new('Color'); - $colorStruct->r = 255; - $colorStruct->g = 255; - $colorStruct->b = 255; - $colorStruct->a = 255; - - $this->ffiProxy->UpdateTexture( - $this->sameCDataTexture2DArgument($textureStruct), - $this->sameCDataColorArgument($colorStruct) - )->shouldBeCalledOnce(); - - $texture = new Texture2D( - $textureStruct->id, - $textureStruct->width, - $textureStruct->height, - $textureStruct->mipmaps, - $textureStruct->format, - ); - - $this->raylib->updateTexture($texture, $colorStruct); - } - - public function test_updateModelAnimation_respectsParameterOrderAndConvertsObjectsToCDataAndUpdatesOriginalObject( - ): void { - $transform = $this->ffi->new('Matrix'); - $meshes = $this->ffi->new('Mesh*'); - $materials = $this->ffi->new('Material*'); - $meshMaterial = $this->ffi->new('int*'); - $bones = $this->ffi->new('BoneInfo*'); - $bindPose = $this->ffi->new('Transform*'); - $model = new Model( - $transform, - 0, - 0, - $meshes, - $materials, - $meshMaterial, - 0, - $bones, - $bindPose, - ); - $animation = $this->ffi->new('ModelAnimation'); - - $expectedModel = $this->ffi->new('Model'); - $this->ffiProxy->UpdateModelAnimation( - $expectedModel, - $animation, - 0, - )->shouldBeCalledOnce(); - - $this->raylib->updateModelAnimation($model, $animation, 0); - } - - public function test_windowShouldClose(): void - { - $this->ffiProxy->WindowShouldClose() - ->shouldBeCalledOnce() - ->willReturn(true); - - self::assertTrue($this->raylib->windowShouldClose()); - } - - private function sameCDataBoundingBoxArgument(CData $expectedStruct): CallbackToken - { - return Argument::that(function (CData $boundingBox) use ($expectedStruct) { - self::assertEquals($expectedStruct->min->x, $boundingBox->min->x); - self::assertEquals($expectedStruct->min->y, $boundingBox->min->y); - self::assertEquals($expectedStruct->min->z, $boundingBox->min->z); - - self::assertEquals($expectedStruct->max->x, $boundingBox->max->x); - self::assertEquals($expectedStruct->max->y, $boundingBox->max->y); - self::assertEquals($expectedStruct->max->z, $boundingBox->max->z); - - return true; - }); - } - - private function sameCDataCamera2DArgument(CData $expectedStruct): CallbackToken - { - return Argument::that(function (CData $camera) use ($expectedStruct) { - self::assertEquals($expectedStruct->offset->x, $camera->offset->x); - self::assertEquals($expectedStruct->offset->y, $camera->offset->y); - self::assertEquals($expectedStruct->target->x, $camera->target->x); - self::assertEquals($expectedStruct->target->y, $camera->target->y); - self::assertEquals($expectedStruct->rotation, $camera->rotation); - self::assertEquals($expectedStruct->zoom, $camera->zoom); - - return true; - }); - } - - private function sameCDataCamera3DArgument(CData $expectedStruct): CallbackToken - { - return Argument::that(function (CData $camera) use ($expectedStruct) { - self::assertEquals($expectedStruct->position->x, $camera->position->x); - self::assertEquals($expectedStruct->position->y, $camera->position->y); - self::assertEquals($expectedStruct->position->z, $camera->position->z); - self::assertEquals($expectedStruct->target->x, $camera->target->x); - self::assertEquals($expectedStruct->target->y, $camera->target->y); - self::assertEquals($expectedStruct->target->z, $camera->target->z); - self::assertEquals($expectedStruct->up->x, $camera->up->x); - self::assertEquals($expectedStruct->up->y, $camera->up->y); - self::assertEquals($expectedStruct->up->z, $camera->up->z); - self::assertEquals($expectedStruct->fovy, $camera->fovy); - self::assertEquals($expectedStruct->projection, $camera->projection); - - return true; - }); - } - - private function sameCDataColorArgument(CData $expectedStruct): CallbackToken - { - return Argument::that(function (CData $color) use ($expectedStruct) { - self::assertEquals($expectedStruct->r, $color->r); - self::assertEquals($expectedStruct->g, $color->g); - self::assertEquals($expectedStruct->b, $color->b); - self::assertEquals($expectedStruct->a, $color->a); - - return true; - }); - } - - private function sameCDataFontArgument(CData $expectedStruct): CallbackToken - { - return Argument::that(function (CData $font) use ($expectedStruct) { - self::assertEquals($expectedStruct->baseSize, $font->baseSize); - self::assertEquals($expectedStruct->charsCount, $font->charsCount); - self::assertEquals($expectedStruct->charsPadding, $font->charsPadding); - self::assertEquals($expectedStruct->texture, $font->texture); - self::assertEquals($expectedStruct->recs, $font->recs); - self::assertEquals($expectedStruct->chars, $font->chars); - - return true; - }); - } - - public function sameCDataImageArgument(CData $expectedStruct): CallbackToken - { - return Argument::that(function (CData $image) use ($expectedStruct) { - self::assertEquals($expectedStruct->data, $image->data); - self::assertEquals($expectedStruct->width, $image->width); - self::assertEquals($expectedStruct->height, $image->height); - self::assertEquals($expectedStruct->mipmaps, $image->mipmaps); - self::assertEquals($expectedStruct->format, $image->format); - - return true; - }); - } - - public function sameCDataRayArgument(CData $expectedStruct): CallbackToken - { - return Argument::that(function (CData $ray) use ($expectedStruct) { - self::assertEquals($expectedStruct->position->x, $ray->position->x); - self::assertEquals($expectedStruct->position->y, $ray->position->y); - self::assertEquals($expectedStruct->position->z, $ray->position->z); - - self::assertEquals($expectedStruct->direction->x, $ray->direction->x); - self::assertEquals($expectedStruct->direction->y, $ray->direction->y); - self::assertEquals($expectedStruct->direction->z, $ray->direction->z); - - return true; - }); - } - - private function sameCDataRenderTexture2DArgument(CData $expectedStruct): CallbackToken - { - return Argument::that(function (CData $renderTexure) use ($expectedStruct) { - self::assertEquals($expectedStruct->id, $renderTexure->id); - self::assertEquals($expectedStruct->texture, $renderTexure->texture); - self::assertEquals($expectedStruct->depth, $renderTexure->depth); - - return true; - }); - } - - private function sameCDataRectangleArgument(CData $expectedStruct): CallbackToken - { - return Argument::that(function (CData $rectangle) use ($expectedStruct) { - self::assertEquals($expectedStruct->x, $rectangle->x); - self::assertEquals($expectedStruct->y, $rectangle->y); - self::assertEquals($expectedStruct->width, $rectangle->width); - self::assertEquals($expectedStruct->height, $rectangle->height); - - return true; - }); - } - - private function sameCDataTexture2DArgument(CData $expectedStruct): CallbackToken - { - return Argument::that(function (CData $texture2D) use ($expectedStruct) { - self::assertEquals($expectedStruct->id, $texture2D->id); - self::assertEquals($expectedStruct->width, $texture2D->width); - self::assertEquals($expectedStruct->height, $texture2D->height); - self::assertEquals($expectedStruct->mipmaps, $texture2D->mipmaps); - self::assertEquals($expectedStruct->format, $texture2D->format); - - return true; - }); - } - - private function sameCDataVector2Argument(CData $expectedStruct): CallbackToken - { - return Argument::that(function (CData $vector2) use ($expectedStruct) { - self::assertEquals($expectedStruct->x, $vector2->x); - self::assertEquals($expectedStruct->y, $vector2->y); - - return true; - }); - } - - private function sameCDataVector3Argument(CData $expectedStruct): CallbackToken - { - return Argument::that(function (CData $vector3) use ($expectedStruct) { - self::assertEquals($expectedStruct->x, $vector3->x); - self::assertEquals($expectedStruct->y, $vector3->y); - self::assertEquals($expectedStruct->z, $vector3->z); - - return true; - }); - } -} diff --git a/tests/Types/Camera2DTest.php b/tests/Types/Camera2DTest.php deleted file mode 100644 index da8c9a1..0000000 --- a/tests/Types/Camera2DTest.php +++ /dev/null @@ -1,59 +0,0 @@ -toCData(new RaylibFFIProxy($ffi)); - } - - public function test_toCData_withValidFFIStructDef_returnsCDataValidObject(): void - { - $offset = new Vector2(10, 10); - $target = new Vector2(20, 20); - $camera = new Camera2D($offset, $target, 5.0, 2.5); - - $ffi = FFI::cdef(<<toCData(new RaylibFFIProxy($ffi)); - - self::assertEquals(10, $cdata->offset->x); - self::assertEquals(10, $cdata->offset->y); - self::assertEquals(20, $cdata->target->x); - self::assertEquals(20, $cdata->target->y); - self::assertEquals(5.0, $cdata->rotation); - self::assertEquals(2.5, $cdata->zoom); - } -} diff --git a/tests/Types/ColorTest.php b/tests/Types/ColorTest.php deleted file mode 100644 index 6e64c1c..0000000 --- a/tests/Types/ColorTest.php +++ /dev/null @@ -1,72 +0,0 @@ -toCData(new RaylibFFIProxy($ffi)); - } - - public function test_toCData_withValidFFIStructDef_returnsCDataValidObject(): void - { - $color = new Color(255, 255, 150, 110); - - $ffi = FFI::cdef(<<toCData(new RaylibFFIProxy($ffi)); - - self::assertEquals(255, $cdata->r); - self::assertEquals(255, $cdata->g); - self::assertEquals(150, $cdata->b); - self::assertEquals(110, $cdata->a); - } -} diff --git a/tests/Types/MatrixTest.php b/tests/Types/MatrixTest.php deleted file mode 100644 index 625e662..0000000 --- a/tests/Types/MatrixTest.php +++ /dev/null @@ -1,49 +0,0 @@ -toCData(new RaylibFFIProxy($ffi)); - } - - public function test_toCData_withValidFFIStructDef_returnsCDataValidObject(): void - { - $matrixValues = array_fill(0, 16, 1.0); - $matrix = new Matrix(...$matrixValues); - - $ffi = FFI::cdef(<<toCData(new RaylibFFIProxy($ffi)); - - for ($i = 0; $i < 15; ++$i) { - self::assertEquals(1.0, $cdata->{"m{$i}"}); - } - } -} - diff --git a/tests/Types/RectangleTest.php b/tests/Types/RectangleTest.php deleted file mode 100644 index d6b4617..0000000 --- a/tests/Types/RectangleTest.php +++ /dev/null @@ -1,47 +0,0 @@ -toCData(new RaylibFFIProxy($ffi)); - } - - public function test_toCData_withValidFFIStructDef_returnsCDataValidObject(): void - { - $rectangle = new Rectangle(1.0, 2.0, 3.0, 4.0); - - $ffi = FFI::cdef(<<toCData(new RaylibFFIProxy($ffi)); - - self::assertEquals(1.0, $cdata->x); - self::assertEquals(2.0, $cdata->y); - self::assertEquals(3.0, $cdata->width); - self::assertEquals(4.0, $cdata->height); - } -} diff --git a/tests/Types/Vector2Test.php b/tests/Types/Vector2Test.php deleted file mode 100644 index e404d3c..0000000 --- a/tests/Types/Vector2Test.php +++ /dev/null @@ -1,85 +0,0 @@ -add($v2), - ); - } - - public function test_length(): void - { - $vec = new Vector2(1, 1); - - self::assertEquals( - 1.41421, - round($vec->length(), 5), - ); - } - - public function test_scale(): void - { - $vec = new Vector2(5, 5); - - self::assertEquals( - new Vector2(10, 10), - $vec->scale(2), - ); - } - - public function test_subtract(): void - { - $v1 = new Vector2(5, 5); - $v2 = new Vector2(2, 2); - - self::assertEquals( - new Vector2(3, 3), - $v1->subtract($v2), - ); - } - - public function test_toCData_withInvalidFFIStructDef_throwsInvalidArgumentException(): void - { - $vec = new Vector2(1.0, 2.0); - - $ffi = FFI::cdef(''); - - self::expectExceptionMessage('Object $ffi does not provide the type "struct Vector2"'); - self::expectException(InvalidArgumentException::class); - $vec->toCData(new RaylibFFIProxy($ffi)); - } - - public function test_toCData_withValidFFIStructDef_returnsCDataValidObject(): void - { - $vec = new Vector2(1.0, 2.0); - - $ffi = FFI::cdef(<<toCData(new RaylibFFIProxy($ffi)); - - self::assertEquals(1.0, $cdata->x); - self::assertEquals(2.0, $cdata->y); - } -} diff --git a/tests/resources/raylib.h b/tests/resources/raylib.h deleted file mode 100644 index 9a4d0f9..0000000 --- a/tests/resources/raylib.h +++ /dev/null @@ -1,311 +0,0 @@ -// Structures Definition -//---------------------------------------------------------------------------------- -// Vector2 type -typedef struct Vector2 { - float x; - float y; -} Vector2; - -// Vector3 type -typedef struct Vector3 { - float x; - float y; - float z; -} Vector3; - -// Vector4 type -typedef struct Vector4 { - float x; - float y; - float z; - float w; -} Vector4; - -// Quaternion type, same as Vector4 -typedef Vector4 Quaternion; - -// Matrix type (OpenGL style 4x4 - right handed, column major) -typedef struct Matrix { - float m0, m4, m8, m12; - float m1, m5, m9, m13; - float m2, m6, m10, m14; - float m3, m7, m11, m15; -} Matrix; - -// Color type, RGBA (32bit) -typedef struct Color { - unsigned char r; - unsigned char g; - unsigned char b; - unsigned char a; -} Color; - -// Rectangle type -typedef struct Rectangle { - float x; - float y; - float width; - float height; -} Rectangle; - -// Image type, bpp always RGBA (32bit) -// NOTE: Data stored in CPU memory (RAM) -typedef struct Image { - void *data; // Image raw data - int width; // Image base width - int height; // Image base height - int mipmaps; // Mipmap levels, 1 by default - int format; // Data format (PixelFormat type) -} Image; - -// Texture type -// NOTE: Data stored in GPU memory -typedef struct Texture { - unsigned int id; // OpenGL texture id - int width; // Texture base width - int height; // Texture base height - int mipmaps; // Mipmap levels, 1 by default - int format; // Data format (PixelFormat type) -} Texture; - -// Texture2D type, same as Texture -typedef Texture Texture2D; - -// TextureCubemap type, actually, same as Texture -typedef Texture TextureCubemap; - -// RenderTexture type, for texture rendering -typedef struct RenderTexture { - unsigned int id; // OpenGL framebuffer object id - Texture texture; // Color buffer attachment texture - Texture depth; // Depth buffer attachment texture -} RenderTexture; - -// RenderTexture2D type, same as RenderTexture -typedef RenderTexture RenderTexture2D; - -// N-Patch layout info -typedef struct NPatchInfo { - Rectangle source; // Texture source rectangle - int left; // Left border offset - int top; // Top border offset - int right; // Right border offset - int bottom; // Bottom border offset - int layout; // Layout of the n-patch: 3x3, 1x3 or 3x1 -} NPatchInfo; - -// Font character info -typedef struct CharInfo { - int value; // Character value (Unicode) - int offsetX; // Character offset X when drawing - int offsetY; // Character offset Y when drawing - int advanceX; // Character advance position X - Image image; // Character image data -} CharInfo; - -// Font type, includes texture and charSet array data -typedef struct Font { - int baseSize; // Base size (default chars height) - int charsCount; // Number of characters - int charsPadding; // Padding around the chars - Texture2D texture; // Characters texture atlas - Rectangle *recs; // Characters rectangles in texture - CharInfo *chars; // Characters info data -} Font; - -#define SpriteFont Font // SpriteFont type fallback, defaults to Font - -// Camera type, defines a camera position/orientation in 3d space -typedef struct Camera3D { - Vector3 position; // Camera position - Vector3 target; // Camera target it looks-at - Vector3 up; // Camera up vector (rotation over its axis) - float fovy; // Camera field-of-view apperture in Y (degrees) in perspective, used as near plane width in orthographic - int projection; // Camera projection: CAMERA_PERSPECTIVE or CAMERA_ORTHOGRAPHIC -} Camera3D; - -typedef Camera3D Camera; // Camera type fallback, defaults to Camera3D - -// Camera2D type, defines a 2d camera -typedef struct Camera2D { - Vector2 offset; // Camera offset (displacement from target) - Vector2 target; // Camera target (rotation and zoom origin) - float rotation; // Camera rotation in degrees - float zoom; // Camera zoom (scaling), should be 1.0f by default -} Camera2D; - -// Vertex data definning a mesh -// NOTE: Data stored in CPU memory (and GPU) -typedef struct Mesh { - int vertexCount; // Number of vertices stored in arrays - int triangleCount; // Number of triangles stored (indexed or not) - - // Default vertex data - float *vertices; // Vertex position (XYZ - 3 components per vertex) (shader-location = 0) - float *texcoords; // Vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1) - float *texcoords2; // Vertex second texture coordinates (useful for lightmaps) (shader-location = 5) - float *normals; // Vertex normals (XYZ - 3 components per vertex) (shader-location = 2) - float *tangents; // Vertex tangents (XYZW - 4 components per vertex) (shader-location = 4) - unsigned char *colors; // Vertex colors (RGBA - 4 components per vertex) (shader-location = 3) - unsigned short *indices;// Vertex indices (in case vertex data comes indexed) - - // Animation vertex data - float *animVertices; // Animated vertex positions (after bones transformations) - float *animNormals; // Animated normals (after bones transformations) - int *boneIds; // Vertex bone ids, up to 4 bones influence by vertex (skinning) - float *boneWeights; // Vertex bone weight, up to 4 bones influence by vertex (skinning) - - // OpenGL identifiers - unsigned int vaoId; // OpenGL Vertex Array Object id - unsigned int *vboId; // OpenGL Vertex Buffer Objects id (default vertex data) -} Mesh; - -// Shader type (generic) -typedef struct Shader { - unsigned int id; // Shader program id - int *locs; // Shader locations array (MAX_SHADER_LOCATIONS) -} Shader; - -// Material texture map -typedef struct MaterialMap { - Texture2D texture; // Material map texture - Color color; // Material map color - float value; // Material map value -} MaterialMap; - -// Material type (generic) -typedef struct Material { - Shader shader; // Material shader - MaterialMap *maps; // Material maps array (MAX_MATERIAL_MAPS) - float params[4]; // Material generic parameters (if required) -} Material; - -// Transformation properties -typedef struct Transform { - Vector3 translation; // Translation - Quaternion rotation; // Rotation - Vector3 scale; // Scale -} Transform; - -// Bone information -typedef struct BoneInfo { - char name[32]; // Bone name - int parent; // Bone parent -} BoneInfo; - -// Model type -typedef struct Model { - Matrix transform; // Local transform matrix - - int meshCount; // Number of meshes - int materialCount; // Number of materials - Mesh *meshes; // Meshes array - Material *materials; // Materials array - int *meshMaterial; // Mesh material number - - // Animation data - int boneCount; // Number of bones - BoneInfo *bones; // Bones information (skeleton) - Transform *bindPose; // Bones base transformation (pose) -} Model; - -// Model animation -typedef struct ModelAnimation { - int boneCount; // Number of bones - int frameCount; // Number of animation frames - BoneInfo *bones; // Bones information (skeleton) - Transform **framePoses; // Poses array by frame -} ModelAnimation; - -// Ray type (useful for raycast) -typedef struct Ray { - Vector3 position; // Ray position (origin) - Vector3 direction; // Ray direction -} Ray; - -// Raycast hit information -typedef struct RayHitInfo { - bool hit; // Did the ray hit something? - float distance; // Distance to nearest hit - Vector3 position; // Position of nearest hit - Vector3 normal; // Surface normal of hit -} RayHitInfo; - -// Bounding box type -typedef struct BoundingBox { - Vector3 min; // Minimum vertex box-corner - Vector3 max; // Maximum vertex box-corner -} BoundingBox; - -// Wave type, defines audio wave data -typedef struct Wave { - unsigned int sampleCount; // Total number of samples - unsigned int sampleRate; // Frequency (samples per second) - unsigned int sampleSize; // Bit depth (bits per sample): 8, 16, 32 (24 not supported) - unsigned int channels; // Number of channels (1-mono, 2-stereo) - void *data; // Buffer data pointer -} Wave; - -typedef struct rAudioBuffer rAudioBuffer; - -// Audio stream type -// NOTE: Useful to create custom audio streams not bound to a specific file -typedef struct AudioStream { - rAudioBuffer *buffer; // Pointer to internal data used by the audio system - - unsigned int sampleRate; // Frequency (samples per second) - unsigned int sampleSize; // Bit depth (bits per sample): 8, 16, 32 (24 not supported) - unsigned int channels; // Number of channels (1-mono, 2-stereo) -} AudioStream; - -// Sound source type -typedef struct Sound { - AudioStream stream; // Audio stream - unsigned int sampleCount; // Total number of samples -} Sound; - -// Music stream type (audio file streaming from memory) -// NOTE: Anything longer than ~10 seconds should be streamed -typedef struct Music { - AudioStream stream; // Audio stream - unsigned int sampleCount; // Total number of samples - bool looping; // Music looping enable - - int ctxType; // Type of music context (audio filetype) - void *ctxData; // Audio context data, depends on type -} Music; - -// Head-Mounted-Display device parameters -typedef struct VrDeviceInfo { - int hResolution; // Horizontal resolution in pixels - int vResolution; // Vertical resolution in pixels - float hScreenSize; // Horizontal size in meters - float vScreenSize; // Vertical size in meters - float vScreenCenter; // Screen center in meters - float eyeToScreenDistance; // Distance between eye and display in meters - float lensSeparationDistance; // Lens separation distance in meters - float interpupillaryDistance; // IPD (distance between pupils) in meters - float lensDistortionValues[4]; // Lens distortion constant parameters - float chromaAbCorrection[4]; // Chromatic aberration correction parameters -} VrDeviceInfo; - -// VR Stereo rendering configuration for simulator -typedef struct VrStereoConfig { - Matrix projection[2]; // VR projection matrices (per eye) - Matrix viewOffset[2]; // VR view offset matrices (per eye) - float leftLensCenter[2]; // VR left lens center - float rightLensCenter[2]; // VR right lens center - float leftScreenCenter[2]; // VR left screen center - float rightScreenCenter[2]; // VR right screen center - float scale[2]; // VR distortion scale - float scaleIn[2]; // VR distortion scale in -} VrStereoConfig; - -// Callbacks to hook some internal functions -// WARNING: This callbacks are intended for advance users -typedef void (*TraceLogCallback)(int logLevel, const char *text, va_list args); // Logging: Redirect trace log messages -typedef unsigned char* (*LoadFileDataCallback)(const char* fileName, unsigned int* bytesRead); // FileIO: Load binary data -typedef bool (*SaveFileDataCallback)(const char *fileName, void *data, unsigned int bytesToWrite); // FileIO: Save binary data -typedef char *(*LoadFileTextCallback)(const char* fileName); // FileIO: Load text data -typedef bool (*SaveFileTextCallback)(const char *fileName, char *text); // FileIO: Save text data - From 6c656644aedd60a30a20205e2babf74b968c2a73 Mon Sep 17 00:00:00 2001 From: Nawarian Date: Tue, 22 Feb 2022 08:23:08 +0100 Subject: [PATCH 2/3] Save PoC --- composer.json | 8 +- generated/AudioStream.php | 55 + generated/BoneInfo.php | 41 + generated/BoundingBox.php | 41 + generated/Camera2D.php | 55 + generated/Camera3D.php | 63 + generated/CharInfo.php | 62 + generated/Color.php | 55 + generated/Font.php | 69 + generated/Image.php | 62 + generated/Material.php | 48 + generated/MaterialMap.php | 48 + generated/Matrix.php | 139 + generated/Mesh.php | 132 + generated/Model.php | 94 + generated/ModelAnimation.php | 55 + generated/Music.php | 62 + generated/NPatchInfo.php | 69 + generated/Ray.php | 41 + generated/RayCollision.php | 55 + generated/Rectangle.php | 55 + generated/RenderTexture.php | 48 + generated/Shader.php | 41 + generated/Sound.php | 41 + generated/Texture.php | 62 + generated/Transform.php | 48 + generated/Vector2.php | 41 + generated/Vector3.php | 48 + generated/Vector4.php | 55 + generated/VrDeviceInfo.php | 97 + generated/VrStereoConfig.php | 83 + generated/Wave.php | 62 + generated/functions.php | 4168 ++++++++++ resources/raylib.h | 1186 ++- resources/raylib_api.json | 8419 ++++++-------------- src/Command/GenerateRaylibWrappers.php | 294 + src/Generator/CustomMethodGenerator.php | 22 + src/Generator/CustomParameterGenerator.php | 49 + src/Generator/CustomPropertyGenerator.php | 68 + 39 files changed, 9553 insertions(+), 6588 deletions(-) create mode 100644 generated/AudioStream.php create mode 100644 generated/BoneInfo.php create mode 100644 generated/BoundingBox.php create mode 100644 generated/Camera2D.php create mode 100644 generated/Camera3D.php create mode 100644 generated/CharInfo.php create mode 100644 generated/Color.php create mode 100644 generated/Font.php create mode 100644 generated/Image.php create mode 100644 generated/Material.php create mode 100644 generated/MaterialMap.php create mode 100644 generated/Matrix.php create mode 100644 generated/Mesh.php create mode 100644 generated/Model.php create mode 100644 generated/ModelAnimation.php create mode 100644 generated/Music.php create mode 100644 generated/NPatchInfo.php create mode 100644 generated/Ray.php create mode 100644 generated/RayCollision.php create mode 100644 generated/Rectangle.php create mode 100644 generated/RenderTexture.php create mode 100644 generated/Shader.php create mode 100644 generated/Sound.php create mode 100644 generated/Texture.php create mode 100644 generated/Transform.php create mode 100644 generated/Vector2.php create mode 100644 generated/Vector3.php create mode 100644 generated/Vector4.php create mode 100644 generated/VrDeviceInfo.php create mode 100644 generated/VrStereoConfig.php create mode 100644 generated/Wave.php create mode 100644 generated/functions.php create mode 100644 src/Command/GenerateRaylibWrappers.php create mode 100644 src/Generator/CustomMethodGenerator.php create mode 100644 src/Generator/CustomParameterGenerator.php create mode 100644 src/Generator/CustomPropertyGenerator.php diff --git a/composer.json b/composer.json index 2203db8..e9f9bb8 100644 --- a/composer.json +++ b/composer.json @@ -26,20 +26,20 @@ }, "autoload": { "psr-4": { - "Nawarian\\Raylib\\": "src/" + "Nawarian\\Raylib\\": "src/", + "Nawarian\\Raylib\\Generated\\": "generated/" } }, "autoload-dev": { "psr-4": { "Nawarian\\Tests\\Raylib\\": "tests/" - }, - "files": ["src/generated-functions.php"] + } }, "scripts": { "phpunit": "phpunit", "phpcs": "phpcs --standard=PSR12 -s src/ examples/", "psalm": "psalm", "checks": ["@psalm", "@phpcs", "@phpunit"], - "generate-functions": "Nawarian\\Raylib\\Utils\\Composer\\CommandHandler::generateFunctionsFile" + "build": "Nawarian\\Raylib\\Command\\GenerateRaylibWrappers::generate" } } diff --git a/generated/AudioStream.php b/generated/AudioStream.php new file mode 100644 index 0000000..f8aab88 --- /dev/null +++ b/generated/AudioStream.php @@ -0,0 +1,55 @@ +buffer = $buffer; + $this->sampleRate = $sampleRate; + $this->sampleSize = $sampleSize; + $this->channels = $channels; + } + + public function toCData() : \FFI\CData + { + global $raylib; + $type = $raylib->new('AudioStream'); + $type->buffer = $this->buffer; + $type->sampleRate = $this->sampleRate; + $type->sampleSize = $this->sampleSize; + $type->channels = $this->channels; + return $type; + } + + public static function fromCData(\FFI\CData $cdata) + { + return new self($cdata->buffer, $cdata->sampleRate, $cdata->sampleSize, $cdata->channels); + } +} + diff --git a/generated/BoneInfo.php b/generated/BoneInfo.php new file mode 100644 index 0000000..5e207bc --- /dev/null +++ b/generated/BoneInfo.php @@ -0,0 +1,41 @@ +name = $name; + $this->parent = $parent; + } + + public function toCData() : \FFI\CData + { + global $raylib; + $type = $raylib->new('BoneInfo'); + $type->name = $this->name; + $type->parent = $this->parent; + return $type; + } + + public static function fromCData(\FFI\CData $cdata) + { + return new self($cdata->name, $cdata->parent); + } +} + diff --git a/generated/BoundingBox.php b/generated/BoundingBox.php new file mode 100644 index 0000000..d2c0d34 --- /dev/null +++ b/generated/BoundingBox.php @@ -0,0 +1,41 @@ +min = $min; + $this->max = $max; + } + + public function toCData() : \FFI\CData + { + global $raylib; + $type = $raylib->new('BoundingBox'); + $type->min = $this->min->toCData(); + $type->max = $this->max->toCData(); + return $type; + } + + public static function fromCData(\FFI\CData $cdata) + { + return new self(\Nawarian\Raylib\Generated\Vector3::fromCData($cdata->min), \Nawarian\Raylib\Generated\Vector3::fromCData($cdata->max)); + } +} + diff --git a/generated/Camera2D.php b/generated/Camera2D.php new file mode 100644 index 0000000..29682e1 --- /dev/null +++ b/generated/Camera2D.php @@ -0,0 +1,55 @@ +offset = $offset; + $this->target = $target; + $this->rotation = $rotation; + $this->zoom = $zoom; + } + + public function toCData() : \FFI\CData + { + global $raylib; + $type = $raylib->new('Camera2D'); + $type->offset = $this->offset->toCData(); + $type->target = $this->target->toCData(); + $type->rotation = $this->rotation; + $type->zoom = $this->zoom; + return $type; + } + + public static function fromCData(\FFI\CData $cdata) + { + return new self(\Nawarian\Raylib\Generated\Vector2::fromCData($cdata->offset), \Nawarian\Raylib\Generated\Vector2::fromCData($cdata->target), $cdata->rotation, $cdata->zoom); + } +} + diff --git a/generated/Camera3D.php b/generated/Camera3D.php new file mode 100644 index 0000000..6900c34 --- /dev/null +++ b/generated/Camera3D.php @@ -0,0 +1,63 @@ +position = $position; + $this->target = $target; + $this->up = $up; + $this->fovy = $fovy; + $this->projection = $projection; + } + + public function toCData() : \FFI\CData + { + global $raylib; + $type = $raylib->new('Camera3D'); + $type->position = $this->position->toCData(); + $type->target = $this->target->toCData(); + $type->up = $this->up->toCData(); + $type->fovy = $this->fovy; + $type->projection = $this->projection; + return $type; + } + + public static function fromCData(\FFI\CData $cdata) + { + return new self(\Nawarian\Raylib\Generated\Vector3::fromCData($cdata->position), \Nawarian\Raylib\Generated\Vector3::fromCData($cdata->target), \Nawarian\Raylib\Generated\Vector3::fromCData($cdata->up), $cdata->fovy, $cdata->projection); + } +} + diff --git a/generated/CharInfo.php b/generated/CharInfo.php new file mode 100644 index 0000000..572c87c --- /dev/null +++ b/generated/CharInfo.php @@ -0,0 +1,62 @@ +value = $value; + $this->offsetX = $offsetX; + $this->offsetY = $offsetY; + $this->advanceX = $advanceX; + $this->image = $image; + } + + public function toCData() : \FFI\CData + { + global $raylib; + $type = $raylib->new('CharInfo'); + $type->value = $this->value; + $type->offsetX = $this->offsetX; + $type->offsetY = $this->offsetY; + $type->advanceX = $this->advanceX; + $type->image = $this->image->toCData(); + return $type; + } + + public static function fromCData(\FFI\CData $cdata) + { + return new self($cdata->value, $cdata->offsetX, $cdata->offsetY, $cdata->advanceX, \Nawarian\Raylib\Generated\Image::fromCData($cdata->image)); + } +} + diff --git a/generated/Color.php b/generated/Color.php new file mode 100644 index 0000000..0200f6f --- /dev/null +++ b/generated/Color.php @@ -0,0 +1,55 @@ +r = $r; + $this->g = $g; + $this->b = $b; + $this->a = $a; + } + + public function toCData() : \FFI\CData + { + global $raylib; + $type = $raylib->new('Color'); + $type->r = $this->r; + $type->g = $this->g; + $type->b = $this->b; + $type->a = $this->a; + return $type; + } + + public static function fromCData(\FFI\CData $cdata) + { + return new self($cdata->r, $cdata->g, $cdata->b, $cdata->a); + } +} + diff --git a/generated/Font.php b/generated/Font.php new file mode 100644 index 0000000..aab971d --- /dev/null +++ b/generated/Font.php @@ -0,0 +1,69 @@ +baseSize = $baseSize; + $this->charsCount = $charsCount; + $this->charsPadding = $charsPadding; + $this->texture = $texture; + $this->recs = $recs; + $this->chars = $chars; + } + + public function toCData() : \FFI\CData + { + global $raylib; + $type = $raylib->new('Font'); + $type->baseSize = $this->baseSize; + $type->charsCount = $this->charsCount; + $type->charsPadding = $this->charsPadding; + $type->texture = $this->texture->toCData(); + $type->recs = $this->recs; + $type->chars = $this->chars->toCData(); + return $type; + } + + public static function fromCData(\FFI\CData $cdata) + { + return new self($cdata->baseSize, $cdata->charsCount, $cdata->charsPadding, \Nawarian\Raylib\Generated\Texture::fromCData($cdata->texture), $cdata->recs, \Nawarian\Raylib\Generated\CharInfo::fromCData($cdata->chars)); + } +} + diff --git a/generated/Image.php b/generated/Image.php new file mode 100644 index 0000000..0aca515 --- /dev/null +++ b/generated/Image.php @@ -0,0 +1,62 @@ +data = $data; + $this->width = $width; + $this->height = $height; + $this->mipmaps = $mipmaps; + $this->format = $format; + } + + public function toCData() : \FFI\CData + { + global $raylib; + $type = $raylib->new('Image'); + $type->data = $this->data; + $type->width = $this->width; + $type->height = $this->height; + $type->mipmaps = $this->mipmaps; + $type->format = $this->format; + return $type; + } + + public static function fromCData(\FFI\CData $cdata) + { + return new self($cdata->data, $cdata->width, $cdata->height, $cdata->mipmaps, $cdata->format); + } +} + diff --git a/generated/Material.php b/generated/Material.php new file mode 100644 index 0000000..f57fd7b --- /dev/null +++ b/generated/Material.php @@ -0,0 +1,48 @@ +shader = $shader; + $this->maps = $maps; + $this->params = $params; + } + + public function toCData() : \FFI\CData + { + global $raylib; + $type = $raylib->new('Material'); + $type->shader = $this->shader->toCData(); + $type->maps = $this->maps; + $type->params = $this->params; + return $type; + } + + public static function fromCData(\FFI\CData $cdata) + { + return new self(\Nawarian\Raylib\Generated\Shader::fromCData($cdata->shader), $cdata->maps, $cdata->params); + } +} + diff --git a/generated/MaterialMap.php b/generated/MaterialMap.php new file mode 100644 index 0000000..090c9e4 --- /dev/null +++ b/generated/MaterialMap.php @@ -0,0 +1,48 @@ +texture = $texture; + $this->color = $color; + $this->value = $value; + } + + public function toCData() : \FFI\CData + { + global $raylib; + $type = $raylib->new('MaterialMap'); + $type->texture = $this->texture->toCData(); + $type->color = $this->color->toCData(); + $type->value = $this->value; + return $type; + } + + public static function fromCData(\FFI\CData $cdata) + { + return new self(\Nawarian\Raylib\Generated\Texture::fromCData($cdata->texture), \Nawarian\Raylib\Generated\Color::fromCData($cdata->color), $cdata->value); + } +} + diff --git a/generated/Matrix.php b/generated/Matrix.php new file mode 100644 index 0000000..1a6992e --- /dev/null +++ b/generated/Matrix.php @@ -0,0 +1,139 @@ +m0 = $m0; + $this->m4 = $m4; + $this->m8 = $m8; + $this->m12 = $m12; + $this->m1 = $m1; + $this->m5 = $m5; + $this->m9 = $m9; + $this->m13 = $m13; + $this->m2 = $m2; + $this->m6 = $m6; + $this->m10 = $m10; + $this->m14 = $m14; + $this->m3 = $m3; + $this->m7 = $m7; + $this->m11 = $m11; + $this->m15 = $m15; + } + + public function toCData() : \FFI\CData + { + global $raylib; + $type = $raylib->new('Matrix'); + $type->m0 = $this->m0; + $type->m4 = $this->m4; + $type->m8 = $this->m8; + $type->m12 = $this->m12; + $type->m1 = $this->m1; + $type->m5 = $this->m5; + $type->m9 = $this->m9; + $type->m13 = $this->m13; + $type->m2 = $this->m2; + $type->m6 = $this->m6; + $type->m10 = $this->m10; + $type->m14 = $this->m14; + $type->m3 = $this->m3; + $type->m7 = $this->m7; + $type->m11 = $this->m11; + $type->m15 = $this->m15; + return $type; + } + + public static function fromCData(\FFI\CData $cdata) + { + return new self($cdata->m0, $cdata->m4, $cdata->m8, $cdata->m12, $cdata->m1, $cdata->m5, $cdata->m9, $cdata->m13, $cdata->m2, $cdata->m6, $cdata->m10, $cdata->m14, $cdata->m3, $cdata->m7, $cdata->m11, $cdata->m15); + } +} + diff --git a/generated/Mesh.php b/generated/Mesh.php new file mode 100644 index 0000000..77f4605 --- /dev/null +++ b/generated/Mesh.php @@ -0,0 +1,132 @@ +vertexCount = $vertexCount; + $this->triangleCount = $triangleCount; + $this->vertices = $vertices; + $this->texcoords = $texcoords; + $this->texcoords2 = $texcoords2; + $this->normals = $normals; + $this->tangents = $tangents; + $this->colors = $colors; + $this->indices = $indices; + $this->animVertices = $animVertices; + $this->animNormals = $animNormals; + $this->boneIds = $boneIds; + $this->boneWeights = $boneWeights; + $this->vaoId = $vaoId; + $this->vboId = $vboId; + } + + public function toCData() : \FFI\CData + { + global $raylib; + $type = $raylib->new('Mesh'); + $type->vertexCount = $this->vertexCount; + $type->triangleCount = $this->triangleCount; + $type->vertices = $this->vertices; + $type->texcoords = $this->texcoords; + $type->texcoords2 = $this->texcoords2; + $type->normals = $this->normals; + $type->tangents = $this->tangents; + $type->colors = $this->colors; + $type->indices = $this->indices; + $type->animVertices = $this->animVertices; + $type->animNormals = $this->animNormals; + $type->boneIds = $this->boneIds; + $type->boneWeights = $this->boneWeights; + $type->vaoId = $this->vaoId; + $type->vboId = $this->vboId; + return $type; + } + + public static function fromCData(\FFI\CData $cdata) + { + return new self($cdata->vertexCount, $cdata->triangleCount, $cdata->vertices, $cdata->texcoords, $cdata->texcoords2, $cdata->normals, $cdata->tangents, $cdata->colors, $cdata->indices, $cdata->animVertices, $cdata->animNormals, $cdata->boneIds, $cdata->boneWeights, $cdata->vaoId, $cdata->vboId); + } +} + diff --git a/generated/Model.php b/generated/Model.php new file mode 100644 index 0000000..44315f6 --- /dev/null +++ b/generated/Model.php @@ -0,0 +1,94 @@ +transform = $transform; + $this->meshCount = $meshCount; + $this->materialCount = $materialCount; + $this->meshes = $meshes; + $this->materials = $materials; + $this->meshMaterial = $meshMaterial; + $this->boneCount = $boneCount; + $this->bones = $bones; + $this->bindPose = $bindPose; + } + + public function toCData() : \FFI\CData + { + global $raylib; + $type = $raylib->new('Model'); + $type->transform = $this->transform->toCData(); + $type->meshCount = $this->meshCount; + $type->materialCount = $this->materialCount; + $type->meshes = $this->meshes; + $type->materials = $this->materials; + $type->meshMaterial = $this->meshMaterial; + $type->boneCount = $this->boneCount; + $type->bones = $this->bones; + $type->bindPose = $this->bindPose; + return $type; + } + + public static function fromCData(\FFI\CData $cdata) + { + return new self( + \Nawarian\Raylib\Generated\Matrix::fromCData($cdata->transform), + $cdata->meshCount, + $cdata->materialCount, + $cdata->meshes, $cdata->materials, $cdata->meshMaterial, $cdata->boneCount, $cdata->bones, $cdata->bindPose); + } +} + diff --git a/generated/ModelAnimation.php b/generated/ModelAnimation.php new file mode 100644 index 0000000..c61b8b3 --- /dev/null +++ b/generated/ModelAnimation.php @@ -0,0 +1,55 @@ +boneCount = $boneCount; + $this->frameCount = $frameCount; + $this->bones = $bones; + $this->framePoses = $framePoses; + } + + public function toCData() : \FFI\CData + { + global $raylib; + $type = $raylib->new('ModelAnimation'); + $type->boneCount = $this->boneCount; + $type->frameCount = $this->frameCount; + $type->bones = $this->bones; + $type->framePoses = $this->framePoses; + return $type; + } + + public static function fromCData(\FFI\CData $cdata) + { + return new self($cdata->boneCount, $cdata->frameCount, $cdata->bones, $cdata->framePoses); + } +} + diff --git a/generated/Music.php b/generated/Music.php new file mode 100644 index 0000000..61ae40b --- /dev/null +++ b/generated/Music.php @@ -0,0 +1,62 @@ +stream = $stream; + $this->sampleCount = $sampleCount; + $this->looping = $looping; + $this->ctxType = $ctxType; + $this->ctxData = $ctxData; + } + + public function toCData() : \FFI\CData + { + global $raylib; + $type = $raylib->new('Music'); + $type->stream = $this->stream->toCData(); + $type->sampleCount = $this->sampleCount; + $type->looping = $this->looping->toCData(); + $type->ctxType = $this->ctxType; + $type->ctxData = $this->ctxData; + return $type; + } + + public static function fromCData(\FFI\CData $cdata) + { + return new self(\Nawarian\Raylib\Generated\AudioStream::fromCData($cdata->stream), $cdata->sampleCount, bool::fromCData($cdata->looping), $cdata->ctxType, $cdata->ctxData); + } +} + diff --git a/generated/NPatchInfo.php b/generated/NPatchInfo.php new file mode 100644 index 0000000..4680475 --- /dev/null +++ b/generated/NPatchInfo.php @@ -0,0 +1,69 @@ +source = $source; + $this->left = $left; + $this->top = $top; + $this->right = $right; + $this->bottom = $bottom; + $this->layout = $layout; + } + + public function toCData() : \FFI\CData + { + global $raylib; + $type = $raylib->new('NPatchInfo'); + $type->source = $this->source->toCData(); + $type->left = $this->left; + $type->top = $this->top; + $type->right = $this->right; + $type->bottom = $this->bottom; + $type->layout = $this->layout; + return $type; + } + + public static function fromCData(\FFI\CData $cdata) + { + return new self(\Nawarian\Raylib\Generated\Rectangle::fromCData($cdata->source), $cdata->left, $cdata->top, $cdata->right, $cdata->bottom, $cdata->layout); + } +} + diff --git a/generated/Ray.php b/generated/Ray.php new file mode 100644 index 0000000..c17de1c --- /dev/null +++ b/generated/Ray.php @@ -0,0 +1,41 @@ +position = $position; + $this->direction = $direction; + } + + public function toCData() : \FFI\CData + { + global $raylib; + $type = $raylib->new('Ray'); + $type->position = $this->position->toCData(); + $type->direction = $this->direction->toCData(); + return $type; + } + + public static function fromCData(\FFI\CData $cdata) + { + return new self(\Nawarian\Raylib\Generated\Vector3::fromCData($cdata->position), \Nawarian\Raylib\Generated\Vector3::fromCData($cdata->direction)); + } +} + diff --git a/generated/RayCollision.php b/generated/RayCollision.php new file mode 100644 index 0000000..f61292a --- /dev/null +++ b/generated/RayCollision.php @@ -0,0 +1,55 @@ +hit = $hit; + $this->distance = $distance; + $this->point = $point; + $this->normal = $normal; + } + + public function toCData() : \FFI\CData + { + global $raylib; + $type = $raylib->new('RayCollision'); + $type->hit = $this->hit->toCData(); + $type->distance = $this->distance; + $type->point = $this->point->toCData(); + $type->normal = $this->normal->toCData(); + return $type; + } + + public static function fromCData(\FFI\CData $cdata) + { + return new self(bool::fromCData($cdata->hit), $cdata->distance, \Nawarian\Raylib\Generated\Vector3::fromCData($cdata->point), \Nawarian\Raylib\Generated\Vector3::fromCData($cdata->normal)); + } +} + diff --git a/generated/Rectangle.php b/generated/Rectangle.php new file mode 100644 index 0000000..fb41245 --- /dev/null +++ b/generated/Rectangle.php @@ -0,0 +1,55 @@ +x = $x; + $this->y = $y; + $this->width = $width; + $this->height = $height; + } + + public function toCData() : \FFI\CData + { + global $raylib; + $type = $raylib->new('Rectangle'); + $type->x = $this->x; + $type->y = $this->y; + $type->width = $this->width; + $type->height = $this->height; + return $type; + } + + public static function fromCData(\FFI\CData $cdata) + { + return new self($cdata->x, $cdata->y, $cdata->width, $cdata->height); + } +} + diff --git a/generated/RenderTexture.php b/generated/RenderTexture.php new file mode 100644 index 0000000..c58014e --- /dev/null +++ b/generated/RenderTexture.php @@ -0,0 +1,48 @@ +id = $id; + $this->texture = $texture; + $this->depth = $depth; + } + + public function toCData() : \FFI\CData + { + global $raylib; + $type = $raylib->new('RenderTexture'); + $type->id = $this->id; + $type->texture = $this->texture->toCData(); + $type->depth = $this->depth->toCData(); + return $type; + } + + public static function fromCData(\FFI\CData $cdata) + { + return new self($cdata->id, \Nawarian\Raylib\Generated\Texture::fromCData($cdata->texture), \Nawarian\Raylib\Generated\Texture::fromCData($cdata->depth)); + } +} + diff --git a/generated/Shader.php b/generated/Shader.php new file mode 100644 index 0000000..a40d125 --- /dev/null +++ b/generated/Shader.php @@ -0,0 +1,41 @@ +id = $id; + $this->locs = $locs; + } + + public function toCData() : \FFI\CData + { + global $raylib; + $type = $raylib->new('Shader'); + $type->id = $this->id; + $type->locs = $this->locs; + return $type; + } + + public static function fromCData(\FFI\CData $cdata) + { + return new self($cdata->id, $cdata->locs); + } +} + diff --git a/generated/Sound.php b/generated/Sound.php new file mode 100644 index 0000000..60a443d --- /dev/null +++ b/generated/Sound.php @@ -0,0 +1,41 @@ +stream = $stream; + $this->frameCount = $frameCount; + } + + public function toCData() : \FFI\CData + { + global $raylib; + $type = $raylib->new('Sound'); + $type->stream = $this->stream->toCData(); + $type->frameCount = $this->frameCount; + return $type; + } + + public static function fromCData(\FFI\CData $cdata) + { + return new self(\Nawarian\Raylib\Generated\AudioStream::fromCData($cdata->stream), $cdata->frameCount); + } +} + diff --git a/generated/Texture.php b/generated/Texture.php new file mode 100644 index 0000000..3c1ad35 --- /dev/null +++ b/generated/Texture.php @@ -0,0 +1,62 @@ +id = $id; + $this->width = $width; + $this->height = $height; + $this->mipmaps = $mipmaps; + $this->format = $format; + } + + public function toCData() : \FFI\CData + { + global $raylib; + $type = $raylib->new('Texture'); + $type->id = $this->id; + $type->width = $this->width; + $type->height = $this->height; + $type->mipmaps = $this->mipmaps; + $type->format = $this->format; + return $type; + } + + public static function fromCData(\FFI\CData $cdata) + { + return new self($cdata->id, $cdata->width, $cdata->height, $cdata->mipmaps, $cdata->format); + } +} + diff --git a/generated/Transform.php b/generated/Transform.php new file mode 100644 index 0000000..22e2917 --- /dev/null +++ b/generated/Transform.php @@ -0,0 +1,48 @@ +translation = $translation; + $this->rotation = $rotation; + $this->scale = $scale; + } + + public function toCData() : \FFI\CData + { + global $raylib; + $type = $raylib->new('Transform'); + $type->translation = $this->translation->toCData(); + $type->rotation = $this->rotation->toCData(); + $type->scale = $this->scale->toCData(); + return $type; + } + + public static function fromCData(\FFI\CData $cdata) + { + return new self(\Nawarian\Raylib\Generated\Vector3::fromCData($cdata->translation), \Nawarian\Raylib\Generated\Vector4::fromCData($cdata->rotation), \Nawarian\Raylib\Generated\Vector3::fromCData($cdata->scale)); + } +} + diff --git a/generated/Vector2.php b/generated/Vector2.php new file mode 100644 index 0000000..ecd90c9 --- /dev/null +++ b/generated/Vector2.php @@ -0,0 +1,41 @@ +x = $x; + $this->y = $y; + } + + public function toCData() : \FFI\CData + { + global $raylib; + $type = $raylib->new('Vector2'); + $type->x = $this->x; + $type->y = $this->y; + return $type; + } + + public static function fromCData(\FFI\CData $cdata) + { + return new self($cdata->x, $cdata->y); + } +} + diff --git a/generated/Vector3.php b/generated/Vector3.php new file mode 100644 index 0000000..13b3e2f --- /dev/null +++ b/generated/Vector3.php @@ -0,0 +1,48 @@ +x = $x; + $this->y = $y; + $this->z = $z; + } + + public function toCData() : \FFI\CData + { + global $raylib; + $type = $raylib->new('Vector3'); + $type->x = $this->x; + $type->y = $this->y; + $type->z = $this->z; + return $type; + } + + public static function fromCData(\FFI\CData $cdata) + { + return new self($cdata->x, $cdata->y, $cdata->z); + } +} + diff --git a/generated/Vector4.php b/generated/Vector4.php new file mode 100644 index 0000000..dfadba6 --- /dev/null +++ b/generated/Vector4.php @@ -0,0 +1,55 @@ +x = $x; + $this->y = $y; + $this->z = $z; + $this->w = $w; + } + + public function toCData() : \FFI\CData + { + global $raylib; + $type = $raylib->new('Vector4'); + $type->x = $this->x; + $type->y = $this->y; + $type->z = $this->z; + $type->w = $this->w; + return $type; + } + + public static function fromCData(\FFI\CData $cdata) + { + return new self($cdata->x, $cdata->y, $cdata->z, $cdata->w); + } +} + diff --git a/generated/VrDeviceInfo.php b/generated/VrDeviceInfo.php new file mode 100644 index 0000000..908317a --- /dev/null +++ b/generated/VrDeviceInfo.php @@ -0,0 +1,97 @@ +hResolution = $hResolution; + $this->vResolution = $vResolution; + $this->hScreenSize = $hScreenSize; + $this->vScreenSize = $vScreenSize; + $this->vScreenCenter = $vScreenCenter; + $this->eyeToScreenDistance = $eyeToScreenDistance; + $this->lensSeparationDistance = $lensSeparationDistance; + $this->interpupillaryDistance = $interpupillaryDistance; + $this->lensDistortionValues = $lensDistortionValues; + $this->chromaAbCorrection = $chromaAbCorrection; + } + + public function toCData() : \FFI\CData + { + global $raylib; + $type = $raylib->new('VrDeviceInfo'); + $type->hResolution = $this->hResolution; + $type->vResolution = $this->vResolution; + $type->hScreenSize = $this->hScreenSize; + $type->vScreenSize = $this->vScreenSize; + $type->vScreenCenter = $this->vScreenCenter; + $type->eyeToScreenDistance = $this->eyeToScreenDistance; + $type->lensSeparationDistance = $this->lensSeparationDistance; + $type->interpupillaryDistance = $this->interpupillaryDistance; + $type->lensDistortionValues = $this->lensDistortionValues; + $type->chromaAbCorrection = $this->chromaAbCorrection; + return $type; + } + + public static function fromCData(\FFI\CData $cdata) + { + return new self($cdata->hResolution, $cdata->vResolution, $cdata->hScreenSize, $cdata->vScreenSize, $cdata->vScreenCenter, $cdata->eyeToScreenDistance, $cdata->lensSeparationDistance, $cdata->interpupillaryDistance, $cdata->lensDistortionValues, $cdata->chromaAbCorrection); + } +} + diff --git a/generated/VrStereoConfig.php b/generated/VrStereoConfig.php new file mode 100644 index 0000000..4a33a62 --- /dev/null +++ b/generated/VrStereoConfig.php @@ -0,0 +1,83 @@ +projection = $projection; + $this->viewOffset = $viewOffset; + $this->leftLensCenter = $leftLensCenter; + $this->rightLensCenter = $rightLensCenter; + $this->leftScreenCenter = $leftScreenCenter; + $this->rightScreenCenter = $rightScreenCenter; + $this->scale = $scale; + $this->scaleIn = $scaleIn; + } + + public function toCData() : \FFI\CData + { + global $raylib; + $type = $raylib->new('VrStereoConfig'); + $type->projection = $this->projection; + $type->viewOffset = $this->viewOffset; + $type->leftLensCenter = $this->leftLensCenter; + $type->rightLensCenter = $this->rightLensCenter; + $type->leftScreenCenter = $this->leftScreenCenter; + $type->rightScreenCenter = $this->rightScreenCenter; + $type->scale = $this->scale; + $type->scaleIn = $this->scaleIn; + return $type; + } + + public static function fromCData(\FFI\CData $cdata) + { + return new self($cdata->projection, $cdata->viewOffset, $cdata->leftLensCenter, $cdata->rightLensCenter, $cdata->leftScreenCenter, $cdata->rightScreenCenter, $cdata->scale, $cdata->scaleIn); + } +} + diff --git a/generated/Wave.php b/generated/Wave.php new file mode 100644 index 0000000..d874362 --- /dev/null +++ b/generated/Wave.php @@ -0,0 +1,62 @@ +sampleCount = $sampleCount; + $this->sampleRate = $sampleRate; + $this->sampleSize = $sampleSize; + $this->channels = $channels; + $this->data = $data; + } + + public function toCData() : \FFI\CData + { + global $raylib; + $type = $raylib->new('Wave'); + $type->sampleCount = $this->sampleCount; + $type->sampleRate = $this->sampleRate; + $type->sampleSize = $this->sampleSize; + $type->channels = $this->channels; + $type->data = $this->data; + return $type; + } + + public static function fromCData(\FFI\CData $cdata) + { + return new self($cdata->sampleCount, $cdata->sampleRate, $cdata->sampleSize, $cdata->channels, $cdata->data); + } +} + diff --git a/generated/functions.php b/generated/functions.php new file mode 100644 index 0000000..999eceb --- /dev/null +++ b/generated/functions.php @@ -0,0 +1,4168 @@ +InitWindow($paramwidth, $paramheight, $paramtitle); +} + +/** + * Check if KEY_ESCAPE pressed or Close icon pressed + */ + function WindowShouldClose() : bool +{ +global $raylib; +return $raylib->WindowShouldClose(); +} + +/** + * Close window and unload OpenGL context + */ + function CloseWindow() : void +{ +global $raylib; +$raylib->CloseWindow(); +} + +/** + * Check if window has been initialized successfully + */ + function IsWindowReady() : bool +{ +global $raylib; +return $raylib->IsWindowReady(); +} + +/** + * Check if window is currently fullscreen + */ + function IsWindowFullscreen() : bool +{ +global $raylib; +return $raylib->IsWindowFullscreen(); +} + +/** + * Check if window is currently hidden (only PLATFORM_DESKTOP) + */ + function IsWindowHidden() : bool +{ +global $raylib; +return $raylib->IsWindowHidden(); +} + +/** + * Check if window is currently minimized (only PLATFORM_DESKTOP) + */ + function IsWindowMinimized() : bool +{ +global $raylib; +return $raylib->IsWindowMinimized(); +} + +/** + * Check if window is currently maximized (only PLATFORM_DESKTOP) + */ + function IsWindowMaximized() : bool +{ +global $raylib; +return $raylib->IsWindowMaximized(); +} + +/** + * Check if window is currently focused (only PLATFORM_DESKTOP) + */ + function IsWindowFocused() : bool +{ +global $raylib; +return $raylib->IsWindowFocused(); +} + +/** + * Check if window has been resized last frame + */ + function IsWindowResized() : bool +{ +global $raylib; +return $raylib->IsWindowResized(); +} + +/** + * Check if one specific window flag is enabled + */ + function IsWindowState(int $paramflag) : bool +{ +global $raylib; +return $raylib->IsWindowState($paramflag); +} + +/** + * Set window configuration state using flags + */ + function SetWindowState(int $paramflags) : void +{ +global $raylib; +$raylib->SetWindowState($paramflags); +} + +/** + * Clear window configuration state flags + */ + function ClearWindowState(int $paramflags) : void +{ +global $raylib; +$raylib->ClearWindowState($paramflags); +} + +/** + * Toggle window state: fullscreen/windowed (only PLATFORM_DESKTOP) + */ + function ToggleFullscreen() : void +{ +global $raylib; +$raylib->ToggleFullscreen(); +} + +/** + * Set window state: maximized, if resizable (only PLATFORM_DESKTOP) + */ + function MaximizeWindow() : void +{ +global $raylib; +$raylib->MaximizeWindow(); +} + +/** + * Set window state: minimized, if resizable (only PLATFORM_DESKTOP) + */ + function MinimizeWindow() : void +{ +global $raylib; +$raylib->MinimizeWindow(); +} + +/** + * Set window state: not minimized/maximized (only PLATFORM_DESKTOP) + */ + function RestoreWindow() : void +{ +global $raylib; +$raylib->RestoreWindow(); +} + +/** + * Set icon for window (only PLATFORM_DESKTOP) + */ + function SetWindowIcon(\Nawarian\Raylib\Generated\Image $paramimage) : void +{ +global $raylib; +$raylib->SetWindowIcon($paramimage->toCData()); +} + +/** + * Set title for window (only PLATFORM_DESKTOP) + */ + function SetWindowTitle(string $paramtitle) : void +{ +global $raylib; +$raylib->SetWindowTitle($paramtitle); +} + +/** + * Set window position on screen (only PLATFORM_DESKTOP) + */ + function SetWindowPosition(int $paramx, int $paramy) : void +{ +global $raylib; +$raylib->SetWindowPosition($paramx, $paramy); +} + +/** + * Set monitor for the current window (fullscreen mode) + */ + function SetWindowMonitor(int $parammonitor) : void +{ +global $raylib; +$raylib->SetWindowMonitor($parammonitor); +} + +/** + * Set window minimum dimensions (for FLAG_WINDOW_RESIZABLE) + */ + function SetWindowMinSize(int $paramwidth, int $paramheight) : void +{ +global $raylib; +$raylib->SetWindowMinSize($paramwidth, $paramheight); +} + +/** + * Set window dimensions + */ + function SetWindowSize(int $paramwidth, int $paramheight) : void +{ +global $raylib; +$raylib->SetWindowSize($paramwidth, $paramheight); +} + +/** + * Get native window handle + */ + function GetWindowHandle() : \FFI\CData +{ +global $raylib; +return $raylib->GetWindowHandle(); +} + +/** + * Get current screen width + */ + function GetScreenWidth() : int +{ +global $raylib; +return $raylib->GetScreenWidth(); +} + +/** + * Get current screen height + */ + function GetScreenHeight() : int +{ +global $raylib; +return $raylib->GetScreenHeight(); +} + +/** + * Get number of connected monitors + */ + function GetMonitorCount() : int +{ +global $raylib; +return $raylib->GetMonitorCount(); +} + +/** + * Get current connected monitor + */ + function GetCurrentMonitor() : int +{ +global $raylib; +return $raylib->GetCurrentMonitor(); +} + +/** + * Get specified monitor position + */ + function GetMonitorPosition(int $parammonitor) : \Nawarian\Raylib\Generated\Vector2 +{ +global $raylib; +return \Nawarian\Raylib\Generated\Vector2::fromCData($raylib->GetMonitorPosition($parammonitor)); +} + +/** + * Get specified monitor width (max available by monitor) + */ + function GetMonitorWidth(int $parammonitor) : int +{ +global $raylib; +return $raylib->GetMonitorWidth($parammonitor); +} + +/** + * Get specified monitor height (max available by monitor) + */ + function GetMonitorHeight(int $parammonitor) : int +{ +global $raylib; +return $raylib->GetMonitorHeight($parammonitor); +} + +/** + * Get specified monitor physical width in millimetres + */ + function GetMonitorPhysicalWidth(int $parammonitor) : int +{ +global $raylib; +return $raylib->GetMonitorPhysicalWidth($parammonitor); +} + +/** + * Get specified monitor physical height in millimetres + */ + function GetMonitorPhysicalHeight(int $parammonitor) : int +{ +global $raylib; +return $raylib->GetMonitorPhysicalHeight($parammonitor); +} + +/** + * Get specified monitor refresh rate + */ + function GetMonitorRefreshRate(int $parammonitor) : int +{ +global $raylib; +return $raylib->GetMonitorRefreshRate($parammonitor); +} + +/** + * Get window position XY on monitor + */ + function GetWindowPosition() : \Nawarian\Raylib\Generated\Vector2 +{ +global $raylib; +return \Nawarian\Raylib\Generated\Vector2::fromCData($raylib->GetWindowPosition()); +} + +/** + * Get window scale DPI factor + */ + function GetWindowScaleDPI() : \Nawarian\Raylib\Generated\Vector2 +{ +global $raylib; +return \Nawarian\Raylib\Generated\Vector2::fromCData($raylib->GetWindowScaleDPI()); +} + +/** + * Get the human-readable, UTF-8 encoded name of the primary monitor + */ + function GetMonitorName(int $parammonitor) : string +{ +global $raylib; +return $raylib->GetMonitorName($parammonitor); +} + +/** + * Set clipboard text content + */ + function SetClipboardText(string $paramtext) : void +{ +global $raylib; +$raylib->SetClipboardText($paramtext); +} + +/** + * Get clipboard text content + */ + function GetClipboardText() : string +{ +global $raylib; +return $raylib->GetClipboardText(); +} + +/** + * Shows cursor + */ + function ShowCursor() : void +{ +global $raylib; +$raylib->ShowCursor(); +} + +/** + * Hides cursor + */ + function HideCursor() : void +{ +global $raylib; +$raylib->HideCursor(); +} + +/** + * Check if cursor is not visible + */ + function IsCursorHidden() : bool +{ +global $raylib; +return $raylib->IsCursorHidden(); +} + +/** + * Enables cursor (unlock cursor) + */ + function EnableCursor() : void +{ +global $raylib; +$raylib->EnableCursor(); +} + +/** + * Disables cursor (lock cursor) + */ + function DisableCursor() : void +{ +global $raylib; +$raylib->DisableCursor(); +} + +/** + * Check if cursor is on the screen + */ + function IsCursorOnScreen() : bool +{ +global $raylib; +return $raylib->IsCursorOnScreen(); +} + +/** + * Set background color (framebuffer clear color) + */ + function ClearBackground(\Nawarian\Raylib\Generated\Color $paramcolor) : void +{ +global $raylib; +$raylib->ClearBackground($paramcolor->toCData()); +} + +/** + * Setup canvas (framebuffer) to start drawing + */ + function BeginDrawing() : void +{ +global $raylib; +$raylib->BeginDrawing(); +} + +/** + * End canvas drawing and swap buffers (double buffering) + */ + function EndDrawing() : void +{ +global $raylib; +$raylib->EndDrawing(); +} + +/** + * Begin 2D mode with custom camera (2D) + */ + function BeginMode2D(\Nawarian\Raylib\Generated\Camera2D $paramcamera) : void +{ +global $raylib; +$raylib->BeginMode2D($paramcamera->toCData()); +} + +/** + * Ends 2D mode with custom camera + */ + function EndMode2D() : void +{ +global $raylib; +$raylib->EndMode2D(); +} + +/** + * Begin 3D mode with custom camera (3D) + */ + function BeginMode3D(\Nawarian\Raylib\Generated\Camera3D $paramcamera) : void +{ +global $raylib; +$raylib->BeginMode3D($paramcamera->toCData()); +} + +/** + * Ends 3D mode and returns to default 2D orthographic mode + */ + function EndMode3D() : void +{ +global $raylib; +$raylib->EndMode3D(); +} + +/** + * Begin drawing to render texture + */ + function BeginTextureMode(\Nawarian\Raylib\Generated\RenderTexture $paramtarget) : void +{ +global $raylib; +$raylib->BeginTextureMode($paramtarget->toCData()); +} + +/** + * Ends drawing to render texture + */ + function EndTextureMode() : void +{ +global $raylib; +$raylib->EndTextureMode(); +} + +/** + * Begin custom shader drawing + */ + function BeginShaderMode(\Nawarian\Raylib\Generated\Shader $paramshader) : void +{ +global $raylib; +$raylib->BeginShaderMode($paramshader->toCData()); +} + +/** + * End custom shader drawing (use default shader) + */ + function EndShaderMode() : void +{ +global $raylib; +$raylib->EndShaderMode(); +} + +/** + * Begin blending mode (alpha, additive, multiplied, subtract, custom) + */ + function BeginBlendMode(int $parammode) : void +{ +global $raylib; +$raylib->BeginBlendMode($parammode); +} + +/** + * End blending mode (reset to default: alpha blending) + */ + function EndBlendMode() : void +{ +global $raylib; +$raylib->EndBlendMode(); +} + +/** + * Begin scissor mode (define screen area for following drawing) + */ + function BeginScissorMode(int $paramx, int $paramy, int $paramwidth, int $paramheight) : void +{ +global $raylib; +$raylib->BeginScissorMode($paramx, $paramy, $paramwidth, $paramheight); +} + +/** + * End scissor mode + */ + function EndScissorMode() : void +{ +global $raylib; +$raylib->EndScissorMode(); +} + +/** + * Begin stereo rendering (requires VR simulator) + */ + function BeginVrStereoMode(\Nawarian\Raylib\Generated\VrStereoConfig $paramconfig) : void +{ +global $raylib; +$raylib->BeginVrStereoMode($paramconfig->toCData()); +} + +/** + * End stereo rendering (requires VR simulator) + */ + function EndVrStereoMode() : void +{ +global $raylib; +$raylib->EndVrStereoMode(); +} + +/** + * Load VR stereo config for VR simulator device parameters + */ + function LoadVrStereoConfig(\Nawarian\Raylib\Generated\VrDeviceInfo $paramdevice) : \Nawarian\Raylib\Generated\VrStereoConfig +{ +global $raylib; +return \Nawarian\Raylib\Generated\VrStereoConfig::fromCData($raylib->LoadVrStereoConfig($paramdevice->toCData())); +} + +/** + * Unload VR stereo config + */ + function UnloadVrStereoConfig(\Nawarian\Raylib\Generated\VrStereoConfig $paramconfig) : void +{ +global $raylib; +$raylib->UnloadVrStereoConfig($paramconfig->toCData()); +} + +/** + * Load shader from files and bind default locations + */ + function LoadShader(string $paramvsFileName, string $paramfsFileName) : \Nawarian\Raylib\Generated\Shader +{ +global $raylib; +return \Nawarian\Raylib\Generated\Shader::fromCData($raylib->LoadShader($paramvsFileName, $paramfsFileName)); +} + +/** + * Load shader from code strings and bind default locations + */ + function LoadShaderFromMemory(string $paramvsCode, string $paramfsCode) : \Nawarian\Raylib\Generated\Shader +{ +global $raylib; +return \Nawarian\Raylib\Generated\Shader::fromCData($raylib->LoadShaderFromMemory($paramvsCode, $paramfsCode)); +} + +/** + * Get shader uniform location + */ + function GetShaderLocation(\Nawarian\Raylib\Generated\Shader $paramshader, string $paramuniformName) : int +{ +global $raylib; +return $raylib->GetShaderLocation($paramshader->toCData(), $paramuniformName); +} + +/** + * Get shader attribute location + */ + function GetShaderLocationAttrib(\Nawarian\Raylib\Generated\Shader $paramshader, string $paramattribName) : int +{ +global $raylib; +return $raylib->GetShaderLocationAttrib($paramshader->toCData(), $paramattribName); +} + +/** + * Set shader uniform value + */ + function SetShaderValue(\Nawarian\Raylib\Generated\Shader $paramshader, int $paramlocIndex, \FFI\CData $paramvalue, int $paramuniformType) : void +{ +global $raylib; +$raylib->SetShaderValue($paramshader->toCData(), $paramlocIndex, $paramvalue, $paramuniformType); +} + +/** + * Set shader uniform value vector + */ + function SetShaderValueV(\Nawarian\Raylib\Generated\Shader $paramshader, int $paramlocIndex, \FFI\CData $paramvalue, int $paramuniformType, int $paramcount) : void +{ +global $raylib; +$raylib->SetShaderValueV($paramshader->toCData(), $paramlocIndex, $paramvalue, $paramuniformType, $paramcount); +} + +/** + * Set shader uniform value (matrix 4x4) + */ + function SetShaderValueMatrix(\Nawarian\Raylib\Generated\Shader $paramshader, int $paramlocIndex, \Nawarian\Raylib\Generated\Matrix $parammat) : void +{ +global $raylib; +$raylib->SetShaderValueMatrix($paramshader->toCData(), $paramlocIndex, $parammat->toCData()); +} + +/** + * Set shader uniform value for texture (sampler2d) + */ + function SetShaderValueTexture(\Nawarian\Raylib\Generated\Shader $paramshader, int $paramlocIndex, \Nawarian\Raylib\Generated\Texture $paramtexture) : void +{ +global $raylib; +$raylib->SetShaderValueTexture($paramshader->toCData(), $paramlocIndex, $paramtexture->toCData()); +} + +/** + * Unload shader from GPU memory (VRAM) + */ + function UnloadShader(\Nawarian\Raylib\Generated\Shader $paramshader) : void +{ +global $raylib; +$raylib->UnloadShader($paramshader->toCData()); +} + +/** + * Get a ray trace from mouse position + */ + function GetMouseRay(\Nawarian\Raylib\Generated\Vector2 $parammousePosition, \Nawarian\Raylib\Generated\Camera3D $paramcamera) : \Nawarian\Raylib\Generated\Ray +{ +global $raylib; +return \Nawarian\Raylib\Generated\Ray::fromCData($raylib->GetMouseRay($parammousePosition->toCData(), $paramcamera->toCData())); +} + +/** + * Get camera transform matrix (view matrix) + */ + function GetCameraMatrix(\Nawarian\Raylib\Generated\Camera3D $paramcamera) : \Nawarian\Raylib\Generated\Matrix +{ +global $raylib; +return \Nawarian\Raylib\Generated\Matrix::fromCData($raylib->GetCameraMatrix($paramcamera->toCData())); +} + +/** + * Get camera 2d transform matrix + */ + function GetCameraMatrix2D(\Nawarian\Raylib\Generated\Camera2D $paramcamera) : \Nawarian\Raylib\Generated\Matrix +{ +global $raylib; +return \Nawarian\Raylib\Generated\Matrix::fromCData($raylib->GetCameraMatrix2D($paramcamera->toCData())); +} + +/** + * Get the screen space position for a 3d world space position + */ + function GetWorldToScreen(\Nawarian\Raylib\Generated\Vector3 $paramposition, \Nawarian\Raylib\Generated\Camera3D $paramcamera) : \Nawarian\Raylib\Generated\Vector2 +{ +global $raylib; +return \Nawarian\Raylib\Generated\Vector2::fromCData($raylib->GetWorldToScreen($paramposition->toCData(), $paramcamera->toCData())); +} + +/** + * Get size position for a 3d world space position + */ + function GetWorldToScreenEx(\Nawarian\Raylib\Generated\Vector3 $paramposition, \Nawarian\Raylib\Generated\Camera3D $paramcamera, int $paramwidth, int $paramheight) : \Nawarian\Raylib\Generated\Vector2 +{ +global $raylib; +return \Nawarian\Raylib\Generated\Vector2::fromCData($raylib->GetWorldToScreenEx($paramposition->toCData(), $paramcamera->toCData(), $paramwidth, $paramheight)); +} + +/** + * Get the screen space position for a 2d camera world space position + */ + function GetWorldToScreen2D(\Nawarian\Raylib\Generated\Vector2 $paramposition, \Nawarian\Raylib\Generated\Camera2D $paramcamera) : \Nawarian\Raylib\Generated\Vector2 +{ +global $raylib; +return \Nawarian\Raylib\Generated\Vector2::fromCData($raylib->GetWorldToScreen2D($paramposition->toCData(), $paramcamera->toCData())); +} + +/** + * Get the world space position for a 2d camera screen space position + */ + function GetScreenToWorld2D(\Nawarian\Raylib\Generated\Vector2 $paramposition, \Nawarian\Raylib\Generated\Camera2D $paramcamera) : \Nawarian\Raylib\Generated\Vector2 +{ +global $raylib; +return \Nawarian\Raylib\Generated\Vector2::fromCData($raylib->GetScreenToWorld2D($paramposition->toCData(), $paramcamera->toCData())); +} + +/** + * Set target FPS (maximum) + */ + function SetTargetFPS(int $paramfps) : void +{ +global $raylib; +$raylib->SetTargetFPS($paramfps); +} + +/** + * Get current FPS + */ + function GetFPS() : int +{ +global $raylib; +return $raylib->GetFPS(); +} + +/** + * Get time in seconds for last frame drawn (delta time) + */ + function GetFrameTime() : float +{ +global $raylib; +return $raylib->GetFrameTime(); +} + +/** + * Get elapsed time in seconds since InitWindow() + */ + function GetTime() : float +{ +global $raylib; +return $raylib->GetTime(); +} + +/** + * Get a random value between min and max (both included) + */ + function GetRandomValue(int $parammin, int $parammax) : int +{ +global $raylib; +return $raylib->GetRandomValue($parammin, $parammax); +} + +/** + * Takes a screenshot of current screen (filename extension defines format) + */ + function TakeScreenshot(string $paramfileName) : void +{ +global $raylib; +$raylib->TakeScreenshot($paramfileName); +} + +/** + * Setup init configuration flags (view FLAGS) + */ + function SetConfigFlags(int $paramflags) : void +{ +global $raylib; +$raylib->SetConfigFlags($paramflags); +} + +/** + * Set the current threshold (minimum) log level + */ + function SetTraceLogLevel(int $paramlogLevel) : void +{ +global $raylib; +$raylib->SetTraceLogLevel($paramlogLevel); +} + +/** + * Internal memory allocator + */ + function MemAlloc(int $paramsize) : \FFI\CData +{ +global $raylib; +return $raylib->MemAlloc($paramsize); +} + +/** + * Internal memory reallocator + */ + function MemRealloc(\FFI\CData $paramptr, int $paramsize) : \FFI\CData +{ +global $raylib; +return $raylib->MemRealloc($paramptr, $paramsize); +} + +/** + * Internal memory free + */ + function MemFree(\FFI\CData $paramptr) : void +{ +global $raylib; +$raylib->MemFree($paramptr); +} + +/** + * Load file data as byte array (read) + */ + function LoadFileData(string $paramfileName, array $parambytesRead) : array +{ +global $raylib; +return $raylib->LoadFileData($paramfileName, $parambytesRead); +} + +/** + * Unload file data allocated by LoadFileData() + */ + function UnloadFileData(array $paramdata) : void +{ +global $raylib; +$raylib->UnloadFileData($paramdata); +} + +/** + * Save data to file from byte array (write), returns true on success + */ + function SaveFileData(string $paramfileName, \FFI\CData $paramdata, int $parambytesToWrite) : bool +{ +global $raylib; +return $raylib->SaveFileData($paramfileName, $paramdata, $parambytesToWrite); +} + +/** + * Load text data from file (read), returns a ' 0' terminated string + */ + function LoadFileText(string $paramfileName) : string +{ +global $raylib; +return $raylib->LoadFileText($paramfileName); +} + +/** + * Unload file text data allocated by LoadFileText() + */ + function UnloadFileText(string $paramtext) : void +{ +global $raylib; +$raylib->UnloadFileText($paramtext); +} + +/** + * Save text data to file (write), string must be ' 0' terminated, returns true on + * success + */ + function SaveFileText(string $paramfileName, string $paramtext) : bool +{ +global $raylib; +return $raylib->SaveFileText($paramfileName, $paramtext); +} + +/** + * Check if file exists + */ + function FileExists(string $paramfileName) : bool +{ +global $raylib; +return $raylib->FileExists($paramfileName); +} + +/** + * Check if a directory path exists + */ + function DirectoryExists(string $paramdirPath) : bool +{ +global $raylib; +return $raylib->DirectoryExists($paramdirPath); +} + +/** + * Check file extension (including point: .png, .wav) + */ + function IsFileExtension(string $paramfileName, string $paramext) : bool +{ +global $raylib; +return $raylib->IsFileExtension($paramfileName, $paramext); +} + +/** + * Get pointer to extension for a filename string (includes dot: '.png') + */ + function GetFileExtension(string $paramfileName) : string +{ +global $raylib; +return $raylib->GetFileExtension($paramfileName); +} + +/** + * Get pointer to filename for a path string + */ + function GetFileName(string $paramfilePath) : string +{ +global $raylib; +return $raylib->GetFileName($paramfilePath); +} + +/** + * Get filename string without extension (uses static string) + */ + function GetFileNameWithoutExt(string $paramfilePath) : string +{ +global $raylib; +return $raylib->GetFileNameWithoutExt($paramfilePath); +} + +/** + * Get full path for a given fileName with path (uses static string) + */ + function GetDirectoryPath(string $paramfilePath) : string +{ +global $raylib; +return $raylib->GetDirectoryPath($paramfilePath); +} + +/** + * Get previous directory path for a given path (uses static string) + */ + function GetPrevDirectoryPath(string $paramdirPath) : string +{ +global $raylib; +return $raylib->GetPrevDirectoryPath($paramdirPath); +} + +/** + * Get current working directory (uses static string) + */ + function GetWorkingDirectory() : string +{ +global $raylib; +return $raylib->GetWorkingDirectory(); +} + +/** + * Get filenames in a directory path (memory should be freed) + */ + function GetDirectoryFiles(string $paramdirPath, array $paramcount) : array +{ +global $raylib; +return $raylib->GetDirectoryFiles($paramdirPath, $paramcount); +} + +/** + * Clear directory files paths buffers (free memory) + */ + function ClearDirectoryFiles() : void +{ +global $raylib; +$raylib->ClearDirectoryFiles(); +} + +/** + * Change working directory, return true on success + */ + function ChangeDirectory(string $paramdir) : bool +{ +global $raylib; +return $raylib->ChangeDirectory($paramdir); +} + +/** + * Check if a file has been dropped into window + */ + function IsFileDropped() : bool +{ +global $raylib; +return $raylib->IsFileDropped(); +} + +/** + * Get dropped files names (memory should be freed) + */ + function GetDroppedFiles(array $paramcount) : array +{ +global $raylib; +return $raylib->GetDroppedFiles($paramcount); +} + +/** + * Clear dropped files paths buffer (free memory) + */ + function ClearDroppedFiles() : void +{ +global $raylib; +$raylib->ClearDroppedFiles(); +} + +/** + * Get file modification time (last write time) + */ + function GetFileModTime(string $paramfileName) : int +{ +global $raylib; +return $raylib->GetFileModTime($paramfileName); +} + +/** + * Compress data (DEFLATE algorithm) + */ + function CompressData(array $paramdata, int $paramdataLength, array $paramcompDataLength) : array +{ +global $raylib; +return $raylib->CompressData($paramdata, $paramdataLength, $paramcompDataLength); +} + +/** + * Decompress data (DEFLATE algorithm) + */ + function DecompressData(array $paramcompData, int $paramcompDataLength, array $paramdataLength) : array +{ +global $raylib; +return $raylib->DecompressData($paramcompData, $paramcompDataLength, $paramdataLength); +} + +/** + * Save integer value to storage file (to defined position), returns true on + * success + */ + function SaveStorageValue(int $paramposition, int $paramvalue) : bool +{ +global $raylib; +return $raylib->SaveStorageValue($paramposition, $paramvalue); +} + +/** + * Load integer value from storage file (from defined position) + */ + function LoadStorageValue(int $paramposition) : int +{ +global $raylib; +return $raylib->LoadStorageValue($paramposition); +} + +/** + * Open URL with default system browser (if available) + */ + function OpenURL(string $paramurl) : void +{ +global $raylib; +$raylib->OpenURL($paramurl); +} + +/** + * Check if a key has been pressed once + */ + function IsKeyPressed(int $paramkey) : bool +{ +global $raylib; +return $raylib->IsKeyPressed($paramkey); +} + +/** + * Check if a key is being pressed + */ + function IsKeyDown(int $paramkey) : bool +{ +global $raylib; +return $raylib->IsKeyDown($paramkey); +} + +/** + * Check if a key has been released once + */ + function IsKeyReleased(int $paramkey) : bool +{ +global $raylib; +return $raylib->IsKeyReleased($paramkey); +} + +/** + * Check if a key is NOT being pressed + */ + function IsKeyUp(int $paramkey) : bool +{ +global $raylib; +return $raylib->IsKeyUp($paramkey); +} + +/** + * Set a custom key to exit program (default is ESC) + */ + function SetExitKey(int $paramkey) : void +{ +global $raylib; +$raylib->SetExitKey($paramkey); +} + +/** + * Get key pressed (keycode), call it multiple times for keys queued + */ + function GetKeyPressed() : int +{ +global $raylib; +return $raylib->GetKeyPressed(); +} + +/** + * Get char pressed (unicode), call it multiple times for chars queued + */ + function GetCharPressed() : int +{ +global $raylib; +return $raylib->GetCharPressed(); +} + +/** + * Check if a gamepad is available + */ + function IsGamepadAvailable(int $paramgamepad) : bool +{ +global $raylib; +return $raylib->IsGamepadAvailable($paramgamepad); +} + +/** + * Check gamepad name (if available) + */ + function IsGamepadName(int $paramgamepad, string $paramname) : bool +{ +global $raylib; +return $raylib->IsGamepadName($paramgamepad, $paramname); +} + +/** + * Get gamepad internal name id + */ + function GetGamepadName(int $paramgamepad) : string +{ +global $raylib; +return $raylib->GetGamepadName($paramgamepad); +} + +/** + * Check if a gamepad button has been pressed once + */ + function IsGamepadButtonPressed(int $paramgamepad, int $parambutton) : bool +{ +global $raylib; +return $raylib->IsGamepadButtonPressed($paramgamepad, $parambutton); +} + +/** + * Check if a gamepad button is being pressed + */ + function IsGamepadButtonDown(int $paramgamepad, int $parambutton) : bool +{ +global $raylib; +return $raylib->IsGamepadButtonDown($paramgamepad, $parambutton); +} + +/** + * Check if a gamepad button has been released once + */ + function IsGamepadButtonReleased(int $paramgamepad, int $parambutton) : bool +{ +global $raylib; +return $raylib->IsGamepadButtonReleased($paramgamepad, $parambutton); +} + +/** + * Check if a gamepad button is NOT being pressed + */ + function IsGamepadButtonUp(int $paramgamepad, int $parambutton) : bool +{ +global $raylib; +return $raylib->IsGamepadButtonUp($paramgamepad, $parambutton); +} + +/** + * Get the last gamepad button pressed + */ + function GetGamepadButtonPressed() : int +{ +global $raylib; +return $raylib->GetGamepadButtonPressed(); +} + +/** + * Get gamepad axis count for a gamepad + */ + function GetGamepadAxisCount(int $paramgamepad) : int +{ +global $raylib; +return $raylib->GetGamepadAxisCount($paramgamepad); +} + +/** + * Get axis movement value for a gamepad axis + */ + function GetGamepadAxisMovement(int $paramgamepad, int $paramaxis) : float +{ +global $raylib; +return $raylib->GetGamepadAxisMovement($paramgamepad, $paramaxis); +} + +/** + * Set internal gamepad mappings (SDL_GameControllerDB) + */ + function SetGamepadMappings(string $parammappings) : int +{ +global $raylib; +return $raylib->SetGamepadMappings($parammappings); +} + +/** + * Check if a mouse button has been pressed once + */ + function IsMouseButtonPressed(int $parambutton) : bool +{ +global $raylib; +return $raylib->IsMouseButtonPressed($parambutton); +} + +/** + * Check if a mouse button is being pressed + */ + function IsMouseButtonDown(int $parambutton) : bool +{ +global $raylib; +return $raylib->IsMouseButtonDown($parambutton); +} + +/** + * Check if a mouse button has been released once + */ + function IsMouseButtonReleased(int $parambutton) : bool +{ +global $raylib; +return $raylib->IsMouseButtonReleased($parambutton); +} + +/** + * Check if a mouse button is NOT being pressed + */ + function IsMouseButtonUp(int $parambutton) : bool +{ +global $raylib; +return $raylib->IsMouseButtonUp($parambutton); +} + +/** + * Get mouse position X + */ + function GetMouseX() : int +{ +global $raylib; +return $raylib->GetMouseX(); +} + +/** + * Get mouse position Y + */ + function GetMouseY() : int +{ +global $raylib; +return $raylib->GetMouseY(); +} + +/** + * Get mouse position XY + */ + function GetMousePosition() : \Nawarian\Raylib\Generated\Vector2 +{ +global $raylib; +return \Nawarian\Raylib\Generated\Vector2::fromCData($raylib->GetMousePosition()); +} + +/** + * Set mouse position XY + */ + function SetMousePosition(int $paramx, int $paramy) : void +{ +global $raylib; +$raylib->SetMousePosition($paramx, $paramy); +} + +/** + * Set mouse offset + */ + function SetMouseOffset(int $paramoffsetX, int $paramoffsetY) : void +{ +global $raylib; +$raylib->SetMouseOffset($paramoffsetX, $paramoffsetY); +} + +/** + * Set mouse scaling + */ + function SetMouseScale(float $paramscaleX, float $paramscaleY) : void +{ +global $raylib; +$raylib->SetMouseScale($paramscaleX, $paramscaleY); +} + +/** + * Get mouse wheel movement Y + */ + function GetMouseWheelMove() : float +{ +global $raylib; +return $raylib->GetMouseWheelMove(); +} + +/** + * Set mouse cursor + */ + function SetMouseCursor(int $paramcursor) : void +{ +global $raylib; +$raylib->SetMouseCursor($paramcursor); +} + +/** + * Get touch position X for touch point 0 (relative to screen size) + */ + function GetTouchX() : int +{ +global $raylib; +return $raylib->GetTouchX(); +} + +/** + * Get touch position Y for touch point 0 (relative to screen size) + */ + function GetTouchY() : int +{ +global $raylib; +return $raylib->GetTouchY(); +} + +/** + * Get touch position XY for a touch point index (relative to screen size) + */ + function GetTouchPosition(int $paramindex) : \Nawarian\Raylib\Generated\Vector2 +{ +global $raylib; +return \Nawarian\Raylib\Generated\Vector2::fromCData($raylib->GetTouchPosition($paramindex)); +} + +/** + * Enable a set of gestures using flags + */ + function SetGesturesEnabled(int $paramflags) : void +{ +global $raylib; +$raylib->SetGesturesEnabled($paramflags); +} + +/** + * Check if a gesture have been detected + */ + function IsGestureDetected(int $paramgesture) : bool +{ +global $raylib; +return $raylib->IsGestureDetected($paramgesture); +} + +/** + * Get latest detected gesture + */ + function GetGestureDetected() : int +{ +global $raylib; +return $raylib->GetGestureDetected(); +} + +/** + * Get touch points count + */ + function GetTouchPointsCount() : int +{ +global $raylib; +return $raylib->GetTouchPointsCount(); +} + +/** + * Get gesture hold time in milliseconds + */ + function GetGestureHoldDuration() : float +{ +global $raylib; +return $raylib->GetGestureHoldDuration(); +} + +/** + * Get gesture drag vector + */ + function GetGestureDragVector() : \Nawarian\Raylib\Generated\Vector2 +{ +global $raylib; +return \Nawarian\Raylib\Generated\Vector2::fromCData($raylib->GetGestureDragVector()); +} + +/** + * Get gesture drag angle + */ + function GetGestureDragAngle() : float +{ +global $raylib; +return $raylib->GetGestureDragAngle(); +} + +/** + * Get gesture pinch delta + */ + function GetGesturePinchVector() : \Nawarian\Raylib\Generated\Vector2 +{ +global $raylib; +return \Nawarian\Raylib\Generated\Vector2::fromCData($raylib->GetGesturePinchVector()); +} + +/** + * Get gesture pinch angle + */ + function GetGesturePinchAngle() : float +{ +global $raylib; +return $raylib->GetGesturePinchAngle(); +} + +/** + * Set camera mode (multiple camera modes available) + */ + function SetCameraMode(\Nawarian\Raylib\Generated\Camera3D $paramcamera, int $parammode) : void +{ +global $raylib; +$raylib->SetCameraMode($paramcamera->toCData(), $parammode); +} + +/** + * Update camera position for selected mode + */ + function UpdateCamera(\Nawarian\Raylib\Generated\Camera3D $paramcamera) : void +{ +global $raylib; +$raylib->UpdateCamera($paramcamera->toCData()); +} + +/** + * Set camera pan key to combine with mouse movement (free camera) + */ + function SetCameraPanControl(int $paramkeyPan) : void +{ +global $raylib; +$raylib->SetCameraPanControl($paramkeyPan); +} + +/** + * Set camera alt key to combine with mouse movement (free camera) + */ + function SetCameraAltControl(int $paramkeyAlt) : void +{ +global $raylib; +$raylib->SetCameraAltControl($paramkeyAlt); +} + +/** + * Set camera smooth zoom key to combine with mouse (free camera) + */ + function SetCameraSmoothZoomControl(int $paramkeySmoothZoom) : void +{ +global $raylib; +$raylib->SetCameraSmoothZoomControl($paramkeySmoothZoom); +} + +/** + * Set camera move controls (1st person and 3rd person cameras) + */ + function SetCameraMoveControls(int $paramkeyFront, int $paramkeyBack, int $paramkeyRight, int $paramkeyLeft, int $paramkeyUp, int $paramkeyDown) : void +{ +global $raylib; +$raylib->SetCameraMoveControls($paramkeyFront, $paramkeyBack, $paramkeyRight, $paramkeyLeft, $paramkeyUp, $paramkeyDown); +} + +/** + * Set texture and rectangle to be used on shapes drawing + */ + function SetShapesTexture(\Nawarian\Raylib\Generated\Texture $paramtexture, \Nawarian\Raylib\Generated\Rectangle $paramsource) : void +{ +global $raylib; +$raylib->SetShapesTexture($paramtexture->toCData(), $paramsource->toCData()); +} + +/** + * Draw a pixel + */ + function DrawPixel(int $paramposX, int $paramposY, \Nawarian\Raylib\Generated\Color $paramcolor) : void +{ +global $raylib; +$raylib->DrawPixel($paramposX, $paramposY, $paramcolor->toCData()); +} + +/** + * Draw a pixel (Vector version) + */ + function DrawPixelV(\Nawarian\Raylib\Generated\Vector2 $paramposition, \Nawarian\Raylib\Generated\Color $paramcolor) : void +{ +global $raylib; +$raylib->DrawPixelV($paramposition->toCData(), $paramcolor->toCData()); +} + +/** + * Draw a line + */ + function DrawLine(int $paramstartPosX, int $paramstartPosY, int $paramendPosX, int $paramendPosY, \Nawarian\Raylib\Generated\Color $paramcolor) : void +{ +global $raylib; +$raylib->DrawLine($paramstartPosX, $paramstartPosY, $paramendPosX, $paramendPosY, $paramcolor->toCData()); +} + +/** + * Draw a line (Vector version) + */ + function DrawLineV(\Nawarian\Raylib\Generated\Vector2 $paramstartPos, \Nawarian\Raylib\Generated\Vector2 $paramendPos, \Nawarian\Raylib\Generated\Color $paramcolor) : void +{ +global $raylib; +$raylib->DrawLineV($paramstartPos->toCData(), $paramendPos->toCData(), $paramcolor->toCData()); +} + +/** + * Draw a line defining thickness + */ + function DrawLineEx(\Nawarian\Raylib\Generated\Vector2 $paramstartPos, \Nawarian\Raylib\Generated\Vector2 $paramendPos, float $paramthick, \Nawarian\Raylib\Generated\Color $paramcolor) : void +{ +global $raylib; +$raylib->DrawLineEx($paramstartPos->toCData(), $paramendPos->toCData(), $paramthick, $paramcolor->toCData()); +} + +/** + * Draw a line using cubic-bezier curves in-out + */ + function DrawLineBezier(\Nawarian\Raylib\Generated\Vector2 $paramstartPos, \Nawarian\Raylib\Generated\Vector2 $paramendPos, float $paramthick, \Nawarian\Raylib\Generated\Color $paramcolor) : void +{ +global $raylib; +$raylib->DrawLineBezier($paramstartPos->toCData(), $paramendPos->toCData(), $paramthick, $paramcolor->toCData()); +} + +/** + * raw line using quadratic bezier curves with a control point + */ + function DrawLineBezierQuad(\Nawarian\Raylib\Generated\Vector2 $paramstartPos, \Nawarian\Raylib\Generated\Vector2 $paramendPos, \Nawarian\Raylib\Generated\Vector2 $paramcontrolPos, float $paramthick, \Nawarian\Raylib\Generated\Color $paramcolor) : void +{ +global $raylib; +$raylib->DrawLineBezierQuad($paramstartPos->toCData(), $paramendPos->toCData(), $paramcontrolPos->toCData(), $paramthick, $paramcolor->toCData()); +} + +/** + * Draw lines sequence + */ + function DrawLineStrip(\Nawarian\Raylib\Generated\Vector2 $parampoints, int $parampointsCount, \Nawarian\Raylib\Generated\Color $paramcolor) : void +{ +global $raylib; +$raylib->DrawLineStrip($parampoints->toCData(), $parampointsCount, $paramcolor->toCData()); +} + +/** + * Draw a color-filled circle + */ + function DrawCircle(int $paramcenterX, int $paramcenterY, float $paramradius, \Nawarian\Raylib\Generated\Color $paramcolor) : void +{ +global $raylib; +$raylib->DrawCircle($paramcenterX, $paramcenterY, $paramradius, $paramcolor->toCData()); +} + +/** + * Draw a piece of a circle + */ + function DrawCircleSector(\Nawarian\Raylib\Generated\Vector2 $paramcenter, float $paramradius, float $paramstartAngle, float $paramendAngle, int $paramsegments, \Nawarian\Raylib\Generated\Color $paramcolor) : void +{ +global $raylib; +$raylib->DrawCircleSector($paramcenter->toCData(), $paramradius, $paramstartAngle, $paramendAngle, $paramsegments, $paramcolor->toCData()); +} + +/** + * Draw circle sector outline + */ + function DrawCircleSectorLines(\Nawarian\Raylib\Generated\Vector2 $paramcenter, float $paramradius, float $paramstartAngle, float $paramendAngle, int $paramsegments, \Nawarian\Raylib\Generated\Color $paramcolor) : void +{ +global $raylib; +$raylib->DrawCircleSectorLines($paramcenter->toCData(), $paramradius, $paramstartAngle, $paramendAngle, $paramsegments, $paramcolor->toCData()); +} + +/** + * Draw a gradient-filled circle + */ + function DrawCircleGradient(int $paramcenterX, int $paramcenterY, float $paramradius, \Nawarian\Raylib\Generated\Color $paramcolor1, \Nawarian\Raylib\Generated\Color $paramcolor2) : void +{ +global $raylib; +$raylib->DrawCircleGradient($paramcenterX, $paramcenterY, $paramradius, $paramcolor1->toCData(), $paramcolor2->toCData()); +} + +/** + * Draw a color-filled circle (Vector version) + */ + function DrawCircleV(\Nawarian\Raylib\Generated\Vector2 $paramcenter, float $paramradius, \Nawarian\Raylib\Generated\Color $paramcolor) : void +{ +global $raylib; +$raylib->DrawCircleV($paramcenter->toCData(), $paramradius, $paramcolor->toCData()); +} + +/** + * Draw circle outline + */ + function DrawCircleLines(int $paramcenterX, int $paramcenterY, float $paramradius, \Nawarian\Raylib\Generated\Color $paramcolor) : void +{ +global $raylib; +$raylib->DrawCircleLines($paramcenterX, $paramcenterY, $paramradius, $paramcolor->toCData()); +} + +/** + * Draw ellipse + */ + function DrawEllipse(int $paramcenterX, int $paramcenterY, float $paramradiusH, float $paramradiusV, \Nawarian\Raylib\Generated\Color $paramcolor) : void +{ +global $raylib; +$raylib->DrawEllipse($paramcenterX, $paramcenterY, $paramradiusH, $paramradiusV, $paramcolor->toCData()); +} + +/** + * Draw ellipse outline + */ + function DrawEllipseLines(int $paramcenterX, int $paramcenterY, float $paramradiusH, float $paramradiusV, \Nawarian\Raylib\Generated\Color $paramcolor) : void +{ +global $raylib; +$raylib->DrawEllipseLines($paramcenterX, $paramcenterY, $paramradiusH, $paramradiusV, $paramcolor->toCData()); +} + +/** + * Draw ring + */ + function DrawRing(\Nawarian\Raylib\Generated\Vector2 $paramcenter, float $paraminnerRadius, float $paramouterRadius, float $paramstartAngle, float $paramendAngle, int $paramsegments, \Nawarian\Raylib\Generated\Color $paramcolor) : void +{ +global $raylib; +$raylib->DrawRing($paramcenter->toCData(), $paraminnerRadius, $paramouterRadius, $paramstartAngle, $paramendAngle, $paramsegments, $paramcolor->toCData()); +} + +/** + * Draw ring outline + */ + function DrawRingLines(\Nawarian\Raylib\Generated\Vector2 $paramcenter, float $paraminnerRadius, float $paramouterRadius, float $paramstartAngle, float $paramendAngle, int $paramsegments, \Nawarian\Raylib\Generated\Color $paramcolor) : void +{ +global $raylib; +$raylib->DrawRingLines($paramcenter->toCData(), $paraminnerRadius, $paramouterRadius, $paramstartAngle, $paramendAngle, $paramsegments, $paramcolor->toCData()); +} + +/** + * Draw a color-filled rectangle + */ + function DrawRectangle(int $paramposX, int $paramposY, int $paramwidth, int $paramheight, \Nawarian\Raylib\Generated\Color $paramcolor) : void +{ +global $raylib; +$raylib->DrawRectangle($paramposX, $paramposY, $paramwidth, $paramheight, $paramcolor->toCData()); +} + +/** + * Draw a color-filled rectangle (Vector version) + */ + function DrawRectangleV(\Nawarian\Raylib\Generated\Vector2 $paramposition, \Nawarian\Raylib\Generated\Vector2 $paramsize, \Nawarian\Raylib\Generated\Color $paramcolor) : void +{ +global $raylib; +$raylib->DrawRectangleV($paramposition->toCData(), $paramsize->toCData(), $paramcolor->toCData()); +} + +/** + * Draw a color-filled rectangle + */ + function DrawRectangleRec(\Nawarian\Raylib\Generated\Rectangle $paramrec, \Nawarian\Raylib\Generated\Color $paramcolor) : void +{ +global $raylib; +$raylib->DrawRectangleRec($paramrec->toCData(), $paramcolor->toCData()); +} + +/** + * Draw a color-filled rectangle with pro parameters + */ + function DrawRectanglePro(\Nawarian\Raylib\Generated\Rectangle $paramrec, \Nawarian\Raylib\Generated\Vector2 $paramorigin, float $paramrotation, \Nawarian\Raylib\Generated\Color $paramcolor) : void +{ +global $raylib; +$raylib->DrawRectanglePro($paramrec->toCData(), $paramorigin->toCData(), $paramrotation, $paramcolor->toCData()); +} + +/** + * Draw a vertical-gradient-filled rectangle + */ + function DrawRectangleGradientV(int $paramposX, int $paramposY, int $paramwidth, int $paramheight, \Nawarian\Raylib\Generated\Color $paramcolor1, \Nawarian\Raylib\Generated\Color $paramcolor2) : void +{ +global $raylib; +$raylib->DrawRectangleGradientV($paramposX, $paramposY, $paramwidth, $paramheight, $paramcolor1->toCData(), $paramcolor2->toCData()); +} + +/** + * Draw a horizontal-gradient-filled rectangle + */ + function DrawRectangleGradientH(int $paramposX, int $paramposY, int $paramwidth, int $paramheight, \Nawarian\Raylib\Generated\Color $paramcolor1, \Nawarian\Raylib\Generated\Color $paramcolor2) : void +{ +global $raylib; +$raylib->DrawRectangleGradientH($paramposX, $paramposY, $paramwidth, $paramheight, $paramcolor1->toCData(), $paramcolor2->toCData()); +} + +/** + * Draw a gradient-filled rectangle with custom vertex colors + */ + function DrawRectangleGradientEx(\Nawarian\Raylib\Generated\Rectangle $paramrec, \Nawarian\Raylib\Generated\Color $paramcol1, \Nawarian\Raylib\Generated\Color $paramcol2, \Nawarian\Raylib\Generated\Color $paramcol3, \Nawarian\Raylib\Generated\Color $paramcol4) : void +{ +global $raylib; +$raylib->DrawRectangleGradientEx($paramrec->toCData(), $paramcol1->toCData(), $paramcol2->toCData(), $paramcol3->toCData(), $paramcol4->toCData()); +} + +/** + * Draw rectangle outline + */ + function DrawRectangleLines(int $paramposX, int $paramposY, int $paramwidth, int $paramheight, \Nawarian\Raylib\Generated\Color $paramcolor) : void +{ +global $raylib; +$raylib->DrawRectangleLines($paramposX, $paramposY, $paramwidth, $paramheight, $paramcolor->toCData()); +} + +/** + * Draw rectangle outline with extended parameters + */ + function DrawRectangleLinesEx(\Nawarian\Raylib\Generated\Rectangle $paramrec, float $paramlineThick, \Nawarian\Raylib\Generated\Color $paramcolor) : void +{ +global $raylib; +$raylib->DrawRectangleLinesEx($paramrec->toCData(), $paramlineThick, $paramcolor->toCData()); +} + +/** + * Draw rectangle with rounded edges + */ + function DrawRectangleRounded(\Nawarian\Raylib\Generated\Rectangle $paramrec, float $paramroundness, int $paramsegments, \Nawarian\Raylib\Generated\Color $paramcolor) : void +{ +global $raylib; +$raylib->DrawRectangleRounded($paramrec->toCData(), $paramroundness, $paramsegments, $paramcolor->toCData()); +} + +/** + * Draw rectangle with rounded edges outline + */ + function DrawRectangleRoundedLines(\Nawarian\Raylib\Generated\Rectangle $paramrec, float $paramroundness, int $paramsegments, float $paramlineThick, \Nawarian\Raylib\Generated\Color $paramcolor) : void +{ +global $raylib; +$raylib->DrawRectangleRoundedLines($paramrec->toCData(), $paramroundness, $paramsegments, $paramlineThick, $paramcolor->toCData()); +} + +/** + * Draw a color-filled triangle (vertex in counter-clockwise order!) + */ + function DrawTriangle(\Nawarian\Raylib\Generated\Vector2 $paramv1, \Nawarian\Raylib\Generated\Vector2 $paramv2, \Nawarian\Raylib\Generated\Vector2 $paramv3, \Nawarian\Raylib\Generated\Color $paramcolor) : void +{ +global $raylib; +$raylib->DrawTriangle($paramv1->toCData(), $paramv2->toCData(), $paramv3->toCData(), $paramcolor->toCData()); +} + +/** + * Draw triangle outline (vertex in counter-clockwise order!) + */ + function DrawTriangleLines(\Nawarian\Raylib\Generated\Vector2 $paramv1, \Nawarian\Raylib\Generated\Vector2 $paramv2, \Nawarian\Raylib\Generated\Vector2 $paramv3, \Nawarian\Raylib\Generated\Color $paramcolor) : void +{ +global $raylib; +$raylib->DrawTriangleLines($paramv1->toCData(), $paramv2->toCData(), $paramv3->toCData(), $paramcolor->toCData()); +} + +/** + * Draw a triangle fan defined by points (first vertex is the center) + */ + function DrawTriangleFan(\Nawarian\Raylib\Generated\Vector2 $parampoints, int $parampointsCount, \Nawarian\Raylib\Generated\Color $paramcolor) : void +{ +global $raylib; +$raylib->DrawTriangleFan($parampoints->toCData(), $parampointsCount, $paramcolor->toCData()); +} + +/** + * Draw a triangle strip defined by points + */ + function DrawTriangleStrip(\Nawarian\Raylib\Generated\Vector2 $parampoints, int $parampointsCount, \Nawarian\Raylib\Generated\Color $paramcolor) : void +{ +global $raylib; +$raylib->DrawTriangleStrip($parampoints->toCData(), $parampointsCount, $paramcolor->toCData()); +} + +/** + * Draw a regular polygon (Vector version) + */ + function DrawPoly(\Nawarian\Raylib\Generated\Vector2 $paramcenter, int $paramsides, float $paramradius, float $paramrotation, \Nawarian\Raylib\Generated\Color $paramcolor) : void +{ +global $raylib; +$raylib->DrawPoly($paramcenter->toCData(), $paramsides, $paramradius, $paramrotation, $paramcolor->toCData()); +} + +/** + * Draw a polygon outline of n sides + */ + function DrawPolyLines(\Nawarian\Raylib\Generated\Vector2 $paramcenter, int $paramsides, float $paramradius, float $paramrotation, \Nawarian\Raylib\Generated\Color $paramcolor) : void +{ +global $raylib; +$raylib->DrawPolyLines($paramcenter->toCData(), $paramsides, $paramradius, $paramrotation, $paramcolor->toCData()); +} + +/** + * Draw a polygon outline of n sides with extended parameters + */ + function DrawPolyLinesEx(\Nawarian\Raylib\Generated\Vector2 $paramcenter, int $paramsides, float $paramradius, float $paramrotation, float $paramlineThick, \Nawarian\Raylib\Generated\Color $paramcolor) : void +{ +global $raylib; +$raylib->DrawPolyLinesEx($paramcenter->toCData(), $paramsides, $paramradius, $paramrotation, $paramlineThick, $paramcolor->toCData()); +} + +/** + * Check collision between two rectangles + */ + function CheckCollisionRecs(\Nawarian\Raylib\Generated\Rectangle $paramrec1, \Nawarian\Raylib\Generated\Rectangle $paramrec2) : bool +{ +global $raylib; +return $raylib->CheckCollisionRecs($paramrec1->toCData(), $paramrec2->toCData()); +} + +/** + * Check collision between two circles + */ + function CheckCollisionCircles(\Nawarian\Raylib\Generated\Vector2 $paramcenter1, float $paramradius1, \Nawarian\Raylib\Generated\Vector2 $paramcenter2, float $paramradius2) : bool +{ +global $raylib; +return $raylib->CheckCollisionCircles($paramcenter1->toCData(), $paramradius1, $paramcenter2->toCData(), $paramradius2); +} + +/** + * Check collision between circle and rectangle + */ + function CheckCollisionCircleRec(\Nawarian\Raylib\Generated\Vector2 $paramcenter, float $paramradius, \Nawarian\Raylib\Generated\Rectangle $paramrec) : bool +{ +global $raylib; +return $raylib->CheckCollisionCircleRec($paramcenter->toCData(), $paramradius, $paramrec->toCData()); +} + +/** + * Check if point is inside rectangle + */ + function CheckCollisionPointRec(\Nawarian\Raylib\Generated\Vector2 $parampoint, \Nawarian\Raylib\Generated\Rectangle $paramrec) : bool +{ +global $raylib; +return $raylib->CheckCollisionPointRec($parampoint->toCData(), $paramrec->toCData()); +} + +/** + * Check if point is inside circle + */ + function CheckCollisionPointCircle(\Nawarian\Raylib\Generated\Vector2 $parampoint, \Nawarian\Raylib\Generated\Vector2 $paramcenter, float $paramradius) : bool +{ +global $raylib; +return $raylib->CheckCollisionPointCircle($parampoint->toCData(), $paramcenter->toCData(), $paramradius); +} + +/** + * Check if point is inside a triangle + */ + function CheckCollisionPointTriangle(\Nawarian\Raylib\Generated\Vector2 $parampoint, \Nawarian\Raylib\Generated\Vector2 $paramp1, \Nawarian\Raylib\Generated\Vector2 $paramp2, \Nawarian\Raylib\Generated\Vector2 $paramp3) : bool +{ +global $raylib; +return $raylib->CheckCollisionPointTriangle($parampoint->toCData(), $paramp1->toCData(), $paramp2->toCData(), $paramp3->toCData()); +} + +/** + * Check the collision between two lines defined by two points each, returns + * collision point by reference + */ + function CheckCollisionLines(\Nawarian\Raylib\Generated\Vector2 $paramstartPos1, \Nawarian\Raylib\Generated\Vector2 $paramendPos1, \Nawarian\Raylib\Generated\Vector2 $paramstartPos2, \Nawarian\Raylib\Generated\Vector2 $paramendPos2, \Nawarian\Raylib\Generated\Vector2 $paramcollisionPoint) : bool +{ +global $raylib; +return $raylib->CheckCollisionLines($paramstartPos1->toCData(), $paramendPos1->toCData(), $paramstartPos2->toCData(), $paramendPos2->toCData(), $paramcollisionPoint->toCData()); +} + +/** + * Get collision rectangle for two rectangles collision + */ + function GetCollisionRec(\Nawarian\Raylib\Generated\Rectangle $paramrec1, \Nawarian\Raylib\Generated\Rectangle $paramrec2) : \Nawarian\Raylib\Generated\Rectangle +{ +global $raylib; +return \Nawarian\Raylib\Generated\Rectangle::fromCData($raylib->GetCollisionRec($paramrec1->toCData(), $paramrec2->toCData())); +} + +/** + * Load image from file into CPU memory (RAM) + */ + function LoadImage(string $paramfileName) : \Nawarian\Raylib\Generated\Image +{ +global $raylib; +return \Nawarian\Raylib\Generated\Image::fromCData($raylib->LoadImage($paramfileName)); +} + +/** + * Load image from RAW file data + */ + function LoadImageRaw(string $paramfileName, int $paramwidth, int $paramheight, int $paramformat, int $paramheaderSize) : \Nawarian\Raylib\Generated\Image +{ +global $raylib; +return \Nawarian\Raylib\Generated\Image::fromCData($raylib->LoadImageRaw($paramfileName, $paramwidth, $paramheight, $paramformat, $paramheaderSize)); +} + +/** + * Load image sequence from file (frames appended to image.data) + */ + function LoadImageAnim(string $paramfileName, array $paramframes) : \Nawarian\Raylib\Generated\Image +{ +global $raylib; +return \Nawarian\Raylib\Generated\Image::fromCData($raylib->LoadImageAnim($paramfileName, $paramframes)); +} + +/** + * Load image from memory buffer, fileType refers to extension: i.e. '.png' + */ + function LoadImageFromMemory(string $paramfileType, array $paramfileData, int $paramdataSize) : \Nawarian\Raylib\Generated\Image +{ +global $raylib; +return \Nawarian\Raylib\Generated\Image::fromCData($raylib->LoadImageFromMemory($paramfileType, $paramfileData, $paramdataSize)); +} + +/** + * Unload image from CPU memory (RAM) + */ + function UnloadImage(\Nawarian\Raylib\Generated\Image $paramimage) : void +{ +global $raylib; +$raylib->UnloadImage($paramimage->toCData()); +} + +/** + * Export image data to file, returns true on success + */ + function ExportImage(\Nawarian\Raylib\Generated\Image $paramimage, string $paramfileName) : bool +{ +global $raylib; +return $raylib->ExportImage($paramimage->toCData(), $paramfileName); +} + +/** + * Export image as code file defining an array of bytes, returns true on success + */ + function ExportImageAsCode(\Nawarian\Raylib\Generated\Image $paramimage, string $paramfileName) : bool +{ +global $raylib; +return $raylib->ExportImageAsCode($paramimage->toCData(), $paramfileName); +} + +/** + * Generate image: plain color + */ + function GenImageColor(int $paramwidth, int $paramheight, \Nawarian\Raylib\Generated\Color $paramcolor) : \Nawarian\Raylib\Generated\Image +{ +global $raylib; +return \Nawarian\Raylib\Generated\Image::fromCData($raylib->GenImageColor($paramwidth, $paramheight, $paramcolor->toCData())); +} + +/** + * Generate image: vertical gradient + */ + function GenImageGradientV(int $paramwidth, int $paramheight, \Nawarian\Raylib\Generated\Color $paramtop, \Nawarian\Raylib\Generated\Color $parambottom) : \Nawarian\Raylib\Generated\Image +{ +global $raylib; +return \Nawarian\Raylib\Generated\Image::fromCData($raylib->GenImageGradientV($paramwidth, $paramheight, $paramtop->toCData(), $parambottom->toCData())); +} + +/** + * Generate image: horizontal gradient + */ + function GenImageGradientH(int $paramwidth, int $paramheight, \Nawarian\Raylib\Generated\Color $paramleft, \Nawarian\Raylib\Generated\Color $paramright) : \Nawarian\Raylib\Generated\Image +{ +global $raylib; +return \Nawarian\Raylib\Generated\Image::fromCData($raylib->GenImageGradientH($paramwidth, $paramheight, $paramleft->toCData(), $paramright->toCData())); +} + +/** + * Generate image: radial gradient + */ + function GenImageGradientRadial(int $paramwidth, int $paramheight, float $paramdensity, \Nawarian\Raylib\Generated\Color $paraminner, \Nawarian\Raylib\Generated\Color $paramouter) : \Nawarian\Raylib\Generated\Image +{ +global $raylib; +return \Nawarian\Raylib\Generated\Image::fromCData($raylib->GenImageGradientRadial($paramwidth, $paramheight, $paramdensity, $paraminner->toCData(), $paramouter->toCData())); +} + +/** + * Generate image: checked + */ + function GenImageChecked(int $paramwidth, int $paramheight, int $paramchecksX, int $paramchecksY, \Nawarian\Raylib\Generated\Color $paramcol1, \Nawarian\Raylib\Generated\Color $paramcol2) : \Nawarian\Raylib\Generated\Image +{ +global $raylib; +return \Nawarian\Raylib\Generated\Image::fromCData($raylib->GenImageChecked($paramwidth, $paramheight, $paramchecksX, $paramchecksY, $paramcol1->toCData(), $paramcol2->toCData())); +} + +/** + * Generate image: white noise + */ + function GenImageWhiteNoise(int $paramwidth, int $paramheight, float $paramfactor) : \Nawarian\Raylib\Generated\Image +{ +global $raylib; +return \Nawarian\Raylib\Generated\Image::fromCData($raylib->GenImageWhiteNoise($paramwidth, $paramheight, $paramfactor)); +} + +/** + * Generate image: perlin noise + */ + function GenImagePerlinNoise(int $paramwidth, int $paramheight, int $paramoffsetX, int $paramoffsetY, float $paramscale) : \Nawarian\Raylib\Generated\Image +{ +global $raylib; +return \Nawarian\Raylib\Generated\Image::fromCData($raylib->GenImagePerlinNoise($paramwidth, $paramheight, $paramoffsetX, $paramoffsetY, $paramscale)); +} + +/** + * Generate image: cellular algorithm. Bigger tileSize means bigger cells + */ + function GenImageCellular(int $paramwidth, int $paramheight, int $paramtileSize) : \Nawarian\Raylib\Generated\Image +{ +global $raylib; +return \Nawarian\Raylib\Generated\Image::fromCData($raylib->GenImageCellular($paramwidth, $paramheight, $paramtileSize)); +} + +/** + * Create an image duplicate (useful for transformations) + */ + function ImageCopy(\Nawarian\Raylib\Generated\Image $paramimage) : \Nawarian\Raylib\Generated\Image +{ +global $raylib; +return \Nawarian\Raylib\Generated\Image::fromCData($raylib->ImageCopy($paramimage->toCData())); +} + +/** + * Create an image from another image piece + */ + function ImageFromImage(\Nawarian\Raylib\Generated\Image $paramimage, \Nawarian\Raylib\Generated\Rectangle $paramrec) : \Nawarian\Raylib\Generated\Image +{ +global $raylib; +return \Nawarian\Raylib\Generated\Image::fromCData($raylib->ImageFromImage($paramimage->toCData(), $paramrec->toCData())); +} + +/** + * Create an image from text (default font) + */ + function ImageText(string $paramtext, int $paramfontSize, \Nawarian\Raylib\Generated\Color $paramcolor) : \Nawarian\Raylib\Generated\Image +{ +global $raylib; +return \Nawarian\Raylib\Generated\Image::fromCData($raylib->ImageText($paramtext, $paramfontSize, $paramcolor->toCData())); +} + +/** + * Create an image from text (custom sprite font) + */ + function ImageTextEx(\Nawarian\Raylib\Generated\Font $paramfont, string $paramtext, float $paramfontSize, float $paramspacing, \Nawarian\Raylib\Generated\Color $paramtint) : \Nawarian\Raylib\Generated\Image +{ +global $raylib; +return \Nawarian\Raylib\Generated\Image::fromCData($raylib->ImageTextEx($paramfont->toCData(), $paramtext, $paramfontSize, $paramspacing, $paramtint->toCData())); +} + +/** + * Convert image data to desired format + */ + function ImageFormat(\Nawarian\Raylib\Generated\Image $paramimage, int $paramnewFormat) : void +{ +global $raylib; +$raylib->ImageFormat($paramimage->toCData(), $paramnewFormat); +} + +/** + * Convert image to POT (power-of-two) + */ + function ImageToPOT(\Nawarian\Raylib\Generated\Image $paramimage, \Nawarian\Raylib\Generated\Color $paramfill) : void +{ +global $raylib; +$raylib->ImageToPOT($paramimage->toCData(), $paramfill->toCData()); +} + +/** + * Crop an image to a defined rectangle + */ + function ImageCrop(\Nawarian\Raylib\Generated\Image $paramimage, \Nawarian\Raylib\Generated\Rectangle $paramcrop) : void +{ +global $raylib; +$raylib->ImageCrop($paramimage->toCData(), $paramcrop->toCData()); +} + +/** + * Crop image depending on alpha value + */ + function ImageAlphaCrop(\Nawarian\Raylib\Generated\Image $paramimage, float $paramthreshold) : void +{ +global $raylib; +$raylib->ImageAlphaCrop($paramimage->toCData(), $paramthreshold); +} + +/** + * Clear alpha channel to desired color + */ + function ImageAlphaClear(\Nawarian\Raylib\Generated\Image $paramimage, \Nawarian\Raylib\Generated\Color $paramcolor, float $paramthreshold) : void +{ +global $raylib; +$raylib->ImageAlphaClear($paramimage->toCData(), $paramcolor->toCData(), $paramthreshold); +} + +/** + * Apply alpha mask to image + */ + function ImageAlphaMask(\Nawarian\Raylib\Generated\Image $paramimage, \Nawarian\Raylib\Generated\Image $paramalphaMask) : void +{ +global $raylib; +$raylib->ImageAlphaMask($paramimage->toCData(), $paramalphaMask->toCData()); +} + +/** + * Premultiply alpha channel + */ + function ImageAlphaPremultiply(\Nawarian\Raylib\Generated\Image $paramimage) : void +{ +global $raylib; +$raylib->ImageAlphaPremultiply($paramimage->toCData()); +} + +/** + * Resize image (Bicubic scaling algorithm) + */ + function ImageResize(\Nawarian\Raylib\Generated\Image $paramimage, int $paramnewWidth, int $paramnewHeight) : void +{ +global $raylib; +$raylib->ImageResize($paramimage->toCData(), $paramnewWidth, $paramnewHeight); +} + +/** + * Resize image (Nearest-Neighbor scaling algorithm) + */ + function ImageResizeNN(\Nawarian\Raylib\Generated\Image $paramimage, int $paramnewWidth, int $paramnewHeight) : void +{ +global $raylib; +$raylib->ImageResizeNN($paramimage->toCData(), $paramnewWidth, $paramnewHeight); +} + +/** + * Resize canvas and fill with color + */ + function ImageResizeCanvas(\Nawarian\Raylib\Generated\Image $paramimage, int $paramnewWidth, int $paramnewHeight, int $paramoffsetX, int $paramoffsetY, \Nawarian\Raylib\Generated\Color $paramfill) : void +{ +global $raylib; +$raylib->ImageResizeCanvas($paramimage->toCData(), $paramnewWidth, $paramnewHeight, $paramoffsetX, $paramoffsetY, $paramfill->toCData()); +} + +/** + * Compute all mipmap levels for a provided image + */ + function ImageMipmaps(\Nawarian\Raylib\Generated\Image $paramimage) : void +{ +global $raylib; +$raylib->ImageMipmaps($paramimage->toCData()); +} + +/** + * Dither image data to 16bpp or lower (Floyd-Steinberg dithering) + */ + function ImageDither(\Nawarian\Raylib\Generated\Image $paramimage, int $paramrBpp, int $paramgBpp, int $parambBpp, int $paramaBpp) : void +{ +global $raylib; +$raylib->ImageDither($paramimage->toCData(), $paramrBpp, $paramgBpp, $parambBpp, $paramaBpp); +} + +/** + * Flip image vertically + */ + function ImageFlipVertical(\Nawarian\Raylib\Generated\Image $paramimage) : void +{ +global $raylib; +$raylib->ImageFlipVertical($paramimage->toCData()); +} + +/** + * Flip image horizontally + */ + function ImageFlipHorizontal(\Nawarian\Raylib\Generated\Image $paramimage) : void +{ +global $raylib; +$raylib->ImageFlipHorizontal($paramimage->toCData()); +} + +/** + * Rotate image clockwise 90deg + */ + function ImageRotateCW(\Nawarian\Raylib\Generated\Image $paramimage) : void +{ +global $raylib; +$raylib->ImageRotateCW($paramimage->toCData()); +} + +/** + * Rotate image counter-clockwise 90deg + */ + function ImageRotateCCW(\Nawarian\Raylib\Generated\Image $paramimage) : void +{ +global $raylib; +$raylib->ImageRotateCCW($paramimage->toCData()); +} + +/** + * Modify image color: tint + */ + function ImageColorTint(\Nawarian\Raylib\Generated\Image $paramimage, \Nawarian\Raylib\Generated\Color $paramcolor) : void +{ +global $raylib; +$raylib->ImageColorTint($paramimage->toCData(), $paramcolor->toCData()); +} + +/** + * Modify image color: invert + */ + function ImageColorInvert(\Nawarian\Raylib\Generated\Image $paramimage) : void +{ +global $raylib; +$raylib->ImageColorInvert($paramimage->toCData()); +} + +/** + * Modify image color: grayscale + */ + function ImageColorGrayscale(\Nawarian\Raylib\Generated\Image $paramimage) : void +{ +global $raylib; +$raylib->ImageColorGrayscale($paramimage->toCData()); +} + +/** + * Modify image color: contrast (-100 to 100) + */ + function ImageColorContrast(\Nawarian\Raylib\Generated\Image $paramimage, float $paramcontrast) : void +{ +global $raylib; +$raylib->ImageColorContrast($paramimage->toCData(), $paramcontrast); +} + +/** + * Modify image color: brightness (-255 to 255) + */ + function ImageColorBrightness(\Nawarian\Raylib\Generated\Image $paramimage, int $parambrightness) : void +{ +global $raylib; +$raylib->ImageColorBrightness($paramimage->toCData(), $parambrightness); +} + +/** + * Modify image color: replace color + */ + function ImageColorReplace(\Nawarian\Raylib\Generated\Image $paramimage, \Nawarian\Raylib\Generated\Color $paramcolor, \Nawarian\Raylib\Generated\Color $paramreplace) : void +{ +global $raylib; +$raylib->ImageColorReplace($paramimage->toCData(), $paramcolor->toCData(), $paramreplace->toCData()); +} + +/** + * Load color data from image as a Color array (RGBA - 32bit) + */ + function LoadImageColors(\Nawarian\Raylib\Generated\Image $paramimage) : \Nawarian\Raylib\Generated\Color +{ +global $raylib; +return \Nawarian\Raylib\Generated\Color::fromCData($raylib->LoadImageColors($paramimage->toCData())); +} + +/** + * Load colors palette from image as a Color array (RGBA - 32bit) + */ + function LoadImagePalette(\Nawarian\Raylib\Generated\Image $paramimage, int $parammaxPaletteSize, array $paramcolorsCount) : \Nawarian\Raylib\Generated\Color +{ +global $raylib; +return \Nawarian\Raylib\Generated\Color::fromCData($raylib->LoadImagePalette($paramimage->toCData(), $parammaxPaletteSize, $paramcolorsCount)); +} + +/** + * Unload color data loaded with LoadImageColors() + */ + function UnloadImageColors(\Nawarian\Raylib\Generated\Color $paramcolors) : void +{ +global $raylib; +$raylib->UnloadImageColors($paramcolors->toCData()); +} + +/** + * Unload colors palette loaded with LoadImagePalette() + */ + function UnloadImagePalette(\Nawarian\Raylib\Generated\Color $paramcolors) : void +{ +global $raylib; +$raylib->UnloadImagePalette($paramcolors->toCData()); +} + +/** + * Get image alpha border rectangle + */ + function GetImageAlphaBorder(\Nawarian\Raylib\Generated\Image $paramimage, float $paramthreshold) : \Nawarian\Raylib\Generated\Rectangle +{ +global $raylib; +return \Nawarian\Raylib\Generated\Rectangle::fromCData($raylib->GetImageAlphaBorder($paramimage->toCData(), $paramthreshold)); +} + +/** + * Clear image background with given color + */ + function ImageClearBackground(\Nawarian\Raylib\Generated\Image $paramdst, \Nawarian\Raylib\Generated\Color $paramcolor) : void +{ +global $raylib; +$raylib->ImageClearBackground($paramdst->toCData(), $paramcolor->toCData()); +} + +/** + * Draw pixel within an image + */ + function ImageDrawPixel(\Nawarian\Raylib\Generated\Image $paramdst, int $paramposX, int $paramposY, \Nawarian\Raylib\Generated\Color $paramcolor) : void +{ +global $raylib; +$raylib->ImageDrawPixel($paramdst->toCData(), $paramposX, $paramposY, $paramcolor->toCData()); +} + +/** + * Draw pixel within an image (Vector version) + */ + function ImageDrawPixelV(\Nawarian\Raylib\Generated\Image $paramdst, \Nawarian\Raylib\Generated\Vector2 $paramposition, \Nawarian\Raylib\Generated\Color $paramcolor) : void +{ +global $raylib; +$raylib->ImageDrawPixelV($paramdst->toCData(), $paramposition->toCData(), $paramcolor->toCData()); +} + +/** + * Draw line within an image + */ + function ImageDrawLine(\Nawarian\Raylib\Generated\Image $paramdst, int $paramstartPosX, int $paramstartPosY, int $paramendPosX, int $paramendPosY, \Nawarian\Raylib\Generated\Color $paramcolor) : void +{ +global $raylib; +$raylib->ImageDrawLine($paramdst->toCData(), $paramstartPosX, $paramstartPosY, $paramendPosX, $paramendPosY, $paramcolor->toCData()); +} + +/** + * Draw line within an image (Vector version) + */ + function ImageDrawLineV(\Nawarian\Raylib\Generated\Image $paramdst, \Nawarian\Raylib\Generated\Vector2 $paramstart, \Nawarian\Raylib\Generated\Vector2 $paramend, \Nawarian\Raylib\Generated\Color $paramcolor) : void +{ +global $raylib; +$raylib->ImageDrawLineV($paramdst->toCData(), $paramstart->toCData(), $paramend->toCData(), $paramcolor->toCData()); +} + +/** + * Draw circle within an image + */ + function ImageDrawCircle(\Nawarian\Raylib\Generated\Image $paramdst, int $paramcenterX, int $paramcenterY, int $paramradius, \Nawarian\Raylib\Generated\Color $paramcolor) : void +{ +global $raylib; +$raylib->ImageDrawCircle($paramdst->toCData(), $paramcenterX, $paramcenterY, $paramradius, $paramcolor->toCData()); +} + +/** + * Draw circle within an image (Vector version) + */ + function ImageDrawCircleV(\Nawarian\Raylib\Generated\Image $paramdst, \Nawarian\Raylib\Generated\Vector2 $paramcenter, int $paramradius, \Nawarian\Raylib\Generated\Color $paramcolor) : void +{ +global $raylib; +$raylib->ImageDrawCircleV($paramdst->toCData(), $paramcenter->toCData(), $paramradius, $paramcolor->toCData()); +} + +/** + * Draw rectangle within an image + */ + function ImageDrawRectangle(\Nawarian\Raylib\Generated\Image $paramdst, int $paramposX, int $paramposY, int $paramwidth, int $paramheight, \Nawarian\Raylib\Generated\Color $paramcolor) : void +{ +global $raylib; +$raylib->ImageDrawRectangle($paramdst->toCData(), $paramposX, $paramposY, $paramwidth, $paramheight, $paramcolor->toCData()); +} + +/** + * Draw rectangle within an image (Vector version) + */ + function ImageDrawRectangleV(\Nawarian\Raylib\Generated\Image $paramdst, \Nawarian\Raylib\Generated\Vector2 $paramposition, \Nawarian\Raylib\Generated\Vector2 $paramsize, \Nawarian\Raylib\Generated\Color $paramcolor) : void +{ +global $raylib; +$raylib->ImageDrawRectangleV($paramdst->toCData(), $paramposition->toCData(), $paramsize->toCData(), $paramcolor->toCData()); +} + +/** + * Draw rectangle within an image + */ + function ImageDrawRectangleRec(\Nawarian\Raylib\Generated\Image $paramdst, \Nawarian\Raylib\Generated\Rectangle $paramrec, \Nawarian\Raylib\Generated\Color $paramcolor) : void +{ +global $raylib; +$raylib->ImageDrawRectangleRec($paramdst->toCData(), $paramrec->toCData(), $paramcolor->toCData()); +} + +/** + * Draw rectangle lines within an image + */ + function ImageDrawRectangleLines(\Nawarian\Raylib\Generated\Image $paramdst, \Nawarian\Raylib\Generated\Rectangle $paramrec, int $paramthick, \Nawarian\Raylib\Generated\Color $paramcolor) : void +{ +global $raylib; +$raylib->ImageDrawRectangleLines($paramdst->toCData(), $paramrec->toCData(), $paramthick, $paramcolor->toCData()); +} + +/** + * Draw a source image within a destination image (tint applied to source) + */ + function ImageDraw(\Nawarian\Raylib\Generated\Image $paramdst, \Nawarian\Raylib\Generated\Image $paramsrc, \Nawarian\Raylib\Generated\Rectangle $paramsrcRec, \Nawarian\Raylib\Generated\Rectangle $paramdstRec, \Nawarian\Raylib\Generated\Color $paramtint) : void +{ +global $raylib; +$raylib->ImageDraw($paramdst->toCData(), $paramsrc->toCData(), $paramsrcRec->toCData(), $paramdstRec->toCData(), $paramtint->toCData()); +} + +/** + * Draw text (using default font) within an image (destination) + */ + function ImageDrawText(\Nawarian\Raylib\Generated\Image $paramdst, string $paramtext, int $paramposX, int $paramposY, int $paramfontSize, \Nawarian\Raylib\Generated\Color $paramcolor) : void +{ +global $raylib; +$raylib->ImageDrawText($paramdst->toCData(), $paramtext, $paramposX, $paramposY, $paramfontSize, $paramcolor->toCData()); +} + +/** + * Draw text (custom sprite font) within an image (destination) + */ + function ImageDrawTextEx(\Nawarian\Raylib\Generated\Image $paramdst, \Nawarian\Raylib\Generated\Font $paramfont, string $paramtext, \Nawarian\Raylib\Generated\Vector2 $paramposition, float $paramfontSize, float $paramspacing, \Nawarian\Raylib\Generated\Color $paramtint) : void +{ +global $raylib; +$raylib->ImageDrawTextEx($paramdst->toCData(), $paramfont->toCData(), $paramtext, $paramposition->toCData(), $paramfontSize, $paramspacing, $paramtint->toCData()); +} + +/** + * Load texture from file into GPU memory (VRAM) + */ + function LoadTexture(string $paramfileName) : \Nawarian\Raylib\Generated\Texture +{ +global $raylib; +return \Nawarian\Raylib\Generated\Texture::fromCData($raylib->LoadTexture($paramfileName)); +} + +/** + * Load texture from image data + */ + function LoadTextureFromImage(\Nawarian\Raylib\Generated\Image $paramimage) : \Nawarian\Raylib\Generated\Texture +{ +global $raylib; +return \Nawarian\Raylib\Generated\Texture::fromCData($raylib->LoadTextureFromImage($paramimage->toCData())); +} + +/** + * Load cubemap from image, multiple image cubemap layouts supported + */ + function LoadTextureCubemap(\Nawarian\Raylib\Generated\Image $paramimage, int $paramlayout) : \Nawarian\Raylib\Generated\Texture +{ +global $raylib; +return \Nawarian\Raylib\Generated\Texture::fromCData($raylib->LoadTextureCubemap($paramimage->toCData(), $paramlayout)); +} + +/** + * Load texture for rendering (framebuffer) + */ + function LoadRenderTexture(int $paramwidth, int $paramheight) : \Nawarian\Raylib\Generated\RenderTexture +{ +global $raylib; +return \Nawarian\Raylib\Generated\RenderTexture::fromCData($raylib->LoadRenderTexture($paramwidth, $paramheight)); +} + +/** + * Unload texture from GPU memory (VRAM) + */ + function UnloadTexture(\Nawarian\Raylib\Generated\Texture $paramtexture) : void +{ +global $raylib; +$raylib->UnloadTexture($paramtexture->toCData()); +} + +/** + * Unload render texture from GPU memory (VRAM) + */ + function UnloadRenderTexture(\Nawarian\Raylib\Generated\RenderTexture $paramtarget) : void +{ +global $raylib; +$raylib->UnloadRenderTexture($paramtarget->toCData()); +} + +/** + * Update GPU texture with new data + */ + function UpdateTexture(\Nawarian\Raylib\Generated\Texture $paramtexture, \FFI\CData $parampixels) : void +{ +global $raylib; +$raylib->UpdateTexture($paramtexture->toCData(), $parampixels); +} + +/** + * Update GPU texture rectangle with new data + */ + function UpdateTextureRec(\Nawarian\Raylib\Generated\Texture $paramtexture, \Nawarian\Raylib\Generated\Rectangle $paramrec, \FFI\CData $parampixels) : void +{ +global $raylib; +$raylib->UpdateTextureRec($paramtexture->toCData(), $paramrec->toCData(), $parampixels); +} + +/** + * Get pixel data from GPU texture and return an Image + */ + function GetTextureData(\Nawarian\Raylib\Generated\Texture $paramtexture) : \Nawarian\Raylib\Generated\Image +{ +global $raylib; +return \Nawarian\Raylib\Generated\Image::fromCData($raylib->GetTextureData($paramtexture->toCData())); +} + +/** + * Get pixel data from screen buffer and return an Image (screenshot) + */ + function GetScreenData() : \Nawarian\Raylib\Generated\Image +{ +global $raylib; +return \Nawarian\Raylib\Generated\Image::fromCData($raylib->GetScreenData()); +} + +/** + * Generate GPU mipmaps for a texture + */ + function GenTextureMipmaps(\Nawarian\Raylib\Generated\Texture $paramtexture) : void +{ +global $raylib; +$raylib->GenTextureMipmaps($paramtexture->toCData()); +} + +/** + * Set texture scaling filter mode + */ + function SetTextureFilter(\Nawarian\Raylib\Generated\Texture $paramtexture, int $paramfilter) : void +{ +global $raylib; +$raylib->SetTextureFilter($paramtexture->toCData(), $paramfilter); +} + +/** + * Set texture wrapping mode + */ + function SetTextureWrap(\Nawarian\Raylib\Generated\Texture $paramtexture, int $paramwrap) : void +{ +global $raylib; +$raylib->SetTextureWrap($paramtexture->toCData(), $paramwrap); +} + +/** + * Draw a Texture2D + */ + function DrawTexture(\Nawarian\Raylib\Generated\Texture $paramtexture, int $paramposX, int $paramposY, \Nawarian\Raylib\Generated\Color $paramtint) : void +{ +global $raylib; +$raylib->DrawTexture($paramtexture->toCData(), $paramposX, $paramposY, $paramtint->toCData()); +} + +/** + * Draw a Texture2D with position defined as Vector2 + */ + function DrawTextureV(\Nawarian\Raylib\Generated\Texture $paramtexture, \Nawarian\Raylib\Generated\Vector2 $paramposition, \Nawarian\Raylib\Generated\Color $paramtint) : void +{ +global $raylib; +$raylib->DrawTextureV($paramtexture->toCData(), $paramposition->toCData(), $paramtint->toCData()); +} + +/** + * Draw a Texture2D with extended parameters + */ + function DrawTextureEx(\Nawarian\Raylib\Generated\Texture $paramtexture, \Nawarian\Raylib\Generated\Vector2 $paramposition, float $paramrotation, float $paramscale, \Nawarian\Raylib\Generated\Color $paramtint) : void +{ +global $raylib; +$raylib->DrawTextureEx($paramtexture->toCData(), $paramposition->toCData(), $paramrotation, $paramscale, $paramtint->toCData()); +} + +/** + * Draw a part of a texture defined by a rectangle + */ + function DrawTextureRec(\Nawarian\Raylib\Generated\Texture $paramtexture, \Nawarian\Raylib\Generated\Rectangle $paramsource, \Nawarian\Raylib\Generated\Vector2 $paramposition, \Nawarian\Raylib\Generated\Color $paramtint) : void +{ +global $raylib; +$raylib->DrawTextureRec($paramtexture->toCData(), $paramsource->toCData(), $paramposition->toCData(), $paramtint->toCData()); +} + +/** + * Draw texture quad with tiling and offset parameters + */ + function DrawTextureQuad(\Nawarian\Raylib\Generated\Texture $paramtexture, \Nawarian\Raylib\Generated\Vector2 $paramtiling, \Nawarian\Raylib\Generated\Vector2 $paramoffset, \Nawarian\Raylib\Generated\Rectangle $paramquad, \Nawarian\Raylib\Generated\Color $paramtint) : void +{ +global $raylib; +$raylib->DrawTextureQuad($paramtexture->toCData(), $paramtiling->toCData(), $paramoffset->toCData(), $paramquad->toCData(), $paramtint->toCData()); +} + +/** + * Draw part of a texture (defined by a rectangle) with rotation and scale tiled + * into dest. + */ + function DrawTextureTiled(\Nawarian\Raylib\Generated\Texture $paramtexture, \Nawarian\Raylib\Generated\Rectangle $paramsource, \Nawarian\Raylib\Generated\Rectangle $paramdest, \Nawarian\Raylib\Generated\Vector2 $paramorigin, float $paramrotation, float $paramscale, \Nawarian\Raylib\Generated\Color $paramtint) : void +{ +global $raylib; +$raylib->DrawTextureTiled($paramtexture->toCData(), $paramsource->toCData(), $paramdest->toCData(), $paramorigin->toCData(), $paramrotation, $paramscale, $paramtint->toCData()); +} + +/** + * Draw a part of a texture defined by a rectangle with 'pro' parameters + */ + function DrawTexturePro(\Nawarian\Raylib\Generated\Texture $paramtexture, \Nawarian\Raylib\Generated\Rectangle $paramsource, \Nawarian\Raylib\Generated\Rectangle $paramdest, \Nawarian\Raylib\Generated\Vector2 $paramorigin, float $paramrotation, \Nawarian\Raylib\Generated\Color $paramtint) : void +{ +global $raylib; +$raylib->DrawTexturePro($paramtexture->toCData(), $paramsource->toCData(), $paramdest->toCData(), $paramorigin->toCData(), $paramrotation, $paramtint->toCData()); +} + +/** + * Draws a texture (or part of it) that stretches or shrinks nicely + */ + function DrawTextureNPatch(\Nawarian\Raylib\Generated\Texture $paramtexture, \Nawarian\Raylib\Generated\NPatchInfo $paramnPatchInfo, \Nawarian\Raylib\Generated\Rectangle $paramdest, \Nawarian\Raylib\Generated\Vector2 $paramorigin, float $paramrotation, \Nawarian\Raylib\Generated\Color $paramtint) : void +{ +global $raylib; +$raylib->DrawTextureNPatch($paramtexture->toCData(), $paramnPatchInfo->toCData(), $paramdest->toCData(), $paramorigin->toCData(), $paramrotation, $paramtint->toCData()); +} + +/** + * Draw a textured polygon + */ + function DrawTexturePoly(\Nawarian\Raylib\Generated\Texture $paramtexture, \Nawarian\Raylib\Generated\Vector2 $paramcenter, \Nawarian\Raylib\Generated\Vector2 $parampoints, \Nawarian\Raylib\Generated\Vector2 $paramtexcoords, int $parampointsCount, \Nawarian\Raylib\Generated\Color $paramtint) : void +{ +global $raylib; +$raylib->DrawTexturePoly($paramtexture->toCData(), $paramcenter->toCData(), $parampoints->toCData(), $paramtexcoords->toCData(), $parampointsCount, $paramtint->toCData()); +} + +/** + * Get color with alpha applied, alpha goes from 0.0f to 1.0f + */ + function Fade(\Nawarian\Raylib\Generated\Color $paramcolor, float $paramalpha) : \Nawarian\Raylib\Generated\Color +{ +global $raylib; +return \Nawarian\Raylib\Generated\Color::fromCData($raylib->Fade($paramcolor->toCData(), $paramalpha)); +} + +/** + * Get hexadecimal value for a Color + */ + function ColorToInt(\Nawarian\Raylib\Generated\Color $paramcolor) : int +{ +global $raylib; +return $raylib->ColorToInt($paramcolor->toCData()); +} + +/** + * Get Color normalized as float [0..1] + */ + function ColorNormalize(\Nawarian\Raylib\Generated\Color $paramcolor) : \Nawarian\Raylib\Generated\Vector4 +{ +global $raylib; +return \Nawarian\Raylib\Generated\Vector4::fromCData($raylib->ColorNormalize($paramcolor->toCData())); +} + +/** + * Get Color from normalized values [0..1] + */ + function ColorFromNormalized(\Nawarian\Raylib\Generated\Vector4 $paramnormalized) : \Nawarian\Raylib\Generated\Color +{ +global $raylib; +return \Nawarian\Raylib\Generated\Color::fromCData($raylib->ColorFromNormalized($paramnormalized->toCData())); +} + +/** + * Get HSV values for a Color, hue [0..360], saturation/value [0..1] + */ + function ColorToHSV(\Nawarian\Raylib\Generated\Color $paramcolor) : \Nawarian\Raylib\Generated\Vector3 +{ +global $raylib; +return \Nawarian\Raylib\Generated\Vector3::fromCData($raylib->ColorToHSV($paramcolor->toCData())); +} + +/** + * Get a Color from HSV values, hue [0..360], saturation/value [0..1] + */ + function ColorFromHSV(float $paramhue, float $paramsaturation, float $paramvalue) : \Nawarian\Raylib\Generated\Color +{ +global $raylib; +return \Nawarian\Raylib\Generated\Color::fromCData($raylib->ColorFromHSV($paramhue, $paramsaturation, $paramvalue)); +} + +/** + * Get color with alpha applied, alpha goes from 0.0f to 1.0f + */ + function ColorAlpha(\Nawarian\Raylib\Generated\Color $paramcolor, float $paramalpha) : \Nawarian\Raylib\Generated\Color +{ +global $raylib; +return \Nawarian\Raylib\Generated\Color::fromCData($raylib->ColorAlpha($paramcolor->toCData(), $paramalpha)); +} + +/** + * Get src alpha-blended into dst color with tint + */ + function ColorAlphaBlend(\Nawarian\Raylib\Generated\Color $paramdst, \Nawarian\Raylib\Generated\Color $paramsrc, \Nawarian\Raylib\Generated\Color $paramtint) : \Nawarian\Raylib\Generated\Color +{ +global $raylib; +return \Nawarian\Raylib\Generated\Color::fromCData($raylib->ColorAlphaBlend($paramdst->toCData(), $paramsrc->toCData(), $paramtint->toCData())); +} + +/** + * Get Color structure from hexadecimal value + */ + function GetColor(int $paramhexValue) : \Nawarian\Raylib\Generated\Color +{ +global $raylib; +return \Nawarian\Raylib\Generated\Color::fromCData($raylib->GetColor($paramhexValue)); +} + +/** + * Get Color from a source pixel pointer of certain format + */ + function GetPixelColor(\FFI\CData $paramsrcPtr, int $paramformat) : \Nawarian\Raylib\Generated\Color +{ +global $raylib; +return \Nawarian\Raylib\Generated\Color::fromCData($raylib->GetPixelColor($paramsrcPtr, $paramformat)); +} + +/** + * Set color formatted into destination pixel pointer + */ + function SetPixelColor(\FFI\CData $paramdstPtr, \Nawarian\Raylib\Generated\Color $paramcolor, int $paramformat) : void +{ +global $raylib; +$raylib->SetPixelColor($paramdstPtr, $paramcolor->toCData(), $paramformat); +} + +/** + * Get pixel data size in bytes for certain format + */ + function GetPixelDataSize(int $paramwidth, int $paramheight, int $paramformat) : int +{ +global $raylib; +return $raylib->GetPixelDataSize($paramwidth, $paramheight, $paramformat); +} + +/** + * Get the default Font + */ + function GetFontDefault() : \Nawarian\Raylib\Generated\Font +{ +global $raylib; +return \Nawarian\Raylib\Generated\Font::fromCData($raylib->GetFontDefault()); +} + +/** + * Load font from file into GPU memory (VRAM) + */ + function LoadFont(string $paramfileName) : \Nawarian\Raylib\Generated\Font +{ +global $raylib; +return \Nawarian\Raylib\Generated\Font::fromCData($raylib->LoadFont($paramfileName)); +} + +/** + * Load font from file with extended parameters + */ + function LoadFontEx(string $paramfileName, int $paramfontSize, array $paramfontChars, int $paramcharsCount) : \Nawarian\Raylib\Generated\Font +{ +global $raylib; +return \Nawarian\Raylib\Generated\Font::fromCData($raylib->LoadFontEx($paramfileName, $paramfontSize, $paramfontChars, $paramcharsCount)); +} + +/** + * Load font from Image (XNA style) + */ + function LoadFontFromImage(\Nawarian\Raylib\Generated\Image $paramimage, \Nawarian\Raylib\Generated\Color $paramkey, int $paramfirstChar) : \Nawarian\Raylib\Generated\Font +{ +global $raylib; +return \Nawarian\Raylib\Generated\Font::fromCData($raylib->LoadFontFromImage($paramimage->toCData(), $paramkey->toCData(), $paramfirstChar)); +} + +/** + * Load font from memory buffer, fileType refers to extension: i.e. '.ttf' + */ + function LoadFontFromMemory(string $paramfileType, array $paramfileData, int $paramdataSize, int $paramfontSize, array $paramfontChars, int $paramcharsCount) : \Nawarian\Raylib\Generated\Font +{ +global $raylib; +return \Nawarian\Raylib\Generated\Font::fromCData($raylib->LoadFontFromMemory($paramfileType, $paramfileData, $paramdataSize, $paramfontSize, $paramfontChars, $paramcharsCount)); +} + +/** + * Load font data for further use + */ + function LoadFontData(array $paramfileData, int $paramdataSize, int $paramfontSize, array $paramfontChars, int $paramcharsCount, int $paramtype) : \Nawarian\Raylib\Generated\CharInfo +{ +global $raylib; +return \Nawarian\Raylib\Generated\CharInfo::fromCData($raylib->LoadFontData($paramfileData, $paramdataSize, $paramfontSize, $paramfontChars, $paramcharsCount, $paramtype)); +} + +/** + * Generate image font atlas using chars info + */ + function GenImageFontAtlas(\Nawarian\Raylib\Generated\CharInfo $paramchars, array $paramrecs, int $paramcharsCount, int $paramfontSize, int $parampadding, int $parampackMethod) : \Nawarian\Raylib\Generated\Image +{ +global $raylib; +return \Nawarian\Raylib\Generated\Image::fromCData($raylib->GenImageFontAtlas($paramchars->toCData(), $paramrecs, $paramcharsCount, $paramfontSize, $parampadding, $parampackMethod)); +} + +/** + * Unload font chars info data (RAM) + */ + function UnloadFontData(\Nawarian\Raylib\Generated\CharInfo $paramchars, int $paramcharsCount) : void +{ +global $raylib; +$raylib->UnloadFontData($paramchars->toCData(), $paramcharsCount); +} + +/** + * Unload Font from GPU memory (VRAM) + */ + function UnloadFont(\Nawarian\Raylib\Generated\Font $paramfont) : void +{ +global $raylib; +$raylib->UnloadFont($paramfont->toCData()); +} + +/** + * Draw current FPS + */ + function DrawFPS(int $paramposX, int $paramposY) : void +{ +global $raylib; +$raylib->DrawFPS($paramposX, $paramposY); +} + +/** + * Draw text (using default font) + */ + function DrawText(string $paramtext, int $paramposX, int $paramposY, int $paramfontSize, \Nawarian\Raylib\Generated\Color $paramcolor) : void +{ +global $raylib; +$raylib->DrawText($paramtext, $paramposX, $paramposY, $paramfontSize, $paramcolor->toCData()); +} + +/** + * Draw text using font and additional parameters + */ + function DrawTextEx(\Nawarian\Raylib\Generated\Font $paramfont, string $paramtext, \Nawarian\Raylib\Generated\Vector2 $paramposition, float $paramfontSize, float $paramspacing, \Nawarian\Raylib\Generated\Color $paramtint) : void +{ +global $raylib; +$raylib->DrawTextEx($paramfont->toCData(), $paramtext, $paramposition->toCData(), $paramfontSize, $paramspacing, $paramtint->toCData()); +} + +/** + * Draw text using font inside rectangle limits + */ + function DrawTextRec(\Nawarian\Raylib\Generated\Font $paramfont, string $paramtext, \Nawarian\Raylib\Generated\Rectangle $paramrec, float $paramfontSize, float $paramspacing, bool $paramwordWrap, \Nawarian\Raylib\Generated\Color $paramtint) : void +{ +global $raylib; +$raylib->DrawTextRec($paramfont->toCData(), $paramtext, $paramrec->toCData(), $paramfontSize, $paramspacing, $paramwordWrap->toCData(), $paramtint->toCData()); +} + +/** + * Draw text using font inside rectangle limits with support for text selection + */ + function DrawTextRecEx(\Nawarian\Raylib\Generated\Font $paramfont, string $paramtext, \Nawarian\Raylib\Generated\Rectangle $paramrec, float $paramfontSize, float $paramspacing, bool $paramwordWrap, \Nawarian\Raylib\Generated\Color $paramtint, int $paramselectStart, int $paramselectLength, \Nawarian\Raylib\Generated\Color $paramselectTint, \Nawarian\Raylib\Generated\Color $paramselectBackTint) : void +{ +global $raylib; +$raylib->DrawTextRecEx($paramfont->toCData(), $paramtext, $paramrec->toCData(), $paramfontSize, $paramspacing, $paramwordWrap->toCData(), $paramtint->toCData(), $paramselectStart, $paramselectLength, $paramselectTint->toCData(), $paramselectBackTint->toCData()); +} + +/** + * Draw one character (codepoint) + */ + function DrawTextCodepoint(\Nawarian\Raylib\Generated\Font $paramfont, int $paramcodepoint, \Nawarian\Raylib\Generated\Vector2 $paramposition, float $paramfontSize, \Nawarian\Raylib\Generated\Color $paramtint) : void +{ +global $raylib; +$raylib->DrawTextCodepoint($paramfont->toCData(), $paramcodepoint, $paramposition->toCData(), $paramfontSize, $paramtint->toCData()); +} + +/** + * Measure string width for default font + */ + function MeasureText(string $paramtext, int $paramfontSize) : int +{ +global $raylib; +return $raylib->MeasureText($paramtext, $paramfontSize); +} + +/** + * Measure string size for Font + */ + function MeasureTextEx(\Nawarian\Raylib\Generated\Font $paramfont, string $paramtext, float $paramfontSize, float $paramspacing) : \Nawarian\Raylib\Generated\Vector2 +{ +global $raylib; +return \Nawarian\Raylib\Generated\Vector2::fromCData($raylib->MeasureTextEx($paramfont->toCData(), $paramtext, $paramfontSize, $paramspacing)); +} + +/** + * Get index position for a unicode character on font + */ + function GetGlyphIndex(\Nawarian\Raylib\Generated\Font $paramfont, int $paramcodepoint) : int +{ +global $raylib; +return $raylib->GetGlyphIndex($paramfont->toCData(), $paramcodepoint); +} + +/** + * Copy one string to another, returns bytes copied + */ + function TextCopy(string $paramdst, string $paramsrc) : int +{ +global $raylib; +return $raylib->TextCopy($paramdst, $paramsrc); +} + +/** + * Check if two text string are equal + */ + function TextIsEqual(string $paramtext1, string $paramtext2) : bool +{ +global $raylib; +return $raylib->TextIsEqual($paramtext1, $paramtext2); +} + +/** + * Get text length, checks for ' 0' ending + */ + function TextLength(string $paramtext) : int +{ +global $raylib; +return $raylib->TextLength($paramtext); +} + +/** + * Get a piece of a text string + */ + function TextSubtext(string $paramtext, int $paramposition, int $paramlength) : string +{ +global $raylib; +return $raylib->TextSubtext($paramtext, $paramposition, $paramlength); +} + +/** + * Replace text string (memory must be freed!) + */ + function TextReplace(string $paramtext, string $paramreplace, string $paramby) : string +{ +global $raylib; +return $raylib->TextReplace($paramtext, $paramreplace, $paramby); +} + +/** + * Insert text in a position (memory must be freed!) + */ + function TextInsert(string $paramtext, string $paraminsert, int $paramposition) : string +{ +global $raylib; +return $raylib->TextInsert($paramtext, $paraminsert, $paramposition); +} + +/** + * Split text into multiple strings + */ + function TextSplit(string $paramtext, string $paramdelimiter, array $paramcount) : array +{ +global $raylib; +return $raylib->TextSplit($paramtext, $paramdelimiter, $paramcount); +} + +/** + * Append text at specific position and move cursor! + */ + function TextAppend(string $paramtext, string $paramappend, array $paramposition) : void +{ +global $raylib; +$raylib->TextAppend($paramtext, $paramappend, $paramposition); +} + +/** + * Find first text occurrence within a string + */ + function TextFindIndex(string $paramtext, string $paramfind) : int +{ +global $raylib; +return $raylib->TextFindIndex($paramtext, $paramfind); +} + +/** + * Get upper case version of provided string + */ + function TextToUpper(string $paramtext) : string +{ +global $raylib; +return $raylib->TextToUpper($paramtext); +} + +/** + * Get lower case version of provided string + */ + function TextToLower(string $paramtext) : string +{ +global $raylib; +return $raylib->TextToLower($paramtext); +} + +/** + * Get Pascal case notation version of provided string + */ + function TextToPascal(string $paramtext) : string +{ +global $raylib; +return $raylib->TextToPascal($paramtext); +} + +/** + * Get integer value from text (negative values not supported) + */ + function TextToInteger(string $paramtext) : int +{ +global $raylib; +return $raylib->TextToInteger($paramtext); +} + +/** + * Encode text codepoint into utf8 text (memory must be freed!) + */ + function TextToUtf8(array $paramcodepoints, int $paramlength) : string +{ +global $raylib; +return $raylib->TextToUtf8($paramcodepoints, $paramlength); +} + +/** + * Get all codepoints in a string, codepoints count returned by parameters + */ + function GetCodepoints(string $paramtext, array $paramcount) : array +{ +global $raylib; +return $raylib->GetCodepoints($paramtext, $paramcount); +} + +/** + * Get total number of characters (codepoints) in a UTF8 encoded string + */ + function GetCodepointsCount(string $paramtext) : int +{ +global $raylib; +return $raylib->GetCodepointsCount($paramtext); +} + +/** + * Get next codepoint in a UTF8 encoded string; 0x3f('?') is returned on failure + */ + function GetNextCodepoint(string $paramtext, array $parambytesProcessed) : int +{ +global $raylib; +return $raylib->GetNextCodepoint($paramtext, $parambytesProcessed); +} + +/** + * Encode codepoint into utf8 text (char array length returned as parameter) + */ + function CodepointToUtf8(int $paramcodepoint, array $parambyteLength) : string +{ +global $raylib; +return $raylib->CodepointToUtf8($paramcodepoint, $parambyteLength); +} + +/** + * Draw a line in 3D world space + */ + function DrawLine3D(\Nawarian\Raylib\Generated\Vector3 $paramstartPos, \Nawarian\Raylib\Generated\Vector3 $paramendPos, \Nawarian\Raylib\Generated\Color $paramcolor) : void +{ +global $raylib; +$raylib->DrawLine3D($paramstartPos->toCData(), $paramendPos->toCData(), $paramcolor->toCData()); +} + +/** + * Draw a point in 3D space, actually a small line + */ + function DrawPoint3D(\Nawarian\Raylib\Generated\Vector3 $paramposition, \Nawarian\Raylib\Generated\Color $paramcolor) : void +{ +global $raylib; +$raylib->DrawPoint3D($paramposition->toCData(), $paramcolor->toCData()); +} + +/** + * Draw a circle in 3D world space + */ + function DrawCircle3D(\Nawarian\Raylib\Generated\Vector3 $paramcenter, float $paramradius, \Nawarian\Raylib\Generated\Vector3 $paramrotationAxis, float $paramrotationAngle, \Nawarian\Raylib\Generated\Color $paramcolor) : void +{ +global $raylib; +$raylib->DrawCircle3D($paramcenter->toCData(), $paramradius, $paramrotationAxis->toCData(), $paramrotationAngle, $paramcolor->toCData()); +} + +/** + * Draw a color-filled triangle (vertex in counter-clockwise order!) + */ + function DrawTriangle3D(\Nawarian\Raylib\Generated\Vector3 $paramv1, \Nawarian\Raylib\Generated\Vector3 $paramv2, \Nawarian\Raylib\Generated\Vector3 $paramv3, \Nawarian\Raylib\Generated\Color $paramcolor) : void +{ +global $raylib; +$raylib->DrawTriangle3D($paramv1->toCData(), $paramv2->toCData(), $paramv3->toCData(), $paramcolor->toCData()); +} + +/** + * Draw a triangle strip defined by points + */ + function DrawTriangleStrip3D(array $parampoints, int $parampointsCount, \Nawarian\Raylib\Generated\Color $paramcolor) : void +{ +global $raylib; +$raylib->DrawTriangleStrip3D($parampoints, $parampointsCount, $paramcolor->toCData()); +} + +/** + * Draw cube + */ + function DrawCube(\Nawarian\Raylib\Generated\Vector3 $paramposition, float $paramwidth, float $paramheight, float $paramlength, \Nawarian\Raylib\Generated\Color $paramcolor) : void +{ +global $raylib; +$raylib->DrawCube($paramposition->toCData(), $paramwidth, $paramheight, $paramlength, $paramcolor->toCData()); +} + +/** + * Draw cube (Vector version) + */ + function DrawCubeV(\Nawarian\Raylib\Generated\Vector3 $paramposition, \Nawarian\Raylib\Generated\Vector3 $paramsize, \Nawarian\Raylib\Generated\Color $paramcolor) : void +{ +global $raylib; +$raylib->DrawCubeV($paramposition->toCData(), $paramsize->toCData(), $paramcolor->toCData()); +} + +/** + * Draw cube wires + */ + function DrawCubeWires(\Nawarian\Raylib\Generated\Vector3 $paramposition, float $paramwidth, float $paramheight, float $paramlength, \Nawarian\Raylib\Generated\Color $paramcolor) : void +{ +global $raylib; +$raylib->DrawCubeWires($paramposition->toCData(), $paramwidth, $paramheight, $paramlength, $paramcolor->toCData()); +} + +/** + * Draw cube wires (Vector version) + */ + function DrawCubeWiresV(\Nawarian\Raylib\Generated\Vector3 $paramposition, \Nawarian\Raylib\Generated\Vector3 $paramsize, \Nawarian\Raylib\Generated\Color $paramcolor) : void +{ +global $raylib; +$raylib->DrawCubeWiresV($paramposition->toCData(), $paramsize->toCData(), $paramcolor->toCData()); +} + +/** + * Draw cube textured + */ + function DrawCubeTexture(\Nawarian\Raylib\Generated\Texture $paramtexture, \Nawarian\Raylib\Generated\Vector3 $paramposition, float $paramwidth, float $paramheight, float $paramlength, \Nawarian\Raylib\Generated\Color $paramcolor) : void +{ +global $raylib; +$raylib->DrawCubeTexture($paramtexture->toCData(), $paramposition->toCData(), $paramwidth, $paramheight, $paramlength, $paramcolor->toCData()); +} + +/** + * Draw sphere + */ + function DrawSphere(\Nawarian\Raylib\Generated\Vector3 $paramcenterPos, float $paramradius, \Nawarian\Raylib\Generated\Color $paramcolor) : void +{ +global $raylib; +$raylib->DrawSphere($paramcenterPos->toCData(), $paramradius, $paramcolor->toCData()); +} + +/** + * Draw sphere with extended parameters + */ + function DrawSphereEx(\Nawarian\Raylib\Generated\Vector3 $paramcenterPos, float $paramradius, int $paramrings, int $paramslices, \Nawarian\Raylib\Generated\Color $paramcolor) : void +{ +global $raylib; +$raylib->DrawSphereEx($paramcenterPos->toCData(), $paramradius, $paramrings, $paramslices, $paramcolor->toCData()); +} + +/** + * Draw sphere wires + */ + function DrawSphereWires(\Nawarian\Raylib\Generated\Vector3 $paramcenterPos, float $paramradius, int $paramrings, int $paramslices, \Nawarian\Raylib\Generated\Color $paramcolor) : void +{ +global $raylib; +$raylib->DrawSphereWires($paramcenterPos->toCData(), $paramradius, $paramrings, $paramslices, $paramcolor->toCData()); +} + +/** + * Draw a cylinder/cone + */ + function DrawCylinder(\Nawarian\Raylib\Generated\Vector3 $paramposition, float $paramradiusTop, float $paramradiusBottom, float $paramheight, int $paramslices, \Nawarian\Raylib\Generated\Color $paramcolor) : void +{ +global $raylib; +$raylib->DrawCylinder($paramposition->toCData(), $paramradiusTop, $paramradiusBottom, $paramheight, $paramslices, $paramcolor->toCData()); +} + +/** + * Draw a cylinder/cone wires + */ + function DrawCylinderWires(\Nawarian\Raylib\Generated\Vector3 $paramposition, float $paramradiusTop, float $paramradiusBottom, float $paramheight, int $paramslices, \Nawarian\Raylib\Generated\Color $paramcolor) : void +{ +global $raylib; +$raylib->DrawCylinderWires($paramposition->toCData(), $paramradiusTop, $paramradiusBottom, $paramheight, $paramslices, $paramcolor->toCData()); +} + +/** + * Draw a plane XZ + */ + function DrawPlane(\Nawarian\Raylib\Generated\Vector3 $paramcenterPos, \Nawarian\Raylib\Generated\Vector2 $paramsize, \Nawarian\Raylib\Generated\Color $paramcolor) : void +{ +global $raylib; +$raylib->DrawPlane($paramcenterPos->toCData(), $paramsize->toCData(), $paramcolor->toCData()); +} + +/** + * Draw a ray line + */ + function DrawRay(\Nawarian\Raylib\Generated\Ray $paramray, \Nawarian\Raylib\Generated\Color $paramcolor) : void +{ +global $raylib; +$raylib->DrawRay($paramray->toCData(), $paramcolor->toCData()); +} + +/** + * Draw a grid (centered at (0, 0, 0)) + */ + function DrawGrid(int $paramslices, float $paramspacing) : void +{ +global $raylib; +$raylib->DrawGrid($paramslices, $paramspacing); +} + +/** + * Load model from files (meshes and materials) + */ + function LoadModel(string $paramfileName) : \Nawarian\Raylib\Generated\Model +{ +global $raylib; +return \Nawarian\Raylib\Generated\Model::fromCData($raylib->LoadModel($paramfileName)); +} + +/** + * Load model from generated mesh (default material) + */ + function LoadModelFromMesh(\Nawarian\Raylib\Generated\Mesh $parammesh) : \Nawarian\Raylib\Generated\Model +{ +global $raylib; +return \Nawarian\Raylib\Generated\Model::fromCData($raylib->LoadModelFromMesh($parammesh->toCData())); +} + +/** + * Unload model (including meshes) from memory (RAM and/or VRAM) + */ + function UnloadModel(\Nawarian\Raylib\Generated\Model $parammodel) : void +{ +global $raylib; +$raylib->UnloadModel($parammodel->toCData()); +} + +/** + * Unload model (but not meshes) from memory (RAM and/or VRAM) + */ + function UnloadModelKeepMeshes(\Nawarian\Raylib\Generated\Model $parammodel) : void +{ +global $raylib; +$raylib->UnloadModelKeepMeshes($parammodel->toCData()); +} + +/** + * Upload mesh vertex data in GPU and provide VAO/VBO ids + */ + function UploadMesh(array $parammesh, bool $paramdynamic) : void +{ +global $raylib; +$raylib->UploadMesh($parammesh, $paramdynamic->toCData()); +} + +/** + * Update mesh vertex data in GPU for a specific buffer index + */ + function UpdateMeshBuffer(\Nawarian\Raylib\Generated\Mesh $parammesh, int $paramindex, \FFI\CData $paramdata, int $paramdataSize, int $paramoffset) : void +{ +global $raylib; +$raylib->UpdateMeshBuffer($parammesh->toCData(), $paramindex, $paramdata, $paramdataSize, $paramoffset); +} + +/** + * Draw a 3d mesh with material and transform + */ + function DrawMesh(\Nawarian\Raylib\Generated\Mesh $parammesh, \Nawarian\Raylib\Generated\Material $parammaterial, \Nawarian\Raylib\Generated\Matrix $paramtransform) : void +{ +global $raylib; +$raylib->DrawMesh($parammesh->toCData(), $parammaterial->toCData(), $paramtransform->toCData()); +} + +/** + * Draw multiple mesh instances with material and different transforms + */ + function DrawMeshInstanced(\Nawarian\Raylib\Generated\Mesh $parammesh, \Nawarian\Raylib\Generated\Material $parammaterial, array $paramtransforms, int $paraminstances) : void +{ +global $raylib; +$raylib->DrawMeshInstanced($parammesh->toCData(), $parammaterial->toCData(), $paramtransforms, $paraminstances); +} + +/** + * Unload mesh data from CPU and GPU + */ + function UnloadMesh(\Nawarian\Raylib\Generated\Mesh $parammesh) : void +{ +global $raylib; +$raylib->UnloadMesh($parammesh->toCData()); +} + +/** + * Export mesh data to file, returns true on success + */ + function ExportMesh(\Nawarian\Raylib\Generated\Mesh $parammesh, string $paramfileName) : bool +{ +global $raylib; +return $raylib->ExportMesh($parammesh->toCData(), $paramfileName); +} + +/** + * Load materials from model file + */ + function LoadMaterials(string $paramfileName, array $parammaterialCount) : array +{ +global $raylib; +return $raylib->LoadMaterials($paramfileName, $parammaterialCount); +} + +/** + * Load default material (Supports: DIFFUSE, SPECULAR, NORMAL maps) + */ + function LoadMaterialDefault() : \Nawarian\Raylib\Generated\Material +{ +global $raylib; +return \Nawarian\Raylib\Generated\Material::fromCData($raylib->LoadMaterialDefault()); +} + +/** + * Unload material from GPU memory (VRAM) + */ + function UnloadMaterial(\Nawarian\Raylib\Generated\Material $parammaterial) : void +{ +global $raylib; +$raylib->UnloadMaterial($parammaterial->toCData()); +} + +/** + * Set texture for a material map type (MATERIAL_MAP_DIFFUSE, + * MATERIAL_MAP_SPECULAR...) + */ + function SetMaterialTexture(array $parammaterial, int $parammapType, \Nawarian\Raylib\Generated\Texture $paramtexture) : void +{ +global $raylib; +$raylib->SetMaterialTexture($parammaterial, $parammapType, $paramtexture->toCData()); +} + +/** + * Set material for a mesh + */ + function SetModelMeshMaterial(\Nawarian\Raylib\Generated\Model $parammodel, int $parammeshId, int $parammaterialId) : void +{ +global $raylib; +$raylib->SetModelMeshMaterial($parammodel->toCData(), $parammeshId, $parammaterialId); +} + +/** + * Load model animations from file + */ + function LoadModelAnimations(string $paramfileName, array $paramanimsCount) : array +{ +global $raylib; +return $raylib->LoadModelAnimations($paramfileName, $paramanimsCount); +} + +/** + * Update model animation pose + */ + function UpdateModelAnimation(\Nawarian\Raylib\Generated\Model $parammodel, \Nawarian\Raylib\Generated\ModelAnimation $paramanim, int $paramframe) : void +{ +global $raylib; +$raylib->UpdateModelAnimation($parammodel->toCData(), $paramanim->toCData(), $paramframe); +} + +/** + * Unload animation data + */ + function UnloadModelAnimation(\Nawarian\Raylib\Generated\ModelAnimation $paramanim) : void +{ +global $raylib; +$raylib->UnloadModelAnimation($paramanim->toCData()); +} + +/** + * Unload animation array data + */ + function UnloadModelAnimations(array $paramanimations, int $paramcount) : void +{ +global $raylib; +$raylib->UnloadModelAnimations($paramanimations, $paramcount); +} + +/** + * Check model animation skeleton match + */ + function IsModelAnimationValid(\Nawarian\Raylib\Generated\Model $parammodel, \Nawarian\Raylib\Generated\ModelAnimation $paramanim) : bool +{ +global $raylib; +return $raylib->IsModelAnimationValid($parammodel->toCData(), $paramanim->toCData()); +} + +/** + * Generate polygonal mesh + */ + function GenMeshPoly(int $paramsides, float $paramradius) : \Nawarian\Raylib\Generated\Mesh +{ +global $raylib; +return \Nawarian\Raylib\Generated\Mesh::fromCData($raylib->GenMeshPoly($paramsides, $paramradius)); +} + +/** + * Generate plane mesh (with subdivisions) + */ + function GenMeshPlane(float $paramwidth, float $paramlength, int $paramresX, int $paramresZ) : \Nawarian\Raylib\Generated\Mesh +{ +global $raylib; +return \Nawarian\Raylib\Generated\Mesh::fromCData($raylib->GenMeshPlane($paramwidth, $paramlength, $paramresX, $paramresZ)); +} + +/** + * Generate cuboid mesh + */ + function GenMeshCube(float $paramwidth, float $paramheight, float $paramlength) : \Nawarian\Raylib\Generated\Mesh +{ +global $raylib; +return \Nawarian\Raylib\Generated\Mesh::fromCData($raylib->GenMeshCube($paramwidth, $paramheight, $paramlength)); +} + +/** + * Generate sphere mesh (standard sphere) + */ + function GenMeshSphere(float $paramradius, int $paramrings, int $paramslices) : \Nawarian\Raylib\Generated\Mesh +{ +global $raylib; +return \Nawarian\Raylib\Generated\Mesh::fromCData($raylib->GenMeshSphere($paramradius, $paramrings, $paramslices)); +} + +/** + * Generate half-sphere mesh (no bottom cap) + */ + function GenMeshHemiSphere(float $paramradius, int $paramrings, int $paramslices) : \Nawarian\Raylib\Generated\Mesh +{ +global $raylib; +return \Nawarian\Raylib\Generated\Mesh::fromCData($raylib->GenMeshHemiSphere($paramradius, $paramrings, $paramslices)); +} + +/** + * Generate cylinder mesh + */ + function GenMeshCylinder(float $paramradius, float $paramheight, int $paramslices) : \Nawarian\Raylib\Generated\Mesh +{ +global $raylib; +return \Nawarian\Raylib\Generated\Mesh::fromCData($raylib->GenMeshCylinder($paramradius, $paramheight, $paramslices)); +} + +/** + * Generate torus mesh + */ + function GenMeshTorus(float $paramradius, float $paramsize, int $paramradSeg, int $paramsides) : \Nawarian\Raylib\Generated\Mesh +{ +global $raylib; +return \Nawarian\Raylib\Generated\Mesh::fromCData($raylib->GenMeshTorus($paramradius, $paramsize, $paramradSeg, $paramsides)); +} + +/** + * Generate trefoil knot mesh + */ + function GenMeshKnot(float $paramradius, float $paramsize, int $paramradSeg, int $paramsides) : \Nawarian\Raylib\Generated\Mesh +{ +global $raylib; +return \Nawarian\Raylib\Generated\Mesh::fromCData($raylib->GenMeshKnot($paramradius, $paramsize, $paramradSeg, $paramsides)); +} + +/** + * Generate heightmap mesh from image data + */ + function GenMeshHeightmap(\Nawarian\Raylib\Generated\Image $paramheightmap, \Nawarian\Raylib\Generated\Vector3 $paramsize) : \Nawarian\Raylib\Generated\Mesh +{ +global $raylib; +return \Nawarian\Raylib\Generated\Mesh::fromCData($raylib->GenMeshHeightmap($paramheightmap->toCData(), $paramsize->toCData())); +} + +/** + * Generate cubes-based map mesh from image data + */ + function GenMeshCubicmap(\Nawarian\Raylib\Generated\Image $paramcubicmap, \Nawarian\Raylib\Generated\Vector3 $paramcubeSize) : \Nawarian\Raylib\Generated\Mesh +{ +global $raylib; +return \Nawarian\Raylib\Generated\Mesh::fromCData($raylib->GenMeshCubicmap($paramcubicmap->toCData(), $paramcubeSize->toCData())); +} + +/** + * Compute mesh bounding box limits + */ + function GetMeshBoundingBox(\Nawarian\Raylib\Generated\Mesh $parammesh) : \Nawarian\Raylib\Generated\BoundingBox +{ +global $raylib; +return \Nawarian\Raylib\Generated\BoundingBox::fromCData($raylib->GetMeshBoundingBox($parammesh->toCData())); +} + +/** + * Compute mesh tangents + */ + function MeshTangents(array $parammesh) : void +{ +global $raylib; +$raylib->MeshTangents($parammesh); +} + +/** + * Compute mesh binormals + */ + function MeshBinormals(array $parammesh) : void +{ +global $raylib; +$raylib->MeshBinormals($parammesh); +} + +/** + * Draw a model (with texture if set) + */ + function DrawModel(\Nawarian\Raylib\Generated\Model $parammodel, \Nawarian\Raylib\Generated\Vector3 $paramposition, float $paramscale, \Nawarian\Raylib\Generated\Color $paramtint) : void +{ +global $raylib; +$raylib->DrawModel($parammodel->toCData(), $paramposition->toCData(), $paramscale, $paramtint->toCData()); +} + +/** + * Draw a model with extended parameters + */ + function DrawModelEx(\Nawarian\Raylib\Generated\Model $parammodel, \Nawarian\Raylib\Generated\Vector3 $paramposition, \Nawarian\Raylib\Generated\Vector3 $paramrotationAxis, float $paramrotationAngle, \Nawarian\Raylib\Generated\Vector3 $paramscale, \Nawarian\Raylib\Generated\Color $paramtint) : void +{ +global $raylib; +$raylib->DrawModelEx($parammodel->toCData(), $paramposition->toCData(), $paramrotationAxis->toCData(), $paramrotationAngle, $paramscale->toCData(), $paramtint->toCData()); +} + +/** + * Draw a model wires (with texture if set) + */ + function DrawModelWires(\Nawarian\Raylib\Generated\Model $parammodel, \Nawarian\Raylib\Generated\Vector3 $paramposition, float $paramscale, \Nawarian\Raylib\Generated\Color $paramtint) : void +{ +global $raylib; +$raylib->DrawModelWires($parammodel->toCData(), $paramposition->toCData(), $paramscale, $paramtint->toCData()); +} + +/** + * Draw a model wires (with texture if set) with extended parameters + */ + function DrawModelWiresEx(\Nawarian\Raylib\Generated\Model $parammodel, \Nawarian\Raylib\Generated\Vector3 $paramposition, \Nawarian\Raylib\Generated\Vector3 $paramrotationAxis, float $paramrotationAngle, \Nawarian\Raylib\Generated\Vector3 $paramscale, \Nawarian\Raylib\Generated\Color $paramtint) : void +{ +global $raylib; +$raylib->DrawModelWiresEx($parammodel->toCData(), $paramposition->toCData(), $paramrotationAxis->toCData(), $paramrotationAngle, $paramscale->toCData(), $paramtint->toCData()); +} + +/** + * Draw bounding box (wires) + */ + function DrawBoundingBox(\Nawarian\Raylib\Generated\BoundingBox $parambox, \Nawarian\Raylib\Generated\Color $paramcolor) : void +{ +global $raylib; +$raylib->DrawBoundingBox($parambox->toCData(), $paramcolor->toCData()); +} + +/** + * Draw a billboard texture + */ + function DrawBillboard(\Nawarian\Raylib\Generated\Camera3D $paramcamera, \Nawarian\Raylib\Generated\Texture $paramtexture, \Nawarian\Raylib\Generated\Vector3 $paramposition, float $paramsize, \Nawarian\Raylib\Generated\Color $paramtint) : void +{ +global $raylib; +$raylib->DrawBillboard($paramcamera->toCData(), $paramtexture->toCData(), $paramposition->toCData(), $paramsize, $paramtint->toCData()); +} + +/** + * Draw a billboard texture defined by source + */ + function DrawBillboardRec(\Nawarian\Raylib\Generated\Camera3D $paramcamera, \Nawarian\Raylib\Generated\Texture $paramtexture, \Nawarian\Raylib\Generated\Rectangle $paramsource, \Nawarian\Raylib\Generated\Vector3 $paramposition, \Nawarian\Raylib\Generated\Vector2 $paramsize, \Nawarian\Raylib\Generated\Color $paramtint) : void +{ +global $raylib; +$raylib->DrawBillboardRec($paramcamera->toCData(), $paramtexture->toCData(), $paramsource->toCData(), $paramposition->toCData(), $paramsize->toCData(), $paramtint->toCData()); +} + +/** + * Draw a billboard texture defined by source and rotation + */ + function DrawBillboardPro(\Nawarian\Raylib\Generated\Camera3D $paramcamera, \Nawarian\Raylib\Generated\Texture $paramtexture, \Nawarian\Raylib\Generated\Rectangle $paramsource, \Nawarian\Raylib\Generated\Vector3 $paramposition, \Nawarian\Raylib\Generated\Vector2 $paramsize, \Nawarian\Raylib\Generated\Vector2 $paramorigin, float $paramrotation, \Nawarian\Raylib\Generated\Color $paramtint) : void +{ +global $raylib; +$raylib->DrawBillboardPro($paramcamera->toCData(), $paramtexture->toCData(), $paramsource->toCData(), $paramposition->toCData(), $paramsize->toCData(), $paramorigin->toCData(), $paramrotation, $paramtint->toCData()); +} + +/** + * Check collision between two spheres + */ + function CheckCollisionSpheres(\Nawarian\Raylib\Generated\Vector3 $paramcenter1, float $paramradius1, \Nawarian\Raylib\Generated\Vector3 $paramcenter2, float $paramradius2) : bool +{ +global $raylib; +return $raylib->CheckCollisionSpheres($paramcenter1->toCData(), $paramradius1, $paramcenter2->toCData(), $paramradius2); +} + +/** + * Check collision between two bounding boxes + */ + function CheckCollisionBoxes(\Nawarian\Raylib\Generated\BoundingBox $parambox1, \Nawarian\Raylib\Generated\BoundingBox $parambox2) : bool +{ +global $raylib; +return $raylib->CheckCollisionBoxes($parambox1->toCData(), $parambox2->toCData()); +} + +/** + * Check collision between box and sphere + */ + function CheckCollisionBoxSphere(\Nawarian\Raylib\Generated\BoundingBox $parambox, \Nawarian\Raylib\Generated\Vector3 $paramcenter, float $paramradius) : bool +{ +global $raylib; +return $raylib->CheckCollisionBoxSphere($parambox->toCData(), $paramcenter->toCData(), $paramradius); +} + +/** + * Get collision info between ray and sphere + */ + function GetRayCollisionSphere(\Nawarian\Raylib\Generated\Ray $paramray, \Nawarian\Raylib\Generated\Vector3 $paramcenter, float $paramradius) : \Nawarian\Raylib\Generated\RayCollision +{ +global $raylib; +return \Nawarian\Raylib\Generated\RayCollision::fromCData($raylib->GetRayCollisionSphere($paramray->toCData(), $paramcenter->toCData(), $paramradius)); +} + +/** + * Get collision info between ray and box + */ + function GetRayCollisionBox(\Nawarian\Raylib\Generated\Ray $paramray, \Nawarian\Raylib\Generated\BoundingBox $parambox) : \Nawarian\Raylib\Generated\RayCollision +{ +global $raylib; +return \Nawarian\Raylib\Generated\RayCollision::fromCData($raylib->GetRayCollisionBox($paramray->toCData(), $parambox->toCData())); +} + +/** + * Get collision info between ray and model + */ + function GetRayCollisionModel(\Nawarian\Raylib\Generated\Ray $paramray, \Nawarian\Raylib\Generated\Model $parammodel) : \Nawarian\Raylib\Generated\RayCollision +{ +global $raylib; +return \Nawarian\Raylib\Generated\RayCollision::fromCData($raylib->GetRayCollisionModel($paramray->toCData(), $parammodel->toCData())); +} + +/** + * Get collision info between ray and mesh + */ + function GetRayCollisionMesh(\Nawarian\Raylib\Generated\Ray $paramray, \Nawarian\Raylib\Generated\Mesh $parammesh, \Nawarian\Raylib\Generated\Matrix $paramtransform) : \Nawarian\Raylib\Generated\RayCollision +{ +global $raylib; +return \Nawarian\Raylib\Generated\RayCollision::fromCData($raylib->GetRayCollisionMesh($paramray->toCData(), $parammesh->toCData(), $paramtransform->toCData())); +} + +/** + * Get collision info between ray and triangle + */ + function GetRayCollisionTriangle(\Nawarian\Raylib\Generated\Ray $paramray, \Nawarian\Raylib\Generated\Vector3 $paramp1, \Nawarian\Raylib\Generated\Vector3 $paramp2, \Nawarian\Raylib\Generated\Vector3 $paramp3) : \Nawarian\Raylib\Generated\RayCollision +{ +global $raylib; +return \Nawarian\Raylib\Generated\RayCollision::fromCData($raylib->GetRayCollisionTriangle($paramray->toCData(), $paramp1->toCData(), $paramp2->toCData(), $paramp3->toCData())); +} + +/** + * Get collision info between ray and quad + */ + function GetRayCollisionQuad(\Nawarian\Raylib\Generated\Ray $paramray, \Nawarian\Raylib\Generated\Vector3 $paramp1, \Nawarian\Raylib\Generated\Vector3 $paramp2, \Nawarian\Raylib\Generated\Vector3 $paramp3, \Nawarian\Raylib\Generated\Vector3 $paramp4) : \Nawarian\Raylib\Generated\RayCollision +{ +global $raylib; +return \Nawarian\Raylib\Generated\RayCollision::fromCData($raylib->GetRayCollisionQuad($paramray->toCData(), $paramp1->toCData(), $paramp2->toCData(), $paramp3->toCData(), $paramp4->toCData())); +} + +/** + * Initialize audio device and context + */ + function InitAudioDevice() : void +{ +global $raylib; +$raylib->InitAudioDevice(); +} + +/** + * Close the audio device and context + */ + function CloseAudioDevice() : void +{ +global $raylib; +$raylib->CloseAudioDevice(); +} + +/** + * Check if audio device has been initialized successfully + */ + function IsAudioDeviceReady() : bool +{ +global $raylib; +return $raylib->IsAudioDeviceReady(); +} + +/** + * Set master volume (listener) + */ + function SetMasterVolume(float $paramvolume) : void +{ +global $raylib; +$raylib->SetMasterVolume($paramvolume); +} + +/** + * Load wave data from file + */ + function LoadWave(string $paramfileName) : \Nawarian\Raylib\Generated\Wave +{ +global $raylib; +return \Nawarian\Raylib\Generated\Wave::fromCData($raylib->LoadWave($paramfileName)); +} + +/** + * Load wave from memory buffer, fileType refers to extension: i.e. '.wav' + */ + function LoadWaveFromMemory(string $paramfileType, array $paramfileData, int $paramdataSize) : \Nawarian\Raylib\Generated\Wave +{ +global $raylib; +return \Nawarian\Raylib\Generated\Wave::fromCData($raylib->LoadWaveFromMemory($paramfileType, $paramfileData, $paramdataSize)); +} + +/** + * Load sound from file + */ + function LoadSound(string $paramfileName) : \Nawarian\Raylib\Generated\Sound +{ +global $raylib; +return \Nawarian\Raylib\Generated\Sound::fromCData($raylib->LoadSound($paramfileName)); +} + +/** + * Load sound from wave data + */ + function LoadSoundFromWave(\Nawarian\Raylib\Generated\Wave $paramwave) : \Nawarian\Raylib\Generated\Sound +{ +global $raylib; +return \Nawarian\Raylib\Generated\Sound::fromCData($raylib->LoadSoundFromWave($paramwave->toCData())); +} + +/** + * Update sound buffer with new data + */ + function UpdateSound(\Nawarian\Raylib\Generated\Sound $paramsound, \FFI\CData $paramdata, int $paramsamplesCount) : void +{ +global $raylib; +$raylib->UpdateSound($paramsound->toCData(), $paramdata, $paramsamplesCount); +} + +/** + * Unload wave data + */ + function UnloadWave(\Nawarian\Raylib\Generated\Wave $paramwave) : void +{ +global $raylib; +$raylib->UnloadWave($paramwave->toCData()); +} + +/** + * Unload sound + */ + function UnloadSound(\Nawarian\Raylib\Generated\Sound $paramsound) : void +{ +global $raylib; +$raylib->UnloadSound($paramsound->toCData()); +} + +/** + * Export wave data to file, returns true on success + */ + function ExportWave(\Nawarian\Raylib\Generated\Wave $paramwave, string $paramfileName) : bool +{ +global $raylib; +return $raylib->ExportWave($paramwave->toCData(), $paramfileName); +} + +/** + * Export wave sample data to code (.h), returns true on success + */ + function ExportWaveAsCode(\Nawarian\Raylib\Generated\Wave $paramwave, string $paramfileName) : bool +{ +global $raylib; +return $raylib->ExportWaveAsCode($paramwave->toCData(), $paramfileName); +} + +/** + * Play a sound + */ + function PlaySound(\Nawarian\Raylib\Generated\Sound $paramsound) : void +{ +global $raylib; +$raylib->PlaySound($paramsound->toCData()); +} + +/** + * Stop playing a sound + */ + function StopSound(\Nawarian\Raylib\Generated\Sound $paramsound) : void +{ +global $raylib; +$raylib->StopSound($paramsound->toCData()); +} + +/** + * Pause a sound + */ + function PauseSound(\Nawarian\Raylib\Generated\Sound $paramsound) : void +{ +global $raylib; +$raylib->PauseSound($paramsound->toCData()); +} + +/** + * Resume a paused sound + */ + function ResumeSound(\Nawarian\Raylib\Generated\Sound $paramsound) : void +{ +global $raylib; +$raylib->ResumeSound($paramsound->toCData()); +} + +/** + * Play a sound (using multichannel buffer pool) + */ + function PlaySoundMulti(\Nawarian\Raylib\Generated\Sound $paramsound) : void +{ +global $raylib; +$raylib->PlaySoundMulti($paramsound->toCData()); +} + +/** + * Stop any sound playing (using multichannel buffer pool) + */ + function StopSoundMulti() : void +{ +global $raylib; +$raylib->StopSoundMulti(); +} + +/** + * Get number of sounds playing in the multichannel + */ + function GetSoundsPlaying() : int +{ +global $raylib; +return $raylib->GetSoundsPlaying(); +} + +/** + * Check if a sound is currently playing + */ + function IsSoundPlaying(\Nawarian\Raylib\Generated\Sound $paramsound) : bool +{ +global $raylib; +return $raylib->IsSoundPlaying($paramsound->toCData()); +} + +/** + * Set volume for a sound (1.0 is max level) + */ + function SetSoundVolume(\Nawarian\Raylib\Generated\Sound $paramsound, float $paramvolume) : void +{ +global $raylib; +$raylib->SetSoundVolume($paramsound->toCData(), $paramvolume); +} + +/** + * Set pitch for a sound (1.0 is base level) + */ + function SetSoundPitch(\Nawarian\Raylib\Generated\Sound $paramsound, float $parampitch) : void +{ +global $raylib; +$raylib->SetSoundPitch($paramsound->toCData(), $parampitch); +} + +/** + * Convert wave data to desired format + */ + function WaveFormat(\Nawarian\Raylib\Generated\Wave $paramwave, int $paramsampleRate, int $paramsampleSize, int $paramchannels) : void +{ +global $raylib; +$raylib->WaveFormat($paramwave->toCData(), $paramsampleRate, $paramsampleSize, $paramchannels); +} + +/** + * Copy a wave to a new wave + */ + function WaveCopy(\Nawarian\Raylib\Generated\Wave $paramwave) : \Nawarian\Raylib\Generated\Wave +{ +global $raylib; +return \Nawarian\Raylib\Generated\Wave::fromCData($raylib->WaveCopy($paramwave->toCData())); +} + +/** + * Crop a wave to defined samples range + */ + function WaveCrop(\Nawarian\Raylib\Generated\Wave $paramwave, int $paraminitSample, int $paramfinalSample) : void +{ +global $raylib; +$raylib->WaveCrop($paramwave->toCData(), $paraminitSample, $paramfinalSample); +} + +/** + * Load samples data from wave as a floats array + */ + function LoadWaveSamples(\Nawarian\Raylib\Generated\Wave $paramwave) : array +{ +global $raylib; +return $raylib->LoadWaveSamples($paramwave->toCData()); +} + +/** + * Unload samples data loaded with LoadWaveSamples() + */ + function UnloadWaveSamples(array $paramsamples) : void +{ +global $raylib; +$raylib->UnloadWaveSamples($paramsamples); +} + +/** + * Load music stream from file + */ + function LoadMusicStream(string $paramfileName) : \Nawarian\Raylib\Generated\Music +{ +global $raylib; +return \Nawarian\Raylib\Generated\Music::fromCData($raylib->LoadMusicStream($paramfileName)); +} + +/** + * Load music stream from data + */ + function LoadMusicStreamFromMemory(string $paramfileType, array $paramdata, int $paramdataSize) : \Nawarian\Raylib\Generated\Music +{ +global $raylib; +return \Nawarian\Raylib\Generated\Music::fromCData($raylib->LoadMusicStreamFromMemory($paramfileType, $paramdata, $paramdataSize)); +} + +/** + * Unload music stream + */ + function UnloadMusicStream(\Nawarian\Raylib\Generated\Music $parammusic) : void +{ +global $raylib; +$raylib->UnloadMusicStream($parammusic->toCData()); +} + +/** + * Start music playing + */ + function PlayMusicStream(\Nawarian\Raylib\Generated\Music $parammusic) : void +{ +global $raylib; +$raylib->PlayMusicStream($parammusic->toCData()); +} + +/** + * Check if music is playing + */ + function IsMusicStreamPlaying(\Nawarian\Raylib\Generated\Music $parammusic) : bool +{ +global $raylib; +return $raylib->IsMusicStreamPlaying($parammusic->toCData()); +} + +/** + * Updates buffers for music streaming + */ + function UpdateMusicStream(\Nawarian\Raylib\Generated\Music $parammusic) : void +{ +global $raylib; +$raylib->UpdateMusicStream($parammusic->toCData()); +} + +/** + * Stop music playing + */ + function StopMusicStream(\Nawarian\Raylib\Generated\Music $parammusic) : void +{ +global $raylib; +$raylib->StopMusicStream($parammusic->toCData()); +} + +/** + * Pause music playing + */ + function PauseMusicStream(\Nawarian\Raylib\Generated\Music $parammusic) : void +{ +global $raylib; +$raylib->PauseMusicStream($parammusic->toCData()); +} + +/** + * Resume playing paused music + */ + function ResumeMusicStream(\Nawarian\Raylib\Generated\Music $parammusic) : void +{ +global $raylib; +$raylib->ResumeMusicStream($parammusic->toCData()); +} + +/** + * Set volume for music (1.0 is max level) + */ + function SetMusicVolume(\Nawarian\Raylib\Generated\Music $parammusic, float $paramvolume) : void +{ +global $raylib; +$raylib->SetMusicVolume($parammusic->toCData(), $paramvolume); +} + +/** + * Set pitch for a music (1.0 is base level) + */ + function SetMusicPitch(\Nawarian\Raylib\Generated\Music $parammusic, float $parampitch) : void +{ +global $raylib; +$raylib->SetMusicPitch($parammusic->toCData(), $parampitch); +} + +/** + * Get music time length (in seconds) + */ + function GetMusicTimeLength(\Nawarian\Raylib\Generated\Music $parammusic) : float +{ +global $raylib; +return $raylib->GetMusicTimeLength($parammusic->toCData()); +} + +/** + * Get current music time played (in seconds) + */ + function GetMusicTimePlayed(\Nawarian\Raylib\Generated\Music $parammusic) : float +{ +global $raylib; +return $raylib->GetMusicTimePlayed($parammusic->toCData()); +} + +/** + * Load audio stream (to stream raw audio pcm data) + */ + function LoadAudioStream(int $paramsampleRate, int $paramsampleSize, int $paramchannels) : \Nawarian\Raylib\Generated\AudioStream +{ +global $raylib; +return \Nawarian\Raylib\Generated\AudioStream::fromCData($raylib->LoadAudioStream($paramsampleRate, $paramsampleSize, $paramchannels)); +} + +/** + * Unload audio stream and free memory + */ + function UnloadAudioStream(\Nawarian\Raylib\Generated\AudioStream $paramstream) : void +{ +global $raylib; +$raylib->UnloadAudioStream($paramstream->toCData()); +} + +/** + * Update audio stream buffers with data + */ + function UpdateAudioStream(\Nawarian\Raylib\Generated\AudioStream $paramstream, \FFI\CData $paramdata, int $paramsamplesCount) : void +{ +global $raylib; +$raylib->UpdateAudioStream($paramstream->toCData(), $paramdata, $paramsamplesCount); +} + +/** + * Check if any audio stream buffers requires refill + */ + function IsAudioStreamProcessed(\Nawarian\Raylib\Generated\AudioStream $paramstream) : bool +{ +global $raylib; +return $raylib->IsAudioStreamProcessed($paramstream->toCData()); +} + +/** + * Play audio stream + */ + function PlayAudioStream(\Nawarian\Raylib\Generated\AudioStream $paramstream) : void +{ +global $raylib; +$raylib->PlayAudioStream($paramstream->toCData()); +} + +/** + * Pause audio stream + */ + function PauseAudioStream(\Nawarian\Raylib\Generated\AudioStream $paramstream) : void +{ +global $raylib; +$raylib->PauseAudioStream($paramstream->toCData()); +} + +/** + * Resume audio stream + */ + function ResumeAudioStream(\Nawarian\Raylib\Generated\AudioStream $paramstream) : void +{ +global $raylib; +$raylib->ResumeAudioStream($paramstream->toCData()); +} + +/** + * Check if audio stream is playing + */ + function IsAudioStreamPlaying(\Nawarian\Raylib\Generated\AudioStream $paramstream) : bool +{ +global $raylib; +return $raylib->IsAudioStreamPlaying($paramstream->toCData()); +} + +/** + * Stop audio stream + */ + function StopAudioStream(\Nawarian\Raylib\Generated\AudioStream $paramstream) : void +{ +global $raylib; +$raylib->StopAudioStream($paramstream->toCData()); +} + +/** + * Set volume for audio stream (1.0 is max level) + */ + function SetAudioStreamVolume(\Nawarian\Raylib\Generated\AudioStream $paramstream, float $paramvolume) : void +{ +global $raylib; +$raylib->SetAudioStreamVolume($paramstream->toCData(), $paramvolume); +} + +/** + * Set pitch for audio stream (1.0 is base level) + */ + function SetAudioStreamPitch(\Nawarian\Raylib\Generated\AudioStream $paramstream, float $parampitch) : void +{ +global $raylib; +$raylib->SetAudioStreamPitch($paramstream->toCData(), $parampitch); +} + +/** + * Default size for new audio streams + */ + function SetAudioStreamBufferSizeDefault(int $paramsize) : void +{ +global $raylib; +$raylib->SetAudioStreamBufferSizeDefault($paramsize); +} diff --git a/resources/raylib.h b/resources/raylib.h index 1604ecc..7be200e 100644 --- a/resources/raylib.h +++ b/resources/raylib.h @@ -1,189 +1,3 @@ -/********************************************************************************************** -* -* raylib v4.1-dev - A simple and easy-to-use library to enjoy videogames programming (www.raylib.com) -* -* FEATURES: -* - NO external dependencies, all required libraries included with raylib -* - Multiplatform: Windows, Linux, FreeBSD, OpenBSD, NetBSD, DragonFly, -* MacOS, Haiku, Android, Raspberry Pi, DRM native, HTML5. -* - Written in plain C code (C99) in PascalCase/camelCase notation -* - Hardware accelerated with OpenGL (1.1, 2.1, 3.3, 4.3 or ES2 - choose at compile) -* - Unique OpenGL abstraction layer (usable as standalone module): [rlgl] -* - Multiple Fonts formats supported (TTF, XNA fonts, AngelCode fonts) -* - Outstanding texture formats support, including compressed formats (DXT, ETC, ASTC) -* - Full 3d support for 3d Shapes, Models, Billboards, Heightmaps and more! -* - Flexible Materials system, supporting classic maps and PBR maps -* - Animated 3D models supported (skeletal bones animation) (IQM) -* - Shaders support, including Model shaders and Postprocessing shaders -* - Powerful math module for Vector, Matrix and Quaternion operations: [raymath] -* - Audio loading and playing with streaming support (WAV, OGG, MP3, FLAC, XM, MOD) -* - VR stereo rendering with configurable HMD device parameters -* - Bindings to multiple programming languages available! -* -* NOTES: -* - One default Font is loaded on InitWindow()->LoadFontDefault() [core, text] -* - One default Texture2D is loaded on rlglInit(), 1x1 white pixel R8G8B8A8 [rlgl] (OpenGL 3.3 or ES2) -* - One default Shader is loaded on rlglInit()->rlLoadShaderDefault() [rlgl] (OpenGL 3.3 or ES2) -* - One default RenderBatch is loaded on rlglInit()->rlLoadRenderBatch() [rlgl] (OpenGL 3.3 or ES2) -* -* DEPENDENCIES (included): -* [rcore] rglfw (Camilla Löwy - github.com/glfw/glfw) for window/context management and input (PLATFORM_DESKTOP) -* [rlgl] glad (David Herberth - github.com/Dav1dde/glad) for OpenGL 3.3 extensions loading (PLATFORM_DESKTOP) -* [raudio] miniaudio (David Reid - github.com/mackron/miniaudio) for audio device/context management -* -* OPTIONAL DEPENDENCIES (included): -* [rcore] msf_gif (Miles Fogle) for GIF recording -* [rcore] sinfl (Micha Mettke) for DEFLATE decompression algorythm -* [rcore] sdefl (Micha Mettke) for DEFLATE compression algorythm -* [rtextures] stb_image (Sean Barret) for images loading (BMP, TGA, PNG, JPEG, HDR...) -* [rtextures] stb_image_write (Sean Barret) for image writing (BMP, TGA, PNG, JPG) -* [rtextures] stb_image_resize (Sean Barret) for image resizing algorithms -* [rtext] stb_truetype (Sean Barret) for ttf fonts loading -* [rtext] stb_rect_pack (Sean Barret) for rectangles packing -* [rmodels] par_shapes (Philip Rideout) for parametric 3d shapes generation -* [rmodels] tinyobj_loader_c (Syoyo Fujita) for models loading (OBJ, MTL) -* [rmodels] cgltf (Johannes Kuhlmann) for models loading (glTF) -* [raudio] dr_wav (David Reid) for WAV audio file loading -* [raudio] dr_flac (David Reid) for FLAC audio file loading -* [raudio] dr_mp3 (David Reid) for MP3 audio file loading -* [raudio] stb_vorbis (Sean Barret) for OGG audio loading -* [raudio] jar_xm (Joshua Reisenauer) for XM audio module loading -* [raudio] jar_mod (Joshua Reisenauer) for MOD audio module loading -* -* -* LICENSE: zlib/libpng -* -* raylib is 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) 2013-2022 Ramon Santamaria (@raysan5) -* -* This software is provided "as-is", without any express or implied warranty. In no event -* will the authors be held liable for any damages arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, including commercial -* applications, and to alter it and redistribute it freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not claim that you -* wrote the original software. If you use this software in a product, an acknowledgment -* in the product documentation would be appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be misrepresented -* as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -* -**********************************************************************************************/ - -#ifndef RAYLIB_H -#define RAYLIB_H - -#include // Required for: va_list - Only used by TraceLogCallback - -#define RAYLIB_VERSION "4.1-dev" - -// 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) - #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 - #define RLAPI // Functions defined as 'extern' by default (implicit specifiers) -#endif - -//---------------------------------------------------------------------------------- -// Some basic Defines -//---------------------------------------------------------------------------------- -#ifndef PI - #define PI 3.14159265358979323846f -#endif -#ifndef DEG2RAD - #define DEG2RAD (PI/180.0f) -#endif -#ifndef RAD2DEG - #define RAD2DEG (180.0f/PI) -#endif - -// Allow custom memory allocators -#ifndef RL_MALLOC - #define RL_MALLOC(sz) malloc(sz) -#endif -#ifndef RL_CALLOC - #define RL_CALLOC(n,sz) calloc(n,sz) -#endif -#ifndef RL_REALLOC - #define RL_REALLOC(ptr,sz) realloc(ptr,sz) -#endif -#ifndef RL_FREE - #define RL_FREE(ptr) free(ptr) -#endif - -// NOTE: MSVC C++ compiler does not support compound literals (C99 feature) -// Plain structures in C++ (without constructors) can be initialized with { } -#if defined(__cplusplus) - #define CLITERAL(type) type -#else - #define CLITERAL(type) (type) -#endif - -// NOTE: We set some defines with some data types declared by raylib -// Other modules (raymath, rlgl) also require some of those types, so, -// to be able to use those other modules as standalone (not depending on raylib) -// this defines are very useful for internal check and avoid type (re)definitions -#define RL_COLOR_TYPE -#define RL_RECTANGLE_TYPE -#define RL_VECTOR2_TYPE -#define RL_VECTOR3_TYPE -#define RL_VECTOR4_TYPE -#define RL_QUATERNION_TYPE -#define RL_MATRIX_TYPE - -// Some Basic Colors -// NOTE: Custom raylib color palette for amazing visuals on WHITE background -#define LIGHTGRAY CLITERAL(Color){ 200, 200, 200, 255 } // Light Gray -#define GRAY CLITERAL(Color){ 130, 130, 130, 255 } // Gray -#define DARKGRAY CLITERAL(Color){ 80, 80, 80, 255 } // Dark Gray -#define YELLOW CLITERAL(Color){ 253, 249, 0, 255 } // Yellow -#define GOLD CLITERAL(Color){ 255, 203, 0, 255 } // Gold -#define ORANGE CLITERAL(Color){ 255, 161, 0, 255 } // Orange -#define PINK CLITERAL(Color){ 255, 109, 194, 255 } // Pink -#define RED CLITERAL(Color){ 230, 41, 55, 255 } // Red -#define MAROON CLITERAL(Color){ 190, 33, 55, 255 } // Maroon -#define GREEN CLITERAL(Color){ 0, 228, 48, 255 } // Green -#define LIME CLITERAL(Color){ 0, 158, 47, 255 } // Lime -#define DARKGREEN CLITERAL(Color){ 0, 117, 44, 255 } // Dark Green -#define SKYBLUE CLITERAL(Color){ 102, 191, 255, 255 } // Sky Blue -#define BLUE CLITERAL(Color){ 0, 121, 241, 255 } // Blue -#define DARKBLUE CLITERAL(Color){ 0, 82, 172, 255 } // Dark Blue -#define PURPLE CLITERAL(Color){ 200, 122, 255, 255 } // Purple -#define VIOLET CLITERAL(Color){ 135, 60, 190, 255 } // Violet -#define DARKPURPLE CLITERAL(Color){ 112, 31, 126, 255 } // Dark Purple -#define BEIGE CLITERAL(Color){ 211, 176, 131, 255 } // Beige -#define BROWN CLITERAL(Color){ 127, 106, 79, 255 } // Brown -#define DARKBROWN CLITERAL(Color){ 76, 63, 47, 255 } // Dark Brown - -#define WHITE CLITERAL(Color){ 255, 255, 255, 255 } // White -#define BLACK CLITERAL(Color){ 0, 0, 0, 255 } // Black -#define BLANK CLITERAL(Color){ 0, 0, 0, 0 } // Blank (Transparent) -#define MAGENTA CLITERAL(Color){ 255, 0, 255, 255 } // Magenta -#define RAYWHITE CLITERAL(Color){ 245, 245, 245, 255 } // My own White (raylib logo) - -//---------------------------------------------------------------------------------- -// Structures Definition -//---------------------------------------------------------------------------------- -// Boolean type -#if defined(__STDC__) && __STDC_VERSION__ >= 199901L - #include -#elif !defined(__cplusplus) && !defined(bool) - typedef enum bool { false, true } bool; - #define RL_BOOL_TYPE -#endif - // Vector2, 2 components typedef struct Vector2 { float x; // Vector x component @@ -799,7 +613,7 @@ typedef enum { // NOTE 1: Filtering considers mipmaps if available in the texture // NOTE 2: Filter is accordingly set for minification and magnification typedef enum { - TEXTURE_FILTER_POINT = 0, // No filter, just pixel approximation + TEXTURE_FILTER_POINT = 0, // No filter, just pixel aproximation TEXTURE_FILTER_BILINEAR, // Linear filtering TEXTURE_FILTER_TRILINEAR, // Trilinear filtering (linear with mipmaps) TEXTURE_FILTER_ANISOTROPIC_4X, // Anisotropic filtering 4x @@ -839,8 +653,7 @@ typedef enum { BLEND_MULTIPLIED, // Blend textures multiplying colors BLEND_ADD_COLORS, // Blend textures adding colors (alternative) BLEND_SUBTRACT_COLORS, // Blend textures subtracting colors (alternative) - BLEND_ALPHA_PREMUL, // Blend premultiplied textures considering alpha - BLEND_CUSTOM // Blend textures using custom src/dst factors (use rlSetBlendMode()) + BLEND_CUSTOM // Belnd textures using custom src/dst factors (use rlSetBlendMode()) } BlendMode; // Gesture @@ -898,247 +711,238 @@ typedef bool (*SaveFileTextCallback)(const char *fileName, char *text); // F // Window and Graphics Device Functions (Module: core) //------------------------------------------------------------------------------------ -#if defined(__cplusplus) -extern "C" { // Prevents name mangling of functions -#endif - // Window-related functions -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 bool IsWindowReady(void); // Check if window has been initialized successfully -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 IsWindowMinimized(void); // Check if window is currently minimized (only PLATFORM_DESKTOP) -RLAPI bool IsWindowMaximized(void); // Check if window is currently maximized (only PLATFORM_DESKTOP) -RLAPI bool IsWindowFocused(void); // Check if window is currently focused (only PLATFORM_DESKTOP) -RLAPI bool IsWindowResized(void); // Check if window has been resized last frame -RLAPI bool IsWindowState(unsigned int flag); // Check if one specific window flag is enabled -RLAPI void SetWindowState(unsigned int flags); // Set window configuration state using flags (only PLATFORM_DESKTOP) -RLAPI void ClearWindowState(unsigned int flags); // Clear window configuration state flags -RLAPI void ToggleFullscreen(void); // Toggle window state: fullscreen/windowed (only PLATFORM_DESKTOP) -RLAPI void MaximizeWindow(void); // Set window state: maximized, if resizable (only PLATFORM_DESKTOP) -RLAPI void MinimizeWindow(void); // Set window state: minimized, if resizable (only PLATFORM_DESKTOP) -RLAPI void RestoreWindow(void); // Set window state: not minimized/maximized (only PLATFORM_DESKTOP) -RLAPI void SetWindowIcon(Image image); // Set icon for window (only PLATFORM_DESKTOP) -RLAPI void SetWindowTitle(const char *title); // Set title for window (only PLATFORM_DESKTOP) -RLAPI void SetWindowPosition(int x, int y); // Set window position on screen (only PLATFORM_DESKTOP) -RLAPI void SetWindowMonitor(int monitor); // Set monitor for the current window (fullscreen mode) -RLAPI void SetWindowMinSize(int width, int height); // Set window minimum dimensions (for FLAG_WINDOW_RESIZABLE) -RLAPI void SetWindowSize(int width, int height); // Set window dimensions -RLAPI void SetWindowOpacity(float opacity); // Set window opacity [0.0f..1.0f] (only PLATFORM_DESKTOP) -RLAPI void *GetWindowHandle(void); // Get native window handle -RLAPI int GetScreenWidth(void); // Get current screen width -RLAPI int GetScreenHeight(void); // Get current screen height -RLAPI int GetRenderWidth(void); // Get current render width (it considers HiDPI) -RLAPI int GetRenderHeight(void); // Get current render height (it considers HiDPI) -RLAPI int GetMonitorCount(void); // Get number of connected monitors -RLAPI int GetCurrentMonitor(void); // Get current connected monitor -RLAPI Vector2 GetMonitorPosition(int monitor); // Get specified monitor position -RLAPI int GetMonitorWidth(int monitor); // Get specified monitor width (max available by monitor) -RLAPI int GetMonitorHeight(int monitor); // Get specified monitor height (max available by monitor) -RLAPI int GetMonitorPhysicalWidth(int monitor); // Get specified monitor physical width in millimetres -RLAPI int GetMonitorPhysicalHeight(int monitor); // Get specified monitor physical height in millimetres -RLAPI int GetMonitorRefreshRate(int monitor); // Get specified monitor refresh rate -RLAPI Vector2 GetWindowPosition(void); // Get window position XY on monitor -RLAPI Vector2 GetWindowScaleDPI(void); // Get window scale DPI factor -RLAPI const char *GetMonitorName(int monitor); // Get the human-readable, UTF-8 encoded name of the primary monitor -RLAPI void SetClipboardText(const char *text); // Set clipboard text content -RLAPI const char *GetClipboardText(void); // Get clipboard text content +void InitWindow(int width, int height, const char *title); // Initialize window and OpenGL context +bool WindowShouldClose(void); // Check if KEY_ESCAPE pressed or Close icon pressed +void CloseWindow(void); // Close window and unload OpenGL context +bool IsWindowReady(void); // Check if window has been initialized successfully +bool IsWindowFullscreen(void); // Check if window is currently fullscreen +bool IsWindowHidden(void); // Check if window is currently hidden (only PLATFORM_DESKTOP) +bool IsWindowMinimized(void); // Check if window is currently minimized (only PLATFORM_DESKTOP) +bool IsWindowMaximized(void); // Check if window is currently maximized (only PLATFORM_DESKTOP) +bool IsWindowFocused(void); // Check if window is currently focused (only PLATFORM_DESKTOP) +bool IsWindowResized(void); // Check if window has been resized last frame +bool IsWindowState(unsigned int flag); // Check if one specific window flag is enabled +void SetWindowState(unsigned int flags); // Set window configuration state using flags +void ClearWindowState(unsigned int flags); // Clear window configuration state flags +void ToggleFullscreen(void); // Toggle window state: fullscreen/windowed (only PLATFORM_DESKTOP) +void MaximizeWindow(void); // Set window state: maximized, if resizable (only PLATFORM_DESKTOP) +void MinimizeWindow(void); // Set window state: minimized, if resizable (only PLATFORM_DESKTOP) +void RestoreWindow(void); // Set window state: not minimized/maximized (only PLATFORM_DESKTOP) +void SetWindowIcon(Image image); // Set icon for window (only PLATFORM_DESKTOP) +void SetWindowTitle(const char *title); // Set title for window (only PLATFORM_DESKTOP) +void SetWindowPosition(int x, int y); // Set window position on screen (only PLATFORM_DESKTOP) +void SetWindowMonitor(int monitor); // Set monitor for the current window (fullscreen mode) +void SetWindowMinSize(int width, int height); // Set window minimum dimensions (for FLAG_WINDOW_RESIZABLE) +void SetWindowSize(int width, int height); // Set window dimensions +void *GetWindowHandle(void); // Get native window handle +int GetScreenWidth(void); // Get current screen width +int GetScreenHeight(void); // Get current screen height +int GetMonitorCount(void); // Get number of connected monitors +int GetCurrentMonitor(void); // Get current connected monitor +Vector2 GetMonitorPosition(int monitor); // Get specified monitor position +int GetMonitorWidth(int monitor); // Get specified monitor width (max available by monitor) +int GetMonitorHeight(int monitor); // Get specified monitor height (max available by monitor) +int GetMonitorPhysicalWidth(int monitor); // Get specified monitor physical width in millimetres +int GetMonitorPhysicalHeight(int monitor); // Get specified monitor physical height in millimetres +int GetMonitorRefreshRate(int monitor); // Get specified monitor refresh rate +Vector2 GetWindowPosition(void); // Get window position XY on monitor +Vector2 GetWindowScaleDPI(void); // Get window scale DPI factor +const char *GetMonitorName(int monitor); // Get the human-readable, UTF-8 encoded name of the primary monitor +void SetClipboardText(const char *text); // Set clipboard text content +const char *GetClipboardText(void); // Get clipboard text content // Custom frame control functions // NOTE: Those functions are intended for advance users that want full control over the frame processing // By default EndDrawing() does this job: draws everything + SwapScreenBuffer() + manage frame timming + PollInputEvents() // To avoid that behaviour and control frame processes manually, enable in config.h: SUPPORT_CUSTOM_FRAME_CONTROL -RLAPI void SwapScreenBuffer(void); // Swap back buffer with front buffer (screen drawing) -RLAPI void PollInputEvents(void); // Register all input events -RLAPI void WaitTime(float ms); // Wait for some milliseconds (halt program execution) +void SwapScreenBuffer(void); // Swap back buffer with front buffer (screen drawing) +void PollInputEvents(void); // Register all input events +void WaitTime(float ms); // Wait for some milliseconds (halt program execution) // Cursor-related functions -RLAPI void ShowCursor(void); // Shows cursor -RLAPI void HideCursor(void); // Hides cursor -RLAPI bool IsCursorHidden(void); // Check if cursor is not visible -RLAPI void EnableCursor(void); // Enables cursor (unlock cursor) -RLAPI void DisableCursor(void); // Disables cursor (lock cursor) -RLAPI bool IsCursorOnScreen(void); // Check if cursor is on the screen +void ShowCursor(void); // Shows cursor +void HideCursor(void); // Hides cursor +bool IsCursorHidden(void); // Check if cursor is not visible +void EnableCursor(void); // Enables cursor (unlock cursor) +void DisableCursor(void); // Disables cursor (lock cursor) +bool IsCursorOnScreen(void); // Check if cursor is on the screen // Drawing-related functions -RLAPI void ClearBackground(Color color); // Set background color (framebuffer clear color) -RLAPI void BeginDrawing(void); // Setup canvas (framebuffer) to start drawing -RLAPI void EndDrawing(void); // End canvas drawing and swap buffers (double buffering) -RLAPI void BeginMode2D(Camera2D camera); // Begin 2D mode with custom camera (2D) -RLAPI void EndMode2D(void); // Ends 2D mode with custom camera -RLAPI void BeginMode3D(Camera3D camera); // Begin 3D mode with custom camera (3D) -RLAPI void EndMode3D(void); // Ends 3D mode and returns to default 2D orthographic mode -RLAPI void BeginTextureMode(RenderTexture2D target); // Begin drawing to render texture -RLAPI void EndTextureMode(void); // Ends drawing to render texture -RLAPI void BeginShaderMode(Shader shader); // Begin custom shader drawing -RLAPI void EndShaderMode(void); // End custom shader drawing (use default shader) -RLAPI void BeginBlendMode(int mode); // Begin blending mode (alpha, additive, multiplied, subtract, custom) -RLAPI void EndBlendMode(void); // End blending mode (reset to default: alpha blending) -RLAPI void BeginScissorMode(int x, int y, int width, int height); // Begin scissor mode (define screen area for following drawing) -RLAPI void EndScissorMode(void); // End scissor mode -RLAPI void BeginVrStereoMode(VrStereoConfig config); // Begin stereo rendering (requires VR simulator) -RLAPI void EndVrStereoMode(void); // End stereo rendering (requires VR simulator) +void ClearBackground(Color color); // Set background color (framebuffer clear color) +void BeginDrawing(void); // Setup canvas (framebuffer) to start drawing +void EndDrawing(void); // End canvas drawing and swap buffers (double buffering) +void BeginMode2D(Camera2D camera); // Begin 2D mode with custom camera (2D) +void EndMode2D(void); // Ends 2D mode with custom camera +void BeginMode3D(Camera3D camera); // Begin 3D mode with custom camera (3D) +void EndMode3D(void); // Ends 3D mode and returns to default 2D orthographic mode +void BeginTextureMode(RenderTexture2D target); // Begin drawing to render texture +void EndTextureMode(void); // Ends drawing to render texture +void BeginShaderMode(Shader shader); // Begin custom shader drawing +void EndShaderMode(void); // End custom shader drawing (use default shader) +void BeginBlendMode(int mode); // Begin blending mode (alpha, additive, multiplied, subtract, custom) +void EndBlendMode(void); // End blending mode (reset to default: alpha blending) +void BeginScissorMode(int x, int y, int width, int height); // Begin scissor mode (define screen area for following drawing) +void EndScissorMode(void); // End scissor mode +void BeginVrStereoMode(VrStereoConfig config); // Begin stereo rendering (requires VR simulator) +void EndVrStereoMode(void); // End stereo rendering (requires VR simulator) // VR stereo config functions for VR simulator -RLAPI VrStereoConfig LoadVrStereoConfig(VrDeviceInfo device); // Load VR stereo config for VR simulator device parameters -RLAPI void UnloadVrStereoConfig(VrStereoConfig config); // Unload VR stereo config +VrStereoConfig LoadVrStereoConfig(VrDeviceInfo device); // Load VR stereo config for VR simulator device parameters +void UnloadVrStereoConfig(VrStereoConfig config); // Unload VR stereo config // Shader management functions // NOTE: Shader functionality is not available on OpenGL 1.1 -RLAPI Shader LoadShader(const char *vsFileName, const char *fsFileName); // Load shader from files and bind default locations -RLAPI Shader LoadShaderFromMemory(const char *vsCode, const char *fsCode); // Load shader from code strings and bind default locations -RLAPI int GetShaderLocation(Shader shader, const char *uniformName); // Get shader uniform location -RLAPI int GetShaderLocationAttrib(Shader shader, const char *attribName); // Get shader attribute location -RLAPI void SetShaderValue(Shader shader, int locIndex, const void *value, int uniformType); // Set shader uniform value -RLAPI void SetShaderValueV(Shader shader, int locIndex, const void *value, int uniformType, int count); // Set shader uniform value vector -RLAPI void SetShaderValueMatrix(Shader shader, int locIndex, Matrix mat); // Set shader uniform value (matrix 4x4) -RLAPI void SetShaderValueTexture(Shader shader, int locIndex, Texture2D texture); // Set shader uniform value for texture (sampler2d) -RLAPI void UnloadShader(Shader shader); // Unload shader from GPU memory (VRAM) +Shader LoadShader(const char *vsFileName, const char *fsFileName); // Load shader from files and bind default locations +Shader LoadShaderFromMemory(const char *vsCode, const char *fsCode); // Load shader from code strings and bind default locations +int GetShaderLocation(Shader shader, const char *uniformName); // Get shader uniform location +int GetShaderLocationAttrib(Shader shader, const char *attribName); // Get shader attribute location +void SetShaderValue(Shader shader, int locIndex, const void *value, int uniformType); // Set shader uniform value +void SetShaderValueV(Shader shader, int locIndex, const void *value, int uniformType, int count); // Set shader uniform value vector +void SetShaderValueMatrix(Shader shader, int locIndex, Matrix mat); // Set shader uniform value (matrix 4x4) +void SetShaderValueTexture(Shader shader, int locIndex, Texture2D texture); // Set shader uniform value for texture (sampler2d) +void UnloadShader(Shader shader); // Unload shader from GPU memory (VRAM) // Screen-space-related functions -RLAPI Ray GetMouseRay(Vector2 mousePosition, Camera camera); // Get a ray trace from mouse position -RLAPI Matrix GetCameraMatrix(Camera camera); // Get camera transform matrix (view matrix) -RLAPI Matrix GetCameraMatrix2D(Camera2D camera); // Get camera 2d transform matrix -RLAPI Vector2 GetWorldToScreen(Vector3 position, Camera camera); // Get the screen space position for a 3d world space position -RLAPI Vector2 GetWorldToScreenEx(Vector3 position, Camera camera, int width, int height); // Get size position for a 3d world space position -RLAPI Vector2 GetWorldToScreen2D(Vector2 position, Camera2D camera); // Get the screen space position for a 2d camera world space position -RLAPI Vector2 GetScreenToWorld2D(Vector2 position, Camera2D camera); // Get the world space position for a 2d camera screen space position +Ray GetMouseRay(Vector2 mousePosition, Camera camera); // Get a ray trace from mouse position +Matrix GetCameraMatrix(Camera camera); // Get camera transform matrix (view matrix) +Matrix GetCameraMatrix2D(Camera2D camera); // Get camera 2d transform matrix +Vector2 GetWorldToScreen(Vector3 position, Camera camera); // Get the screen space position for a 3d world space position +Vector2 GetWorldToScreenEx(Vector3 position, Camera camera, int width, int height); // Get size position for a 3d world space position +Vector2 GetWorldToScreen2D(Vector2 position, Camera2D camera); // Get the screen space position for a 2d camera world space position +Vector2 GetScreenToWorld2D(Vector2 position, Camera2D camera); // Get the world space position for a 2d camera screen space position // Timing-related functions -RLAPI void SetTargetFPS(int fps); // Set target FPS (maximum) -RLAPI int GetFPS(void); // Get current FPS -RLAPI float GetFrameTime(void); // Get time in seconds for last frame drawn (delta time) -RLAPI double GetTime(void); // Get elapsed time in seconds since InitWindow() +void SetTargetFPS(int fps); // Set target FPS (maximum) +int GetFPS(void); // Get current FPS +float GetFrameTime(void); // Get time in seconds for last frame drawn (delta time) +double GetTime(void); // Get elapsed time in seconds since InitWindow() // Misc. functions -RLAPI int GetRandomValue(int min, int max); // Get a random value between min and max (both included) -RLAPI void SetRandomSeed(unsigned int seed); // Set the seed for the random number generator -RLAPI void TakeScreenshot(const char *fileName); // Takes a screenshot of current screen (filename extension defines format) -RLAPI void SetConfigFlags(unsigned int flags); // Setup init configuration flags (view FLAGS) +int GetRandomValue(int min, int max); // Get a random value between min and max (both included) +void SetRandomSeed(unsigned int seed); // Set the seed for the random number generator +void TakeScreenshot(const char *fileName); // Takes a screenshot of current screen (filename extension defines format) +void SetConfigFlags(unsigned int flags); // Setup init configuration flags (view FLAGS) -RLAPI void TraceLog(int logLevel, const char *text, ...); // Show trace log messages (LOG_DEBUG, LOG_INFO, LOG_WARNING, LOG_ERROR...) -RLAPI void SetTraceLogLevel(int logLevel); // Set the current threshold (minimum) log level -RLAPI void *MemAlloc(int size); // Internal memory allocator -RLAPI void *MemRealloc(void *ptr, int size); // Internal memory reallocator -RLAPI void MemFree(void *ptr); // Internal memory free +void TraceLog(int logLevel, const char *text, ...); // Show trace log messages (LOG_DEBUG, LOG_INFO, LOG_WARNING, LOG_ERROR...) +void SetTraceLogLevel(int logLevel); // Set the current threshold (minimum) log level +void *MemAlloc(int size); // Internal memory allocator +void *MemRealloc(void *ptr, int size); // Internal memory reallocator +void MemFree(void *ptr); // Internal memory free // Set custom callbacks // WARNING: Callbacks setup is intended for advance users -RLAPI void SetTraceLogCallback(TraceLogCallback callback); // Set custom trace log -RLAPI void SetLoadFileDataCallback(LoadFileDataCallback callback); // Set custom file binary data loader -RLAPI void SetSaveFileDataCallback(SaveFileDataCallback callback); // Set custom file binary data saver -RLAPI void SetLoadFileTextCallback(LoadFileTextCallback callback); // Set custom file text data loader -RLAPI void SetSaveFileTextCallback(SaveFileTextCallback callback); // Set custom file text data saver +void SetTraceLogCallback(TraceLogCallback callback); // Set custom trace log +void SetLoadFileDataCallback(LoadFileDataCallback callback); // Set custom file binary data loader +void SetSaveFileDataCallback(SaveFileDataCallback callback); // Set custom file binary data saver +void SetLoadFileTextCallback(LoadFileTextCallback callback); // Set custom file text data loader +void SetSaveFileTextCallback(SaveFileTextCallback callback); // Set custom file text data saver // Files management functions -RLAPI unsigned char *LoadFileData(const char *fileName, unsigned int *bytesRead); // Load file data as byte array (read) -RLAPI void UnloadFileData(unsigned char *data); // Unload file data allocated by LoadFileData() -RLAPI bool SaveFileData(const char *fileName, void *data, unsigned int bytesToWrite); // Save data to file from byte array (write), returns true on success -RLAPI char *LoadFileText(const char *fileName); // Load text data from file (read), returns a '\0' terminated string -RLAPI void UnloadFileText(char *text); // Unload file text data allocated by LoadFileText() -RLAPI bool SaveFileText(const char *fileName, char *text); // Save text data to file (write), string must be '\0' terminated, returns true on success -RLAPI bool FileExists(const char *fileName); // Check if file exists -RLAPI bool DirectoryExists(const char *dirPath); // Check if a directory path exists -RLAPI bool IsFileExtension(const char *fileName, const char *ext); // Check file extension (including point: .png, .wav) -RLAPI int GetFileLength(const char *fileName); // Get file length in bytes (NOTE: GetFileSize() conflicts with windows.h) -RLAPI const char *GetFileExtension(const char *fileName); // Get pointer to extension for a filename string (includes dot: '.png') -RLAPI const char *GetFileName(const char *filePath); // Get pointer to filename for a path string -RLAPI const char *GetFileNameWithoutExt(const char *filePath); // Get filename string without extension (uses static string) -RLAPI const char *GetDirectoryPath(const char *filePath); // Get full path for a given fileName with path (uses static string) -RLAPI const char *GetPrevDirectoryPath(const char *dirPath); // Get previous directory path for a given path (uses static string) -RLAPI const char *GetWorkingDirectory(void); // Get current working directory (uses static string) -RLAPI const char *GetApplicationDirectory(void); // Get the directory if the running application (uses static string) -RLAPI char **GetDirectoryFiles(const char *dirPath, int *count); // Get filenames in a directory path (memory should be freed) -RLAPI void ClearDirectoryFiles(void); // Clear directory files paths buffers (free memory) -RLAPI bool ChangeDirectory(const char *dir); // Change working directory, return true on success -RLAPI bool IsFileDropped(void); // Check if a file has been dropped into window -RLAPI char **GetDroppedFiles(int *count); // Get dropped files names (memory should be freed) -RLAPI void ClearDroppedFiles(void); // Clear dropped files paths buffer (free memory) -RLAPI long GetFileModTime(const char *fileName); // Get file modification time (last write time) +unsigned char *LoadFileData(const char *fileName, unsigned int *bytesRead); // Load file data as byte array (read) +void UnloadFileData(unsigned char *data); // Unload file data allocated by LoadFileData() +bool SaveFileData(const char *fileName, void *data, unsigned int bytesToWrite); // Save data to file from byte array (write), returns true on success +char *LoadFileText(const char *fileName); // Load text data from file (read), returns a '\0' terminated string +void UnloadFileText(char *text); // Unload file text data allocated by LoadFileText() +bool SaveFileText(const char *fileName, char *text); // Save text data to file (write), string must be '\0' terminated, returns true on success +bool FileExists(const char *fileName); // Check if file exists +bool DirectoryExists(const char *dirPath); // Check if a directory path exists +bool IsFileExtension(const char *fileName, const char *ext);// Check file extension (including point: .png, .wav) +const char *GetFileExtension(const char *fileName); // Get pointer to extension for a filename string (includes dot: '.png') +const char *GetFileName(const char *filePath); // Get pointer to filename for a path string +const char *GetFileNameWithoutExt(const char *filePath); // Get filename string without extension (uses static string) +const char *GetDirectoryPath(const char *filePath); // Get full path for a given fileName with path (uses static string) +const char *GetPrevDirectoryPath(const char *dirPath); // Get previous directory path for a given path (uses static string) +const char *GetWorkingDirectory(void); // Get current working directory (uses static string) +char **GetDirectoryFiles(const char *dirPath, int *count); // Get filenames in a directory path (memory should be freed) +void ClearDirectoryFiles(void); // Clear directory files paths buffers (free memory) +bool ChangeDirectory(const char *dir); // Change working directory, return true on success +bool IsFileDropped(void); // Check if a file has been dropped into window +char **GetDroppedFiles(int *count); // Get dropped files names (memory should be freed) +void ClearDroppedFiles(void); // Clear dropped files paths buffer (free memory) +long GetFileModTime(const char *fileName); // Get file modification time (last write time) // Compression/Encoding functionality -RLAPI unsigned char *CompressData(const unsigned char *data, int dataLength, int *compDataLength); // Compress data (DEFLATE algorithm) -RLAPI unsigned char *DecompressData(const unsigned char *compData, int compDataLength, int *dataLength); // Decompress data (DEFLATE algorithm) -RLAPI char *EncodeDataBase64(const unsigned char *data, int dataLength, int *outputLength); // Encode data to Base64 string -RLAPI unsigned char *DecodeDataBase64(const unsigned char *data, int *outputLength); // Decode Base64 string data +unsigned char *CompressData(unsigned char *data, int dataLength, int *compDataLength); // Compress data (DEFLATE algorithm) +unsigned char *DecompressData(unsigned char *compData, int compDataLength, int *dataLength); // Decompress data (DEFLATE algorithm) +char *EncodeDataBase64(const unsigned char *data, int dataLength, int *outputLength); // Encode data to Base64 string +unsigned char *DecodeDataBase64(unsigned char *data, int *outputLength); // Decode Base64 string data // Persistent storage management -RLAPI bool SaveStorageValue(unsigned int position, int value); // Save integer value to storage file (to defined position), returns true on success -RLAPI int LoadStorageValue(unsigned int position); // Load integer value from storage file (from defined position) +bool SaveStorageValue(unsigned int position, int value); // Save integer value to storage file (to defined position), returns true on success +int LoadStorageValue(unsigned int position); // Load integer value from storage file (from defined position) -RLAPI void OpenURL(const char *url); // Open URL with default system browser (if available) +void OpenURL(const char *url); // Open URL with default system browser (if available) //------------------------------------------------------------------------------------ // Input Handling Functions (Module: core) //------------------------------------------------------------------------------------ // Input-related functions: keyboard -RLAPI bool IsKeyPressed(int key); // Check if a key has been pressed once -RLAPI bool IsKeyDown(int key); // Check if a key is being pressed -RLAPI bool IsKeyReleased(int key); // Check if a key has been released once -RLAPI bool IsKeyUp(int key); // Check if a key is NOT being pressed -RLAPI void SetExitKey(int key); // Set a custom key to exit program (default is ESC) -RLAPI int GetKeyPressed(void); // Get key pressed (keycode), call it multiple times for keys queued, returns 0 when the queue is empty -RLAPI int GetCharPressed(void); // Get char pressed (unicode), call it multiple times for chars queued, returns 0 when the queue is empty +bool IsKeyPressed(int key); // Check if a key has been pressed once +bool IsKeyDown(int key); // Check if a key is being pressed +bool IsKeyReleased(int key); // Check if a key has been released once +bool IsKeyUp(int key); // Check if a key is NOT being pressed +void SetExitKey(int key); // Set a custom key to exit program (default is ESC) +int GetKeyPressed(void); // Get key pressed (keycode), call it multiple times for keys queued, returns 0 when the queue is empty +int GetCharPressed(void); // Get char pressed (unicode), call it multiple times for chars queued, returns 0 when the queue is empty // Input-related functions: gamepads -RLAPI bool IsGamepadAvailable(int gamepad); // Check if a gamepad is available -RLAPI const char *GetGamepadName(int gamepad); // Get gamepad internal name id -RLAPI bool IsGamepadButtonPressed(int gamepad, int button); // Check if a gamepad button has been pressed once -RLAPI bool IsGamepadButtonDown(int gamepad, int button); // Check if a gamepad button is being pressed -RLAPI bool IsGamepadButtonReleased(int gamepad, int button); // Check if a gamepad button has been released once -RLAPI bool IsGamepadButtonUp(int gamepad, int button); // Check if a gamepad button is NOT being pressed -RLAPI int GetGamepadButtonPressed(void); // Get the last gamepad button pressed -RLAPI int GetGamepadAxisCount(int gamepad); // Get gamepad axis count for a gamepad -RLAPI float GetGamepadAxisMovement(int gamepad, int axis); // Get axis movement value for a gamepad axis -RLAPI int SetGamepadMappings(const char *mappings); // Set internal gamepad mappings (SDL_GameControllerDB) +bool IsGamepadAvailable(int gamepad); // Check if a gamepad is available +const char *GetGamepadName(int gamepad); // Get gamepad internal name id +bool IsGamepadButtonPressed(int gamepad, int button); // Check if a gamepad button has been pressed once +bool IsGamepadButtonDown(int gamepad, int button); // Check if a gamepad button is being pressed +bool IsGamepadButtonReleased(int gamepad, int button); // Check if a gamepad button has been released once +bool IsGamepadButtonUp(int gamepad, int button); // Check if a gamepad button is NOT being pressed +int GetGamepadButtonPressed(void); // Get the last gamepad button pressed +int GetGamepadAxisCount(int gamepad); // Get gamepad axis count for a gamepad +float GetGamepadAxisMovement(int gamepad, int axis); // Get axis movement value for a gamepad axis +int SetGamepadMappings(const char *mappings); // Set internal gamepad mappings (SDL_GameControllerDB) // Input-related functions: mouse -RLAPI bool IsMouseButtonPressed(int button); // Check if a mouse button has been pressed once -RLAPI bool IsMouseButtonDown(int button); // Check if a mouse button is being pressed -RLAPI bool IsMouseButtonReleased(int button); // Check if a mouse button has been released once -RLAPI bool IsMouseButtonUp(int button); // Check if a mouse button is NOT being pressed -RLAPI int GetMouseX(void); // Get mouse position X -RLAPI int GetMouseY(void); // Get mouse position Y -RLAPI Vector2 GetMousePosition(void); // Get mouse position XY -RLAPI Vector2 GetMouseDelta(void); // Get mouse delta between frames -RLAPI void SetMousePosition(int x, int y); // Set mouse position XY -RLAPI void SetMouseOffset(int offsetX, int offsetY); // Set mouse offset -RLAPI void SetMouseScale(float scaleX, float scaleY); // Set mouse scaling -RLAPI float GetMouseWheelMove(void); // Get mouse wheel movement Y -RLAPI void SetMouseCursor(int cursor); // Set mouse cursor +bool IsMouseButtonPressed(int button); // Check if a mouse button has been pressed once +bool IsMouseButtonDown(int button); // Check if a mouse button is being pressed +bool IsMouseButtonReleased(int button); // Check if a mouse button has been released once +bool IsMouseButtonUp(int button); // Check if a mouse button is NOT being pressed +int GetMouseX(void); // Get mouse position X +int GetMouseY(void); // Get mouse position Y +Vector2 GetMousePosition(void); // Get mouse position XY +Vector2 GetMouseDelta(void); // Get mouse delta between frames +void SetMousePosition(int x, int y); // Set mouse position XY +void SetMouseOffset(int offsetX, int offsetY); // Set mouse offset +void SetMouseScale(float scaleX, float scaleY); // Set mouse scaling +float GetMouseWheelMove(void); // Get mouse wheel movement Y +void SetMouseCursor(int cursor); // Set mouse cursor // Input-related functions: touch -RLAPI int GetTouchX(void); // Get touch position X for touch point 0 (relative to screen size) -RLAPI int GetTouchY(void); // Get touch position Y for touch point 0 (relative to screen size) -RLAPI Vector2 GetTouchPosition(int index); // Get touch position XY for a touch point index (relative to screen size) -RLAPI int GetTouchPointId(int index); // Get touch point identifier for given index -RLAPI int GetTouchPointCount(void); // Get number of touch points +int GetTouchX(void); // Get touch position X for touch point 0 (relative to screen size) +int GetTouchY(void); // Get touch position Y for touch point 0 (relative to screen size) +Vector2 GetTouchPosition(int index); // Get touch position XY for a touch point index (relative to screen size) +int GetTouchPointId(int index); // Get touch point identifier for given index +int GetTouchPointCount(void); // Get number of touch points //------------------------------------------------------------------------------------ // Gestures and Touch Handling Functions (Module: rgestures) //------------------------------------------------------------------------------------ -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 int GetGestureDetected(void); // Get latest detected gesture -RLAPI float GetGestureHoldDuration(void); // Get gesture hold time in milliseconds -RLAPI Vector2 GetGestureDragVector(void); // Get gesture drag vector -RLAPI float GetGestureDragAngle(void); // Get gesture drag angle -RLAPI Vector2 GetGesturePinchVector(void); // Get gesture pinch delta -RLAPI float GetGesturePinchAngle(void); // Get gesture pinch angle +void SetGesturesEnabled(unsigned int flags); // Enable a set of gestures using flags +bool IsGestureDetected(int gesture); // Check if a gesture have been detected +int GetGestureDetected(void); // Get latest detected gesture +float GetGestureHoldDuration(void); // Get gesture hold time in milliseconds +Vector2 GetGestureDragVector(void); // Get gesture drag vector +float GetGestureDragAngle(void); // Get gesture drag angle +Vector2 GetGesturePinchVector(void); // Get gesture pinch delta +float GetGesturePinchAngle(void); // Get gesture pinch angle //------------------------------------------------------------------------------------ // Camera System Functions (Module: rcamera) //------------------------------------------------------------------------------------ -RLAPI void SetCameraMode(Camera camera, int mode); // Set camera mode (multiple camera modes available) -RLAPI void UpdateCamera(Camera *camera); // Update camera position for selected mode +void SetCameraMode(Camera camera, int mode); // Set camera mode (multiple camera modes available) +void UpdateCamera(Camera *camera); // Update camera position for selected mode -RLAPI void SetCameraPanControl(int keyPan); // Set camera pan key to combine with mouse movement (free camera) -RLAPI void SetCameraAltControl(int keyAlt); // Set camera alt key to combine with mouse movement (free camera) -RLAPI void SetCameraSmoothZoomControl(int keySmoothZoom); // Set camera smooth zoom key to combine with mouse (free camera) -RLAPI void SetCameraMoveControls(int keyFront, int keyBack, int keyRight, int keyLeft, int keyUp, int keyDown); // Set camera move controls (1st person and 3rd person cameras) +void SetCameraPanControl(int keyPan); // Set camera pan key to combine with mouse movement (free camera) +void SetCameraAltControl(int keyAlt); // Set camera alt key to combine with mouse movement (free camera) +void SetCameraSmoothZoomControl(int keySmoothZoom); // Set camera smooth zoom key to combine with mouse (free camera) +void SetCameraMoveControls(int keyFront, int keyBack, int keyRight, int keyLeft, int keyUp, int keyDown); // Set camera move controls (1st person and 3rd person cameras) //------------------------------------------------------------------------------------ // Basic Shapes Drawing Functions (Module: shapes) @@ -1146,57 +950,57 @@ RLAPI void SetCameraMoveControls(int keyFront, int keyBack, int keyRight, int ke // Set texture and rectangle to be used on shapes drawing // NOTE: It can be useful when using basic shapes and one single font, // defining a font char white rectangle would allow drawing everything in a single draw call -RLAPI void SetShapesTexture(Texture2D texture, Rectangle source); // Set texture and rectangle to be used on shapes drawing +void SetShapesTexture(Texture2D texture, Rectangle source); // Set texture and rectangle to be used on shapes drawing // Basic shapes drawing functions -RLAPI void DrawPixel(int posX, int posY, Color color); // Draw a pixel -RLAPI void DrawPixelV(Vector2 position, Color color); // Draw a pixel (Vector version) -RLAPI void DrawLine(int startPosX, int startPosY, int endPosX, int endPosY, Color color); // Draw a line -RLAPI void DrawLineV(Vector2 startPos, Vector2 endPos, Color color); // Draw a line (Vector version) -RLAPI void DrawLineEx(Vector2 startPos, Vector2 endPos, float thick, Color color); // Draw a line defining thickness -RLAPI void DrawLineBezier(Vector2 startPos, Vector2 endPos, float thick, Color color); // Draw a line using cubic-bezier curves in-out -RLAPI void DrawLineBezierQuad(Vector2 startPos, Vector2 endPos, Vector2 controlPos, float thick, Color color); // Draw line using quadratic bezier curves with a control point -RLAPI void DrawLineBezierCubic(Vector2 startPos, Vector2 endPos, Vector2 startControlPos, Vector2 endControlPos, float thick, Color color); // Draw line using cubic bezier curves with 2 control points -RLAPI void DrawLineStrip(Vector2 *points, int pointCount, Color color); // Draw lines sequence -RLAPI void DrawCircle(int centerX, int centerY, float radius, Color color); // Draw a color-filled circle -RLAPI void DrawCircleSector(Vector2 center, float radius, float startAngle, float endAngle, int segments, Color color); // Draw a piece of a circle -RLAPI void DrawCircleSectorLines(Vector2 center, float radius, float startAngle, float endAngle, int segments, Color color); // Draw circle sector outline -RLAPI void DrawCircleGradient(int centerX, int centerY, float radius, Color color1, Color color2); // Draw a gradient-filled circle -RLAPI void DrawCircleV(Vector2 center, float radius, Color color); // Draw a color-filled circle (Vector version) -RLAPI void DrawCircleLines(int centerX, int centerY, float radius, Color color); // Draw circle outline -RLAPI void DrawEllipse(int centerX, int centerY, float radiusH, float radiusV, Color color); // Draw ellipse -RLAPI void DrawEllipseLines(int centerX, int centerY, float radiusH, float radiusV, Color color); // Draw ellipse outline -RLAPI void DrawRing(Vector2 center, float innerRadius, float outerRadius, float startAngle, float endAngle, int segments, Color color); // Draw ring -RLAPI void DrawRingLines(Vector2 center, float innerRadius, float outerRadius, float startAngle, float endAngle, int segments, Color color); // Draw ring outline -RLAPI void DrawRectangle(int posX, int posY, int width, int height, Color color); // Draw a color-filled rectangle -RLAPI void DrawRectangleV(Vector2 position, Vector2 size, Color color); // Draw a color-filled rectangle (Vector version) -RLAPI void DrawRectangleRec(Rectangle rec, Color color); // Draw a color-filled rectangle -RLAPI void DrawRectanglePro(Rectangle rec, Vector2 origin, float rotation, Color color); // Draw a color-filled rectangle with pro parameters -RLAPI void DrawRectangleGradientV(int posX, int posY, int width, int height, Color color1, Color color2);// Draw a vertical-gradient-filled rectangle -RLAPI void DrawRectangleGradientH(int posX, int posY, int width, int height, Color color1, Color color2);// Draw a horizontal-gradient-filled rectangle -RLAPI void DrawRectangleGradientEx(Rectangle rec, Color col1, Color col2, Color col3, Color col4); // Draw a gradient-filled rectangle with custom vertex colors -RLAPI void DrawRectangleLines(int posX, int posY, int width, int height, Color color); // Draw rectangle outline -RLAPI void DrawRectangleLinesEx(Rectangle rec, float lineThick, Color color); // Draw rectangle outline with extended parameters -RLAPI void DrawRectangleRounded(Rectangle rec, float roundness, int segments, Color color); // Draw rectangle with rounded edges -RLAPI void DrawRectangleRoundedLines(Rectangle rec, float roundness, int segments, float lineThick, Color color); // Draw rectangle with rounded edges outline -RLAPI void DrawTriangle(Vector2 v1, Vector2 v2, Vector2 v3, Color color); // Draw a color-filled triangle (vertex in counter-clockwise order!) -RLAPI void DrawTriangleLines(Vector2 v1, Vector2 v2, Vector2 v3, Color color); // Draw triangle outline (vertex in counter-clockwise order!) -RLAPI void DrawTriangleFan(Vector2 *points, int pointCount, Color color); // Draw a triangle fan defined by points (first vertex is the center) -RLAPI void DrawTriangleStrip(Vector2 *points, int pointCount, Color color); // Draw a triangle strip defined by points -RLAPI void DrawPoly(Vector2 center, int sides, float radius, float rotation, Color color); // Draw a regular polygon (Vector version) -RLAPI void DrawPolyLines(Vector2 center, int sides, float radius, float rotation, Color color); // Draw a polygon outline of n sides -RLAPI void DrawPolyLinesEx(Vector2 center, int sides, float radius, float rotation, float lineThick, Color color); // Draw a polygon outline of n sides with extended parameters +void DrawPixel(int posX, int posY, Color color); // Draw a pixel +void DrawPixelV(Vector2 position, Color color); // Draw a pixel (Vector version) +void DrawLine(int startPosX, int startPosY, int endPosX, int endPosY, Color color); // Draw a line +void DrawLineV(Vector2 startPos, Vector2 endPos, Color color); // Draw a line (Vector version) +void DrawLineEx(Vector2 startPos, Vector2 endPos, float thick, Color color); // Draw a line defining thickness +void DrawLineBezier(Vector2 startPos, Vector2 endPos, float thick, Color color); // Draw a line using cubic-bezier curves in-out +void DrawLineBezierQuad(Vector2 startPos, Vector2 endPos, Vector2 controlPos, float thick, Color color); // Draw line using quadratic bezier curves with a control point +void DrawLineBezierCubic(Vector2 startPos, Vector2 endPos, Vector2 startControlPos, Vector2 endControlPos, float thick, Color color); // Draw line using cubic bezier curves with 2 control points +void DrawLineStrip(Vector2 *points, int pointCount, Color color); // Draw lines sequence +void DrawCircle(int centerX, int centerY, float radius, Color color); // Draw a color-filled circle +void DrawCircleSector(Vector2 center, float radius, float startAngle, float endAngle, int segments, Color color); // Draw a piece of a circle +void DrawCircleSectorLines(Vector2 center, float radius, float startAngle, float endAngle, int segments, Color color); // Draw circle sector outline +void DrawCircleGradient(int centerX, int centerY, float radius, Color color1, Color color2); // Draw a gradient-filled circle +void DrawCircleV(Vector2 center, float radius, Color color); // Draw a color-filled circle (Vector version) +void DrawCircleLines(int centerX, int centerY, float radius, Color color); // Draw circle outline +void DrawEllipse(int centerX, int centerY, float radiusH, float radiusV, Color color); // Draw ellipse +void DrawEllipseLines(int centerX, int centerY, float radiusH, float radiusV, Color color); // Draw ellipse outline +void DrawRing(Vector2 center, float innerRadius, float outerRadius, float startAngle, float endAngle, int segments, Color color); // Draw ring +void DrawRingLines(Vector2 center, float innerRadius, float outerRadius, float startAngle, float endAngle, int segments, Color color); // Draw ring outline +void DrawRectangle(int posX, int posY, int width, int height, Color color); // Draw a color-filled rectangle +void DrawRectangleV(Vector2 position, Vector2 size, Color color); // Draw a color-filled rectangle (Vector version) +void DrawRectangleRec(Rectangle rec, Color color); // Draw a color-filled rectangle +void DrawRectanglePro(Rectangle rec, Vector2 origin, float rotation, Color color); // Draw a color-filled rectangle with pro parameters +void DrawRectangleGradientV(int posX, int posY, int width, int height, Color color1, Color color2);// Draw a vertical-gradient-filled rectangle +void DrawRectangleGradientH(int posX, int posY, int width, int height, Color color1, Color color2);// Draw a horizontal-gradient-filled rectangle +void DrawRectangleGradientEx(Rectangle rec, Color col1, Color col2, Color col3, Color col4); // Draw a gradient-filled rectangle with custom vertex colors +void DrawRectangleLines(int posX, int posY, int width, int height, Color color); // Draw rectangle outline +void DrawRectangleLinesEx(Rectangle rec, float lineThick, Color color); // Draw rectangle outline with extended parameters +void DrawRectangleRounded(Rectangle rec, float roundness, int segments, Color color); // Draw rectangle with rounded edges +void DrawRectangleRoundedLines(Rectangle rec, float roundness, int segments, float lineThick, Color color); // Draw rectangle with rounded edges outline +void DrawTriangle(Vector2 v1, Vector2 v2, Vector2 v3, Color color); // Draw a color-filled triangle (vertex in counter-clockwise order!) +void DrawTriangleLines(Vector2 v1, Vector2 v2, Vector2 v3, Color color); // Draw triangle outline (vertex in counter-clockwise order!) +void DrawTriangleFan(Vector2 *points, int pointCount, Color color); // Draw a triangle fan defined by points (first vertex is the center) +void DrawTriangleStrip(Vector2 *points, int pointCount, Color color); // Draw a triangle strip defined by points +void DrawPoly(Vector2 center, int sides, float radius, float rotation, Color color); // Draw a regular polygon (Vector version) +void DrawPolyLines(Vector2 center, int sides, float radius, float rotation, Color color); // Draw a polygon outline of n sides +void DrawPolyLinesEx(Vector2 center, int sides, float radius, float rotation, float lineThick, Color color); // Draw a polygon outline of n sides with extended parameters // Basic shapes collision detection functions -RLAPI bool CheckCollisionRecs(Rectangle rec1, Rectangle rec2); // Check collision between two rectangles -RLAPI bool CheckCollisionCircles(Vector2 center1, float radius1, Vector2 center2, float radius2); // Check collision between two circles -RLAPI bool CheckCollisionCircleRec(Vector2 center, float radius, Rectangle rec); // Check collision between circle and rectangle -RLAPI bool CheckCollisionPointRec(Vector2 point, Rectangle rec); // Check if point is inside rectangle -RLAPI bool CheckCollisionPointCircle(Vector2 point, Vector2 center, float radius); // Check if point is inside circle -RLAPI bool CheckCollisionPointTriangle(Vector2 point, Vector2 p1, Vector2 p2, Vector2 p3); // Check if point is inside a triangle -RLAPI bool CheckCollisionLines(Vector2 startPos1, Vector2 endPos1, Vector2 startPos2, Vector2 endPos2, Vector2 *collisionPoint); // Check the collision between two lines defined by two points each, returns collision point by reference -RLAPI bool CheckCollisionPointLine(Vector2 point, Vector2 p1, Vector2 p2, int threshold); // Check if point belongs to line created between two points [p1] and [p2] with defined margin in pixels [threshold] -RLAPI Rectangle GetCollisionRec(Rectangle rec1, Rectangle rec2); // Get collision rectangle for two rectangles collision +bool CheckCollisionRecs(Rectangle rec1, Rectangle rec2); // Check collision between two rectangles +bool CheckCollisionCircles(Vector2 center1, float radius1, Vector2 center2, float radius2); // Check collision between two circles +bool CheckCollisionCircleRec(Vector2 center, float radius, Rectangle rec); // Check collision between circle and rectangle +bool CheckCollisionPointRec(Vector2 point, Rectangle rec); // Check if point is inside rectangle +bool CheckCollisionPointCircle(Vector2 point, Vector2 center, float radius); // Check if point is inside circle +bool CheckCollisionPointTriangle(Vector2 point, Vector2 p1, Vector2 p2, Vector2 p3); // Check if point is inside a triangle +bool CheckCollisionLines(Vector2 startPos1, Vector2 endPos1, Vector2 startPos2, Vector2 endPos2, Vector2 *collisionPoint); // Check the collision between two lines defined by two points each, returns collision point by reference +bool CheckCollisionPointLine(Vector2 point, Vector2 p1, Vector2 p2, int threshold); // Check if point belongs to line created between two points [p1] and [p2] with defined margin in pixels [threshold] +Rectangle GetCollisionRec(Rectangle rec1, Rectangle rec2); // Get collision rectangle for two rectangles collision //------------------------------------------------------------------------------------ // Texture Loading and Drawing Functions (Module: textures) @@ -1204,345 +1008,333 @@ RLAPI Rectangle GetCollisionRec(Rectangle rec1, Rectangle rec2); // Image loading functions // NOTE: This functions do not require GPU access -RLAPI Image LoadImage(const char *fileName); // Load image from file into CPU memory (RAM) -RLAPI Image LoadImageRaw(const char *fileName, int width, int height, int format, int headerSize); // Load image from RAW file data -RLAPI Image LoadImageAnim(const char *fileName, int *frames); // Load image sequence from file (frames appended to image.data) -RLAPI Image LoadImageFromMemory(const char *fileType, const unsigned char *fileData, int dataSize); // Load image from memory buffer, fileType refers to extension: i.e. '.png' -RLAPI Image LoadImageFromTexture(Texture2D texture); // Load image from GPU texture data -RLAPI Image LoadImageFromScreen(void); // Load image from screen buffer and (screenshot) -RLAPI void UnloadImage(Image image); // Unload image from CPU memory (RAM) -RLAPI bool ExportImage(Image image, const char *fileName); // Export image data to file, returns true on success -RLAPI bool ExportImageAsCode(Image image, const char *fileName); // Export image as code file defining an array of bytes, returns true on success +Image LoadImage(const char *fileName); // Load image from file into CPU memory (RAM) +Image LoadImageRaw(const char *fileName, int width, int height, int format, int headerSize); // Load image from RAW file data +Image LoadImageAnim(const char *fileName, int *frames); // Load image sequence from file (frames appended to image.data) +Image LoadImageFromMemory(const char *fileType, const unsigned char *fileData, int dataSize); // Load image from memory buffer, fileType refers to extension: i.e. '.png' +Image LoadImageFromTexture(Texture2D texture); // Load image from GPU texture data +Image LoadImageFromScreen(void); // Load image from screen buffer and (screenshot) +void UnloadImage(Image image); // Unload image from CPU memory (RAM) +bool ExportImage(Image image, const char *fileName); // Export image data to file, returns true on success +bool ExportImageAsCode(Image image, const char *fileName); // Export image as code file defining an array of bytes, returns true on success // Image generation functions -RLAPI Image GenImageColor(int width, int height, Color color); // Generate image: plain color -RLAPI Image GenImageGradientV(int width, int height, Color top, Color bottom); // Generate image: vertical gradient -RLAPI Image GenImageGradientH(int width, int height, Color left, Color right); // Generate image: horizontal gradient -RLAPI Image GenImageGradientRadial(int width, int height, float density, Color inner, Color outer); // Generate image: radial gradient -RLAPI Image GenImageChecked(int width, int height, int checksX, int checksY, Color col1, Color col2); // Generate image: checked -RLAPI Image GenImageWhiteNoise(int width, int height, float factor); // Generate image: white noise -RLAPI Image GenImageCellular(int width, int height, int tileSize); // Generate image: cellular algorithm, bigger tileSize means bigger cells +Image GenImageColor(int width, int height, Color color); // Generate image: plain color +Image GenImageGradientV(int width, int height, Color top, Color bottom); // Generate image: vertical gradient +Image GenImageGradientH(int width, int height, Color left, Color right); // Generate image: horizontal gradient +Image GenImageGradientRadial(int width, int height, float density, Color inner, Color outer); // Generate image: radial gradient +Image GenImageChecked(int width, int height, int checksX, int checksY, Color col1, Color col2); // Generate image: checked +Image GenImageWhiteNoise(int width, int height, float factor); // Generate image: white noise +Image GenImageCellular(int width, int height, int tileSize); // Generate image: cellular algorithm, bigger tileSize means bigger cells // Image manipulation functions -RLAPI Image ImageCopy(Image image); // Create an image duplicate (useful for transformations) -RLAPI Image ImageFromImage(Image image, Rectangle rec); // Create an image from another image piece -RLAPI Image ImageText(const char *text, int fontSize, Color color); // Create an image from text (default font) -RLAPI Image ImageTextEx(Font font, const char *text, float fontSize, float spacing, Color tint); // Create an image from text (custom sprite font) -RLAPI void ImageFormat(Image *image, int newFormat); // Convert image data to desired format -RLAPI void ImageToPOT(Image *image, Color fill); // Convert image to POT (power-of-two) -RLAPI void ImageCrop(Image *image, Rectangle crop); // Crop an image to a defined rectangle -RLAPI void ImageAlphaCrop(Image *image, float threshold); // Crop image depending on alpha value -RLAPI void ImageAlphaClear(Image *image, Color color, float threshold); // Clear alpha channel to desired color -RLAPI void ImageAlphaMask(Image *image, Image alphaMask); // Apply alpha mask to image -RLAPI void ImageAlphaPremultiply(Image *image); // Premultiply alpha channel -RLAPI void ImageResize(Image *image, int newWidth, int newHeight); // Resize image (Bicubic scaling algorithm) -RLAPI void ImageResizeNN(Image *image, int newWidth,int newHeight); // Resize image (Nearest-Neighbor scaling algorithm) -RLAPI void ImageResizeCanvas(Image *image, int newWidth, int newHeight, int offsetX, int offsetY, Color fill); // Resize canvas and fill with color -RLAPI void ImageMipmaps(Image *image); // Compute all mipmap levels for a provided image -RLAPI void ImageDither(Image *image, int rBpp, int gBpp, int bBpp, int aBpp); // Dither image data to 16bpp or lower (Floyd-Steinberg dithering) -RLAPI void ImageFlipVertical(Image *image); // Flip image vertically -RLAPI void ImageFlipHorizontal(Image *image); // Flip image horizontally -RLAPI void ImageRotateCW(Image *image); // Rotate image clockwise 90deg -RLAPI void ImageRotateCCW(Image *image); // Rotate image counter-clockwise 90deg -RLAPI void ImageColorTint(Image *image, Color color); // Modify image color: tint -RLAPI void ImageColorInvert(Image *image); // Modify image color: invert -RLAPI void ImageColorGrayscale(Image *image); // Modify image color: grayscale -RLAPI void ImageColorContrast(Image *image, float contrast); // Modify image color: contrast (-100 to 100) -RLAPI void ImageColorBrightness(Image *image, int brightness); // Modify image color: brightness (-255 to 255) -RLAPI void ImageColorReplace(Image *image, Color color, Color replace); // Modify image color: replace color -RLAPI Color *LoadImageColors(Image image); // Load color data from image as a Color array (RGBA - 32bit) -RLAPI Color *LoadImagePalette(Image image, int maxPaletteSize, int *colorCount); // Load colors palette from image as a Color array (RGBA - 32bit) -RLAPI void UnloadImageColors(Color *colors); // Unload color data loaded with LoadImageColors() -RLAPI void UnloadImagePalette(Color *colors); // Unload colors palette loaded with LoadImagePalette() -RLAPI Rectangle GetImageAlphaBorder(Image image, float threshold); // Get image alpha border rectangle -RLAPI Color GetImageColor(Image image, int x, int y); // Get image pixel color at (x, y) position +Image ImageCopy(Image image); // Create an image duplicate (useful for transformations) +Image ImageFromImage(Image image, Rectangle rec); // Create an image from another image piece +Image ImageText(const char *text, int fontSize, Color color); // Create an image from text (default font) +Image ImageTextEx(Font font, const char *text, float fontSize, float spacing, Color tint); // Create an image from text (custom sprite font) +void ImageFormat(Image *image, int newFormat); // Convert image data to desired format +void ImageToPOT(Image *image, Color fill); // Convert image to POT (power-of-two) +void ImageCrop(Image *image, Rectangle crop); // Crop an image to a defined rectangle +void ImageAlphaCrop(Image *image, float threshold); // Crop image depending on alpha value +void ImageAlphaClear(Image *image, Color color, float threshold); // Clear alpha channel to desired color +void ImageAlphaMask(Image *image, Image alphaMask); // Apply alpha mask to image +void ImageAlphaPremultiply(Image *image); // Premultiply alpha channel +void ImageResize(Image *image, int newWidth, int newHeight); // Resize image (Bicubic scaling algorithm) +void ImageResizeNN(Image *image, int newWidth,int newHeight); // Resize image (Nearest-Neighbor scaling algorithm) +void ImageResizeCanvas(Image *image, int newWidth, int newHeight, int offsetX, int offsetY, Color fill); // Resize canvas and fill with color +void ImageMipmaps(Image *image); // Compute all mipmap levels for a provided image +void ImageDither(Image *image, int rBpp, int gBpp, int bBpp, int aBpp); // Dither image data to 16bpp or lower (Floyd-Steinberg dithering) +void ImageFlipVertical(Image *image); // Flip image vertically +void ImageFlipHorizontal(Image *image); // Flip image horizontally +void ImageRotateCW(Image *image); // Rotate image clockwise 90deg +void ImageRotateCCW(Image *image); // Rotate image counter-clockwise 90deg +void ImageColorTint(Image *image, Color color); // Modify image color: tint +void ImageColorInvert(Image *image); // Modify image color: invert +void ImageColorGrayscale(Image *image); // Modify image color: grayscale +void ImageColorContrast(Image *image, float contrast); // Modify image color: contrast (-100 to 100) +void ImageColorBrightness(Image *image, int brightness); // Modify image color: brightness (-255 to 255) +void ImageColorReplace(Image *image, Color color, Color replace); // Modify image color: replace color +Color *LoadImageColors(Image image); // Load color data from image as a Color array (RGBA - 32bit) +Color *LoadImagePalette(Image image, int maxPaletteSize, int *colorCount); // Load colors palette from image as a Color array (RGBA - 32bit) +void UnloadImageColors(Color *colors); // Unload color data loaded with LoadImageColors() +void UnloadImagePalette(Color *colors); // Unload colors palette loaded with LoadImagePalette() +Rectangle GetImageAlphaBorder(Image image, float threshold); // Get image alpha border rectangle +Color GetImageColor(Image image, int x, int y); // Get image pixel color at (x, y) position // Image drawing functions // NOTE: Image software-rendering functions (CPU) -RLAPI void ImageClearBackground(Image *dst, Color color); // Clear image background with given color -RLAPI void ImageDrawPixel(Image *dst, int posX, int posY, Color color); // Draw pixel within an image -RLAPI void ImageDrawPixelV(Image *dst, Vector2 position, Color color); // Draw pixel within an image (Vector version) -RLAPI void ImageDrawLine(Image *dst, int startPosX, int startPosY, int endPosX, int endPosY, Color color); // Draw line within an image -RLAPI void ImageDrawLineV(Image *dst, Vector2 start, Vector2 end, Color color); // Draw line within an image (Vector version) -RLAPI void ImageDrawCircle(Image *dst, int centerX, int centerY, int radius, Color color); // Draw circle within an image -RLAPI void ImageDrawCircleV(Image *dst, Vector2 center, int radius, Color color); // Draw circle within an image (Vector version) -RLAPI void ImageDrawRectangle(Image *dst, int posX, int posY, int width, int height, Color color); // Draw rectangle within an image -RLAPI void ImageDrawRectangleV(Image *dst, Vector2 position, Vector2 size, Color color); // Draw rectangle within an image (Vector version) -RLAPI void ImageDrawRectangleRec(Image *dst, Rectangle rec, Color color); // Draw rectangle within an image -RLAPI void ImageDrawRectangleLines(Image *dst, Rectangle rec, int thick, Color color); // Draw rectangle lines within an image -RLAPI void ImageDraw(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec, Color tint); // Draw a source image within a destination image (tint applied to source) -RLAPI void ImageDrawText(Image *dst, const char *text, int posX, int posY, int fontSize, Color color); // Draw text (using default font) within an image (destination) -RLAPI void ImageDrawTextEx(Image *dst, Font font, const char *text, Vector2 position, float fontSize, float spacing, Color tint); // Draw text (custom sprite font) within an image (destination) +void ImageClearBackground(Image *dst, Color color); // Clear image background with given color +void ImageDrawPixel(Image *dst, int posX, int posY, Color color); // Draw pixel within an image +void ImageDrawPixelV(Image *dst, Vector2 position, Color color); // Draw pixel within an image (Vector version) +void ImageDrawLine(Image *dst, int startPosX, int startPosY, int endPosX, int endPosY, Color color); // Draw line within an image +void ImageDrawLineV(Image *dst, Vector2 start, Vector2 end, Color color); // Draw line within an image (Vector version) +void ImageDrawCircle(Image *dst, int centerX, int centerY, int radius, Color color); // Draw circle within an image +void ImageDrawCircleV(Image *dst, Vector2 center, int radius, Color color); // Draw circle within an image (Vector version) +void ImageDrawRectangle(Image *dst, int posX, int posY, int width, int height, Color color); // Draw rectangle within an image +void ImageDrawRectangleV(Image *dst, Vector2 position, Vector2 size, Color color); // Draw rectangle within an image (Vector version) +void ImageDrawRectangleRec(Image *dst, Rectangle rec, Color color); // Draw rectangle within an image +void ImageDrawRectangleLines(Image *dst, Rectangle rec, int thick, Color color); // Draw rectangle lines within an image +void ImageDraw(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec, Color tint); // Draw a source image within a destination image (tint applied to source) +void ImageDrawText(Image *dst, const char *text, int posX, int posY, int fontSize, Color color); // Draw text (using default font) within an image (destination) +void ImageDrawTextEx(Image *dst, Font font, const char *text, Vector2 position, float fontSize, float spacing, Color tint); // Draw text (custom sprite font) within an image (destination) // Texture loading functions // NOTE: These functions require GPU access -RLAPI Texture2D LoadTexture(const char *fileName); // Load texture from file into GPU memory (VRAM) -RLAPI Texture2D LoadTextureFromImage(Image image); // Load texture from image data -RLAPI TextureCubemap LoadTextureCubemap(Image image, int layout); // Load cubemap from image, multiple image cubemap layouts supported -RLAPI RenderTexture2D LoadRenderTexture(int width, int height); // Load texture for rendering (framebuffer) -RLAPI void UnloadTexture(Texture2D texture); // Unload texture from GPU memory (VRAM) -RLAPI void UnloadRenderTexture(RenderTexture2D target); // Unload render texture from GPU memory (VRAM) -RLAPI void UpdateTexture(Texture2D texture, const void *pixels); // Update GPU texture with new data -RLAPI void UpdateTextureRec(Texture2D texture, Rectangle rec, const void *pixels); // Update GPU texture rectangle with new data +Texture2D LoadTexture(const char *fileName); // Load texture from file into GPU memory (VRAM) +Texture2D LoadTextureFromImage(Image image); // Load texture from image data +TextureCubemap LoadTextureCubemap(Image image, int layout); // Load cubemap from image, multiple image cubemap layouts supported +RenderTexture2D LoadRenderTexture(int width, int height); // Load texture for rendering (framebuffer) +void UnloadTexture(Texture2D texture); // Unload texture from GPU memory (VRAM) +void UnloadRenderTexture(RenderTexture2D target); // Unload render texture from GPU memory (VRAM) +void UpdateTexture(Texture2D texture, const void *pixels); // Update GPU texture with new data +void UpdateTextureRec(Texture2D texture, Rectangle rec, const void *pixels); // Update GPU texture rectangle with new data // Texture configuration functions -RLAPI void GenTextureMipmaps(Texture2D *texture); // Generate GPU mipmaps for a texture -RLAPI void SetTextureFilter(Texture2D texture, int filter); // Set texture scaling filter mode -RLAPI void SetTextureWrap(Texture2D texture, int wrap); // Set texture wrapping mode +void GenTextureMipmaps(Texture2D *texture); // Generate GPU mipmaps for a texture +void SetTextureFilter(Texture2D texture, int filter); // Set texture scaling filter mode +void SetTextureWrap(Texture2D texture, int wrap); // Set texture wrapping mode // Texture drawing functions -RLAPI void DrawTexture(Texture2D texture, int posX, int posY, Color tint); // Draw a Texture2D -RLAPI void DrawTextureV(Texture2D texture, Vector2 position, Color tint); // Draw a Texture2D with position defined as Vector2 -RLAPI void DrawTextureEx(Texture2D texture, Vector2 position, float rotation, float scale, Color tint); // Draw a Texture2D with extended parameters -RLAPI void DrawTextureRec(Texture2D texture, Rectangle source, Vector2 position, Color tint); // Draw a part of a texture defined by a rectangle -RLAPI void DrawTextureQuad(Texture2D texture, Vector2 tiling, Vector2 offset, Rectangle quad, Color tint); // Draw texture quad with tiling and offset parameters -RLAPI void DrawTextureTiled(Texture2D texture, Rectangle source, Rectangle dest, Vector2 origin, float rotation, float scale, Color tint); // Draw part of a texture (defined by a rectangle) with rotation and scale tiled into dest. -RLAPI void DrawTexturePro(Texture2D texture, Rectangle source, Rectangle dest, Vector2 origin, float rotation, Color tint); // Draw a part of a texture defined by a rectangle with 'pro' parameters -RLAPI void DrawTextureNPatch(Texture2D texture, NPatchInfo nPatchInfo, Rectangle dest, Vector2 origin, float rotation, Color tint); // Draws a texture (or part of it) that stretches or shrinks nicely -RLAPI void DrawTexturePoly(Texture2D texture, Vector2 center, Vector2 *points, Vector2 *texcoords, int pointCount, Color tint); // Draw a textured polygon +void DrawTexture(Texture2D texture, int posX, int posY, Color tint); // Draw a Texture2D +void DrawTextureV(Texture2D texture, Vector2 position, Color tint); // Draw a Texture2D with position defined as Vector2 +void DrawTextureEx(Texture2D texture, Vector2 position, float rotation, float scale, Color tint); // Draw a Texture2D with extended parameters +void DrawTextureRec(Texture2D texture, Rectangle source, Vector2 position, Color tint); // Draw a part of a texture defined by a rectangle +void DrawTextureQuad(Texture2D texture, Vector2 tiling, Vector2 offset, Rectangle quad, Color tint); // Draw texture quad with tiling and offset parameters +void DrawTextureTiled(Texture2D texture, Rectangle source, Rectangle dest, Vector2 origin, float rotation, float scale, Color tint); // Draw part of a texture (defined by a rectangle) with rotation and scale tiled into dest. +void DrawTexturePro(Texture2D texture, Rectangle source, Rectangle dest, Vector2 origin, float rotation, Color tint); // Draw a part of a texture defined by a rectangle with 'pro' parameters +void DrawTextureNPatch(Texture2D texture, NPatchInfo nPatchInfo, Rectangle dest, Vector2 origin, float rotation, Color tint); // Draws a texture (or part of it) that stretches or shrinks nicely +void DrawTexturePoly(Texture2D texture, Vector2 center, Vector2 *points, Vector2 *texcoords, int pointCount, Color tint); // Draw a textured polygon // Color/pixel related functions -RLAPI Color Fade(Color color, float alpha); // Get color with alpha applied, alpha goes from 0.0f to 1.0f -RLAPI int ColorToInt(Color color); // Get hexadecimal value for a Color -RLAPI Vector4 ColorNormalize(Color color); // Get Color normalized as float [0..1] -RLAPI Color ColorFromNormalized(Vector4 normalized); // Get Color from normalized values [0..1] -RLAPI Vector3 ColorToHSV(Color color); // Get HSV values for a Color, hue [0..360], saturation/value [0..1] -RLAPI Color ColorFromHSV(float hue, float saturation, float value); // Get a Color from HSV values, hue [0..360], saturation/value [0..1] -RLAPI Color ColorAlpha(Color color, float alpha); // Get color with alpha applied, alpha goes from 0.0f to 1.0f -RLAPI Color ColorAlphaBlend(Color dst, Color src, Color tint); // Get src alpha-blended into dst color with tint -RLAPI Color GetColor(unsigned int hexValue); // Get Color structure from hexadecimal value -RLAPI Color GetPixelColor(void *srcPtr, int format); // Get Color from a source pixel pointer of certain format -RLAPI void SetPixelColor(void *dstPtr, Color color, int format); // Set color formatted into destination pixel pointer -RLAPI int GetPixelDataSize(int width, int height, int format); // Get pixel data size in bytes for certain format +Color Fade(Color color, float alpha); // Get color with alpha applied, alpha goes from 0.0f to 1.0f +int ColorToInt(Color color); // Get hexadecimal value for a Color +Vector4 ColorNormalize(Color color); // Get Color normalized as float [0..1] +Color ColorFromNormalized(Vector4 normalized); // Get Color from normalized values [0..1] +Vector3 ColorToHSV(Color color); // Get HSV values for a Color, hue [0..360], saturation/value [0..1] +Color ColorFromHSV(float hue, float saturation, float value); // Get a Color from HSV values, hue [0..360], saturation/value [0..1] +Color ColorAlpha(Color color, float alpha); // Get color with alpha applied, alpha goes from 0.0f to 1.0f +Color ColorAlphaBlend(Color dst, Color src, Color tint); // Get src alpha-blended into dst color with tint +Color GetColor(unsigned int hexValue); // Get Color structure from hexadecimal value +Color GetPixelColor(void *srcPtr, int format); // Get Color from a source pixel pointer of certain format +void SetPixelColor(void *dstPtr, Color color, int format); // Set color formatted into destination pixel pointer +int GetPixelDataSize(int width, int height, int format); // Get pixel data size in bytes for certain format //------------------------------------------------------------------------------------ // Font Loading and Text Drawing Functions (Module: text) //------------------------------------------------------------------------------------ // Font loading/unloading functions -RLAPI Font GetFontDefault(void); // Get the default Font -RLAPI Font LoadFont(const char *fileName); // Load font from file into GPU memory (VRAM) -RLAPI Font LoadFontEx(const char *fileName, int fontSize, int *fontChars, int glyphCount); // Load font from file with extended parameters, use NULL for fontChars and 0 for glyphCount to load the default character set -RLAPI Font LoadFontFromImage(Image image, Color key, int firstChar); // Load font from Image (XNA style) -RLAPI Font LoadFontFromMemory(const char *fileType, const unsigned char *fileData, int dataSize, int fontSize, int *fontChars, int glyphCount); // Load font from memory buffer, fileType refers to extension: i.e. '.ttf' -RLAPI GlyphInfo *LoadFontData(const unsigned char *fileData, int dataSize, int fontSize, int *fontChars, int glyphCount, int type); // Load font data for further use -RLAPI Image GenImageFontAtlas(const GlyphInfo *chars, Rectangle **recs, int glyphCount, int fontSize, int padding, int packMethod); // Generate image font atlas using chars info -RLAPI void UnloadFontData(GlyphInfo *chars, int glyphCount); // Unload font chars info data (RAM) -RLAPI void UnloadFont(Font font); // Unload font from GPU memory (VRAM) -RLAPI bool ExportFontAsCode(Font font, const char *fileName); // Export font as code file, returns true on success - +Font GetFontDefault(void); // Get the default Font +Font LoadFont(const char *fileName); // Load font from file into GPU memory (VRAM) +Font LoadFontEx(const char *fileName, int fontSize, int *fontChars, int glyphCount); // Load font from file with extended parameters +Font LoadFontFromImage(Image image, Color key, int firstChar); // Load font from Image (XNA style) +Font LoadFontFromMemory(const char *fileType, const unsigned char *fileData, int dataSize, int fontSize, int *fontChars, int glyphCount); // Load font from memory buffer, fileType refers to extension: i.e. '.ttf' +GlyphInfo *LoadFontData(const unsigned char *fileData, int dataSize, int fontSize, int *fontChars, int glyphCount, int type); // Load font data for further use +Image GenImageFontAtlas(const GlyphInfo *chars, Rectangle **recs, int glyphCount, int fontSize, int padding, int packMethod); // Generate image font atlas using chars info +void UnloadFontData(GlyphInfo *chars, int glyphCount); // Unload font chars info data (RAM) +void UnloadFont(Font font); // Unload Font from GPU memory (VRAM) // Text drawing functions -RLAPI void DrawFPS(int posX, int posY); // Draw current FPS -RLAPI void DrawText(const char *text, int posX, int posY, int fontSize, Color color); // Draw text (using default font) -RLAPI void DrawTextEx(Font font, const char *text, Vector2 position, float fontSize, float spacing, Color tint); // Draw text using font and additional parameters -RLAPI void DrawTextPro(Font font, const char *text, Vector2 position, Vector2 origin, float rotation, float fontSize, float spacing, Color tint); // Draw text using Font and pro parameters (rotation) -RLAPI void DrawTextCodepoint(Font font, int codepoint, Vector2 position, float fontSize, Color tint); // Draw one character (codepoint) -RLAPI void DrawTextCodepoints(Font font, const int *codepoints, int count, Vector2 position, float fontSize, float spacing, Color tint); // Draw multiple character (codepoint) +void DrawFPS(int posX, int posY); // Draw current FPS +void DrawText(const char *text, int posX, int posY, int fontSize, Color color); // Draw text (using default font) +void DrawTextEx(Font font, const char *text, Vector2 position, float fontSize, float spacing, Color tint); // Draw text using font and additional parameters +void DrawTextPro(Font font, const char *text, Vector2 position, Vector2 origin, float rotation, float fontSize, float spacing, Color tint); // Draw text using Font and pro parameters (rotation) +void DrawTextCodepoint(Font font, int codepoint, Vector2 position, float fontSize, Color tint); // Draw one character (codepoint) // Text font info functions -RLAPI int MeasureText(const char *text, int fontSize); // Measure string width for default font -RLAPI Vector2 MeasureTextEx(Font font, const char *text, float fontSize, float spacing); // Measure string size for Font -RLAPI int GetGlyphIndex(Font font, int codepoint); // Get glyph index position in font for a codepoint (unicode character), fallback to '?' if not found -RLAPI GlyphInfo GetGlyphInfo(Font font, int codepoint); // Get glyph font info data for a codepoint (unicode character), fallback to '?' if not found -RLAPI Rectangle GetGlyphAtlasRec(Font font, int codepoint); // Get glyph rectangle in font atlas for a codepoint (unicode character), fallback to '?' if not found +int MeasureText(const char *text, int fontSize); // Measure string width for default font +Vector2 MeasureTextEx(Font font, const char *text, float fontSize, float spacing); // Measure string size for Font +int GetGlyphIndex(Font font, int codepoint); // Get glyph index position in font for a codepoint (unicode character), fallback to '?' if not found +GlyphInfo GetGlyphInfo(Font font, int codepoint); // Get glyph font info data for a codepoint (unicode character), fallback to '?' if not found +Rectangle GetGlyphAtlasRec(Font font, int codepoint); // Get glyph rectangle in font atlas for a codepoint (unicode character), fallback to '?' if not found // Text codepoints management functions (unicode characters) -RLAPI int *LoadCodepoints(const char *text, int *count); // Load all codepoints from a UTF-8 text string, codepoints count returned by parameter -RLAPI void UnloadCodepoints(int *codepoints); // Unload codepoints data from memory -RLAPI int GetCodepointCount(const char *text); // Get total number of codepoints in a UTF-8 encoded string -RLAPI int GetCodepoint(const char *text, int *bytesProcessed); // Get next codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure -RLAPI const char *CodepointToUTF8(int codepoint, int *byteSize); // Encode one codepoint into UTF-8 byte array (array length returned as parameter) -RLAPI char *TextCodepointsToUTF8(const int *codepoints, int length); // Encode text as codepoints array into UTF-8 text string (WARNING: memory must be freed!) +int *LoadCodepoints(const char *text, int *count); // Load all codepoints from a UTF-8 text string, codepoints count returned by parameter +void UnloadCodepoints(int *codepoints); // Unload codepoints data from memory +int GetCodepointCount(const char *text); // Get total number of codepoints in a UTF-8 encoded string +int GetCodepoint(const char *text, int *bytesProcessed); // Get next codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure +const char *CodepointToUTF8(int codepoint, int *byteSize); // Encode one codepoint into UTF-8 byte array (array length returned as parameter) +char *TextCodepointsToUTF8(int *codepoints, int length); // Encode text as codepoints array into UTF-8 text string (WARNING: memory must be freed!) // Text strings management functions (no UTF-8 strings, only byte chars) // NOTE: Some strings allocate memory internally for returned strings, just be careful! -RLAPI int TextCopy(char *dst, const char *src); // Copy one string to another, returns bytes copied -RLAPI bool TextIsEqual(const char *text1, const char *text2); // Check if two text string are equal -RLAPI unsigned int TextLength(const char *text); // Get text length, checks for '\0' ending -RLAPI const char *TextFormat(const char *text, ...); // Text formatting with variables (sprintf() style) -RLAPI const char *TextSubtext(const char *text, int position, int length); // Get a piece of a text string -RLAPI char *TextReplace(char *text, const char *replace, const char *by); // Replace text string (WARNING: memory must be freed!) -RLAPI char *TextInsert(const char *text, const char *insert, int position); // Insert text in a position (WARNING: memory must be freed!) -RLAPI const char *TextJoin(const char **textList, int count, const char *delimiter); // Join text strings with delimiter -RLAPI const char **TextSplit(const char *text, char delimiter, int *count); // Split text into multiple strings -RLAPI void TextAppend(char *text, const char *append, int *position); // Append text at specific position and move cursor! -RLAPI int TextFindIndex(const char *text, const char *find); // Find first text occurrence within a string -RLAPI const char *TextToUpper(const char *text); // Get upper case version of provided string -RLAPI const char *TextToLower(const char *text); // Get lower case version of provided string -RLAPI const char *TextToPascal(const char *text); // Get Pascal case notation version of provided string -RLAPI int TextToInteger(const char *text); // Get integer value from text (negative values not supported) +int TextCopy(char *dst, const char *src); // Copy one string to another, returns bytes copied +bool TextIsEqual(const char *text1, const char *text2); // Check if two text string are equal +unsigned int TextLength(const char *text); // Get text length, checks for '\0' ending +const char *TextFormat(const char *text, ...); // Text formatting with variables (sprintf() style) +const char *TextSubtext(const char *text, int position, int length); // Get a piece of a text string +char *TextReplace(char *text, const char *replace, const char *by); // Replace text string (WARNING: memory must be freed!) +char *TextInsert(const char *text, const char *insert, int position); // Insert text in a position (WARNING: memory must be freed!) +const char *TextJoin(const char **textList, int count, const char *delimiter); // Join text strings with delimiter +const char **TextSplit(const char *text, char delimiter, int *count); // Split text into multiple strings +void TextAppend(char *text, const char *append, int *position); // Append text at specific position and move cursor! +int TextFindIndex(const char *text, const char *find); // Find first text occurrence within a string +const char *TextToUpper(const char *text); // Get upper case version of provided string +const char *TextToLower(const char *text); // Get lower case version of provided string +const char *TextToPascal(const char *text); // Get Pascal case notation version of provided string +int TextToInteger(const char *text); // Get integer value from text (negative values not supported) //------------------------------------------------------------------------------------ // Basic 3d Shapes Drawing Functions (Module: models) //------------------------------------------------------------------------------------ // Basic geometric 3D shapes drawing functions -RLAPI void DrawLine3D(Vector3 startPos, Vector3 endPos, Color color); // Draw a line in 3D world space -RLAPI void DrawPoint3D(Vector3 position, Color color); // Draw a point in 3D space, actually a small line -RLAPI void DrawCircle3D(Vector3 center, float radius, Vector3 rotationAxis, float rotationAngle, Color color); // Draw a circle in 3D world space -RLAPI void DrawTriangle3D(Vector3 v1, Vector3 v2, Vector3 v3, Color color); // Draw a color-filled triangle (vertex in counter-clockwise order!) -RLAPI void DrawTriangleStrip3D(Vector3 *points, int pointCount, Color color); // Draw a triangle strip defined by points -RLAPI void DrawCube(Vector3 position, float width, float height, float length, Color color); // Draw cube -RLAPI void DrawCubeV(Vector3 position, Vector3 size, Color color); // Draw cube (Vector version) -RLAPI void DrawCubeWires(Vector3 position, float width, float height, float length, Color color); // Draw cube wires -RLAPI void DrawCubeWiresV(Vector3 position, Vector3 size, Color color); // Draw cube wires (Vector version) -RLAPI void DrawCubeTexture(Texture2D texture, Vector3 position, float width, float height, float length, Color color); // Draw cube textured -RLAPI void DrawCubeTextureRec(Texture2D texture, Rectangle source, Vector3 position, float width, float height, float length, Color color); // Draw cube with a region of a texture -RLAPI void DrawSphere(Vector3 centerPos, float radius, Color color); // Draw sphere -RLAPI void DrawSphereEx(Vector3 centerPos, float radius, int rings, int slices, Color color); // Draw sphere with extended parameters -RLAPI void DrawSphereWires(Vector3 centerPos, float radius, int rings, int slices, Color color); // Draw sphere wires -RLAPI void DrawCylinder(Vector3 position, float radiusTop, float radiusBottom, float height, int slices, Color color); // Draw a cylinder/cone -RLAPI void DrawCylinderEx(Vector3 startPos, Vector3 endPos, float startRadius, float endRadius, int sides, Color color); // Draw a cylinder with base at startPos and top at endPos -RLAPI void DrawCylinderWires(Vector3 position, float radiusTop, float radiusBottom, float height, int slices, Color color); // Draw a cylinder/cone wires -RLAPI void DrawCylinderWiresEx(Vector3 startPos, Vector3 endPos, float startRadius, float endRadius, int sides, Color color); // Draw a cylinder wires with base at startPos and top at endPos -RLAPI void DrawPlane(Vector3 centerPos, Vector2 size, Color color); // Draw a plane XZ -RLAPI void DrawRay(Ray ray, Color color); // Draw a ray line -RLAPI void DrawGrid(int slices, float spacing); // Draw a grid (centered at (0, 0, 0)) +void DrawLine3D(Vector3 startPos, Vector3 endPos, Color color); // Draw a line in 3D world space +void DrawPoint3D(Vector3 position, Color color); // Draw a point in 3D space, actually a small line +void DrawCircle3D(Vector3 center, float radius, Vector3 rotationAxis, float rotationAngle, Color color); // Draw a circle in 3D world space +void DrawTriangle3D(Vector3 v1, Vector3 v2, Vector3 v3, Color color); // Draw a color-filled triangle (vertex in counter-clockwise order!) +void DrawTriangleStrip3D(Vector3 *points, int pointCount, Color color); // Draw a triangle strip defined by points +void DrawCube(Vector3 position, float width, float height, float length, Color color); // Draw cube +void DrawCubeV(Vector3 position, Vector3 size, Color color); // Draw cube (Vector version) +void DrawCubeWires(Vector3 position, float width, float height, float length, Color color); // Draw cube wires +void DrawCubeWiresV(Vector3 position, Vector3 size, Color color); // Draw cube wires (Vector version) +void DrawCubeTexture(Texture2D texture, Vector3 position, float width, float height, float length, Color color); // Draw cube textured +void DrawCubeTextureRec(Texture2D texture, Rectangle source, Vector3 position, float width, float height, float length, Color color); // Draw cube with a region of a texture +void DrawSphere(Vector3 centerPos, float radius, Color color); // Draw sphere +void DrawSphereEx(Vector3 centerPos, float radius, int rings, int slices, Color color); // Draw sphere with extended parameters +void DrawSphereWires(Vector3 centerPos, float radius, int rings, int slices, Color color); // Draw sphere wires +void DrawCylinder(Vector3 position, float radiusTop, float radiusBottom, float height, int slices, Color color); // Draw a cylinder/cone +void DrawCylinderEx(Vector3 startPos, Vector3 endPos, float startRadius, float endRadius, int sides, Color color); // Draw a cylinder with base at startPos and top at endPos +void DrawCylinderWires(Vector3 position, float radiusTop, float radiusBottom, float height, int slices, Color color); // Draw a cylinder/cone wires +void DrawCylinderWiresEx(Vector3 startPos, Vector3 endPos, float startRadius, float endRadius, int sides, Color color); // Draw a cylinder wires with base at startPos and top at endPos +void DrawPlane(Vector3 centerPos, Vector2 size, Color color); // Draw a plane XZ +void DrawRay(Ray ray, Color color); // Draw a ray line +void DrawGrid(int slices, float spacing); // Draw a grid (centered at (0, 0, 0)) //------------------------------------------------------------------------------------ // Model 3d Loading and Drawing Functions (Module: models) //------------------------------------------------------------------------------------ // Model management functions -RLAPI Model LoadModel(const char *fileName); // Load model from files (meshes and materials) -RLAPI Model LoadModelFromMesh(Mesh mesh); // Load model from generated mesh (default material) -RLAPI void UnloadModel(Model model); // Unload model (including meshes) from memory (RAM and/or VRAM) -RLAPI void UnloadModelKeepMeshes(Model model); // Unload model (but not meshes) from memory (RAM and/or VRAM) -RLAPI BoundingBox GetModelBoundingBox(Model model); // Compute model bounding box limits (considers all meshes) +Model LoadModel(const char *fileName); // Load model from files (meshes and materials) +Model LoadModelFromMesh(Mesh mesh); // Load model from generated mesh (default material) +void UnloadModel(Model model); // Unload model (including meshes) from memory (RAM and/or VRAM) +void UnloadModelKeepMeshes(Model model); // Unload model (but not meshes) from memory (RAM and/or VRAM) +BoundingBox GetModelBoundingBox(Model model); // Compute model bounding box limits (considers all meshes) // Model drawing functions -RLAPI void DrawModel(Model model, Vector3 position, float scale, Color tint); // Draw a model (with texture if set) -RLAPI void DrawModelEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); // Draw a model with extended parameters -RLAPI void DrawModelWires(Model model, Vector3 position, float scale, Color tint); // Draw a model wires (with texture if set) -RLAPI void DrawModelWiresEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); // Draw a model wires (with texture if set) with extended parameters -RLAPI void DrawBoundingBox(BoundingBox box, Color color); // Draw bounding box (wires) -RLAPI void DrawBillboard(Camera camera, Texture2D texture, Vector3 position, float size, Color tint); // Draw a billboard texture -RLAPI void DrawBillboardRec(Camera camera, Texture2D texture, Rectangle source, Vector3 position, Vector2 size, Color tint); // Draw a billboard texture defined by source -RLAPI void DrawBillboardPro(Camera camera, Texture2D texture, Rectangle source, Vector3 position, Vector3 up, Vector2 size, Vector2 origin, float rotation, Color tint); // Draw a billboard texture defined by source and rotation +void DrawModel(Model model, Vector3 position, float scale, Color tint); // Draw a model (with texture if set) +void DrawModelEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); // Draw a model with extended parameters +void DrawModelWires(Model model, Vector3 position, float scale, Color tint); // Draw a model wires (with texture if set) +void DrawModelWiresEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); // Draw a model wires (with texture if set) with extended parameters +void DrawBoundingBox(BoundingBox box, Color color); // Draw bounding box (wires) +void DrawBillboard(Camera camera, Texture2D texture, Vector3 position, float size, Color tint); // Draw a billboard texture +void DrawBillboardRec(Camera camera, Texture2D texture, Rectangle source, Vector3 position, Vector2 size, Color tint); // Draw a billboard texture defined by source +void DrawBillboardPro(Camera camera, Texture2D texture, Rectangle source, Vector3 position, Vector3 up, Vector2 size, Vector2 origin, float rotation, Color tint); // Draw a billboard texture defined by source and rotation // Mesh management functions -RLAPI void UploadMesh(Mesh *mesh, bool dynamic); // Upload mesh vertex data in GPU and provide VAO/VBO ids -RLAPI void UpdateMeshBuffer(Mesh mesh, int index, const void *data, int dataSize, int offset); // Update mesh vertex data in GPU for a specific buffer index -RLAPI void UnloadMesh(Mesh mesh); // Unload mesh data from CPU and GPU -RLAPI void DrawMesh(Mesh mesh, Material material, Matrix transform); // Draw a 3d mesh with material and transform -RLAPI void DrawMeshInstanced(Mesh mesh, Material material, const Matrix *transforms, int instances); // Draw multiple mesh instances with material and different transforms -RLAPI bool ExportMesh(Mesh mesh, const char *fileName); // Export mesh data to file, returns true on success -RLAPI BoundingBox GetMeshBoundingBox(Mesh mesh); // Compute mesh bounding box limits -RLAPI void GenMeshTangents(Mesh *mesh); // Compute mesh tangents -RLAPI void GenMeshBinormals(Mesh *mesh); // Compute mesh binormals +void UploadMesh(Mesh *mesh, bool dynamic); // Upload mesh vertex data in GPU and provide VAO/VBO ids +void UpdateMeshBuffer(Mesh mesh, int index, void *data, int dataSize, int offset); // Update mesh vertex data in GPU for a specific buffer index +void UnloadMesh(Mesh mesh); // Unload mesh data from CPU and GPU +void DrawMesh(Mesh mesh, Material material, Matrix transform); // Draw a 3d mesh with material and transform +void DrawMeshInstanced(Mesh mesh, Material material, Matrix *transforms, int instances); // Draw multiple mesh instances with material and different transforms +bool ExportMesh(Mesh mesh, const char *fileName); // Export mesh data to file, returns true on success +BoundingBox GetMeshBoundingBox(Mesh mesh); // Compute mesh bounding box limits +void GenMeshTangents(Mesh *mesh); // Compute mesh tangents +void GenMeshBinormals(Mesh *mesh); // Compute mesh binormals // Mesh generation functions -RLAPI Mesh GenMeshPoly(int sides, float radius); // Generate polygonal mesh -RLAPI Mesh GenMeshPlane(float width, float length, int resX, int resZ); // Generate plane mesh (with subdivisions) -RLAPI Mesh GenMeshCube(float width, float height, float length); // Generate cuboid mesh -RLAPI Mesh GenMeshSphere(float radius, int rings, int slices); // Generate sphere mesh (standard sphere) -RLAPI Mesh GenMeshHemiSphere(float radius, int rings, int slices); // Generate half-sphere mesh (no bottom cap) -RLAPI Mesh GenMeshCylinder(float radius, float height, int slices); // Generate cylinder mesh -RLAPI Mesh GenMeshCone(float radius, float height, int slices); // Generate cone/pyramid mesh -RLAPI Mesh GenMeshTorus(float radius, float size, int radSeg, int sides); // Generate torus mesh -RLAPI Mesh GenMeshKnot(float radius, float size, int radSeg, int sides); // Generate trefoil knot mesh -RLAPI Mesh GenMeshHeightmap(Image heightmap, Vector3 size); // Generate heightmap mesh from image data -RLAPI Mesh GenMeshCubicmap(Image cubicmap, Vector3 cubeSize); // Generate cubes-based map mesh from image data +Mesh GenMeshPoly(int sides, float radius); // Generate polygonal mesh +Mesh GenMeshPlane(float width, float length, int resX, int resZ); // Generate plane mesh (with subdivisions) +Mesh GenMeshCube(float width, float height, float length); // Generate cuboid mesh +Mesh GenMeshSphere(float radius, int rings, int slices); // Generate sphere mesh (standard sphere) +Mesh GenMeshHemiSphere(float radius, int rings, int slices); // Generate half-sphere mesh (no bottom cap) +Mesh GenMeshCylinder(float radius, float height, int slices); // Generate cylinder mesh +Mesh GenMeshCone(float radius, float height, int slices); // Generate cone/pyramid mesh +Mesh GenMeshTorus(float radius, float size, int radSeg, int sides); // Generate torus mesh +Mesh GenMeshKnot(float radius, float size, int radSeg, int sides); // Generate trefoil knot mesh +Mesh GenMeshHeightmap(Image heightmap, Vector3 size); // Generate heightmap mesh from image data +Mesh GenMeshCubicmap(Image cubicmap, Vector3 cubeSize); // Generate cubes-based map mesh from image data // Material loading/unloading functions -RLAPI Material *LoadMaterials(const char *fileName, int *materialCount); // Load materials from model file -RLAPI Material LoadMaterialDefault(void); // Load default material (Supports: DIFFUSE, SPECULAR, NORMAL maps) -RLAPI void UnloadMaterial(Material material); // Unload material from GPU memory (VRAM) -RLAPI void SetMaterialTexture(Material *material, int mapType, Texture2D texture); // Set texture for a material map type (MATERIAL_MAP_DIFFUSE, MATERIAL_MAP_SPECULAR...) -RLAPI void SetModelMeshMaterial(Model *model, int meshId, int materialId); // Set material for a mesh +Material *LoadMaterials(const char *fileName, int *materialCount); // Load materials from model file +Material LoadMaterialDefault(void); // Load default material (Supports: DIFFUSE, SPECULAR, NORMAL maps) +void UnloadMaterial(Material material); // Unload material from GPU memory (VRAM) +void SetMaterialTexture(Material *material, int mapType, Texture2D texture); // Set texture for a material map type (MATERIAL_MAP_DIFFUSE, MATERIAL_MAP_SPECULAR...) +void SetModelMeshMaterial(Model *model, int meshId, int materialId); // Set material for a mesh // Model animations loading/unloading functions -RLAPI ModelAnimation *LoadModelAnimations(const char *fileName, unsigned int *animCount); // Load model animations from file -RLAPI void UpdateModelAnimation(Model model, ModelAnimation anim, int frame); // Update model animation pose -RLAPI void UnloadModelAnimation(ModelAnimation anim); // Unload animation data -RLAPI void UnloadModelAnimations(ModelAnimation *animations, unsigned int count); // Unload animation array data -RLAPI bool IsModelAnimationValid(Model model, ModelAnimation anim); // Check model animation skeleton match +ModelAnimation *LoadModelAnimations(const char *fileName, unsigned int *animCount); // Load model animations from file +void UpdateModelAnimation(Model model, ModelAnimation anim, int frame); // Update model animation pose +void UnloadModelAnimation(ModelAnimation anim); // Unload animation data +void UnloadModelAnimations(ModelAnimation* animations, unsigned int count); // Unload animation array data +bool IsModelAnimationValid(Model model, ModelAnimation anim); // Check model animation skeleton match // Collision detection functions -RLAPI bool CheckCollisionSpheres(Vector3 center1, float radius1, Vector3 center2, float radius2); // Check collision between two spheres -RLAPI bool CheckCollisionBoxes(BoundingBox box1, BoundingBox box2); // Check collision between two bounding boxes -RLAPI bool CheckCollisionBoxSphere(BoundingBox box, Vector3 center, float radius); // Check collision between box and sphere -RLAPI RayCollision GetRayCollisionSphere(Ray ray, Vector3 center, float radius); // Get collision info between ray and sphere -RLAPI RayCollision GetRayCollisionBox(Ray ray, BoundingBox box); // Get collision info between ray and box -RLAPI RayCollision GetRayCollisionModel(Ray ray, Model model); // Get collision info between ray and model -RLAPI RayCollision GetRayCollisionMesh(Ray ray, Mesh mesh, Matrix transform); // Get collision info between ray and mesh -RLAPI RayCollision GetRayCollisionTriangle(Ray ray, Vector3 p1, Vector3 p2, Vector3 p3); // Get collision info between ray and triangle -RLAPI RayCollision GetRayCollisionQuad(Ray ray, Vector3 p1, Vector3 p2, Vector3 p3, Vector3 p4); // Get collision info between ray and quad +bool CheckCollisionSpheres(Vector3 center1, float radius1, Vector3 center2, float radius2); // Check collision between two spheres +bool CheckCollisionBoxes(BoundingBox box1, BoundingBox box2); // Check collision between two bounding boxes +bool CheckCollisionBoxSphere(BoundingBox box, Vector3 center, float radius); // Check collision between box and sphere +RayCollision GetRayCollisionSphere(Ray ray, Vector3 center, float radius); // Get collision info between ray and sphere +RayCollision GetRayCollisionBox(Ray ray, BoundingBox box); // Get collision info between ray and box +RayCollision GetRayCollisionModel(Ray ray, Model model); // Get collision info between ray and model +RayCollision GetRayCollisionMesh(Ray ray, Mesh mesh, Matrix transform); // Get collision info between ray and mesh +RayCollision GetRayCollisionTriangle(Ray ray, Vector3 p1, Vector3 p2, Vector3 p3); // Get collision info between ray and triangle +RayCollision GetRayCollisionQuad(Ray ray, Vector3 p1, Vector3 p2, Vector3 p3, Vector3 p4); // Get collision info between ray and quad //------------------------------------------------------------------------------------ // Audio Loading and Playing Functions (Module: audio) //------------------------------------------------------------------------------------ // Audio device management functions -RLAPI void InitAudioDevice(void); // Initialize audio device and context -RLAPI void CloseAudioDevice(void); // Close the audio device and context -RLAPI bool IsAudioDeviceReady(void); // Check if audio device has been initialized successfully -RLAPI void SetMasterVolume(float volume); // Set master volume (listener) +void InitAudioDevice(void); // Initialize audio device and context +void CloseAudioDevice(void); // Close the audio device and context +bool IsAudioDeviceReady(void); // Check if audio device has been initialized successfully +void SetMasterVolume(float volume); // Set master volume (listener) // Wave/Sound loading/unloading functions -RLAPI Wave LoadWave(const char *fileName); // Load wave data from file -RLAPI Wave LoadWaveFromMemory(const char *fileType, const unsigned char *fileData, int dataSize); // Load wave from memory buffer, fileType refers to extension: i.e. '.wav' -RLAPI Sound LoadSound(const char *fileName); // Load sound from file -RLAPI Sound LoadSoundFromWave(Wave wave); // Load sound from wave data -RLAPI void UpdateSound(Sound sound, const void *data, int sampleCount); // Update sound buffer with new data -RLAPI void UnloadWave(Wave wave); // Unload wave data -RLAPI void UnloadSound(Sound sound); // Unload sound -RLAPI bool ExportWave(Wave wave, const char *fileName); // Export wave data to file, returns true on success -RLAPI bool ExportWaveAsCode(Wave wave, const char *fileName); // Export wave sample data to code (.h), returns true on success +Wave LoadWave(const char *fileName); // Load wave data from file +Wave LoadWaveFromMemory(const char *fileType, const unsigned char *fileData, int dataSize); // Load wave from memory buffer, fileType refers to extension: i.e. '.wav' +Sound LoadSound(const char *fileName); // Load sound from file +Sound LoadSoundFromWave(Wave wave); // Load sound from wave data +void UpdateSound(Sound sound, const void *data, int sampleCount); // Update sound buffer with new data +void UnloadWave(Wave wave); // Unload wave data +void UnloadSound(Sound sound); // Unload sound +bool ExportWave(Wave wave, const char *fileName); // Export wave data to file, returns true on success +bool ExportWaveAsCode(Wave wave, const char *fileName); // Export wave sample data to code (.h), returns true on success // Wave/Sound management functions -RLAPI void PlaySound(Sound sound); // Play a sound -RLAPI void StopSound(Sound sound); // Stop playing a sound -RLAPI void PauseSound(Sound sound); // Pause a sound -RLAPI void ResumeSound(Sound sound); // Resume a paused sound -RLAPI void PlaySoundMulti(Sound sound); // Play a sound (using multichannel buffer pool) -RLAPI void StopSoundMulti(void); // Stop any sound playing (using multichannel buffer pool) -RLAPI int GetSoundsPlaying(void); // Get number of sounds playing in the multichannel -RLAPI bool IsSoundPlaying(Sound sound); // Check if a sound is currently playing -RLAPI void SetSoundVolume(Sound sound, float volume); // Set volume for a sound (1.0 is max level) -RLAPI void SetSoundPitch(Sound sound, float pitch); // Set pitch for a sound (1.0 is base level) -RLAPI void SetSoundPan(Sound sound, float pan); // Set pan for a sound (0.5 is center) -RLAPI Wave WaveCopy(Wave wave); // Copy a wave to a new wave -RLAPI void WaveCrop(Wave *wave, int initSample, int finalSample); // Crop a wave to defined samples range -RLAPI void WaveFormat(Wave *wave, int sampleRate, int sampleSize, int channels); // Convert wave data to desired format -RLAPI float *LoadWaveSamples(Wave wave); // Load samples data from wave as a 32bit float data array -RLAPI void UnloadWaveSamples(float *samples); // Unload samples data loaded with LoadWaveSamples() +void PlaySound(Sound sound); // Play a sound +void StopSound(Sound sound); // Stop playing a sound +void PauseSound(Sound sound); // Pause a sound +void ResumeSound(Sound sound); // Resume a paused sound +void PlaySoundMulti(Sound sound); // Play a sound (using multichannel buffer pool) +void StopSoundMulti(void); // Stop any sound playing (using multichannel buffer pool) +int GetSoundsPlaying(void); // Get number of sounds playing in the multichannel +bool IsSoundPlaying(Sound sound); // Check if a sound is currently playing +void SetSoundVolume(Sound sound, float volume); // Set volume for a sound (1.0 is max level) +void SetSoundPitch(Sound sound, float pitch); // Set pitch for a sound (1.0 is base level) +void WaveFormat(Wave *wave, int sampleRate, int sampleSize, int channels); // Convert wave data to desired format +Wave WaveCopy(Wave wave); // Copy a wave to a new wave +void WaveCrop(Wave *wave, int initSample, int finalSample); // Crop a wave to defined samples range +float *LoadWaveSamples(Wave wave); // Load samples data from wave as a floats array +void UnloadWaveSamples(float *samples); // Unload samples data loaded with LoadWaveSamples() // Music management functions -RLAPI Music LoadMusicStream(const char *fileName); // Load music stream from file -RLAPI Music LoadMusicStreamFromMemory(const char *fileType, const unsigned char *data, int dataSize); // Load music stream from data -RLAPI void UnloadMusicStream(Music music); // Unload music stream -RLAPI void PlayMusicStream(Music music); // Start music playing -RLAPI bool IsMusicStreamPlaying(Music music); // Check if music is playing -RLAPI void UpdateMusicStream(Music music); // Updates buffers for music streaming -RLAPI void StopMusicStream(Music music); // Stop music playing -RLAPI void PauseMusicStream(Music music); // Pause music playing -RLAPI void ResumeMusicStream(Music music); // Resume playing paused music -RLAPI void SeekMusicStream(Music music, float position); // Seek music to a position (in seconds) -RLAPI void SetMusicVolume(Music music, float volume); // Set volume for music (1.0 is max level) -RLAPI void SetMusicPitch(Music music, float pitch); // Set pitch for a music (1.0 is base level) -RLAPI void SetMusicPan(Music music, float pan); // Set pan for a music (0.5 is center) -RLAPI float GetMusicTimeLength(Music music); // Get music time length (in seconds) -RLAPI float GetMusicTimePlayed(Music music); // Get current music time played (in seconds) +Music LoadMusicStream(const char *fileName); // Load music stream from file +Music LoadMusicStreamFromMemory(const char *fileType, unsigned char *data, int dataSize); // Load music stream from data +void UnloadMusicStream(Music music); // Unload music stream +void PlayMusicStream(Music music); // Start music playing +bool IsMusicStreamPlaying(Music music); // Check if music is playing +void UpdateMusicStream(Music music); // Updates buffers for music streaming +void StopMusicStream(Music music); // Stop music playing +void PauseMusicStream(Music music); // Pause music playing +void ResumeMusicStream(Music music); // Resume playing paused music +void SeekMusicStream(Music music, float position); // Seek music to a position (in seconds) +void SetMusicVolume(Music music, float volume); // Set volume for music (1.0 is max level) +void SetMusicPitch(Music music, float pitch); // Set pitch for a music (1.0 is base level) +float GetMusicTimeLength(Music music); // Get music time length (in seconds) +float GetMusicTimePlayed(Music music); // Get current music time played (in seconds) // AudioStream management functions -RLAPI AudioStream LoadAudioStream(unsigned int sampleRate, unsigned int sampleSize, unsigned int channels); // Load audio stream (to stream raw audio pcm data) -RLAPI void UnloadAudioStream(AudioStream stream); // Unload audio stream and free memory -RLAPI void UpdateAudioStream(AudioStream stream, const void *data, int frameCount); // Update audio stream buffers with data -RLAPI bool IsAudioStreamProcessed(AudioStream stream); // Check if any audio stream buffers requires refill -RLAPI void PlayAudioStream(AudioStream stream); // Play audio stream -RLAPI void PauseAudioStream(AudioStream stream); // Pause audio stream -RLAPI void ResumeAudioStream(AudioStream stream); // Resume audio stream -RLAPI bool IsAudioStreamPlaying(AudioStream stream); // Check if audio stream is playing -RLAPI void StopAudioStream(AudioStream stream); // Stop audio stream -RLAPI void SetAudioStreamVolume(AudioStream stream, float volume); // Set volume for audio stream (1.0 is max level) -RLAPI void SetAudioStreamPitch(AudioStream stream, float pitch); // Set pitch for audio stream (1.0 is base level) -RLAPI void SetAudioStreamPan(AudioStream stream, float pan); // Set pan for audio stream (0.5 is centered) -RLAPI void SetAudioStreamBufferSizeDefault(int size); // Default size for new audio streams - -#if defined(__cplusplus) -} -#endif - -#endif // RAYLIB_H +AudioStream LoadAudioStream(unsigned int sampleRate, unsigned int sampleSize, unsigned int channels); // Load audio stream (to stream raw audio pcm data) +void UnloadAudioStream(AudioStream stream); // Unload audio stream and free memory +void UpdateAudioStream(AudioStream stream, const void *data, int frameCount); // Update audio stream buffers with data +bool IsAudioStreamProcessed(AudioStream stream); // Check if any audio stream buffers requires refill +void PlayAudioStream(AudioStream stream); // Play audio stream +void PauseAudioStream(AudioStream stream); // Pause audio stream +void ResumeAudioStream(AudioStream stream); // Resume audio stream +bool IsAudioStreamPlaying(AudioStream stream); // Check if audio stream is playing +void StopAudioStream(AudioStream stream); // Stop audio stream +void SetAudioStreamVolume(AudioStream stream, float volume); // Set volume for audio stream (1.0 is max level) +void SetAudioStreamPitch(AudioStream stream, float pitch); // Set pitch for audio stream (1.0 is base level) +void SetAudioStreamBufferSizeDefault(int size); // Default size for new audio streams diff --git a/resources/raylib_api.json b/resources/raylib_api.json index 5f703a7..5a75649 100644 --- a/resources/raylib_api.json +++ b/resources/raylib_api.json @@ -2,901 +2,901 @@ "structs": [ { "name": "Vector2", - "description": "Vector2, 2 components", + "description": "", "fields": [ { - "type": "float", "name": "x", + "type": "float", "description": "Vector x component" }, { - "type": "float", "name": "y", + "type": "float", "description": "Vector y component" } ] }, { "name": "Vector3", - "description": "Vector3, 3 components", + "description": "", "fields": [ { - "type": "float", "name": "x", + "type": "float", "description": "Vector x component" }, { - "type": "float", "name": "y", + "type": "float", "description": "Vector y component" }, { - "type": "float", "name": "z", + "type": "float", "description": "Vector z component" } ] }, { "name": "Vector4", - "description": "Vector4, 4 components", + "description": "", "fields": [ { - "type": "float", "name": "x", + "type": "float", "description": "Vector x component" }, { - "type": "float", "name": "y", + "type": "float", "description": "Vector y component" }, { - "type": "float", "name": "z", + "type": "float", "description": "Vector z component" }, { - "type": "float", "name": "w", + "type": "float", "description": "Vector w component" } ] }, { "name": "Matrix", - "description": "Matrix, 4x4 components, column major, OpenGL style, right handed", + "description": "", "fields": [ { - "type": "float", "name": "m0, m4, m8, m12", + "type": "float", "description": "Matrix first row (4 components)" }, { - "type": "float", "name": "m1, m5, m9, m13", + "type": "float", "description": "Matrix second row (4 components)" }, { - "type": "float", "name": "m2, m6, m10, m14", + "type": "float", "description": "Matrix third row (4 components)" }, { - "type": "float", "name": "m3, m7, m11, m15", + "type": "float", "description": "Matrix fourth row (4 components)" } ] }, { "name": "Color", - "description": "Color, 4 components, R8G8B8A8 (32bit)", + "description": "", "fields": [ { - "type": "unsigned char", "name": "r", + "type": "unsigned char", "description": "Color red value" }, { - "type": "unsigned char", "name": "g", + "type": "unsigned char", "description": "Color green value" }, { - "type": "unsigned char", "name": "b", + "type": "unsigned char", "description": "Color blue value" }, { - "type": "unsigned char", "name": "a", + "type": "unsigned char", "description": "Color alpha value" } ] }, { "name": "Rectangle", - "description": "Rectangle, 4 components", + "description": "", "fields": [ { - "type": "float", "name": "x", - "description": "Rectangle top-left corner position x" + "type": "float", + "description": "Rectangle top-left corner position x " }, { - "type": "float", "name": "y", + "type": "float", "description": "Rectangle top-left corner position y" }, { - "type": "float", "name": "width", + "type": "float", "description": "Rectangle width" }, { - "type": "float", "name": "height", + "type": "float", "description": "Rectangle height" } ] }, { "name": "Image", - "description": "Image, pixel data stored in CPU memory (RAM)", + "description": "", "fields": [ { - "type": "void *", "name": "data", + "type": "void *", "description": "Image raw data" }, { - "type": "int", "name": "width", + "type": "int", "description": "Image base width" }, { - "type": "int", "name": "height", + "type": "int", "description": "Image base height" }, { - "type": "int", "name": "mipmaps", + "type": "int", "description": "Mipmap levels, 1 by default" }, { - "type": "int", "name": "format", + "type": "int", "description": "Data format (PixelFormat type)" } ] }, { "name": "Texture", - "description": "Texture, tex data stored in GPU memory (VRAM)", + "description": "", "fields": [ { - "type": "unsigned int", "name": "id", + "type": "unsigned int", "description": "OpenGL texture id" }, { - "type": "int", "name": "width", + "type": "int", "description": "Texture base width" }, { - "type": "int", "name": "height", + "type": "int", "description": "Texture base height" }, { - "type": "int", "name": "mipmaps", + "type": "int", "description": "Mipmap levels, 1 by default" }, { - "type": "int", "name": "format", + "type": "int", "description": "Data format (PixelFormat type)" } ] }, { "name": "RenderTexture", - "description": "RenderTexture, fbo for texture rendering", + "description": "", "fields": [ { - "type": "unsigned int", "name": "id", + "type": "unsigned int", "description": "OpenGL framebuffer object id" }, { - "type": "Texture", "name": "texture", + "type": "Texture", "description": "Color buffer attachment texture" }, { - "type": "Texture", "name": "depth", + "type": "Texture", "description": "Depth buffer attachment texture" } ] }, { "name": "NPatchInfo", - "description": "NPatchInfo, n-patch layout info", + "description": "", "fields": [ { - "type": "Rectangle", "name": "source", + "type": "Rectangle", "description": "Texture source rectangle" }, { - "type": "int", "name": "left", + "type": "int", "description": "Left border offset" }, { - "type": "int", "name": "top", + "type": "int", "description": "Top border offset" }, { - "type": "int", "name": "right", + "type": "int", "description": "Right border offset" }, { - "type": "int", "name": "bottom", + "type": "int", "description": "Bottom border offset" }, { - "type": "int", "name": "layout", + "type": "int", "description": "Layout of the n-patch: 3x3, 1x3 or 3x1" } ] }, { - "name": "GlyphInfo", - "description": "GlyphInfo, font characters glyphs info", + "name": "CharInfo", + "description": "", "fields": [ { - "type": "int", "name": "value", + "type": "int", "description": "Character value (Unicode)" }, { - "type": "int", "name": "offsetX", + "type": "int", "description": "Character offset X when drawing" }, { - "type": "int", "name": "offsetY", + "type": "int", "description": "Character offset Y when drawing" }, { - "type": "int", "name": "advanceX", + "type": "int", "description": "Character advance position X" }, { - "type": "Image", "name": "image", + "type": "Image", "description": "Character image data" } ] }, { "name": "Font", - "description": "Font, font texture and GlyphInfo array data", + "description": "", "fields": [ { - "type": "int", "name": "baseSize", + "type": "int", "description": "Base size (default chars height)" }, { + "name": "charsCount", "type": "int", - "name": "glyphCount", - "description": "Number of glyph characters" + "description": "Number of characters" }, { + "name": "charsPadding", "type": "int", - "name": "glyphPadding", - "description": "Padding around the glyph characters" + "description": "Padding around the chars" }, { - "type": "Texture2D", "name": "texture", - "description": "Texture atlas containing the glyphs" + "type": "Texture2D", + "description": "Characters texture atlas" }, { - "type": "Rectangle *", "name": "recs", - "description": "Rectangles in texture for the glyphs" + "type": "Rectangle *", + "description": "Characters rectangles in texture" }, { - "type": "GlyphInfo *", - "name": "glyphs", - "description": "Glyphs info data" + "name": "chars", + "type": "CharInfo *", + "description": "Characters info data" } ] }, { "name": "Camera3D", - "description": "Camera, defines position/orientation in 3d space", + "description": "", "fields": [ { - "type": "Vector3", "name": "position", + "type": "Vector3", "description": "Camera position" }, { - "type": "Vector3", "name": "target", + "type": "Vector3", "description": "Camera target it looks-at" }, { - "type": "Vector3", "name": "up", + "type": "Vector3", "description": "Camera up vector (rotation over its axis)" }, { - "type": "float", "name": "fovy", + "type": "float", "description": "Camera field-of-view apperture in Y (degrees) in perspective, used as near plane width in orthographic" }, { - "type": "int", "name": "projection", + "type": "int", "description": "Camera projection: CAMERA_PERSPECTIVE or CAMERA_ORTHOGRAPHIC" } ] }, { "name": "Camera2D", - "description": "Camera2D, defines position/orientation in 2d space", + "description": "", "fields": [ { - "type": "Vector2", "name": "offset", + "type": "Vector2", "description": "Camera offset (displacement from target)" }, { - "type": "Vector2", "name": "target", + "type": "Vector2", "description": "Camera target (rotation and zoom origin)" }, { - "type": "float", "name": "rotation", + "type": "float", "description": "Camera rotation in degrees" }, { - "type": "float", "name": "zoom", + "type": "float", "description": "Camera zoom (scaling), should be 1.0f by default" } ] }, { "name": "Mesh", - "description": "Mesh, vertex data and vao/vbo", + "description": "", "fields": [ { - "type": "int", "name": "vertexCount", + "type": "int", "description": "Number of vertices stored in arrays" }, { - "type": "int", "name": "triangleCount", + "type": "int", "description": "Number of triangles stored (indexed or not)" }, { - "type": "float *", "name": "vertices", + "type": "float *", "description": "Vertex position (XYZ - 3 components per vertex) (shader-location = 0)" }, { - "type": "float *", "name": "texcoords", + "type": "float *", "description": "Vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1)" }, { - "type": "float *", "name": "texcoords2", + "type": "float *", "description": "Vertex second texture coordinates (useful for lightmaps) (shader-location = 5)" }, { - "type": "float *", "name": "normals", + "type": "float *", "description": "Vertex normals (XYZ - 3 components per vertex) (shader-location = 2)" }, { - "type": "float *", "name": "tangents", + "type": "float *", "description": "Vertex tangents (XYZW - 4 components per vertex) (shader-location = 4)" }, { - "type": "unsigned char *", "name": "colors", + "type": "unsigned char *", "description": "Vertex colors (RGBA - 4 components per vertex) (shader-location = 3)" }, { - "type": "unsigned short *", "name": "indices", + "type": "unsigned short *", "description": "Vertex indices (in case vertex data comes indexed)" }, { - "type": "float *", "name": "animVertices", + "type": "float *", "description": "Animated vertex positions (after bones transformations)" }, { - "type": "float *", "name": "animNormals", + "type": "float *", "description": "Animated normals (after bones transformations)" }, { - "type": "unsigned char *", "name": "boneIds", - "description": "Vertex bone ids, max 255 bone ids, up to 4 bones influence by vertex (skinning)" + "type": "int *", + "description": "Vertex bone ids, up to 4 bones influence by vertex (skinning)" }, { - "type": "float *", "name": "boneWeights", + "type": "float *", "description": "Vertex bone weight, up to 4 bones influence by vertex (skinning)" }, { - "type": "unsigned int", "name": "vaoId", + "type": "unsigned int", "description": "OpenGL Vertex Array Object id" }, { - "type": "unsigned int *", "name": "vboId", + "type": "unsigned int *", "description": "OpenGL Vertex Buffer Objects id (default vertex data)" } ] }, { "name": "Shader", - "description": "Shader", + "description": "", "fields": [ { - "type": "unsigned int", "name": "id", + "type": "unsigned int", "description": "Shader program id" }, { - "type": "int *", "name": "locs", - "description": "Shader locations array (RL_MAX_SHADER_LOCATIONS)" + "type": "int *", + "description": "Shader locations array (MAX_SHADER_LOCATIONS)" } ] }, { "name": "MaterialMap", - "description": "MaterialMap", + "description": "", "fields": [ { - "type": "Texture2D", "name": "texture", + "type": "Texture2D", "description": "Material map texture" }, { - "type": "Color", "name": "color", + "type": "Color", "description": "Material map color" }, { - "type": "float", "name": "value", + "type": "float", "description": "Material map value" } ] }, { "name": "Material", - "description": "Material, includes shader and maps", + "description": "", "fields": [ { - "type": "Shader", "name": "shader", + "type": "Shader", "description": "Material shader" }, { - "type": "MaterialMap *", "name": "maps", + "type": "MaterialMap *", "description": "Material maps array (MAX_MATERIAL_MAPS)" }, { - "type": "float", "name": "params[4]", + "type": "float", "description": "Material generic parameters (if required)" } ] }, { "name": "Transform", - "description": "Transform, vectex transformation data", + "description": "", "fields": [ { - "type": "Vector3", "name": "translation", + "type": "Vector3", "description": "Translation" }, { - "type": "Quaternion", "name": "rotation", + "type": "Quaternion", "description": "Rotation" }, { - "type": "Vector3", "name": "scale", + "type": "Vector3", "description": "Scale" } ] }, { "name": "BoneInfo", - "description": "Bone, skeletal animation bone", + "description": "", "fields": [ { - "type": "char", "name": "name[32]", + "type": "char", "description": "Bone name" }, { - "type": "int", "name": "parent", + "type": "int", "description": "Bone parent" } ] }, { "name": "Model", - "description": "Model, meshes, materials and animation data", + "description": "", "fields": [ { - "type": "Matrix", "name": "transform", + "type": "Matrix", "description": "Local transform matrix" }, { - "type": "int", "name": "meshCount", + "type": "int", "description": "Number of meshes" }, { - "type": "int", "name": "materialCount", + "type": "int", "description": "Number of materials" }, { - "type": "Mesh *", "name": "meshes", + "type": "Mesh *", "description": "Meshes array" }, { - "type": "Material *", "name": "materials", + "type": "Material *", "description": "Materials array" }, { - "type": "int *", "name": "meshMaterial", + "type": "int *", "description": "Mesh material number" }, { - "type": "int", "name": "boneCount", + "type": "int", "description": "Number of bones" }, { - "type": "BoneInfo *", "name": "bones", + "type": "BoneInfo *", "description": "Bones information (skeleton)" }, { - "type": "Transform *", "name": "bindPose", + "type": "Transform *", "description": "Bones base transformation (pose)" } ] }, { "name": "ModelAnimation", - "description": "ModelAnimation", + "description": "", "fields": [ { - "type": "int", "name": "boneCount", + "type": "int", "description": "Number of bones" }, { - "type": "int", "name": "frameCount", + "type": "int", "description": "Number of animation frames" }, { - "type": "BoneInfo *", "name": "bones", + "type": "BoneInfo *", "description": "Bones information (skeleton)" }, { - "type": "Transform **", "name": "framePoses", + "type": "Transform **", "description": "Poses array by frame" } ] }, { "name": "Ray", - "description": "Ray, ray for raycasting", + "description": "", "fields": [ { - "type": "Vector3", "name": "position", + "type": "Vector3", "description": "Ray position (origin)" }, { - "type": "Vector3", "name": "direction", + "type": "Vector3", "description": "Ray direction" } ] }, { "name": "RayCollision", - "description": "RayCollision, ray hit information", + "description": "", "fields": [ { - "type": "bool", "name": "hit", + "type": "bool", "description": "Did the ray hit something?" }, { - "type": "float", "name": "distance", + "type": "float", "description": "Distance to nearest hit" }, { - "type": "Vector3", "name": "point", + "type": "Vector3", "description": "Point of nearest hit" }, { - "type": "Vector3", "name": "normal", + "type": "Vector3", "description": "Surface normal of hit" } ] }, { "name": "BoundingBox", - "description": "BoundingBox", + "description": "", "fields": [ { - "type": "Vector3", "name": "min", + "type": "Vector3", "description": "Minimum vertex box-corner" }, { - "type": "Vector3", "name": "max", + "type": "Vector3", "description": "Maximum vertex box-corner" } ] }, { "name": "Wave", - "description": "Wave, audio wave data", + "description": "", "fields": [ { + "name": "sampleCount", "type": "unsigned int", - "name": "frameCount", - "description": "Total number of frames (considering channels)" + "description": "Total number of samples (considering channels!)" }, { - "type": "unsigned int", "name": "sampleRate", + "type": "unsigned int", "description": "Frequency (samples per second)" }, { - "type": "unsigned int", "name": "sampleSize", + "type": "unsigned int", "description": "Bit depth (bits per sample): 8, 16, 32 (24 not supported)" }, { - "type": "unsigned int", "name": "channels", - "description": "Number of channels (1-mono, 2-stereo, ...)" + "type": "unsigned int", + "description": "Number of channels (1-mono, 2-stereo)" }, { - "type": "void *", "name": "data", + "type": "void *", "description": "Buffer data pointer" } ] }, { "name": "AudioStream", - "description": "AudioStream, custom audio stream", + "description": "", "fields": [ { - "type": "rAudioBuffer *", "name": "buffer", + "type": "rAudioBuffer *", "description": "Pointer to internal data used by the audio system" }, { - "type": "unsigned int", "name": "sampleRate", + "type": "unsigned int", "description": "Frequency (samples per second)" }, { - "type": "unsigned int", "name": "sampleSize", + "type": "unsigned int", "description": "Bit depth (bits per sample): 8, 16, 32 (24 not supported)" }, { - "type": "unsigned int", "name": "channels", - "description": "Number of channels (1-mono, 2-stereo, ...)" + "type": "unsigned int", + "description": "Number of channels (1-mono, 2-stereo)" } ] }, { "name": "Sound", - "description": "Sound", + "description": "", "fields": [ { - "type": "AudioStream", "name": "stream", + "type": "AudioStream", "description": "Audio stream" }, { - "type": "unsigned int", "name": "frameCount", - "description": "Total number of frames (considering channels)" + "type": "unsigned int", + "description": "Total number of samples" } ] }, { "name": "Music", - "description": "Music, audio stream, anything longer than ~10 seconds should be streamed", + "description": "", "fields": [ { - "type": "AudioStream", "name": "stream", + "type": "AudioStream", "description": "Audio stream" }, { + "name": "sampleCount", "type": "unsigned int", - "name": "frameCount", - "description": "Total number of frames (considering channels)" + "description": "Total number of samples" }, { - "type": "bool", "name": "looping", + "type": "bool", "description": "Music looping enable" }, { - "type": "int", "name": "ctxType", + "type": "int", "description": "Type of music context (audio filetype)" }, { - "type": "void *", "name": "ctxData", + "type": "void *", "description": "Audio context data, depends on type" } ] }, { "name": "VrDeviceInfo", - "description": "VrDeviceInfo, Head-Mounted-Display device parameters", + "description": "", "fields": [ { - "type": "int", "name": "hResolution", + "type": "int", "description": "Horizontal resolution in pixels" }, { - "type": "int", "name": "vResolution", + "type": "int", "description": "Vertical resolution in pixels" }, { - "type": "float", "name": "hScreenSize", + "type": "float", "description": "Horizontal size in meters" }, { - "type": "float", "name": "vScreenSize", + "type": "float", "description": "Vertical size in meters" }, { - "type": "float", "name": "vScreenCenter", + "type": "float", "description": "Screen center in meters" }, { - "type": "float", "name": "eyeToScreenDistance", + "type": "float", "description": "Distance between eye and display in meters" }, { - "type": "float", "name": "lensSeparationDistance", + "type": "float", "description": "Lens separation distance in meters" }, { - "type": "float", "name": "interpupillaryDistance", + "type": "float", "description": "IPD (distance between pupils) in meters" }, { - "type": "float", "name": "lensDistortionValues[4]", + "type": "float", "description": "Lens distortion constant parameters" }, { - "type": "float", "name": "chromaAbCorrection[4]", + "type": "float", "description": "Chromatic aberration correction parameters" } ] }, { "name": "VrStereoConfig", - "description": "VrStereoConfig, VR stereo rendering configuration for simulator", + "description": "", "fields": [ { - "type": "Matrix", "name": "projection[2]", + "type": "Matrix", "description": "VR projection matrices (per eye)" }, { - "type": "Matrix", "name": "viewOffset[2]", + "type": "Matrix", "description": "VR view offset matrices (per eye)" }, { - "type": "float", "name": "leftLensCenter[2]", + "type": "float", "description": "VR left lens center" }, { - "type": "float", "name": "rightLensCenter[2]", + "type": "float", "description": "VR right lens center" }, { - "type": "float", "name": "leftScreenCenter[2]", + "type": "float", "description": "VR left screen center" }, { - "type": "float", "name": "rightScreenCenter[2]", + "type": "float", "description": "VR right screen center" }, { - "type": "float", "name": "scale[2]", + "type": "float", "description": "VR distortion scale" }, { - "type": "float", "name": "scaleIn[2]", + "type": "float", "description": "VR distortion scale in" } ] @@ -905,1582 +905,1582 @@ "enums": [ { "name": "ConfigFlags", - "description": "System/Window config flags", + "description": "", "values": [ { "name": "FLAG_VSYNC_HINT", "value": 64, - "description": "Set to try enabling V-Sync on GPU" + "description": "" }, { "name": "FLAG_FULLSCREEN_MODE", "value": 2, - "description": "Set to run program in fullscreen" + "description": "" }, { "name": "FLAG_WINDOW_RESIZABLE", "value": 4, - "description": "Set to allow resizable window" + "description": "" }, { "name": "FLAG_WINDOW_UNDECORATED", "value": 8, - "description": "Set to disable window decoration (frame and buttons)" + "description": "" }, { "name": "FLAG_WINDOW_HIDDEN", "value": 128, - "description": "Set to hide window" + "description": "" }, { "name": "FLAG_WINDOW_MINIMIZED", "value": 512, - "description": "Set to minimize window (iconify)" + "description": "" }, { "name": "FLAG_WINDOW_MAXIMIZED", "value": 1024, - "description": "Set to maximize window (expanded to monitor)" + "description": "" }, { "name": "FLAG_WINDOW_UNFOCUSED", "value": 2048, - "description": "Set to window non focused" + "description": "" }, { "name": "FLAG_WINDOW_TOPMOST", "value": 4096, - "description": "Set to window always on top" + "description": "" }, { "name": "FLAG_WINDOW_ALWAYS_RUN", "value": 256, - "description": "Set to allow windows running while minimized" + "description": "" }, { "name": "FLAG_WINDOW_TRANSPARENT", "value": 16, - "description": "Set to allow transparent framebuffer" + "description": "" }, { "name": "FLAG_WINDOW_HIGHDPI", "value": 8192, - "description": "Set to support HighDPI" + "description": "" }, { "name": "FLAG_MSAA_4X_HINT", "value": 32, - "description": "Set to try enabling MSAA 4X" + "description": "" }, { "name": "FLAG_INTERLACED_HINT", "value": 65536, - "description": "Set to try enabling interlaced video format (for V3D)" + "description": "" } ] }, { "name": "TraceLogLevel", - "description": "Trace log level", + "description": "", "values": [ { "name": "LOG_ALL", "value": 0, - "description": "Display all logs" + "description": "" }, { "name": "LOG_TRACE", "value": 1, - "description": "Trace logging, intended for internal use only" + "description": "" }, { "name": "LOG_DEBUG", "value": 2, - "description": "Debug logging, used for internal debugging, it should be disabled on release builds" + "description": "" }, { "name": "LOG_INFO", "value": 3, - "description": "Info logging, used for program execution info" + "description": "" }, { "name": "LOG_WARNING", "value": 4, - "description": "Warning logging, used on recoverable failures" + "description": "" }, { "name": "LOG_ERROR", "value": 5, - "description": "Error logging, used on unrecoverable failures" + "description": "" }, { "name": "LOG_FATAL", "value": 6, - "description": "Fatal logging, used to abort program: exit(EXIT_FAILURE)" + "description": "" }, { "name": "LOG_NONE", "value": 7, - "description": "Disable logging" + "description": "" } ] }, { "name": "KeyboardKey", - "description": "Keyboard keys (US keyboard layout)", + "description": "", "values": [ { "name": "KEY_NULL", "value": 0, - "description": "Key: NULL, used for no key pressed" + "description": "" }, { "name": "KEY_APOSTROPHE", "value": 39, - "description": "Key: '" + "description": "" }, { "name": "KEY_COMMA", "value": 44, - "description": "Key: ," + "description": "" }, { "name": "KEY_MINUS", "value": 45, - "description": "Key: -" + "description": "" }, { "name": "KEY_PERIOD", "value": 46, - "description": "Key: ." + "description": "" }, { "name": "KEY_SLASH", "value": 47, - "description": "Key: /" + "description": "" }, { "name": "KEY_ZERO", "value": 48, - "description": "Key: 0" + "description": "" }, { "name": "KEY_ONE", "value": 49, - "description": "Key: 1" + "description": "" }, { "name": "KEY_TWO", "value": 50, - "description": "Key: 2" + "description": "" }, { "name": "KEY_THREE", "value": 51, - "description": "Key: 3" + "description": "" }, { "name": "KEY_FOUR", "value": 52, - "description": "Key: 4" + "description": "" }, { "name": "KEY_FIVE", "value": 53, - "description": "Key: 5" + "description": "" }, { "name": "KEY_SIX", "value": 54, - "description": "Key: 6" + "description": "" }, { "name": "KEY_SEVEN", "value": 55, - "description": "Key: 7" + "description": "" }, { "name": "KEY_EIGHT", "value": 56, - "description": "Key: 8" + "description": "" }, { "name": "KEY_NINE", "value": 57, - "description": "Key: 9" + "description": "" }, { "name": "KEY_SEMICOLON", "value": 59, - "description": "Key: ;" + "description": "" }, { "name": "KEY_EQUAL", "value": 61, - "description": "Key: =" + "description": "" }, { "name": "KEY_A", "value": 65, - "description": "Key: A | a" + "description": "" }, { "name": "KEY_B", "value": 66, - "description": "Key: B | b" + "description": "" }, { "name": "KEY_C", "value": 67, - "description": "Key: C | c" + "description": "" }, { "name": "KEY_D", "value": 68, - "description": "Key: D | d" + "description": "" }, { "name": "KEY_E", "value": 69, - "description": "Key: E | e" + "description": "" }, { "name": "KEY_F", "value": 70, - "description": "Key: F | f" + "description": "" }, { "name": "KEY_G", "value": 71, - "description": "Key: G | g" + "description": "" }, { "name": "KEY_H", "value": 72, - "description": "Key: H | h" + "description": "" }, { "name": "KEY_I", "value": 73, - "description": "Key: I | i" + "description": "" }, { "name": "KEY_J", "value": 74, - "description": "Key: J | j" + "description": "" }, { "name": "KEY_K", "value": 75, - "description": "Key: K | k" + "description": "" }, { "name": "KEY_L", "value": 76, - "description": "Key: L | l" + "description": "" }, { "name": "KEY_M", "value": 77, - "description": "Key: M | m" + "description": "" }, { "name": "KEY_N", "value": 78, - "description": "Key: N | n" + "description": "" }, { "name": "KEY_O", "value": 79, - "description": "Key: O | o" + "description": "" }, { "name": "KEY_P", "value": 80, - "description": "Key: P | p" + "description": "" }, { "name": "KEY_Q", "value": 81, - "description": "Key: Q | q" + "description": "" }, { "name": "KEY_R", "value": 82, - "description": "Key: R | r" + "description": "" }, { "name": "KEY_S", "value": 83, - "description": "Key: S | s" + "description": "" }, { "name": "KEY_T", "value": 84, - "description": "Key: T | t" + "description": "" }, { "name": "KEY_U", "value": 85, - "description": "Key: U | u" + "description": "" }, { "name": "KEY_V", "value": 86, - "description": "Key: V | v" + "description": "" }, { "name": "KEY_W", "value": 87, - "description": "Key: W | w" + "description": "" }, { "name": "KEY_X", "value": 88, - "description": "Key: X | x" + "description": "" }, { "name": "KEY_Y", "value": 89, - "description": "Key: Y | y" + "description": "" }, { "name": "KEY_Z", "value": 90, - "description": "Key: Z | z" - }, - { - "name": "KEY_LEFT_BRACKET", - "value": 91, - "description": "Key: [" - }, - { - "name": "KEY_BACKSLASH", - "value": 92, - "description": "Key: '\\'" - }, - { - "name": "KEY_RIGHT_BRACKET", - "value": 93, - "description": "Key: ]" - }, - { - "name": "KEY_GRAVE", - "value": 96, - "description": "Key: `" + "description": "" }, { "name": "KEY_SPACE", "value": 32, - "description": "Key: Space" + "description": "" }, { "name": "KEY_ESCAPE", "value": 256, - "description": "Key: Esc" + "description": "" }, { "name": "KEY_ENTER", "value": 257, - "description": "Key: Enter" + "description": "" }, { "name": "KEY_TAB", "value": 258, - "description": "Key: Tab" + "description": "" }, { "name": "KEY_BACKSPACE", "value": 259, - "description": "Key: Backspace" + "description": "" }, { "name": "KEY_INSERT", "value": 260, - "description": "Key: Ins" + "description": "" }, { "name": "KEY_DELETE", "value": 261, - "description": "Key: Del" + "description": "" }, { "name": "KEY_RIGHT", "value": 262, - "description": "Key: Cursor right" + "description": "" }, { "name": "KEY_LEFT", "value": 263, - "description": "Key: Cursor left" + "description": "" }, { "name": "KEY_DOWN", "value": 264, - "description": "Key: Cursor down" + "description": "" }, { "name": "KEY_UP", "value": 265, - "description": "Key: Cursor up" + "description": "" }, { "name": "KEY_PAGE_UP", "value": 266, - "description": "Key: Page up" + "description": "" }, { "name": "KEY_PAGE_DOWN", "value": 267, - "description": "Key: Page down" + "description": "" }, { "name": "KEY_HOME", "value": 268, - "description": "Key: Home" + "description": "" }, { "name": "KEY_END", "value": 269, - "description": "Key: End" + "description": "" }, { "name": "KEY_CAPS_LOCK", "value": 280, - "description": "Key: Caps lock" + "description": "" }, { "name": "KEY_SCROLL_LOCK", "value": 281, - "description": "Key: Scroll down" + "description": "" }, { "name": "KEY_NUM_LOCK", "value": 282, - "description": "Key: Num lock" + "description": "" }, { "name": "KEY_PRINT_SCREEN", "value": 283, - "description": "Key: Print screen" + "description": "" }, { "name": "KEY_PAUSE", "value": 284, - "description": "Key: Pause" + "description": "" }, { "name": "KEY_F1", "value": 290, - "description": "Key: F1" + "description": "" }, { "name": "KEY_F2", "value": 291, - "description": "Key: F2" + "description": "" }, { "name": "KEY_F3", "value": 292, - "description": "Key: F3" + "description": "" }, { "name": "KEY_F4", "value": 293, - "description": "Key: F4" + "description": "" }, { "name": "KEY_F5", "value": 294, - "description": "Key: F5" + "description": "" }, { "name": "KEY_F6", "value": 295, - "description": "Key: F6" + "description": "" }, { "name": "KEY_F7", "value": 296, - "description": "Key: F7" + "description": "" }, { "name": "KEY_F8", "value": 297, - "description": "Key: F8" + "description": "" }, { "name": "KEY_F9", "value": 298, - "description": "Key: F9" + "description": "" }, { "name": "KEY_F10", "value": 299, - "description": "Key: F10" + "description": "" }, { "name": "KEY_F11", "value": 300, - "description": "Key: F11" + "description": "" }, { "name": "KEY_F12", "value": 301, - "description": "Key: F12" + "description": "" }, { "name": "KEY_LEFT_SHIFT", "value": 340, - "description": "Key: Shift left" + "description": "" }, { "name": "KEY_LEFT_CONTROL", "value": 341, - "description": "Key: Control left" + "description": "" }, { "name": "KEY_LEFT_ALT", "value": 342, - "description": "Key: Alt left" + "description": "" }, { "name": "KEY_LEFT_SUPER", "value": 343, - "description": "Key: Super left" + "description": "" }, { "name": "KEY_RIGHT_SHIFT", "value": 344, - "description": "Key: Shift right" + "description": "" }, { "name": "KEY_RIGHT_CONTROL", "value": 345, - "description": "Key: Control right" + "description": "" }, { "name": "KEY_RIGHT_ALT", "value": 346, - "description": "Key: Alt right" + "description": "" }, { "name": "KEY_RIGHT_SUPER", "value": 347, - "description": "Key: Super right" + "description": "" }, { "name": "KEY_KB_MENU", "value": 348, - "description": "Key: KB menu" + "description": "" + }, + { + "name": "KEY_LEFT_BRACKET", + "value": 91, + "description": "" + }, + { + "name": "KEY_BACKSLASH", + "value": 92, + "description": "" + }, + { + "name": "KEY_RIGHT_BRACKET", + "value": 93, + "description": "" + }, + { + "name": "KEY_GRAVE", + "value": 96, + "description": "" }, { "name": "KEY_KP_0", "value": 320, - "description": "Key: Keypad 0" + "description": "" }, { "name": "KEY_KP_1", "value": 321, - "description": "Key: Keypad 1" + "description": "" }, { "name": "KEY_KP_2", "value": 322, - "description": "Key: Keypad 2" + "description": "" }, { "name": "KEY_KP_3", "value": 323, - "description": "Key: Keypad 3" + "description": "" }, { "name": "KEY_KP_4", "value": 324, - "description": "Key: Keypad 4" + "description": "" }, { "name": "KEY_KP_5", "value": 325, - "description": "Key: Keypad 5" + "description": "" }, { "name": "KEY_KP_6", "value": 326, - "description": "Key: Keypad 6" + "description": "" }, { "name": "KEY_KP_7", "value": 327, - "description": "Key: Keypad 7" + "description": "" }, { "name": "KEY_KP_8", "value": 328, - "description": "Key: Keypad 8" + "description": "" }, { "name": "KEY_KP_9", "value": 329, - "description": "Key: Keypad 9" + "description": "" }, { "name": "KEY_KP_DECIMAL", "value": 330, - "description": "Key: Keypad ." + "description": "" }, { "name": "KEY_KP_DIVIDE", "value": 331, - "description": "Key: Keypad /" + "description": "" }, { "name": "KEY_KP_MULTIPLY", "value": 332, - "description": "Key: Keypad *" + "description": "" }, { "name": "KEY_KP_SUBTRACT", "value": 333, - "description": "Key: Keypad -" + "description": "" }, { "name": "KEY_KP_ADD", "value": 334, - "description": "Key: Keypad +" + "description": "" }, { "name": "KEY_KP_ENTER", "value": 335, - "description": "Key: Keypad Enter" + "description": "" }, { "name": "KEY_KP_EQUAL", "value": 336, - "description": "Key: Keypad =" + "description": "" }, { "name": "KEY_BACK", "value": 4, - "description": "Key: Android back button" + "description": "" }, { "name": "KEY_MENU", "value": 82, - "description": "Key: Android menu button" + "description": "" }, { "name": "KEY_VOLUME_UP", "value": 24, - "description": "Key: Android volume up button" + "description": "" }, { "name": "KEY_VOLUME_DOWN", "value": 25, - "description": "Key: Android volume down button" + "description": "" } ] }, { "name": "MouseButton", - "description": "Mouse buttons", + "description": "", "values": [ { "name": "MOUSE_BUTTON_LEFT", "value": 0, - "description": "Mouse button left" + "description": "" }, { "name": "MOUSE_BUTTON_RIGHT", "value": 1, - "description": "Mouse button right" + "description": "" }, { "name": "MOUSE_BUTTON_MIDDLE", "value": 2, - "description": "Mouse button middle (pressed wheel)" + "description": "" }, { "name": "MOUSE_BUTTON_SIDE", "value": 3, - "description": "Mouse button side (advanced mouse device)" + "description": "" }, { "name": "MOUSE_BUTTON_EXTRA", "value": 4, - "description": "Mouse button extra (advanced mouse device)" + "description": "" }, { "name": "MOUSE_BUTTON_FORWARD", "value": 5, - "description": "Mouse button fordward (advanced mouse device)" + "description": "" }, { "name": "MOUSE_BUTTON_BACK", "value": 6, - "description": "Mouse button back (advanced mouse device)" + "description": "" } ] }, { "name": "MouseCursor", - "description": "Mouse cursor", + "description": "", "values": [ { "name": "MOUSE_CURSOR_DEFAULT", "value": 0, - "description": "Default pointer shape" + "description": "" }, { "name": "MOUSE_CURSOR_ARROW", "value": 1, - "description": "Arrow shape" + "description": "" }, { "name": "MOUSE_CURSOR_IBEAM", "value": 2, - "description": "Text writing cursor shape" + "description": "" }, { "name": "MOUSE_CURSOR_CROSSHAIR", "value": 3, - "description": "Cross shape" + "description": "" }, { "name": "MOUSE_CURSOR_POINTING_HAND", "value": 4, - "description": "Pointing hand cursor" + "description": "" }, { "name": "MOUSE_CURSOR_RESIZE_EW", "value": 5, - "description": "Horizontal resize/move arrow shape" + "description": "" }, { "name": "MOUSE_CURSOR_RESIZE_NS", "value": 6, - "description": "Vertical resize/move arrow shape" + "description": "" }, { "name": "MOUSE_CURSOR_RESIZE_NWSE", "value": 7, - "description": "Top-left to bottom-right diagonal resize/move arrow shape" + "description": "" }, { "name": "MOUSE_CURSOR_RESIZE_NESW", "value": 8, - "description": "The top-right to bottom-left diagonal resize/move arrow shape" + "description": "" }, { "name": "MOUSE_CURSOR_RESIZE_ALL", "value": 9, - "description": "The omni-directional resize/move cursor shape" + "description": "" }, { "name": "MOUSE_CURSOR_NOT_ALLOWED", "value": 10, - "description": "The operation-not-allowed shape" + "description": "" } ] }, { "name": "GamepadButton", - "description": "Gamepad buttons", + "description": "", "values": [ { "name": "GAMEPAD_BUTTON_UNKNOWN", "value": 0, - "description": "Unknown button, just for error checking" + "description": "" }, { "name": "GAMEPAD_BUTTON_LEFT_FACE_UP", "value": 1, - "description": "Gamepad left DPAD up button" + "description": "" }, { "name": "GAMEPAD_BUTTON_LEFT_FACE_RIGHT", "value": 2, - "description": "Gamepad left DPAD right button" + "description": "" }, { "name": "GAMEPAD_BUTTON_LEFT_FACE_DOWN", "value": 3, - "description": "Gamepad left DPAD down button" + "description": "" }, { "name": "GAMEPAD_BUTTON_LEFT_FACE_LEFT", "value": 4, - "description": "Gamepad left DPAD left button" + "description": "" }, { "name": "GAMEPAD_BUTTON_RIGHT_FACE_UP", "value": 5, - "description": "Gamepad right button up (i.e. PS3: Triangle, Xbox: Y)" + "description": "" }, { "name": "GAMEPAD_BUTTON_RIGHT_FACE_RIGHT", "value": 6, - "description": "Gamepad right button right (i.e. PS3: Square, Xbox: X)" + "description": "" }, { "name": "GAMEPAD_BUTTON_RIGHT_FACE_DOWN", "value": 7, - "description": "Gamepad right button down (i.e. PS3: Cross, Xbox: A)" + "description": "" }, { "name": "GAMEPAD_BUTTON_RIGHT_FACE_LEFT", "value": 8, - "description": "Gamepad right button left (i.e. PS3: Circle, Xbox: B)" + "description": "" }, { "name": "GAMEPAD_BUTTON_LEFT_TRIGGER_1", "value": 9, - "description": "Gamepad top/back trigger left (first), it could be a trailing button" + "description": "" }, { "name": "GAMEPAD_BUTTON_LEFT_TRIGGER_2", "value": 10, - "description": "Gamepad top/back trigger left (second), it could be a trailing button" + "description": "" }, { "name": "GAMEPAD_BUTTON_RIGHT_TRIGGER_1", "value": 11, - "description": "Gamepad top/back trigger right (one), it could be a trailing button" + "description": "" }, { "name": "GAMEPAD_BUTTON_RIGHT_TRIGGER_2", "value": 12, - "description": "Gamepad top/back trigger right (second), it could be a trailing button" + "description": "" }, { "name": "GAMEPAD_BUTTON_MIDDLE_LEFT", "value": 13, - "description": "Gamepad center buttons, left one (i.e. PS3: Select)" + "description": "" }, { "name": "GAMEPAD_BUTTON_MIDDLE", "value": 14, - "description": "Gamepad center buttons, middle one (i.e. PS3: PS, Xbox: XBOX)" + "description": "" }, { "name": "GAMEPAD_BUTTON_MIDDLE_RIGHT", "value": 15, - "description": "Gamepad center buttons, right one (i.e. PS3: Start)" + "description": "" }, { "name": "GAMEPAD_BUTTON_LEFT_THUMB", "value": 16, - "description": "Gamepad joystick pressed button left" + "description": "" }, { "name": "GAMEPAD_BUTTON_RIGHT_THUMB", "value": 17, - "description": "Gamepad joystick pressed button right" + "description": "" } ] }, { "name": "GamepadAxis", - "description": "Gamepad axis", + "description": "", "values": [ { "name": "GAMEPAD_AXIS_LEFT_X", "value": 0, - "description": "Gamepad left stick X axis" + "description": "" }, { "name": "GAMEPAD_AXIS_LEFT_Y", "value": 1, - "description": "Gamepad left stick Y axis" + "description": "" }, { "name": "GAMEPAD_AXIS_RIGHT_X", "value": 2, - "description": "Gamepad right stick X axis" + "description": "" }, { "name": "GAMEPAD_AXIS_RIGHT_Y", "value": 3, - "description": "Gamepad right stick Y axis" + "description": "" }, { "name": "GAMEPAD_AXIS_LEFT_TRIGGER", "value": 4, - "description": "Gamepad back trigger left, pressure level: [1..-1]" + "description": "" }, { "name": "GAMEPAD_AXIS_RIGHT_TRIGGER", "value": 5, - "description": "Gamepad back trigger right, pressure level: [1..-1]" + "description": "" } ] }, { "name": "MaterialMapIndex", - "description": "Material map index", + "description": "", "values": [ { "name": "MATERIAL_MAP_ALBEDO", "value": 0, - "description": "Albedo material (same as: MATERIAL_MAP_DIFFUSE)" + "description": "" }, { "name": "MATERIAL_MAP_METALNESS", "value": 1, - "description": "Metalness material (same as: MATERIAL_MAP_SPECULAR)" + "description": "" }, { "name": "MATERIAL_MAP_NORMAL", "value": 2, - "description": "Normal material" + "description": "" }, { "name": "MATERIAL_MAP_ROUGHNESS", "value": 3, - "description": "Roughness material" + "description": "" }, { "name": "MATERIAL_MAP_OCCLUSION", "value": 4, - "description": "Ambient occlusion material" + "description": "" }, { "name": "MATERIAL_MAP_EMISSION", "value": 5, - "description": "Emission material" + "description": "" }, { "name": "MATERIAL_MAP_HEIGHT", "value": 6, - "description": "Heightmap material" + "description": "" }, { "name": "MATERIAL_MAP_CUBEMAP", "value": 7, - "description": "Cubemap material (NOTE: Uses GL_TEXTURE_CUBE_MAP)" + "description": "" }, { "name": "MATERIAL_MAP_IRRADIANCE", "value": 8, - "description": "Irradiance material (NOTE: Uses GL_TEXTURE_CUBE_MAP)" + "description": "" }, { "name": "MATERIAL_MAP_PREFILTER", "value": 9, - "description": "Prefilter material (NOTE: Uses GL_TEXTURE_CUBE_MAP)" + "description": "" }, { "name": "MATERIAL_MAP_BRDF", "value": 10, - "description": "Brdf material" + "description": "" } ] }, { "name": "ShaderLocationIndex", - "description": "Shader location index", + "description": "", "values": [ { "name": "SHADER_LOC_VERTEX_POSITION", "value": 0, - "description": "Shader location: vertex attribute: position" + "description": "" }, { "name": "SHADER_LOC_VERTEX_TEXCOORD01", "value": 1, - "description": "Shader location: vertex attribute: texcoord01" + "description": "" }, { "name": "SHADER_LOC_VERTEX_TEXCOORD02", "value": 2, - "description": "Shader location: vertex attribute: texcoord02" + "description": "" }, { "name": "SHADER_LOC_VERTEX_NORMAL", "value": 3, - "description": "Shader location: vertex attribute: normal" + "description": "" }, { "name": "SHADER_LOC_VERTEX_TANGENT", "value": 4, - "description": "Shader location: vertex attribute: tangent" + "description": "" }, { "name": "SHADER_LOC_VERTEX_COLOR", "value": 5, - "description": "Shader location: vertex attribute: color" + "description": "" }, { "name": "SHADER_LOC_MATRIX_MVP", "value": 6, - "description": "Shader location: matrix uniform: model-view-projection" + "description": "" }, { "name": "SHADER_LOC_MATRIX_VIEW", "value": 7, - "description": "Shader location: matrix uniform: view (camera transform)" + "description": "" }, { "name": "SHADER_LOC_MATRIX_PROJECTION", "value": 8, - "description": "Shader location: matrix uniform: projection" + "description": "" }, { "name": "SHADER_LOC_MATRIX_MODEL", "value": 9, - "description": "Shader location: matrix uniform: model (transform)" + "description": "" }, { "name": "SHADER_LOC_MATRIX_NORMAL", "value": 10, - "description": "Shader location: matrix uniform: normal" + "description": "" }, { "name": "SHADER_LOC_VECTOR_VIEW", "value": 11, - "description": "Shader location: vector uniform: view" + "description": "" }, { "name": "SHADER_LOC_COLOR_DIFFUSE", "value": 12, - "description": "Shader location: vector uniform: diffuse color" + "description": "" }, { "name": "SHADER_LOC_COLOR_SPECULAR", "value": 13, - "description": "Shader location: vector uniform: specular color" + "description": "" }, { "name": "SHADER_LOC_COLOR_AMBIENT", "value": 14, - "description": "Shader location: vector uniform: ambient color" + "description": "" }, { "name": "SHADER_LOC_MAP_ALBEDO", "value": 15, - "description": "Shader location: sampler2d texture: albedo (same as: SHADER_LOC_MAP_DIFFUSE)" + "description": "" }, { "name": "SHADER_LOC_MAP_METALNESS", "value": 16, - "description": "Shader location: sampler2d texture: metalness (same as: SHADER_LOC_MAP_SPECULAR)" + "description": "" }, { "name": "SHADER_LOC_MAP_NORMAL", "value": 17, - "description": "Shader location: sampler2d texture: normal" + "description": "" }, { "name": "SHADER_LOC_MAP_ROUGHNESS", "value": 18, - "description": "Shader location: sampler2d texture: roughness" + "description": "" }, { "name": "SHADER_LOC_MAP_OCCLUSION", "value": 19, - "description": "Shader location: sampler2d texture: occlusion" + "description": "" }, { "name": "SHADER_LOC_MAP_EMISSION", "value": 20, - "description": "Shader location: sampler2d texture: emission" + "description": "" }, { "name": "SHADER_LOC_MAP_HEIGHT", "value": 21, - "description": "Shader location: sampler2d texture: height" + "description": "" }, { "name": "SHADER_LOC_MAP_CUBEMAP", "value": 22, - "description": "Shader location: samplerCube texture: cubemap" + "description": "" }, { "name": "SHADER_LOC_MAP_IRRADIANCE", "value": 23, - "description": "Shader location: samplerCube texture: irradiance" + "description": "" }, { "name": "SHADER_LOC_MAP_PREFILTER", "value": 24, - "description": "Shader location: samplerCube texture: prefilter" + "description": "" }, { "name": "SHADER_LOC_MAP_BRDF", "value": 25, - "description": "Shader location: sampler2d texture: brdf" + "description": "" } ] }, { "name": "ShaderUniformDataType", - "description": "Shader uniform data type", + "description": "", "values": [ { "name": "SHADER_UNIFORM_FLOAT", "value": 0, - "description": "Shader uniform type: float" + "description": "" }, { "name": "SHADER_UNIFORM_VEC2", "value": 1, - "description": "Shader uniform type: vec2 (2 float)" + "description": "" }, { "name": "SHADER_UNIFORM_VEC3", "value": 2, - "description": "Shader uniform type: vec3 (3 float)" + "description": "" }, { "name": "SHADER_UNIFORM_VEC4", "value": 3, - "description": "Shader uniform type: vec4 (4 float)" + "description": "" }, { "name": "SHADER_UNIFORM_INT", "value": 4, - "description": "Shader uniform type: int" + "description": "" }, { "name": "SHADER_UNIFORM_IVEC2", "value": 5, - "description": "Shader uniform type: ivec2 (2 int)" + "description": "" }, { "name": "SHADER_UNIFORM_IVEC3", "value": 6, - "description": "Shader uniform type: ivec3 (3 int)" + "description": "" }, { "name": "SHADER_UNIFORM_IVEC4", "value": 7, - "description": "Shader uniform type: ivec4 (4 int)" + "description": "" }, { "name": "SHADER_UNIFORM_SAMPLER2D", "value": 8, - "description": "Shader uniform type: sampler2d" + "description": "" } ] }, { "name": "ShaderAttributeDataType", - "description": "Shader attribute data types", + "description": "", "values": [ { "name": "SHADER_ATTRIB_FLOAT", "value": 0, - "description": "Shader attribute type: float" + "description": "" }, { "name": "SHADER_ATTRIB_VEC2", "value": 1, - "description": "Shader attribute type: vec2 (2 float)" + "description": "" }, { "name": "SHADER_ATTRIB_VEC3", "value": 2, - "description": "Shader attribute type: vec3 (3 float)" + "description": "" }, { "name": "SHADER_ATTRIB_VEC4", "value": 3, - "description": "Shader attribute type: vec4 (4 float)" + "description": "" } ] }, { "name": "PixelFormat", - "description": "Pixel formats", + "description": "", "values": [ { "name": "PIXELFORMAT_UNCOMPRESSED_GRAYSCALE", "value": 1, - "description": "8 bit per pixel (no alpha)" + "description": "" }, { "name": "PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA", "value": 2, - "description": "8*2 bpp (2 channels)" + "description": "" }, { "name": "PIXELFORMAT_UNCOMPRESSED_R5G6B5", "value": 3, - "description": "16 bpp" + "description": "" }, { "name": "PIXELFORMAT_UNCOMPRESSED_R8G8B8", "value": 4, - "description": "24 bpp" + "description": "" }, { "name": "PIXELFORMAT_UNCOMPRESSED_R5G5B5A1", "value": 5, - "description": "16 bpp (1 bit alpha)" + "description": "" }, { "name": "PIXELFORMAT_UNCOMPRESSED_R4G4B4A4", "value": 6, - "description": "16 bpp (4 bit alpha)" + "description": "" }, { "name": "PIXELFORMAT_UNCOMPRESSED_R8G8B8A8", "value": 7, - "description": "32 bpp" + "description": "" }, { "name": "PIXELFORMAT_UNCOMPRESSED_R32", "value": 8, - "description": "32 bpp (1 channel - float)" + "description": "" }, { "name": "PIXELFORMAT_UNCOMPRESSED_R32G32B32", "value": 9, - "description": "32*3 bpp (3 channels - float)" + "description": "" }, { "name": "PIXELFORMAT_UNCOMPRESSED_R32G32B32A32", "value": 10, - "description": "32*4 bpp (4 channels - float)" + "description": "" }, { "name": "PIXELFORMAT_COMPRESSED_DXT1_RGB", "value": 11, - "description": "4 bpp (no alpha)" + "description": "" }, { "name": "PIXELFORMAT_COMPRESSED_DXT1_RGBA", "value": 12, - "description": "4 bpp (1 bit alpha)" + "description": "" }, { "name": "PIXELFORMAT_COMPRESSED_DXT3_RGBA", "value": 13, - "description": "8 bpp" + "description": "" }, { "name": "PIXELFORMAT_COMPRESSED_DXT5_RGBA", "value": 14, - "description": "8 bpp" + "description": "" }, { "name": "PIXELFORMAT_COMPRESSED_ETC1_RGB", "value": 15, - "description": "4 bpp" + "description": "" }, { "name": "PIXELFORMAT_COMPRESSED_ETC2_RGB", "value": 16, - "description": "4 bpp" + "description": "" }, { "name": "PIXELFORMAT_COMPRESSED_ETC2_EAC_RGBA", "value": 17, - "description": "8 bpp" + "description": "" }, { "name": "PIXELFORMAT_COMPRESSED_PVRT_RGB", "value": 18, - "description": "4 bpp" + "description": "" }, { "name": "PIXELFORMAT_COMPRESSED_PVRT_RGBA", "value": 19, - "description": "4 bpp" + "description": "" }, { "name": "PIXELFORMAT_COMPRESSED_ASTC_4x4_RGBA", "value": 20, - "description": "8 bpp" + "description": "" }, { "name": "PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA", "value": 21, - "description": "2 bpp" + "description": "" } ] }, { "name": "TextureFilter", - "description": "Texture parameters: filter mode", + "description": "", "values": [ { "name": "TEXTURE_FILTER_POINT", "value": 0, - "description": "No filter, just pixel approximation" + "description": "" }, { "name": "TEXTURE_FILTER_BILINEAR", "value": 1, - "description": "Linear filtering" + "description": "" }, { "name": "TEXTURE_FILTER_TRILINEAR", "value": 2, - "description": "Trilinear filtering (linear with mipmaps)" + "description": "" }, { "name": "TEXTURE_FILTER_ANISOTROPIC_4X", "value": 3, - "description": "Anisotropic filtering 4x" + "description": "" }, { "name": "TEXTURE_FILTER_ANISOTROPIC_8X", "value": 4, - "description": "Anisotropic filtering 8x" + "description": "" }, { "name": "TEXTURE_FILTER_ANISOTROPIC_16X", "value": 5, - "description": "Anisotropic filtering 16x" + "description": "" } ] }, { "name": "TextureWrap", - "description": "Texture parameters: wrap mode", + "description": "", "values": [ { "name": "TEXTURE_WRAP_REPEAT", "value": 0, - "description": "Repeats texture in tiled mode" + "description": "" }, { "name": "TEXTURE_WRAP_CLAMP", "value": 1, - "description": "Clamps texture to edge pixel in tiled mode" + "description": "" }, { "name": "TEXTURE_WRAP_MIRROR_REPEAT", "value": 2, - "description": "Mirrors and repeats the texture in tiled mode" + "description": "" }, { "name": "TEXTURE_WRAP_MIRROR_CLAMP", "value": 3, - "description": "Mirrors and clamps to border the texture in tiled mode" + "description": "" } ] }, { "name": "CubemapLayout", - "description": "Cubemap layouts", + "description": "", "values": [ { "name": "CUBEMAP_LAYOUT_AUTO_DETECT", "value": 0, - "description": "Automatically detect layout type" + "description": "" }, { "name": "CUBEMAP_LAYOUT_LINE_VERTICAL", "value": 1, - "description": "Layout is defined by a vertical line with faces" + "description": "" }, { "name": "CUBEMAP_LAYOUT_LINE_HORIZONTAL", "value": 2, - "description": "Layout is defined by an horizontal line with faces" + "description": "" }, { "name": "CUBEMAP_LAYOUT_CROSS_THREE_BY_FOUR", "value": 3, - "description": "Layout is defined by a 3x4 cross with cubemap faces" + "description": "" }, { "name": "CUBEMAP_LAYOUT_CROSS_FOUR_BY_THREE", "value": 4, - "description": "Layout is defined by a 4x3 cross with cubemap faces" + "description": "" }, { "name": "CUBEMAP_LAYOUT_PANORAMA", "value": 5, - "description": "Layout is defined by a panorama image (equirectangular map)" + "description": "" } ] }, { "name": "FontType", - "description": "Font type, defines generation method", + "description": "", "values": [ { "name": "FONT_DEFAULT", "value": 0, - "description": "Default font generation, anti-aliased" + "description": "" }, { "name": "FONT_BITMAP", "value": 1, - "description": "Bitmap font generation, no anti-aliasing" + "description": "" }, { "name": "FONT_SDF", "value": 2, - "description": "SDF font generation, requires external shader" + "description": "" } ] }, { "name": "BlendMode", - "description": "Color blending modes (pre-defined)", + "description": "", "values": [ { "name": "BLEND_ALPHA", "value": 0, - "description": "Blend textures considering alpha (default)" + "description": "" }, { "name": "BLEND_ADDITIVE", "value": 1, - "description": "Blend textures adding colors" + "description": "" }, { "name": "BLEND_MULTIPLIED", "value": 2, - "description": "Blend textures multiplying colors" + "description": "" }, { "name": "BLEND_ADD_COLORS", "value": 3, - "description": "Blend textures adding colors (alternative)" + "description": "" }, { "name": "BLEND_SUBTRACT_COLORS", "value": 4, - "description": "Blend textures subtracting colors (alternative)" + "description": "" }, { "name": "BLEND_CUSTOM", "value": 5, - "description": "Belnd textures using custom src/dst factors (use rlSetBlendMode())" + "description": "" } ] }, { "name": "Gesture", - "description": "Gesture", + "description": "", "values": [ { "name": "GESTURE_NONE", "value": 0, - "description": "No gesture" + "description": "" }, { "name": "GESTURE_TAP", "value": 1, - "description": "Tap gesture" + "description": "" }, { "name": "GESTURE_DOUBLETAP", "value": 2, - "description": "Double tap gesture" + "description": "" }, { "name": "GESTURE_HOLD", "value": 4, - "description": "Hold gesture" + "description": "" }, { "name": "GESTURE_DRAG", "value": 8, - "description": "Drag gesture" + "description": "" }, { "name": "GESTURE_SWIPE_RIGHT", "value": 16, - "description": "Swipe right gesture" + "description": "" }, { "name": "GESTURE_SWIPE_LEFT", "value": 32, - "description": "Swipe left gesture" + "description": "" }, { "name": "GESTURE_SWIPE_UP", "value": 64, - "description": "Swipe up gesture" + "description": "" }, { "name": "GESTURE_SWIPE_DOWN", "value": 128, - "description": "Swipe down gesture" + "description": "" }, { "name": "GESTURE_PINCH_IN", "value": 256, - "description": "Pinch in gesture" + "description": "" }, { "name": "GESTURE_PINCH_OUT", "value": 512, - "description": "Pinch out gesture" + "description": "" } ] }, { "name": "CameraMode", - "description": "Camera system modes", + "description": "", "values": [ { "name": "CAMERA_CUSTOM", "value": 0, - "description": "Custom camera" + "description": "" }, { "name": "CAMERA_FREE", "value": 1, - "description": "Free camera" + "description": "" }, { "name": "CAMERA_ORBITAL", "value": 2, - "description": "Orbital camera" + "description": "" }, { "name": "CAMERA_FIRST_PERSON", "value": 3, - "description": "First person camera" + "description": "" }, { "name": "CAMERA_THIRD_PERSON", "value": 4, - "description": "Third person camera" + "description": "" } ] }, { "name": "CameraProjection", - "description": "Camera projection", + "description": "", "values": [ { "name": "CAMERA_PERSPECTIVE", "value": 0, - "description": "Perspective projection" + "description": "" }, { "name": "CAMERA_ORTHOGRAPHIC", "value": 1, - "description": "Orthographic projection" + "description": "" } ] }, { "name": "NPatchLayout", - "description": "N-patch layout", + "description": "", "values": [ { "name": "NPATCH_NINE_PATCH", "value": 0, - "description": "Npatch layout: 3x3 tiles" + "description": "" }, { "name": "NPATCH_THREE_PATCH_VERTICAL", "value": 1, - "description": "Npatch layout: 1x3 tiles" + "description": "" }, { "name": "NPATCH_THREE_PATCH_HORIZONTAL", "value": 2, - "description": "Npatch layout: 3x1 tiles" + "description": "" } ] } @@ -2490,20 +2490,11 @@ "name": "InitWindow", "description": "Initialize window and OpenGL context", "returnType": "void", - "params": [ - { - "type": "int", - "name": "width" - }, - { - "type": "int", - "name": "height" - }, - { - "type": "const char *", - "name": "title" - } - ] + "params": { + "width": "int", + "height": "int", + "title": "const char *" + } }, { "name": "WindowShouldClose", @@ -2554,34 +2545,25 @@ "name": "IsWindowState", "description": "Check if one specific window flag is enabled", "returnType": "bool", - "params": [ - { - "type": "unsigned int", - "name": "flag" - } - ] + "params": { + "flag": "unsigned int" + } }, { "name": "SetWindowState", - "description": "Set window configuration state using flags (only PLATFORM_DESKTOP)", + "description": "Set window configuration state using flags", "returnType": "void", - "params": [ - { - "type": "unsigned int", - "name": "flags" - } - ] + "params": { + "flags": "unsigned int" + } }, { "name": "ClearWindowState", "description": "Clear window configuration state flags", "returnType": "void", - "params": [ - { - "type": "unsigned int", - "name": "flags" - } - ] + "params": { + "flags": "unsigned int" + } }, { "name": "ToggleFullscreen", @@ -2607,90 +2589,52 @@ "name": "SetWindowIcon", "description": "Set icon for window (only PLATFORM_DESKTOP)", "returnType": "void", - "params": [ - { - "type": "Image", - "name": "image" - } - ] + "params": { + "image": "Image" + } }, { "name": "SetWindowTitle", "description": "Set title for window (only PLATFORM_DESKTOP)", "returnType": "void", - "params": [ - { - "type": "const char *", - "name": "title" - } - ] + "params": { + "title": "const char *" + } }, { "name": "SetWindowPosition", "description": "Set window position on screen (only PLATFORM_DESKTOP)", "returnType": "void", - "params": [ - { - "type": "int", - "name": "x" - }, - { - "type": "int", - "name": "y" - } - ] + "params": { + "x": "int", + "y": "int" + } }, { "name": "SetWindowMonitor", "description": "Set monitor for the current window (fullscreen mode)", "returnType": "void", - "params": [ - { - "type": "int", - "name": "monitor" - } - ] + "params": { + "monitor": "int" + } }, { "name": "SetWindowMinSize", "description": "Set window minimum dimensions (for FLAG_WINDOW_RESIZABLE)", "returnType": "void", - "params": [ - { - "type": "int", - "name": "width" - }, - { - "type": "int", - "name": "height" - } - ] + "params": { + "width": "int", + "height": "int" + } }, { "name": "SetWindowSize", "description": "Set window dimensions", "returnType": "void", - "params": [ - { - "type": "int", - "name": "width" - }, - { - "type": "int", - "name": "height" - } - ] - }, - { - "name": "SetWindowOpacity", - "description": "Set window opacity [0.0f..1.0f] (only PLATFORM_DESKTOP)", - "returnType": "void", - "params": [ - { - "type": "float", - "name": "opacity" - } - ] + "params": { + "width": "int", + "height": "int" + } }, { "name": "GetWindowHandle", @@ -2707,16 +2651,6 @@ "description": "Get current screen height", "returnType": "int" }, - { - "name": "GetRenderWidth", - "description": "Get current render width (it considers HiDPI)", - "returnType": "int" - }, - { - "name": "GetRenderHeight", - "description": "Get current render height (it considers HiDPI)", - "returnType": "int" - }, { "name": "GetMonitorCount", "description": "Get number of connected monitors", @@ -2731,67 +2665,49 @@ "name": "GetMonitorPosition", "description": "Get specified monitor position", "returnType": "Vector2", - "params": [ - { - "type": "int", - "name": "monitor" - } - ] + "params": { + "monitor": "int" + } }, { "name": "GetMonitorWidth", "description": "Get specified monitor width (max available by monitor)", "returnType": "int", - "params": [ - { - "type": "int", - "name": "monitor" - } - ] + "params": { + "monitor": "int" + } }, { "name": "GetMonitorHeight", "description": "Get specified monitor height (max available by monitor)", "returnType": "int", - "params": [ - { - "type": "int", - "name": "monitor" - } - ] + "params": { + "monitor": "int" + } }, { "name": "GetMonitorPhysicalWidth", "description": "Get specified monitor physical width in millimetres", "returnType": "int", - "params": [ - { - "type": "int", - "name": "monitor" - } - ] + "params": { + "monitor": "int" + } }, { "name": "GetMonitorPhysicalHeight", "description": "Get specified monitor physical height in millimetres", "returnType": "int", - "params": [ - { - "type": "int", - "name": "monitor" - } - ] + "params": { + "monitor": "int" + } }, { "name": "GetMonitorRefreshRate", "description": "Get specified monitor refresh rate", "returnType": "int", - "params": [ - { - "type": "int", - "name": "monitor" - } - ] + "params": { + "monitor": "int" + } }, { "name": "GetWindowPosition", @@ -2807,50 +2723,23 @@ "name": "GetMonitorName", "description": "Get the human-readable, UTF-8 encoded name of the primary monitor", "returnType": "const char *", - "params": [ - { - "type": "int", - "name": "monitor" - } - ] + "params": { + "monitor": "int" + } }, { "name": "SetClipboardText", "description": "Set clipboard text content", "returnType": "void", - "params": [ - { - "type": "const char *", - "name": "text" - } - ] + "params": { + "text": "const char *" + } }, { "name": "GetClipboardText", "description": "Get clipboard text content", "returnType": "const char *" }, - { - "name": "SwapScreenBuffer", - "description": "Swap back buffer with front buffer (screen drawing)", - "returnType": "void" - }, - { - "name": "PollInputEvents", - "description": "Register all input events", - "returnType": "void" - }, - { - "name": "WaitTime", - "description": "Wait for some milliseconds (halt program execution)", - "returnType": "void", - "params": [ - { - "type": "float", - "name": "ms" - } - ] - }, { "name": "ShowCursor", "description": "Shows cursor", @@ -2885,12 +2774,9 @@ "name": "ClearBackground", "description": "Set background color (framebuffer clear color)", "returnType": "void", - "params": [ - { - "type": "Color", - "name": "color" - } - ] + "params": { + "color": "Color" + } }, { "name": "BeginDrawing", @@ -2906,12 +2792,9 @@ "name": "BeginMode2D", "description": "Begin 2D mode with custom camera (2D)", "returnType": "void", - "params": [ - { - "type": "Camera2D", - "name": "camera" - } - ] + "params": { + "camera": "Camera2D" + } }, { "name": "EndMode2D", @@ -2922,12 +2805,9 @@ "name": "BeginMode3D", "description": "Begin 3D mode with custom camera (3D)", "returnType": "void", - "params": [ - { - "type": "Camera3D", - "name": "camera" - } - ] + "params": { + "camera": "Camera3D" + } }, { "name": "EndMode3D", @@ -2938,12 +2818,9 @@ "name": "BeginTextureMode", "description": "Begin drawing to render texture", "returnType": "void", - "params": [ - { - "type": "RenderTexture2D", - "name": "target" - } - ] + "params": { + "target": "RenderTexture2D" + } }, { "name": "EndTextureMode", @@ -2954,12 +2831,9 @@ "name": "BeginShaderMode", "description": "Begin custom shader drawing", "returnType": "void", - "params": [ - { - "type": "Shader", - "name": "shader" - } - ] + "params": { + "shader": "Shader" + } }, { "name": "EndShaderMode", @@ -2970,12 +2844,9 @@ "name": "BeginBlendMode", "description": "Begin blending mode (alpha, additive, multiplied, subtract, custom)", "returnType": "void", - "params": [ - { - "type": "int", - "name": "mode" - } - ] + "params": { + "mode": "int" + } }, { "name": "EndBlendMode", @@ -2986,24 +2857,12 @@ "name": "BeginScissorMode", "description": "Begin scissor mode (define screen area for following drawing)", "returnType": "void", - "params": [ - { - "type": "int", - "name": "x" - }, - { - "type": "int", - "name": "y" - }, - { - "type": "int", - "name": "width" - }, - { - "type": "int", - "name": "height" - } - ] + "params": { + "x": "int", + "y": "int", + "width": "int", + "height": "int" + } }, { "name": "EndScissorMode", @@ -3014,12 +2873,9 @@ "name": "BeginVrStereoMode", "description": "Begin stereo rendering (requires VR simulator)", "returnType": "void", - "params": [ - { - "type": "VrStereoConfig", - "name": "config" - } - ] + "params": { + "config": "VrStereoConfig" + } }, { "name": "EndVrStereoMode", @@ -3030,298 +2886,175 @@ "name": "LoadVrStereoConfig", "description": "Load VR stereo config for VR simulator device parameters", "returnType": "VrStereoConfig", - "params": [ - { - "type": "VrDeviceInfo", - "name": "device" - } - ] + "params": { + "device": "VrDeviceInfo" + } }, { "name": "UnloadVrStereoConfig", "description": "Unload VR stereo config", "returnType": "void", - "params": [ - { - "type": "VrStereoConfig", - "name": "config" - } - ] + "params": { + "config": "VrStereoConfig" + } }, { "name": "LoadShader", "description": "Load shader from files and bind default locations", "returnType": "Shader", - "params": [ - { - "type": "const char *", - "name": "vsFileName" - }, - { - "type": "const char *", - "name": "fsFileName" - } - ] + "params": { + "vsFileName": "const char *", + "fsFileName": "const char *" + } }, { "name": "LoadShaderFromMemory", "description": "Load shader from code strings and bind default locations", "returnType": "Shader", - "params": [ - { - "type": "const char *", - "name": "vsCode" - }, - { - "type": "const char *", - "name": "fsCode" - } - ] + "params": { + "vsCode": "const char *", + "fsCode": "const char *" + } }, { "name": "GetShaderLocation", "description": "Get shader uniform location", "returnType": "int", - "params": [ - { - "type": "Shader", - "name": "shader" - }, - { - "type": "const char *", - "name": "uniformName" - } - ] + "params": { + "shader": "Shader", + "uniformName": "const char *" + } }, { "name": "GetShaderLocationAttrib", "description": "Get shader attribute location", "returnType": "int", - "params": [ - { - "type": "Shader", - "name": "shader" - }, - { - "type": "const char *", - "name": "attribName" - } - ] + "params": { + "shader": "Shader", + "attribName": "const char *" + } }, { "name": "SetShaderValue", "description": "Set shader uniform value", "returnType": "void", - "params": [ - { - "type": "Shader", - "name": "shader" - }, - { - "type": "int", - "name": "locIndex" - }, - { - "type": "const void *", - "name": "value" - }, - { - "type": "int", - "name": "uniformType" - } - ] + "params": { + "shader": "Shader", + "locIndex": "int", + "value": "const void *", + "uniformType": "int" + } }, { "name": "SetShaderValueV", "description": "Set shader uniform value vector", "returnType": "void", - "params": [ - { - "type": "Shader", - "name": "shader" - }, - { - "type": "int", - "name": "locIndex" - }, - { - "type": "const void *", - "name": "value" - }, - { - "type": "int", - "name": "uniformType" - }, - { - "type": "int", - "name": "count" - } - ] + "params": { + "shader": "Shader", + "locIndex": "int", + "value": "const void *", + "uniformType": "int", + "count": "int" + } }, { "name": "SetShaderValueMatrix", "description": "Set shader uniform value (matrix 4x4)", "returnType": "void", - "params": [ - { - "type": "Shader", - "name": "shader" - }, - { - "type": "int", - "name": "locIndex" - }, - { - "type": "Matrix", - "name": "mat" - } - ] + "params": { + "shader": "Shader", + "locIndex": "int", + "mat": "Matrix" + } }, { "name": "SetShaderValueTexture", "description": "Set shader uniform value for texture (sampler2d)", "returnType": "void", - "params": [ - { - "type": "Shader", - "name": "shader" - }, - { - "type": "int", - "name": "locIndex" - }, - { - "type": "Texture2D", - "name": "texture" - } - ] + "params": { + "shader": "Shader", + "locIndex": "int", + "texture": "Texture2D" + } }, { "name": "UnloadShader", "description": "Unload shader from GPU memory (VRAM)", "returnType": "void", - "params": [ - { - "type": "Shader", - "name": "shader" - } - ] + "params": { + "shader": "Shader" + } }, { "name": "GetMouseRay", "description": "Get a ray trace from mouse position", "returnType": "Ray", - "params": [ - { - "type": "Vector2", - "name": "mousePosition" - }, - { - "type": "Camera", - "name": "camera" - } - ] + "params": { + "mousePosition": "Vector2", + "camera": "Camera" + } }, { "name": "GetCameraMatrix", "description": "Get camera transform matrix (view matrix)", "returnType": "Matrix", - "params": [ - { - "type": "Camera", - "name": "camera" - } - ] + "params": { + "camera": "Camera" + } }, { "name": "GetCameraMatrix2D", "description": "Get camera 2d transform matrix", "returnType": "Matrix", - "params": [ - { - "type": "Camera2D", - "name": "camera" - } - ] + "params": { + "camera": "Camera2D" + } }, { "name": "GetWorldToScreen", "description": "Get the screen space position for a 3d world space position", "returnType": "Vector2", - "params": [ - { - "type": "Vector3", - "name": "position" - }, - { - "type": "Camera", - "name": "camera" - } - ] + "params": { + "position": "Vector3", + "camera": "Camera" + } }, { "name": "GetWorldToScreenEx", "description": "Get size position for a 3d world space position", "returnType": "Vector2", - "params": [ - { - "type": "Vector3", - "name": "position" - }, - { - "type": "Camera", - "name": "camera" - }, - { - "type": "int", - "name": "width" - }, - { - "type": "int", - "name": "height" - } - ] + "params": { + "position": "Vector3", + "camera": "Camera", + "width": "int", + "height": "int" + } }, { "name": "GetWorldToScreen2D", "description": "Get the screen space position for a 2d camera world space position", "returnType": "Vector2", - "params": [ - { - "type": "Vector2", - "name": "position" - }, - { - "type": "Camera2D", - "name": "camera" - } - ] + "params": { + "position": "Vector2", + "camera": "Camera2D" + } }, { "name": "GetScreenToWorld2D", "description": "Get the world space position for a 2d camera screen space position", "returnType": "Vector2", - "params": [ - { - "type": "Vector2", - "name": "position" - }, - { - "type": "Camera2D", - "name": "camera" - } - ] + "params": { + "position": "Vector2", + "camera": "Camera2D" + } }, { "name": "SetTargetFPS", "description": "Set target FPS (maximum)", "returnType": "void", - "params": [ - { - "type": "int", - "name": "fps" - } - ] + "params": { + "fps": "int" + } }, { "name": "GetFPS", @@ -3342,345 +3075,226 @@ "name": "GetRandomValue", "description": "Get a random value between min and max (both included)", "returnType": "int", - "params": [ - { - "type": "int", - "name": "min" - }, - { - "type": "int", - "name": "max" - } - ] - }, - { - "name": "SetRandomSeed", - "description": "Set the seed for the random number generator", - "returnType": "void", - "params": [ - { - "type": "unsigned int", - "name": "seed" - } - ] + "params": { + "min": "int", + "max": "int" + } }, { "name": "TakeScreenshot", "description": "Takes a screenshot of current screen (filename extension defines format)", "returnType": "void", - "params": [ - { - "type": "const char *", - "name": "fileName" - } - ] + "params": { + "fileName": "const char *" + } }, { "name": "SetConfigFlags", "description": "Setup init configuration flags (view FLAGS)", "returnType": "void", - "params": [ - { - "type": "unsigned int", - "name": "flags" - } - ] + "params": { + "flags": "unsigned int" + } }, { "name": "TraceLog", "description": "Show trace log messages (LOG_DEBUG, LOG_INFO, LOG_WARNING, LOG_ERROR...)", "returnType": "void", - "params": [ - { - "type": "int", - "name": "logLevel" - }, - { - "type": "const char *", - "name": "text" - }, - { - "type": "", - "name": "" - } - ] + "params": { + "logLevel": "int", + "text": "const char *", + "": "" + } }, { "name": "SetTraceLogLevel", "description": "Set the current threshold (minimum) log level", "returnType": "void", - "params": [ - { - "type": "int", - "name": "logLevel" - } - ] + "params": { + "logLevel": "int" + } }, { "name": "MemAlloc", "description": "Internal memory allocator", "returnType": "void *", - "params": [ - { - "type": "int", - "name": "size" - } - ] + "params": { + "size": "int" + } }, { "name": "MemRealloc", "description": "Internal memory reallocator", "returnType": "void *", - "params": [ - { - "type": "void *", - "name": "ptr" - }, - { - "type": "int", - "name": "size" - } - ] + "params": { + "ptr": "void *", + "size": "int" + } }, { "name": "MemFree", "description": "Internal memory free", "returnType": "void", - "params": [ - { - "type": "void *", - "name": "ptr" - } - ] + "params": { + "ptr": "void *" + } }, { "name": "SetTraceLogCallback", "description": "Set custom trace log", "returnType": "void", - "params": [ - { - "type": "TraceLogCallback", - "name": "callback" - } - ] + "params": { + "callback": "TraceLogCallback" + } }, { "name": "SetLoadFileDataCallback", "description": "Set custom file binary data loader", "returnType": "void", - "params": [ - { - "type": "LoadFileDataCallback", - "name": "callback" - } - ] + "params": { + "callback": "LoadFileDataCallback" + } }, { "name": "SetSaveFileDataCallback", "description": "Set custom file binary data saver", "returnType": "void", - "params": [ - { - "type": "SaveFileDataCallback", - "name": "callback" - } - ] + "params": { + "callback": "SaveFileDataCallback" + } }, { "name": "SetLoadFileTextCallback", "description": "Set custom file text data loader", "returnType": "void", - "params": [ - { - "type": "LoadFileTextCallback", - "name": "callback" - } - ] + "params": { + "callback": "LoadFileTextCallback" + } }, { "name": "SetSaveFileTextCallback", "description": "Set custom file text data saver", "returnType": "void", - "params": [ - { - "type": "SaveFileTextCallback", - "name": "callback" - } - ] + "params": { + "callback": "SaveFileTextCallback" + } }, { "name": "LoadFileData", "description": "Load file data as byte array (read)", "returnType": "unsigned char *", - "params": [ - { - "type": "const char *", - "name": "fileName" - }, - { - "type": "unsigned int *", - "name": "bytesRead" - } - ] + "params": { + "fileName": "const char *", + "bytesRead": "unsigned int *" + } }, { "name": "UnloadFileData", "description": "Unload file data allocated by LoadFileData()", "returnType": "void", - "params": [ - { - "type": "unsigned char *", - "name": "data" - } - ] + "params": { + "data": "unsigned char *" + } }, { "name": "SaveFileData", "description": "Save data to file from byte array (write), returns true on success", "returnType": "bool", - "params": [ - { - "type": "const char *", - "name": "fileName" - }, - { - "type": "void *", - "name": "data" - }, - { - "type": "unsigned int", - "name": "bytesToWrite" - } - ] + "params": { + "fileName": "const char *", + "data": "void *", + "bytesToWrite": "unsigned int" + } }, { "name": "LoadFileText", - "description": "Load text data from file (read), returns a '\\0' terminated string", + "description": "Load text data from file (read), returns a ' 0' terminated string", "returnType": "char *", - "params": [ - { - "type": "const char *", - "name": "fileName" - } - ] + "params": { + "fileName": "const char *" + } }, { "name": "UnloadFileText", "description": "Unload file text data allocated by LoadFileText()", "returnType": "void", - "params": [ - { - "type": "char *", - "name": "text" - } - ] + "params": { + "text": "char *" + } }, { "name": "SaveFileText", - "description": "Save text data to file (write), string must be '\\0' terminated, returns true on success", + "description": "Save text data to file (write), string must be ' 0' terminated, returns true on success", "returnType": "bool", - "params": [ - { - "type": "const char *", - "name": "fileName" - }, - { - "type": "char *", - "name": "text" - } - ] + "params": { + "fileName": "const char *", + "text": "char *" + } }, { "name": "FileExists", "description": "Check if file exists", "returnType": "bool", - "params": [ - { - "type": "const char *", - "name": "fileName" - } - ] + "params": { + "fileName": "const char *" + } }, { "name": "DirectoryExists", "description": "Check if a directory path exists", "returnType": "bool", - "params": [ - { - "type": "const char *", - "name": "dirPath" - } - ] + "params": { + "dirPath": "const char *" + } }, { "name": "IsFileExtension", "description": "Check file extension (including point: .png, .wav)", "returnType": "bool", - "params": [ - { - "type": "const char *", - "name": "fileName" - }, - { - "type": "const char *", - "name": "ext" - } - ] + "params": { + "fileName": "const char *", + "ext": "const char *" + } }, { "name": "GetFileExtension", "description": "Get pointer to extension for a filename string (includes dot: '.png')", "returnType": "const char *", - "params": [ - { - "type": "const char *", - "name": "fileName" - } - ] + "params": { + "fileName": "const char *" + } }, { "name": "GetFileName", "description": "Get pointer to filename for a path string", "returnType": "const char *", - "params": [ - { - "type": "const char *", - "name": "filePath" - } - ] + "params": { + "filePath": "const char *" + } }, { "name": "GetFileNameWithoutExt", "description": "Get filename string without extension (uses static string)", "returnType": "const char *", - "params": [ - { - "type": "const char *", - "name": "filePath" - } - ] + "params": { + "filePath": "const char *" + } }, { "name": "GetDirectoryPath", "description": "Get full path for a given fileName with path (uses static string)", "returnType": "const char *", - "params": [ - { - "type": "const char *", - "name": "filePath" - } - ] + "params": { + "filePath": "const char *" + } }, { "name": "GetPrevDirectoryPath", "description": "Get previous directory path for a given path (uses static string)", "returnType": "const char *", - "params": [ - { - "type": "const char *", - "name": "dirPath" - } - ] + "params": { + "dirPath": "const char *" + } }, { "name": "GetWorkingDirectory", @@ -3691,16 +3305,10 @@ "name": "GetDirectoryFiles", "description": "Get filenames in a directory path (memory should be freed)", "returnType": "char **", - "params": [ - { - "type": "const char *", - "name": "dirPath" - }, - { - "type": "int *", - "name": "count" - } - ] + "params": { + "dirPath": "const char *", + "count": "int *" + } }, { "name": "ClearDirectoryFiles", @@ -3711,12 +3319,9 @@ "name": "ChangeDirectory", "description": "Change working directory, return true on success", "returnType": "bool", - "params": [ - { - "type": "const char *", - "name": "dir" - } - ] + "params": { + "dir": "const char *" + } }, { "name": "IsFileDropped", @@ -3727,12 +3332,9 @@ "name": "GetDroppedFiles", "description": "Get dropped files names (memory should be freed)", "returnType": "char **", - "params": [ - { - "type": "int *", - "name": "count" - } - ] + "params": { + "count": "int *" + } }, { "name": "ClearDroppedFiles", @@ -3743,268 +3345,165 @@ "name": "GetFileModTime", "description": "Get file modification time (last write time)", "returnType": "long", - "params": [ - { - "type": "const char *", - "name": "fileName" - } - ] + "params": { + "fileName": "const char *" + } }, { "name": "CompressData", "description": "Compress data (DEFLATE algorithm)", "returnType": "unsigned char *", - "params": [ - { - "type": "unsigned char *", - "name": "data" - }, - { - "type": "int", - "name": "dataLength" - }, - { - "type": "int *", - "name": "compDataLength" - } - ] + "params": { + "data": "unsigned char *", + "dataLength": "int", + "compDataLength": "int *" + } }, { "name": "DecompressData", "description": "Decompress data (DEFLATE algorithm)", "returnType": "unsigned char *", - "params": [ - { - "type": "unsigned char *", - "name": "compData" - }, - { - "type": "int", - "name": "compDataLength" - }, - { - "type": "int *", - "name": "dataLength" - } - ] - }, - { - "name": "EncodeDataBase64", - "description": "Encode data to Base64 string", - "returnType": "char *", - "params": [ - { - "type": "const unsigned char *", - "name": "data" - }, - { - "type": "int", - "name": "dataLength" - }, - { - "type": "int *", - "name": "outputLength" - } - ] - }, - { - "name": "DecodeDataBase64", - "description": "Decode Base64 string data", - "returnType": "unsigned char *", - "params": [ - { - "type": "unsigned char *", - "name": "data" - }, - { - "type": "int *", - "name": "outputLength" - } - ] + "params": { + "compData": "unsigned char *", + "compDataLength": "int", + "dataLength": "int *" + } }, { "name": "SaveStorageValue", "description": "Save integer value to storage file (to defined position), returns true on success", "returnType": "bool", - "params": [ - { - "type": "unsigned int", - "name": "position" - }, - { - "type": "int", - "name": "value" - } - ] + "params": { + "position": "unsigned int", + "value": "int" + } }, { "name": "LoadStorageValue", "description": "Load integer value from storage file (from defined position)", "returnType": "int", - "params": [ - { - "type": "unsigned int", - "name": "position" - } - ] + "params": { + "position": "unsigned int" + } }, { "name": "OpenURL", "description": "Open URL with default system browser (if available)", "returnType": "void", - "params": [ - { - "type": "const char *", - "name": "url" - } - ] + "params": { + "url": "const char *" + } }, { "name": "IsKeyPressed", "description": "Check if a key has been pressed once", "returnType": "bool", - "params": [ - { - "type": "int", - "name": "key" - } - ] + "params": { + "key": "int" + } }, { "name": "IsKeyDown", "description": "Check if a key is being pressed", "returnType": "bool", - "params": [ - { - "type": "int", - "name": "key" - } - ] + "params": { + "key": "int" + } }, { "name": "IsKeyReleased", "description": "Check if a key has been released once", "returnType": "bool", - "params": [ - { - "type": "int", - "name": "key" - } - ] + "params": { + "key": "int" + } }, { "name": "IsKeyUp", "description": "Check if a key is NOT being pressed", "returnType": "bool", - "params": [ - { - "type": "int", - "name": "key" - } - ] + "params": { + "key": "int" + } }, { "name": "SetExitKey", "description": "Set a custom key to exit program (default is ESC)", "returnType": "void", - "params": [ - { - "type": "int", - "name": "key" - } - ] + "params": { + "key": "int" + } }, { "name": "GetKeyPressed", - "description": "Get key pressed (keycode), call it multiple times for keys queued, returns 0 when the queue is empty", + "description": "Get key pressed (keycode), call it multiple times for keys queued", "returnType": "int" }, { "name": "GetCharPressed", - "description": "Get char pressed (unicode), call it multiple times for chars queued, returns 0 when the queue is empty", + "description": "Get char pressed (unicode), call it multiple times for chars queued", "returnType": "int" }, { "name": "IsGamepadAvailable", "description": "Check if a gamepad is available", "returnType": "bool", - "params": [ - { - "type": "int", - "name": "gamepad" - } - ] + "params": { + "gamepad": "int" + } + }, + { + "name": "IsGamepadName", + "description": "Check gamepad name (if available)", + "returnType": "bool", + "params": { + "gamepad": "int", + "name": "const char *" + } }, { "name": "GetGamepadName", "description": "Get gamepad internal name id", "returnType": "const char *", - "params": [ - { - "type": "int", - "name": "gamepad" - } - ] + "params": { + "gamepad": "int" + } }, { "name": "IsGamepadButtonPressed", "description": "Check if a gamepad button has been pressed once", "returnType": "bool", - "params": [ - { - "type": "int", - "name": "gamepad" - }, - { - "type": "int", - "name": "button" - } - ] + "params": { + "gamepad": "int", + "button": "int" + } }, { "name": "IsGamepadButtonDown", "description": "Check if a gamepad button is being pressed", "returnType": "bool", - "params": [ - { - "type": "int", - "name": "gamepad" - }, - { - "type": "int", - "name": "button" - } - ] + "params": { + "gamepad": "int", + "button": "int" + } }, { "name": "IsGamepadButtonReleased", "description": "Check if a gamepad button has been released once", "returnType": "bool", - "params": [ - { - "type": "int", - "name": "gamepad" - }, - { - "type": "int", - "name": "button" - } - ] + "params": { + "gamepad": "int", + "button": "int" + } }, { "name": "IsGamepadButtonUp", "description": "Check if a gamepad button is NOT being pressed", "returnType": "bool", - "params": [ - { - "type": "int", - "name": "gamepad" - }, - { - "type": "int", - "name": "button" - } - ] + "params": { + "gamepad": "int", + "button": "int" + } }, { "name": "GetGamepadButtonPressed", @@ -4015,82 +3514,58 @@ "name": "GetGamepadAxisCount", "description": "Get gamepad axis count for a gamepad", "returnType": "int", - "params": [ - { - "type": "int", - "name": "gamepad" - } - ] + "params": { + "gamepad": "int" + } }, { "name": "GetGamepadAxisMovement", "description": "Get axis movement value for a gamepad axis", "returnType": "float", - "params": [ - { - "type": "int", - "name": "gamepad" - }, - { - "type": "int", - "name": "axis" - } - ] + "params": { + "gamepad": "int", + "axis": "int" + } }, { "name": "SetGamepadMappings", "description": "Set internal gamepad mappings (SDL_GameControllerDB)", "returnType": "int", - "params": [ - { - "type": "const char *", - "name": "mappings" - } - ] + "params": { + "mappings": "const char *" + } }, { "name": "IsMouseButtonPressed", "description": "Check if a mouse button has been pressed once", "returnType": "bool", - "params": [ - { - "type": "int", - "name": "button" - } - ] + "params": { + "button": "int" + } }, { "name": "IsMouseButtonDown", "description": "Check if a mouse button is being pressed", "returnType": "bool", - "params": [ - { - "type": "int", - "name": "button" - } - ] + "params": { + "button": "int" + } }, { "name": "IsMouseButtonReleased", "description": "Check if a mouse button has been released once", "returnType": "bool", - "params": [ - { - "type": "int", - "name": "button" - } - ] + "params": { + "button": "int" + } }, { "name": "IsMouseButtonUp", "description": "Check if a mouse button is NOT being pressed", "returnType": "bool", - "params": [ - { - "type": "int", - "name": "button" - } - ] + "params": { + "button": "int" + } }, { "name": "GetMouseX", @@ -4107,55 +3582,32 @@ "description": "Get mouse position XY", "returnType": "Vector2" }, - { - "name": "GetMouseDelta", - "description": "Get mouse delta between frames", - "returnType": "Vector2" - }, { "name": "SetMousePosition", "description": "Set mouse position XY", "returnType": "void", - "params": [ - { - "type": "int", - "name": "x" - }, - { - "type": "int", - "name": "y" - } - ] + "params": { + "x": "int", + "y": "int" + } }, { "name": "SetMouseOffset", "description": "Set mouse offset", "returnType": "void", - "params": [ - { - "type": "int", - "name": "offsetX" - }, - { - "type": "int", - "name": "offsetY" - } - ] + "params": { + "offsetX": "int", + "offsetY": "int" + } }, { "name": "SetMouseScale", "description": "Set mouse scaling", "returnType": "void", - "params": [ - { - "type": "float", - "name": "scaleX" - }, - { - "type": "float", - "name": "scaleY" - } - ] + "params": { + "scaleX": "float", + "scaleY": "float" + } }, { "name": "GetMouseWheelMove", @@ -4166,12 +3618,9 @@ "name": "SetMouseCursor", "description": "Set mouse cursor", "returnType": "void", - "params": [ - { - "type": "int", - "name": "cursor" - } - ] + "params": { + "cursor": "int" + } }, { "name": "GetTouchX", @@ -4187,56 +3636,36 @@ "name": "GetTouchPosition", "description": "Get touch position XY for a touch point index (relative to screen size)", "returnType": "Vector2", - "params": [ - { - "type": "int", - "name": "index" - } - ] - }, - { - "name": "GetTouchPointId", - "description": "Get touch point identifier for given index", - "returnType": "int", - "params": [ - { - "type": "int", - "name": "index" - } - ] - }, - { - "name": "GetTouchPointCount", - "description": "Get number of touch points", - "returnType": "int" + "params": { + "index": "int" + } }, { "name": "SetGesturesEnabled", "description": "Enable a set of gestures using flags", "returnType": "void", - "params": [ - { - "type": "unsigned int", - "name": "flags" - } - ] + "params": { + "flags": "unsigned int" + } }, { "name": "IsGestureDetected", "description": "Check if a gesture have been detected", "returnType": "bool", - "params": [ - { - "type": "int", - "name": "gesture" - } - ] + "params": { + "gesture": "int" + } }, { "name": "GetGestureDetected", "description": "Get latest detected gesture", "returnType": "int" }, + { + "name": "GetTouchPointsCount", + "description": "Get touch points count", + "returnType": "int" + }, { "name": "GetGestureHoldDuration", "description": "Get gesture hold time in milliseconds", @@ -4266,2916 +3695,1478 @@ "name": "SetCameraMode", "description": "Set camera mode (multiple camera modes available)", "returnType": "void", - "params": [ - { - "type": "Camera", - "name": "camera" - }, - { - "type": "int", - "name": "mode" - } - ] + "params": { + "camera": "Camera", + "mode": "int" + } }, { "name": "UpdateCamera", "description": "Update camera position for selected mode", "returnType": "void", - "params": [ - { - "type": "Camera *", - "name": "camera" - } - ] + "params": { + "camera": "Camera *" + } }, { "name": "SetCameraPanControl", "description": "Set camera pan key to combine with mouse movement (free camera)", "returnType": "void", - "params": [ - { - "type": "int", - "name": "keyPan" - } - ] + "params": { + "keyPan": "int" + } }, { "name": "SetCameraAltControl", "description": "Set camera alt key to combine with mouse movement (free camera)", "returnType": "void", - "params": [ - { - "type": "int", - "name": "keyAlt" - } - ] + "params": { + "keyAlt": "int" + } }, { "name": "SetCameraSmoothZoomControl", "description": "Set camera smooth zoom key to combine with mouse (free camera)", "returnType": "void", - "params": [ - { - "type": "int", - "name": "keySmoothZoom" - } - ] + "params": { + "keySmoothZoom": "int" + } }, { "name": "SetCameraMoveControls", "description": "Set camera move controls (1st person and 3rd person cameras)", "returnType": "void", - "params": [ - { - "type": "int", - "name": "keyFront" - }, - { - "type": "int", - "name": "keyBack" - }, - { - "type": "int", - "name": "keyRight" - }, - { - "type": "int", - "name": "keyLeft" - }, - { - "type": "int", - "name": "keyUp" - }, - { - "type": "int", - "name": "keyDown" - } - ] + "params": { + "keyFront": "int", + "keyBack": "int", + "keyRight": "int", + "keyLeft": "int", + "keyUp": "int", + "keyDown": "int" + } }, { "name": "SetShapesTexture", "description": "Set texture and rectangle to be used on shapes drawing", "returnType": "void", - "params": [ - { - "type": "Texture2D", - "name": "texture" - }, - { - "type": "Rectangle", - "name": "source" - } - ] + "params": { + "texture": "Texture2D", + "source": "Rectangle" + } }, { "name": "DrawPixel", "description": "Draw a pixel", "returnType": "void", - "params": [ - { - "type": "int", - "name": "posX" - }, - { - "type": "int", - "name": "posY" - }, - { - "type": "Color", - "name": "color" - } - ] + "params": { + "posX": "int", + "posY": "int", + "color": "Color" + } }, { "name": "DrawPixelV", "description": "Draw a pixel (Vector version)", "returnType": "void", - "params": [ - { - "type": "Vector2", - "name": "position" - }, - { - "type": "Color", - "name": "color" - } - ] + "params": { + "position": "Vector2", + "color": "Color" + } }, { "name": "DrawLine", "description": "Draw a line", "returnType": "void", - "params": [ - { - "type": "int", - "name": "startPosX" - }, - { - "type": "int", - "name": "startPosY" - }, - { - "type": "int", - "name": "endPosX" - }, - { - "type": "int", - "name": "endPosY" - }, - { - "type": "Color", - "name": "color" - } - ] + "params": { + "startPosX": "int", + "startPosY": "int", + "endPosX": "int", + "endPosY": "int", + "color": "Color" + } }, { "name": "DrawLineV", "description": "Draw a line (Vector version)", "returnType": "void", - "params": [ - { - "type": "Vector2", - "name": "startPos" - }, - { - "type": "Vector2", - "name": "endPos" - }, - { - "type": "Color", - "name": "color" - } - ] + "params": { + "startPos": "Vector2", + "endPos": "Vector2", + "color": "Color" + } }, { "name": "DrawLineEx", "description": "Draw a line defining thickness", "returnType": "void", - "params": [ - { - "type": "Vector2", - "name": "startPos" - }, - { - "type": "Vector2", - "name": "endPos" - }, - { - "type": "float", - "name": "thick" - }, - { - "type": "Color", - "name": "color" - } - ] + "params": { + "startPos": "Vector2", + "endPos": "Vector2", + "thick": "float", + "color": "Color" + } }, { "name": "DrawLineBezier", "description": "Draw a line using cubic-bezier curves in-out", "returnType": "void", - "params": [ - { - "type": "Vector2", - "name": "startPos" - }, - { - "type": "Vector2", - "name": "endPos" - }, - { - "type": "float", - "name": "thick" - }, - { - "type": "Color", - "name": "color" - } - ] + "params": { + "startPos": "Vector2", + "endPos": "Vector2", + "thick": "float", + "color": "Color" + } }, { "name": "DrawLineBezierQuad", - "description": "Draw line using quadratic bezier curves with a control point", - "returnType": "void", - "params": [ - { - "type": "Vector2", - "name": "startPos" - }, - { - "type": "Vector2", - "name": "endPos" - }, - { - "type": "Vector2", - "name": "controlPos" - }, - { - "type": "float", - "name": "thick" - }, - { - "type": "Color", - "name": "color" - } - ] - }, - { - "name": "DrawLineBezierCubic", - "description": "Draw line using cubic bezier curves with 2 control points", + "description": "raw line using quadratic bezier curves with a control point", "returnType": "void", - "params": [ - { - "type": "Vector2", - "name": "startPos" - }, - { - "type": "Vector2", - "name": "endPos" - }, - { - "type": "Vector2", - "name": "startControlPos" - }, - { - "type": "Vector2", - "name": "endControlPos" - }, - { - "type": "float", - "name": "thick" - }, - { - "type": "Color", - "name": "color" - } - ] + "params": { + "startPos": "Vector2", + "endPos": "Vector2", + "controlPos": "Vector2", + "thick": "float", + "color": "Color" + } }, { "name": "DrawLineStrip", "description": "Draw lines sequence", "returnType": "void", - "params": [ - { - "type": "Vector2 *", - "name": "points" - }, - { - "type": "int", - "name": "pointCount" - }, - { - "type": "Color", - "name": "color" - } - ] + "params": { + "points": "Vector2 *", + "pointsCount": "int", + "color": "Color" + } }, { "name": "DrawCircle", "description": "Draw a color-filled circle", "returnType": "void", - "params": [ - { - "type": "int", - "name": "centerX" - }, - { - "type": "int", - "name": "centerY" - }, - { - "type": "float", - "name": "radius" - }, - { - "type": "Color", - "name": "color" - } - ] + "params": { + "centerX": "int", + "centerY": "int", + "radius": "float", + "color": "Color" + } }, { "name": "DrawCircleSector", "description": "Draw a piece of a circle", "returnType": "void", - "params": [ - { - "type": "Vector2", - "name": "center" - }, - { - "type": "float", - "name": "radius" - }, - { - "type": "float", - "name": "startAngle" - }, - { - "type": "float", - "name": "endAngle" - }, - { - "type": "int", - "name": "segments" - }, - { - "type": "Color", - "name": "color" - } - ] + "params": { + "center": "Vector2", + "radius": "float", + "startAngle": "float", + "endAngle": "float", + "segments": "int", + "color": "Color" + } }, { "name": "DrawCircleSectorLines", "description": "Draw circle sector outline", "returnType": "void", - "params": [ - { - "type": "Vector2", - "name": "center" - }, - { - "type": "float", - "name": "radius" - }, - { - "type": "float", - "name": "startAngle" - }, - { - "type": "float", - "name": "endAngle" - }, - { - "type": "int", - "name": "segments" - }, - { - "type": "Color", - "name": "color" - } - ] + "params": { + "center": "Vector2", + "radius": "float", + "startAngle": "float", + "endAngle": "float", + "segments": "int", + "color": "Color" + } }, { "name": "DrawCircleGradient", "description": "Draw a gradient-filled circle", "returnType": "void", - "params": [ - { - "type": "int", - "name": "centerX" - }, - { - "type": "int", - "name": "centerY" - }, - { - "type": "float", - "name": "radius" - }, - { - "type": "Color", - "name": "color1" - }, - { - "type": "Color", - "name": "color2" - } - ] + "params": { + "centerX": "int", + "centerY": "int", + "radius": "float", + "color1": "Color", + "color2": "Color" + } }, { "name": "DrawCircleV", "description": "Draw a color-filled circle (Vector version)", "returnType": "void", - "params": [ - { - "type": "Vector2", - "name": "center" - }, - { - "type": "float", - "name": "radius" - }, - { - "type": "Color", - "name": "color" - } - ] + "params": { + "center": "Vector2", + "radius": "float", + "color": "Color" + } }, { "name": "DrawCircleLines", "description": "Draw circle outline", "returnType": "void", - "params": [ - { - "type": "int", - "name": "centerX" - }, - { - "type": "int", - "name": "centerY" - }, - { - "type": "float", - "name": "radius" - }, - { - "type": "Color", - "name": "color" - } - ] + "params": { + "centerX": "int", + "centerY": "int", + "radius": "float", + "color": "Color" + } }, { "name": "DrawEllipse", "description": "Draw ellipse", "returnType": "void", - "params": [ - { - "type": "int", - "name": "centerX" - }, - { - "type": "int", - "name": "centerY" - }, - { - "type": "float", - "name": "radiusH" - }, - { - "type": "float", - "name": "radiusV" - }, - { - "type": "Color", - "name": "color" - } - ] + "params": { + "centerX": "int", + "centerY": "int", + "radiusH": "float", + "radiusV": "float", + "color": "Color" + } }, { "name": "DrawEllipseLines", "description": "Draw ellipse outline", "returnType": "void", - "params": [ - { - "type": "int", - "name": "centerX" - }, - { - "type": "int", - "name": "centerY" - }, - { - "type": "float", - "name": "radiusH" - }, - { - "type": "float", - "name": "radiusV" - }, - { - "type": "Color", - "name": "color" - } - ] + "params": { + "centerX": "int", + "centerY": "int", + "radiusH": "float", + "radiusV": "float", + "color": "Color" + } }, { "name": "DrawRing", "description": "Draw ring", "returnType": "void", - "params": [ - { - "type": "Vector2", - "name": "center" - }, - { - "type": "float", - "name": "innerRadius" - }, - { - "type": "float", - "name": "outerRadius" - }, - { - "type": "float", - "name": "startAngle" - }, - { - "type": "float", - "name": "endAngle" - }, - { - "type": "int", - "name": "segments" - }, - { - "type": "Color", - "name": "color" - } - ] + "params": { + "center": "Vector2", + "innerRadius": "float", + "outerRadius": "float", + "startAngle": "float", + "endAngle": "float", + "segments": "int", + "color": "Color" + } }, { "name": "DrawRingLines", "description": "Draw ring outline", "returnType": "void", - "params": [ - { - "type": "Vector2", - "name": "center" - }, - { - "type": "float", - "name": "innerRadius" - }, - { - "type": "float", - "name": "outerRadius" - }, - { - "type": "float", - "name": "startAngle" - }, - { - "type": "float", - "name": "endAngle" - }, - { - "type": "int", - "name": "segments" - }, - { - "type": "Color", - "name": "color" - } - ] + "params": { + "center": "Vector2", + "innerRadius": "float", + "outerRadius": "float", + "startAngle": "float", + "endAngle": "float", + "segments": "int", + "color": "Color" + } }, { "name": "DrawRectangle", "description": "Draw a color-filled rectangle", "returnType": "void", - "params": [ - { - "type": "int", - "name": "posX" - }, - { - "type": "int", - "name": "posY" - }, - { - "type": "int", - "name": "width" - }, - { - "type": "int", - "name": "height" - }, - { - "type": "Color", - "name": "color" - } - ] + "params": { + "posX": "int", + "posY": "int", + "width": "int", + "height": "int", + "color": "Color" + } }, { "name": "DrawRectangleV", "description": "Draw a color-filled rectangle (Vector version)", "returnType": "void", - "params": [ - { - "type": "Vector2", - "name": "position" - }, - { - "type": "Vector2", - "name": "size" - }, - { - "type": "Color", - "name": "color" - } - ] + "params": { + "position": "Vector2", + "size": "Vector2", + "color": "Color" + } }, { "name": "DrawRectangleRec", "description": "Draw a color-filled rectangle", "returnType": "void", - "params": [ - { - "type": "Rectangle", - "name": "rec" - }, - { - "type": "Color", - "name": "color" - } - ] + "params": { + "rec": "Rectangle", + "color": "Color" + } }, { "name": "DrawRectanglePro", "description": "Draw a color-filled rectangle with pro parameters", "returnType": "void", - "params": [ - { - "type": "Rectangle", - "name": "rec" - }, - { - "type": "Vector2", - "name": "origin" - }, - { - "type": "float", - "name": "rotation" - }, - { - "type": "Color", - "name": "color" - } - ] + "params": { + "rec": "Rectangle", + "origin": "Vector2", + "rotation": "float", + "color": "Color" + } }, { "name": "DrawRectangleGradientV", "description": "Draw a vertical-gradient-filled rectangle", "returnType": "void", - "params": [ - { - "type": "int", - "name": "posX" - }, - { - "type": "int", - "name": "posY" - }, - { - "type": "int", - "name": "width" - }, - { - "type": "int", - "name": "height" - }, - { - "type": "Color", - "name": "color1" - }, - { - "type": "Color", - "name": "color2" - } - ] + "params": { + "posX": "int", + "posY": "int", + "width": "int", + "height": "int", + "color1": "Color", + "color2": "Color" + } }, { "name": "DrawRectangleGradientH", "description": "Draw a horizontal-gradient-filled rectangle", "returnType": "void", - "params": [ - { - "type": "int", - "name": "posX" - }, - { - "type": "int", - "name": "posY" - }, - { - "type": "int", - "name": "width" - }, - { - "type": "int", - "name": "height" - }, - { - "type": "Color", - "name": "color1" - }, - { - "type": "Color", - "name": "color2" - } - ] + "params": { + "posX": "int", + "posY": "int", + "width": "int", + "height": "int", + "color1": "Color", + "color2": "Color" + } }, { "name": "DrawRectangleGradientEx", "description": "Draw a gradient-filled rectangle with custom vertex colors", "returnType": "void", - "params": [ - { - "type": "Rectangle", - "name": "rec" - }, - { - "type": "Color", - "name": "col1" - }, - { - "type": "Color", - "name": "col2" - }, - { - "type": "Color", - "name": "col3" - }, - { - "type": "Color", - "name": "col4" - } - ] + "params": { + "rec": "Rectangle", + "col1": "Color", + "col2": "Color", + "col3": "Color", + "col4": "Color" + } }, { "name": "DrawRectangleLines", "description": "Draw rectangle outline", "returnType": "void", - "params": [ - { - "type": "int", - "name": "posX" - }, - { - "type": "int", - "name": "posY" - }, - { - "type": "int", - "name": "width" - }, - { - "type": "int", - "name": "height" - }, - { - "type": "Color", - "name": "color" - } - ] + "params": { + "posX": "int", + "posY": "int", + "width": "int", + "height": "int", + "color": "Color" + } }, { "name": "DrawRectangleLinesEx", "description": "Draw rectangle outline with extended parameters", "returnType": "void", - "params": [ - { - "type": "Rectangle", - "name": "rec" - }, - { - "type": "float", - "name": "lineThick" - }, - { - "type": "Color", - "name": "color" - } - ] + "params": { + "rec": "Rectangle", + "lineThick": "float", + "color": "Color" + } }, { "name": "DrawRectangleRounded", "description": "Draw rectangle with rounded edges", "returnType": "void", - "params": [ - { - "type": "Rectangle", - "name": "rec" - }, - { - "type": "float", - "name": "roundness" - }, - { - "type": "int", - "name": "segments" - }, - { - "type": "Color", - "name": "color" - } - ] + "params": { + "rec": "Rectangle", + "roundness": "float", + "segments": "int", + "color": "Color" + } }, { "name": "DrawRectangleRoundedLines", "description": "Draw rectangle with rounded edges outline", "returnType": "void", - "params": [ - { - "type": "Rectangle", - "name": "rec" - }, - { - "type": "float", - "name": "roundness" - }, - { - "type": "int", - "name": "segments" - }, - { - "type": "float", - "name": "lineThick" - }, - { - "type": "Color", - "name": "color" - } - ] + "params": { + "rec": "Rectangle", + "roundness": "float", + "segments": "int", + "lineThick": "float", + "color": "Color" + } }, { "name": "DrawTriangle", "description": "Draw a color-filled triangle (vertex in counter-clockwise order!)", "returnType": "void", - "params": [ - { - "type": "Vector2", - "name": "v1" - }, - { - "type": "Vector2", - "name": "v2" - }, - { - "type": "Vector2", - "name": "v3" - }, - { - "type": "Color", - "name": "color" - } - ] + "params": { + "v1": "Vector2", + "v2": "Vector2", + "v3": "Vector2", + "color": "Color" + } }, { "name": "DrawTriangleLines", "description": "Draw triangle outline (vertex in counter-clockwise order!)", "returnType": "void", - "params": [ - { - "type": "Vector2", - "name": "v1" - }, - { - "type": "Vector2", - "name": "v2" - }, - { - "type": "Vector2", - "name": "v3" - }, - { - "type": "Color", - "name": "color" - } - ] + "params": { + "v1": "Vector2", + "v2": "Vector2", + "v3": "Vector2", + "color": "Color" + } }, { "name": "DrawTriangleFan", "description": "Draw a triangle fan defined by points (first vertex is the center)", "returnType": "void", - "params": [ - { - "type": "Vector2 *", - "name": "points" - }, - { - "type": "int", - "name": "pointCount" - }, - { - "type": "Color", - "name": "color" - } - ] + "params": { + "points": "Vector2 *", + "pointsCount": "int", + "color": "Color" + } }, { "name": "DrawTriangleStrip", "description": "Draw a triangle strip defined by points", "returnType": "void", - "params": [ - { - "type": "Vector2 *", - "name": "points" - }, - { - "type": "int", - "name": "pointCount" - }, - { - "type": "Color", - "name": "color" - } - ] + "params": { + "points": "Vector2 *", + "pointsCount": "int", + "color": "Color" + } }, { "name": "DrawPoly", "description": "Draw a regular polygon (Vector version)", "returnType": "void", - "params": [ - { - "type": "Vector2", - "name": "center" - }, - { - "type": "int", - "name": "sides" - }, - { - "type": "float", - "name": "radius" - }, - { - "type": "float", - "name": "rotation" - }, - { - "type": "Color", - "name": "color" - } - ] + "params": { + "center": "Vector2", + "sides": "int", + "radius": "float", + "rotation": "float", + "color": "Color" + } }, { "name": "DrawPolyLines", "description": "Draw a polygon outline of n sides", "returnType": "void", - "params": [ - { - "type": "Vector2", - "name": "center" - }, - { - "type": "int", - "name": "sides" - }, - { - "type": "float", - "name": "radius" - }, - { - "type": "float", - "name": "rotation" - }, - { - "type": "Color", - "name": "color" - } - ] + "params": { + "center": "Vector2", + "sides": "int", + "radius": "float", + "rotation": "float", + "color": "Color" + } }, { "name": "DrawPolyLinesEx", "description": "Draw a polygon outline of n sides with extended parameters", "returnType": "void", - "params": [ - { - "type": "Vector2", - "name": "center" - }, - { - "type": "int", - "name": "sides" - }, - { - "type": "float", - "name": "radius" - }, - { - "type": "float", - "name": "rotation" - }, - { - "type": "float", - "name": "lineThick" - }, - { - "type": "Color", - "name": "color" - } - ] + "params": { + "center": "Vector2", + "sides": "int", + "radius": "float", + "rotation": "float", + "lineThick": "float", + "color": "Color" + } }, { "name": "CheckCollisionRecs", "description": "Check collision between two rectangles", "returnType": "bool", - "params": [ - { - "type": "Rectangle", - "name": "rec1" - }, - { - "type": "Rectangle", - "name": "rec2" - } - ] + "params": { + "rec1": "Rectangle", + "rec2": "Rectangle" + } }, { "name": "CheckCollisionCircles", "description": "Check collision between two circles", "returnType": "bool", - "params": [ - { - "type": "Vector2", - "name": "center1" - }, - { - "type": "float", - "name": "radius1" - }, - { - "type": "Vector2", - "name": "center2" - }, - { - "type": "float", - "name": "radius2" - } - ] + "params": { + "center1": "Vector2", + "radius1": "float", + "center2": "Vector2", + "radius2": "float" + } }, { "name": "CheckCollisionCircleRec", "description": "Check collision between circle and rectangle", "returnType": "bool", - "params": [ - { - "type": "Vector2", - "name": "center" - }, - { - "type": "float", - "name": "radius" - }, - { - "type": "Rectangle", - "name": "rec" - } - ] + "params": { + "center": "Vector2", + "radius": "float", + "rec": "Rectangle" + } }, { "name": "CheckCollisionPointRec", "description": "Check if point is inside rectangle", "returnType": "bool", - "params": [ - { - "type": "Vector2", - "name": "point" - }, - { - "type": "Rectangle", - "name": "rec" - } - ] + "params": { + "point": "Vector2", + "rec": "Rectangle" + } }, { "name": "CheckCollisionPointCircle", "description": "Check if point is inside circle", "returnType": "bool", - "params": [ - { - "type": "Vector2", - "name": "point" - }, - { - "type": "Vector2", - "name": "center" - }, - { - "type": "float", - "name": "radius" - } - ] + "params": { + "point": "Vector2", + "center": "Vector2", + "radius": "float" + } }, { "name": "CheckCollisionPointTriangle", "description": "Check if point is inside a triangle", "returnType": "bool", - "params": [ - { - "type": "Vector2", - "name": "point" - }, - { - "type": "Vector2", - "name": "p1" - }, - { - "type": "Vector2", - "name": "p2" - }, - { - "type": "Vector2", - "name": "p3" - } - ] + "params": { + "point": "Vector2", + "p1": "Vector2", + "p2": "Vector2", + "p3": "Vector2" + } }, { "name": "CheckCollisionLines", "description": "Check the collision between two lines defined by two points each, returns collision point by reference", "returnType": "bool", - "params": [ - { - "type": "Vector2", - "name": "startPos1" - }, - { - "type": "Vector2", - "name": "endPos1" - }, - { - "type": "Vector2", - "name": "startPos2" - }, - { - "type": "Vector2", - "name": "endPos2" - }, - { - "type": "Vector2 *", - "name": "collisionPoint" - } - ] - }, - { - "name": "CheckCollisionPointLine", - "description": "Check if point belongs to line created between two points [p1] and [p2] with defined margin in pixels [threshold]", - "returnType": "bool", - "params": [ - { - "type": "Vector2", - "name": "point" - }, - { - "type": "Vector2", - "name": "p1" - }, - { - "type": "Vector2", - "name": "p2" - }, - { - "type": "int", - "name": "threshold" - } - ] + "params": { + "startPos1": "Vector2", + "endPos1": "Vector2", + "startPos2": "Vector2", + "endPos2": "Vector2", + "collisionPoint": "Vector2 *" + } }, { "name": "GetCollisionRec", "description": "Get collision rectangle for two rectangles collision", "returnType": "Rectangle", - "params": [ - { - "type": "Rectangle", - "name": "rec1" - }, - { - "type": "Rectangle", - "name": "rec2" - } - ] + "params": { + "rec1": "Rectangle", + "rec2": "Rectangle" + } }, { "name": "LoadImage", "description": "Load image from file into CPU memory (RAM)", "returnType": "Image", - "params": [ - { - "type": "const char *", - "name": "fileName" - } - ] + "params": { + "fileName": "const char *" + } }, { "name": "LoadImageRaw", "description": "Load image from RAW file data", "returnType": "Image", - "params": [ - { - "type": "const char *", - "name": "fileName" - }, - { - "type": "int", - "name": "width" - }, - { - "type": "int", - "name": "height" - }, - { - "type": "int", - "name": "format" - }, - { - "type": "int", - "name": "headerSize" - } - ] + "params": { + "fileName": "const char *", + "width": "int", + "height": "int", + "format": "int", + "headerSize": "int" + } }, { "name": "LoadImageAnim", "description": "Load image sequence from file (frames appended to image.data)", "returnType": "Image", - "params": [ - { - "type": "const char *", - "name": "fileName" - }, - { - "type": "int *", - "name": "frames" - } - ] + "params": { + "fileName": "const char *", + "frames": "int *" + } }, { "name": "LoadImageFromMemory", "description": "Load image from memory buffer, fileType refers to extension: i.e. '.png'", "returnType": "Image", - "params": [ - { - "type": "const char *", - "name": "fileType" - }, - { - "type": "const unsigned char *", - "name": "fileData" - }, - { - "type": "int", - "name": "dataSize" - } - ] - }, - { - "name": "LoadImageFromTexture", - "description": "Load image from GPU texture data", - "returnType": "Image", - "params": [ - { - "type": "Texture2D", - "name": "texture" - } - ] - }, - { - "name": "LoadImageFromScreen", - "description": "Load image from screen buffer and (screenshot)", - "returnType": "Image" + "params": { + "fileType": "const char *", + "fileData": "const unsigned char *", + "dataSize": "int" + } }, { "name": "UnloadImage", "description": "Unload image from CPU memory (RAM)", "returnType": "void", - "params": [ - { - "type": "Image", - "name": "image" - } - ] + "params": { + "image": "Image" + } }, { "name": "ExportImage", "description": "Export image data to file, returns true on success", "returnType": "bool", - "params": [ - { - "type": "Image", - "name": "image" - }, - { - "type": "const char *", - "name": "fileName" - } - ] + "params": { + "image": "Image", + "fileName": "const char *" + } }, { "name": "ExportImageAsCode", "description": "Export image as code file defining an array of bytes, returns true on success", "returnType": "bool", - "params": [ - { - "type": "Image", - "name": "image" - }, - { - "type": "const char *", - "name": "fileName" - } - ] + "params": { + "image": "Image", + "fileName": "const char *" + } }, { "name": "GenImageColor", "description": "Generate image: plain color", "returnType": "Image", - "params": [ - { - "type": "int", - "name": "width" - }, - { - "type": "int", - "name": "height" - }, - { - "type": "Color", - "name": "color" - } - ] + "params": { + "width": "int", + "height": "int", + "color": "Color" + } }, { "name": "GenImageGradientV", "description": "Generate image: vertical gradient", "returnType": "Image", - "params": [ - { - "type": "int", - "name": "width" - }, - { - "type": "int", - "name": "height" - }, - { - "type": "Color", - "name": "top" - }, - { - "type": "Color", - "name": "bottom" - } - ] + "params": { + "width": "int", + "height": "int", + "top": "Color", + "bottom": "Color" + } }, { "name": "GenImageGradientH", "description": "Generate image: horizontal gradient", "returnType": "Image", - "params": [ - { - "type": "int", - "name": "width" - }, - { - "type": "int", - "name": "height" - }, - { - "type": "Color", - "name": "left" - }, - { - "type": "Color", - "name": "right" - } - ] + "params": { + "width": "int", + "height": "int", + "left": "Color", + "right": "Color" + } }, { "name": "GenImageGradientRadial", "description": "Generate image: radial gradient", "returnType": "Image", - "params": [ - { - "type": "int", - "name": "width" - }, - { - "type": "int", - "name": "height" - }, - { - "type": "float", - "name": "density" - }, - { - "type": "Color", - "name": "inner" - }, - { - "type": "Color", - "name": "outer" - } - ] + "params": { + "width": "int", + "height": "int", + "density": "float", + "inner": "Color", + "outer": "Color" + } }, { "name": "GenImageChecked", "description": "Generate image: checked", "returnType": "Image", - "params": [ - { - "type": "int", - "name": "width" - }, - { - "type": "int", - "name": "height" - }, - { - "type": "int", - "name": "checksX" - }, - { - "type": "int", - "name": "checksY" - }, - { - "type": "Color", - "name": "col1" - }, - { - "type": "Color", - "name": "col2" - } - ] + "params": { + "width": "int", + "height": "int", + "checksX": "int", + "checksY": "int", + "col1": "Color", + "col2": "Color" + } }, { "name": "GenImageWhiteNoise", "description": "Generate image: white noise", "returnType": "Image", - "params": [ - { - "type": "int", - "name": "width" - }, - { - "type": "int", - "name": "height" - }, - { - "type": "float", - "name": "factor" - } - ] + "params": { + "width": "int", + "height": "int", + "factor": "float" + } + }, + { + "name": "GenImagePerlinNoise", + "description": "Generate image: perlin noise", + "returnType": "Image", + "params": { + "width": "int", + "height": "int", + "offsetX": "int", + "offsetY": "int", + "scale": "float" + } }, { "name": "GenImageCellular", - "description": "Generate image: cellular algorithm, bigger tileSize means bigger cells", + "description": "Generate image: cellular algorithm. Bigger tileSize means bigger cells", "returnType": "Image", - "params": [ - { - "type": "int", - "name": "width" - }, - { - "type": "int", - "name": "height" - }, - { - "type": "int", - "name": "tileSize" - } - ] + "params": { + "width": "int", + "height": "int", + "tileSize": "int" + } }, { "name": "ImageCopy", "description": "Create an image duplicate (useful for transformations)", "returnType": "Image", - "params": [ - { - "type": "Image", - "name": "image" - } - ] + "params": { + "image": "Image" + } }, { "name": "ImageFromImage", "description": "Create an image from another image piece", "returnType": "Image", - "params": [ - { - "type": "Image", - "name": "image" - }, - { - "type": "Rectangle", - "name": "rec" - } - ] + "params": { + "image": "Image", + "rec": "Rectangle" + } }, { "name": "ImageText", "description": "Create an image from text (default font)", "returnType": "Image", - "params": [ - { - "type": "const char *", - "name": "text" - }, - { - "type": "int", - "name": "fontSize" - }, - { - "type": "Color", - "name": "color" - } - ] + "params": { + "text": "const char *", + "fontSize": "int", + "color": "Color" + } }, { "name": "ImageTextEx", "description": "Create an image from text (custom sprite font)", "returnType": "Image", - "params": [ - { - "type": "Font", - "name": "font" - }, - { - "type": "const char *", - "name": "text" - }, - { - "type": "float", - "name": "fontSize" - }, - { - "type": "float", - "name": "spacing" - }, - { - "type": "Color", - "name": "tint" - } - ] + "params": { + "font": "Font", + "text": "const char *", + "fontSize": "float", + "spacing": "float", + "tint": "Color" + } }, { "name": "ImageFormat", "description": "Convert image data to desired format", "returnType": "void", - "params": [ - { - "type": "Image *", - "name": "image" - }, - { - "type": "int", - "name": "newFormat" - } - ] + "params": { + "image": "Image *", + "newFormat": "int" + } }, { "name": "ImageToPOT", "description": "Convert image to POT (power-of-two)", "returnType": "void", - "params": [ - { - "type": "Image *", - "name": "image" - }, - { - "type": "Color", - "name": "fill" - } - ] + "params": { + "image": "Image *", + "fill": "Color" + } }, { "name": "ImageCrop", "description": "Crop an image to a defined rectangle", "returnType": "void", - "params": [ - { - "type": "Image *", - "name": "image" - }, - { - "type": "Rectangle", - "name": "crop" - } - ] + "params": { + "image": "Image *", + "crop": "Rectangle" + } }, { "name": "ImageAlphaCrop", "description": "Crop image depending on alpha value", "returnType": "void", - "params": [ - { - "type": "Image *", - "name": "image" - }, - { - "type": "float", - "name": "threshold" - } - ] + "params": { + "image": "Image *", + "threshold": "float" + } }, { "name": "ImageAlphaClear", "description": "Clear alpha channel to desired color", "returnType": "void", - "params": [ - { - "type": "Image *", - "name": "image" - }, - { - "type": "Color", - "name": "color" - }, - { - "type": "float", - "name": "threshold" - } - ] + "params": { + "image": "Image *", + "color": "Color", + "threshold": "float" + } }, { "name": "ImageAlphaMask", "description": "Apply alpha mask to image", "returnType": "void", - "params": [ - { - "type": "Image *", - "name": "image" - }, - { - "type": "Image", - "name": "alphaMask" - } - ] + "params": { + "image": "Image *", + "alphaMask": "Image" + } }, { "name": "ImageAlphaPremultiply", "description": "Premultiply alpha channel", "returnType": "void", - "params": [ - { - "type": "Image *", - "name": "image" - } - ] + "params": { + "image": "Image *" + } }, { "name": "ImageResize", "description": "Resize image (Bicubic scaling algorithm)", "returnType": "void", - "params": [ - { - "type": "Image *", - "name": "image" - }, - { - "type": "int", - "name": "newWidth" - }, - { - "type": "int", - "name": "newHeight" - } - ] + "params": { + "image": "Image *", + "newWidth": "int", + "newHeight": "int" + } }, { "name": "ImageResizeNN", "description": "Resize image (Nearest-Neighbor scaling algorithm)", "returnType": "void", - "params": [ - { - "type": "Image *", - "name": "image" - }, - { - "type": "int", - "name": "newWidth" - }, - { - "type": "int", - "name": "newHeight" - } - ] + "params": { + "image": "Image *", + "newWidth": "int", + "newHeight": "int" + } }, { "name": "ImageResizeCanvas", "description": "Resize canvas and fill with color", "returnType": "void", - "params": [ - { - "type": "Image *", - "name": "image" - }, - { - "type": "int", - "name": "newWidth" - }, - { - "type": "int", - "name": "newHeight" - }, - { - "type": "int", - "name": "offsetX" - }, - { - "type": "int", - "name": "offsetY" - }, - { - "type": "Color", - "name": "fill" - } - ] + "params": { + "image": "Image *", + "newWidth": "int", + "newHeight": "int", + "offsetX": "int", + "offsetY": "int", + "fill": "Color" + } }, { "name": "ImageMipmaps", "description": "Compute all mipmap levels for a provided image", "returnType": "void", - "params": [ - { - "type": "Image *", - "name": "image" - } - ] + "params": { + "image": "Image *" + } }, { "name": "ImageDither", "description": "Dither image data to 16bpp or lower (Floyd-Steinberg dithering)", "returnType": "void", - "params": [ - { - "type": "Image *", - "name": "image" - }, - { - "type": "int", - "name": "rBpp" - }, - { - "type": "int", - "name": "gBpp" - }, - { - "type": "int", - "name": "bBpp" - }, - { - "type": "int", - "name": "aBpp" - } - ] + "params": { + "image": "Image *", + "rBpp": "int", + "gBpp": "int", + "bBpp": "int", + "aBpp": "int" + } }, { "name": "ImageFlipVertical", "description": "Flip image vertically", "returnType": "void", - "params": [ - { - "type": "Image *", - "name": "image" - } - ] + "params": { + "image": "Image *" + } }, { "name": "ImageFlipHorizontal", "description": "Flip image horizontally", "returnType": "void", - "params": [ - { - "type": "Image *", - "name": "image" - } - ] + "params": { + "image": "Image *" + } }, { "name": "ImageRotateCW", "description": "Rotate image clockwise 90deg", "returnType": "void", - "params": [ - { - "type": "Image *", - "name": "image" - } - ] + "params": { + "image": "Image *" + } }, { "name": "ImageRotateCCW", "description": "Rotate image counter-clockwise 90deg", "returnType": "void", - "params": [ - { - "type": "Image *", - "name": "image" - } - ] + "params": { + "image": "Image *" + } }, { "name": "ImageColorTint", "description": "Modify image color: tint", "returnType": "void", - "params": [ - { - "type": "Image *", - "name": "image" - }, - { - "type": "Color", - "name": "color" - } - ] + "params": { + "image": "Image *", + "color": "Color" + } }, { "name": "ImageColorInvert", "description": "Modify image color: invert", "returnType": "void", - "params": [ - { - "type": "Image *", - "name": "image" - } - ] + "params": { + "image": "Image *" + } }, { "name": "ImageColorGrayscale", "description": "Modify image color: grayscale", "returnType": "void", - "params": [ - { - "type": "Image *", - "name": "image" - } - ] + "params": { + "image": "Image *" + } }, { "name": "ImageColorContrast", "description": "Modify image color: contrast (-100 to 100)", "returnType": "void", - "params": [ - { - "type": "Image *", - "name": "image" - }, - { - "type": "float", - "name": "contrast" - } - ] + "params": { + "image": "Image *", + "contrast": "float" + } }, { "name": "ImageColorBrightness", "description": "Modify image color: brightness (-255 to 255)", "returnType": "void", - "params": [ - { - "type": "Image *", - "name": "image" - }, - { - "type": "int", - "name": "brightness" - } - ] + "params": { + "image": "Image *", + "brightness": "int" + } }, { "name": "ImageColorReplace", "description": "Modify image color: replace color", "returnType": "void", - "params": [ - { - "type": "Image *", - "name": "image" - }, - { - "type": "Color", - "name": "color" - }, - { - "type": "Color", - "name": "replace" - } - ] + "params": { + "image": "Image *", + "color": "Color", + "replace": "Color" + } }, { "name": "LoadImageColors", "description": "Load color data from image as a Color array (RGBA - 32bit)", "returnType": "Color *", - "params": [ - { - "type": "Image", - "name": "image" - } - ] + "params": { + "image": "Image" + } }, { "name": "LoadImagePalette", "description": "Load colors palette from image as a Color array (RGBA - 32bit)", "returnType": "Color *", - "params": [ - { - "type": "Image", - "name": "image" - }, - { - "type": "int", - "name": "maxPaletteSize" - }, - { - "type": "int *", - "name": "colorCount" - } - ] + "params": { + "image": "Image", + "maxPaletteSize": "int", + "colorsCount": "int *" + } }, { "name": "UnloadImageColors", "description": "Unload color data loaded with LoadImageColors()", "returnType": "void", - "params": [ - { - "type": "Color *", - "name": "colors" - } - ] + "params": { + "colors": "Color *" + } }, { "name": "UnloadImagePalette", "description": "Unload colors palette loaded with LoadImagePalette()", "returnType": "void", - "params": [ - { - "type": "Color *", - "name": "colors" - } - ] + "params": { + "colors": "Color *" + } }, { "name": "GetImageAlphaBorder", "description": "Get image alpha border rectangle", "returnType": "Rectangle", - "params": [ - { - "type": "Image", - "name": "image" - }, - { - "type": "float", - "name": "threshold" - } - ] - }, - { - "name": "GetImageColor", - "description": "Get image pixel color at (x, y) position", - "returnType": "Color", - "params": [ - { - "type": "Image", - "name": "image" - }, - { - "type": "int", - "name": "x" - }, - { - "type": "int", - "name": "y" - } - ] + "params": { + "image": "Image", + "threshold": "float" + } }, { "name": "ImageClearBackground", "description": "Clear image background with given color", "returnType": "void", - "params": [ - { - "type": "Image *", - "name": "dst" - }, - { - "type": "Color", - "name": "color" - } - ] + "params": { + "dst": "Image *", + "color": "Color" + } }, { "name": "ImageDrawPixel", "description": "Draw pixel within an image", "returnType": "void", - "params": [ - { - "type": "Image *", - "name": "dst" - }, - { - "type": "int", - "name": "posX" - }, - { - "type": "int", - "name": "posY" - }, - { - "type": "Color", - "name": "color" - } - ] + "params": { + "dst": "Image *", + "posX": "int", + "posY": "int", + "color": "Color" + } }, { "name": "ImageDrawPixelV", "description": "Draw pixel within an image (Vector version)", "returnType": "void", - "params": [ - { - "type": "Image *", - "name": "dst" - }, - { - "type": "Vector2", - "name": "position" - }, - { - "type": "Color", - "name": "color" - } - ] + "params": { + "dst": "Image *", + "position": "Vector2", + "color": "Color" + } }, { "name": "ImageDrawLine", "description": "Draw line within an image", "returnType": "void", - "params": [ - { - "type": "Image *", - "name": "dst" - }, - { - "type": "int", - "name": "startPosX" - }, - { - "type": "int", - "name": "startPosY" - }, - { - "type": "int", - "name": "endPosX" - }, - { - "type": "int", - "name": "endPosY" - }, - { - "type": "Color", - "name": "color" - } - ] + "params": { + "dst": "Image *", + "startPosX": "int", + "startPosY": "int", + "endPosX": "int", + "endPosY": "int", + "color": "Color" + } }, { "name": "ImageDrawLineV", "description": "Draw line within an image (Vector version)", "returnType": "void", - "params": [ - { - "type": "Image *", - "name": "dst" - }, - { - "type": "Vector2", - "name": "start" - }, - { - "type": "Vector2", - "name": "end" - }, - { - "type": "Color", - "name": "color" - } - ] + "params": { + "dst": "Image *", + "start": "Vector2", + "end": "Vector2", + "color": "Color" + } }, { "name": "ImageDrawCircle", "description": "Draw circle within an image", "returnType": "void", - "params": [ - { - "type": "Image *", - "name": "dst" - }, - { - "type": "int", - "name": "centerX" - }, - { - "type": "int", - "name": "centerY" - }, - { - "type": "int", - "name": "radius" - }, - { - "type": "Color", - "name": "color" - } - ] + "params": { + "dst": "Image *", + "centerX": "int", + "centerY": "int", + "radius": "int", + "color": "Color" + } }, { "name": "ImageDrawCircleV", "description": "Draw circle within an image (Vector version)", "returnType": "void", - "params": [ - { - "type": "Image *", - "name": "dst" - }, - { - "type": "Vector2", - "name": "center" - }, - { - "type": "int", - "name": "radius" - }, - { - "type": "Color", - "name": "color" - } - ] + "params": { + "dst": "Image *", + "center": "Vector2", + "radius": "int", + "color": "Color" + } }, { "name": "ImageDrawRectangle", "description": "Draw rectangle within an image", "returnType": "void", - "params": [ - { - "type": "Image *", - "name": "dst" - }, - { - "type": "int", - "name": "posX" - }, - { - "type": "int", - "name": "posY" - }, - { - "type": "int", - "name": "width" - }, - { - "type": "int", - "name": "height" - }, - { - "type": "Color", - "name": "color" - } - ] + "params": { + "dst": "Image *", + "posX": "int", + "posY": "int", + "width": "int", + "height": "int", + "color": "Color" + } }, { "name": "ImageDrawRectangleV", "description": "Draw rectangle within an image (Vector version)", "returnType": "void", - "params": [ - { - "type": "Image *", - "name": "dst" - }, - { - "type": "Vector2", - "name": "position" - }, - { - "type": "Vector2", - "name": "size" - }, - { - "type": "Color", - "name": "color" - } - ] + "params": { + "dst": "Image *", + "position": "Vector2", + "size": "Vector2", + "color": "Color" + } }, { "name": "ImageDrawRectangleRec", "description": "Draw rectangle within an image", "returnType": "void", - "params": [ - { - "type": "Image *", - "name": "dst" - }, - { - "type": "Rectangle", - "name": "rec" - }, - { - "type": "Color", - "name": "color" - } - ] + "params": { + "dst": "Image *", + "rec": "Rectangle", + "color": "Color" + } }, { "name": "ImageDrawRectangleLines", "description": "Draw rectangle lines within an image", "returnType": "void", - "params": [ - { - "type": "Image *", - "name": "dst" - }, - { - "type": "Rectangle", - "name": "rec" - }, - { - "type": "int", - "name": "thick" - }, - { - "type": "Color", - "name": "color" - } - ] + "params": { + "dst": "Image *", + "rec": "Rectangle", + "thick": "int", + "color": "Color" + } }, { "name": "ImageDraw", "description": "Draw a source image within a destination image (tint applied to source)", "returnType": "void", - "params": [ - { - "type": "Image *", - "name": "dst" - }, - { - "type": "Image", - "name": "src" - }, - { - "type": "Rectangle", - "name": "srcRec" - }, - { - "type": "Rectangle", - "name": "dstRec" - }, - { - "type": "Color", - "name": "tint" - } - ] + "params": { + "dst": "Image *", + "src": "Image", + "srcRec": "Rectangle", + "dstRec": "Rectangle", + "tint": "Color" + } }, { "name": "ImageDrawText", "description": "Draw text (using default font) within an image (destination)", "returnType": "void", - "params": [ - { - "type": "Image *", - "name": "dst" - }, - { - "type": "const char *", - "name": "text" - }, - { - "type": "int", - "name": "posX" - }, - { - "type": "int", - "name": "posY" - }, - { - "type": "int", - "name": "fontSize" - }, - { - "type": "Color", - "name": "color" - } - ] + "params": { + "dst": "Image *", + "text": "const char *", + "posX": "int", + "posY": "int", + "fontSize": "int", + "color": "Color" + } }, { "name": "ImageDrawTextEx", "description": "Draw text (custom sprite font) within an image (destination)", "returnType": "void", - "params": [ - { - "type": "Image *", - "name": "dst" - }, - { - "type": "Font", - "name": "font" - }, - { - "type": "const char *", - "name": "text" - }, - { - "type": "Vector2", - "name": "position" - }, - { - "type": "float", - "name": "fontSize" - }, - { - "type": "float", - "name": "spacing" - }, - { - "type": "Color", - "name": "tint" - } - ] + "params": { + "dst": "Image *", + "font": "Font", + "text": "const char *", + "position": "Vector2", + "fontSize": "float", + "spacing": "float", + "tint": "Color" + } }, { "name": "LoadTexture", "description": "Load texture from file into GPU memory (VRAM)", "returnType": "Texture2D", - "params": [ - { - "type": "const char *", - "name": "fileName" - } - ] + "params": { + "fileName": "const char *" + } }, { "name": "LoadTextureFromImage", "description": "Load texture from image data", "returnType": "Texture2D", - "params": [ - { - "type": "Image", - "name": "image" - } - ] + "params": { + "image": "Image" + } }, { "name": "LoadTextureCubemap", "description": "Load cubemap from image, multiple image cubemap layouts supported", "returnType": "TextureCubemap", - "params": [ - { - "type": "Image", - "name": "image" - }, - { - "type": "int", - "name": "layout" - } - ] + "params": { + "image": "Image", + "layout": "int" + } }, { "name": "LoadRenderTexture", "description": "Load texture for rendering (framebuffer)", "returnType": "RenderTexture2D", - "params": [ - { - "type": "int", - "name": "width" - }, - { - "type": "int", - "name": "height" - } - ] + "params": { + "width": "int", + "height": "int" + } }, { "name": "UnloadTexture", "description": "Unload texture from GPU memory (VRAM)", "returnType": "void", - "params": [ - { - "type": "Texture2D", - "name": "texture" - } - ] + "params": { + "texture": "Texture2D" + } }, { "name": "UnloadRenderTexture", "description": "Unload render texture from GPU memory (VRAM)", "returnType": "void", - "params": [ - { - "type": "RenderTexture2D", - "name": "target" - } - ] + "params": { + "target": "RenderTexture2D" + } }, { "name": "UpdateTexture", "description": "Update GPU texture with new data", "returnType": "void", - "params": [ - { - "type": "Texture2D", - "name": "texture" - }, - { - "type": "const void *", - "name": "pixels" - } - ] + "params": { + "texture": "Texture2D", + "pixels": "const void *" + } }, { "name": "UpdateTextureRec", "description": "Update GPU texture rectangle with new data", "returnType": "void", - "params": [ - { - "type": "Texture2D", - "name": "texture" - }, - { - "type": "Rectangle", - "name": "rec" - }, - { - "type": "const void *", - "name": "pixels" - } - ] + "params": { + "texture": "Texture2D", + "rec": "Rectangle", + "pixels": "const void *" + } + }, + { + "name": "GetTextureData", + "description": "Get pixel data from GPU texture and return an Image", + "returnType": "Image", + "params": { + "texture": "Texture2D" + } + }, + { + "name": "GetScreenData", + "description": "Get pixel data from screen buffer and return an Image (screenshot)", + "returnType": "Image" }, { "name": "GenTextureMipmaps", "description": "Generate GPU mipmaps for a texture", "returnType": "void", - "params": [ - { - "type": "Texture2D *", - "name": "texture" - } - ] + "params": { + "texture": "Texture2D *" + } }, { "name": "SetTextureFilter", "description": "Set texture scaling filter mode", "returnType": "void", - "params": [ - { - "type": "Texture2D", - "name": "texture" - }, - { - "type": "int", - "name": "filter" - } - ] + "params": { + "texture": "Texture2D", + "filter": "int" + } }, { "name": "SetTextureWrap", "description": "Set texture wrapping mode", "returnType": "void", - "params": [ - { - "type": "Texture2D", - "name": "texture" - }, - { - "type": "int", - "name": "wrap" - } - ] + "params": { + "texture": "Texture2D", + "wrap": "int" + } }, { "name": "DrawTexture", "description": "Draw a Texture2D", "returnType": "void", - "params": [ - { - "type": "Texture2D", - "name": "texture" - }, - { - "type": "int", - "name": "posX" - }, - { - "type": "int", - "name": "posY" - }, - { - "type": "Color", - "name": "tint" - } - ] + "params": { + "texture": "Texture2D", + "posX": "int", + "posY": "int", + "tint": "Color" + } }, { "name": "DrawTextureV", "description": "Draw a Texture2D with position defined as Vector2", "returnType": "void", - "params": [ - { - "type": "Texture2D", - "name": "texture" - }, - { - "type": "Vector2", - "name": "position" - }, - { - "type": "Color", - "name": "tint" - } - ] + "params": { + "texture": "Texture2D", + "position": "Vector2", + "tint": "Color" + } }, { "name": "DrawTextureEx", "description": "Draw a Texture2D with extended parameters", "returnType": "void", - "params": [ - { - "type": "Texture2D", - "name": "texture" - }, - { - "type": "Vector2", - "name": "position" - }, - { - "type": "float", - "name": "rotation" - }, - { - "type": "float", - "name": "scale" - }, - { - "type": "Color", - "name": "tint" - } - ] + "params": { + "texture": "Texture2D", + "position": "Vector2", + "rotation": "float", + "scale": "float", + "tint": "Color" + } }, { "name": "DrawTextureRec", "description": "Draw a part of a texture defined by a rectangle", "returnType": "void", - "params": [ - { - "type": "Texture2D", - "name": "texture" - }, - { - "type": "Rectangle", - "name": "source" - }, - { - "type": "Vector2", - "name": "position" - }, - { - "type": "Color", - "name": "tint" - } - ] + "params": { + "texture": "Texture2D", + "source": "Rectangle", + "position": "Vector2", + "tint": "Color" + } }, { "name": "DrawTextureQuad", "description": "Draw texture quad with tiling and offset parameters", "returnType": "void", - "params": [ - { - "type": "Texture2D", - "name": "texture" - }, - { - "type": "Vector2", - "name": "tiling" - }, - { - "type": "Vector2", - "name": "offset" - }, - { - "type": "Rectangle", - "name": "quad" - }, - { - "type": "Color", - "name": "tint" - } - ] + "params": { + "texture": "Texture2D", + "tiling": "Vector2", + "offset": "Vector2", + "quad": "Rectangle", + "tint": "Color" + } }, { "name": "DrawTextureTiled", "description": "Draw part of a texture (defined by a rectangle) with rotation and scale tiled into dest.", "returnType": "void", - "params": [ - { - "type": "Texture2D", - "name": "texture" - }, - { - "type": "Rectangle", - "name": "source" - }, - { - "type": "Rectangle", - "name": "dest" - }, - { - "type": "Vector2", - "name": "origin" - }, - { - "type": "float", - "name": "rotation" - }, - { - "type": "float", - "name": "scale" - }, - { - "type": "Color", - "name": "tint" - } - ] + "params": { + "texture": "Texture2D", + "source": "Rectangle", + "dest": "Rectangle", + "origin": "Vector2", + "rotation": "float", + "scale": "float", + "tint": "Color" + } }, { "name": "DrawTexturePro", "description": "Draw a part of a texture defined by a rectangle with 'pro' parameters", "returnType": "void", - "params": [ - { - "type": "Texture2D", - "name": "texture" - }, - { - "type": "Rectangle", - "name": "source" - }, - { - "type": "Rectangle", - "name": "dest" - }, - { - "type": "Vector2", - "name": "origin" - }, - { - "type": "float", - "name": "rotation" - }, - { - "type": "Color", - "name": "tint" - } - ] + "params": { + "texture": "Texture2D", + "source": "Rectangle", + "dest": "Rectangle", + "origin": "Vector2", + "rotation": "float", + "tint": "Color" + } }, { "name": "DrawTextureNPatch", "description": "Draws a texture (or part of it) that stretches or shrinks nicely", "returnType": "void", - "params": [ - { - "type": "Texture2D", - "name": "texture" - }, - { - "type": "NPatchInfo", - "name": "nPatchInfo" - }, - { - "type": "Rectangle", - "name": "dest" - }, - { - "type": "Vector2", - "name": "origin" - }, - { - "type": "float", - "name": "rotation" - }, - { - "type": "Color", - "name": "tint" - } - ] + "params": { + "texture": "Texture2D", + "nPatchInfo": "NPatchInfo", + "dest": "Rectangle", + "origin": "Vector2", + "rotation": "float", + "tint": "Color" + } }, { "name": "DrawTexturePoly", "description": "Draw a textured polygon", "returnType": "void", - "params": [ - { - "type": "Texture2D", - "name": "texture" - }, - { - "type": "Vector2", - "name": "center" - }, - { - "type": "Vector2 *", - "name": "points" - }, - { - "type": "Vector2 *", - "name": "texcoords" - }, - { - "type": "int", - "name": "pointCount" - }, - { - "type": "Color", - "name": "tint" - } - ] + "params": { + "texture": "Texture2D", + "center": "Vector2", + "points": "Vector2 *", + "texcoords": "Vector2 *", + "pointsCount": "int", + "tint": "Color" + } }, { "name": "Fade", "description": "Get color with alpha applied, alpha goes from 0.0f to 1.0f", "returnType": "Color", - "params": [ - { - "type": "Color", - "name": "color" - }, - { - "type": "float", - "name": "alpha" - } - ] + "params": { + "color": "Color", + "alpha": "float" + } }, { "name": "ColorToInt", "description": "Get hexadecimal value for a Color", "returnType": "int", - "params": [ - { - "type": "Color", - "name": "color" - } - ] + "params": { + "color": "Color" + } }, { "name": "ColorNormalize", "description": "Get Color normalized as float [0..1]", "returnType": "Vector4", - "params": [ - { - "type": "Color", - "name": "color" - } - ] + "params": { + "color": "Color" + } }, { "name": "ColorFromNormalized", "description": "Get Color from normalized values [0..1]", "returnType": "Color", - "params": [ - { - "type": "Vector4", - "name": "normalized" - } - ] + "params": { + "normalized": "Vector4" + } }, { "name": "ColorToHSV", "description": "Get HSV values for a Color, hue [0..360], saturation/value [0..1]", "returnType": "Vector3", - "params": [ - { - "type": "Color", - "name": "color" - } - ] + "params": { + "color": "Color" + } }, { "name": "ColorFromHSV", "description": "Get a Color from HSV values, hue [0..360], saturation/value [0..1]", "returnType": "Color", - "params": [ - { - "type": "float", - "name": "hue" - }, - { - "type": "float", - "name": "saturation" - }, - { - "type": "float", - "name": "value" - } - ] + "params": { + "hue": "float", + "saturation": "float", + "value": "float" + } }, { "name": "ColorAlpha", "description": "Get color with alpha applied, alpha goes from 0.0f to 1.0f", "returnType": "Color", - "params": [ - { - "type": "Color", - "name": "color" - }, - { - "type": "float", - "name": "alpha" - } - ] + "params": { + "color": "Color", + "alpha": "float" + } }, { "name": "ColorAlphaBlend", "description": "Get src alpha-blended into dst color with tint", "returnType": "Color", - "params": [ - { - "type": "Color", - "name": "dst" - }, - { - "type": "Color", - "name": "src" - }, - { - "type": "Color", - "name": "tint" - } - ] + "params": { + "dst": "Color", + "src": "Color", + "tint": "Color" + } }, { "name": "GetColor", "description": "Get Color structure from hexadecimal value", "returnType": "Color", - "params": [ - { - "type": "unsigned int", - "name": "hexValue" - } - ] + "params": { + "hexValue": "int" + } }, { "name": "GetPixelColor", "description": "Get Color from a source pixel pointer of certain format", "returnType": "Color", - "params": [ - { - "type": "void *", - "name": "srcPtr" - }, - { - "type": "int", - "name": "format" - } - ] + "params": { + "srcPtr": "void *", + "format": "int" + } }, { "name": "SetPixelColor", "description": "Set color formatted into destination pixel pointer", "returnType": "void", - "params": [ - { - "type": "void *", - "name": "dstPtr" - }, - { - "type": "Color", - "name": "color" - }, - { - "type": "int", - "name": "format" - } - ] + "params": { + "dstPtr": "void *", + "color": "Color", + "format": "int" + } }, { "name": "GetPixelDataSize", "description": "Get pixel data size in bytes for certain format", "returnType": "int", - "params": [ - { - "type": "int", - "name": "width" - }, - { - "type": "int", - "name": "height" - }, - { - "type": "int", - "name": "format" - } - ] + "params": { + "width": "int", + "height": "int", + "format": "int" + } }, { "name": "GetFontDefault", @@ -7186,2178 +5177,1060 @@ "name": "LoadFont", "description": "Load font from file into GPU memory (VRAM)", "returnType": "Font", - "params": [ - { - "type": "const char *", - "name": "fileName" - } - ] + "params": { + "fileName": "const char *" + } }, { "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", "returnType": "Font", - "params": [ - { - "type": "const char *", - "name": "fileName" - }, - { - "type": "int", - "name": "fontSize" - }, - { - "type": "int *", - "name": "fontChars" - }, - { - "type": "int", - "name": "glyphCount" - } - ] + "params": { + "fileName": "const char *", + "fontSize": "int", + "fontChars": "int *", + "charsCount": "int" + } }, { "name": "LoadFontFromImage", "description": "Load font from Image (XNA style)", "returnType": "Font", - "params": [ - { - "type": "Image", - "name": "image" - }, - { - "type": "Color", - "name": "key" - }, - { - "type": "int", - "name": "firstChar" - } - ] + "params": { + "image": "Image", + "key": "Color", + "firstChar": "int" + } }, { "name": "LoadFontFromMemory", "description": "Load font from memory buffer, fileType refers to extension: i.e. '.ttf'", "returnType": "Font", - "params": [ - { - "type": "const char *", - "name": "fileType" - }, - { - "type": "const unsigned char *", - "name": "fileData" - }, - { - "type": "int", - "name": "dataSize" - }, - { - "type": "int", - "name": "fontSize" - }, - { - "type": "int *", - "name": "fontChars" - }, - { - "type": "int", - "name": "glyphCount" - } - ] + "params": { + "fileType": "const char *", + "fileData": "const unsigned char *", + "dataSize": "int", + "fontSize": "int", + "fontChars": "int *", + "charsCount": "int" + } }, { "name": "LoadFontData", "description": "Load font data for further use", - "returnType": "GlyphInfo *", - "params": [ - { - "type": "const unsigned char *", - "name": "fileData" - }, - { - "type": "int", - "name": "dataSize" - }, - { - "type": "int", - "name": "fontSize" - }, - { - "type": "int *", - "name": "fontChars" - }, - { - "type": "int", - "name": "glyphCount" - }, - { - "type": "int", - "name": "type" - } - ] + "returnType": "CharInfo *", + "params": { + "fileData": "const unsigned char *", + "dataSize": "int", + "fontSize": "int", + "fontChars": "int *", + "charsCount": "int", + "type": "int" + } }, { "name": "GenImageFontAtlas", "description": "Generate image font atlas using chars info", "returnType": "Image", - "params": [ - { - "type": "const GlyphInfo *", - "name": "chars" - }, - { - "type": "Rectangle **", - "name": "recs" - }, - { - "type": "int", - "name": "glyphCount" - }, - { - "type": "int", - "name": "fontSize" - }, - { - "type": "int", - "name": "padding" - }, - { - "type": "int", - "name": "packMethod" - } - ] + "params": { + "chars": "const CharInfo *", + "recs": "Rectangle **", + "charsCount": "int", + "fontSize": "int", + "padding": "int", + "packMethod": "int" + } }, { "name": "UnloadFontData", "description": "Unload font chars info data (RAM)", "returnType": "void", - "params": [ - { - "type": "GlyphInfo *", - "name": "chars" - }, - { - "type": "int", - "name": "glyphCount" - } - ] + "params": { + "chars": "CharInfo *", + "charsCount": "int" + } }, { "name": "UnloadFont", - "description": "Unload font from GPU memory (VRAM)", + "description": "Unload Font from GPU memory (VRAM)", "returnType": "void", - "params": [ - { - "type": "Font", - "name": "font" - } - ] - }, - { - "name": "ExportFontAsCode", - "description": "Export font as code file, returns true on success", - "returnType": "bool", - "params": [ - { - "type": "Font", - "name": "font" - }, - { - "type": "const char *", - "name": "fileName" - } - ] + "params": { + "font": "Font" + } }, { "name": "DrawFPS", "description": "Draw current FPS", "returnType": "void", - "params": [ - { - "type": "int", - "name": "posX" - }, - { - "type": "int", - "name": "posY" - } - ] + "params": { + "posX": "int", + "posY": "int" + } }, { "name": "DrawText", "description": "Draw text (using default font)", "returnType": "void", - "params": [ - { - "type": "const char *", - "name": "text" - }, - { - "type": "int", - "name": "posX" - }, - { - "type": "int", - "name": "posY" - }, - { - "type": "int", - "name": "fontSize" - }, - { - "type": "Color", - "name": "color" - } - ] + "params": { + "text": "const char *", + "posX": "int", + "posY": "int", + "fontSize": "int", + "color": "Color" + } }, { "name": "DrawTextEx", "description": "Draw text using font and additional parameters", "returnType": "void", - "params": [ - { - "type": "Font", - "name": "font" - }, - { - "type": "const char *", - "name": "text" - }, - { - "type": "Vector2", - "name": "position" - }, - { - "type": "float", - "name": "fontSize" - }, - { - "type": "float", - "name": "spacing" - }, - { - "type": "Color", - "name": "tint" - } - ] - }, - { - "name": "DrawTextPro", - "description": "Draw text using Font and pro parameters (rotation)", - "returnType": "void", - "params": [ - { - "type": "Font", - "name": "font" - }, - { - "type": "const char *", - "name": "text" - }, - { - "type": "Vector2", - "name": "position" - }, - { - "type": "Vector2", - "name": "origin" - }, - { - "type": "float", - "name": "rotation" - }, - { - "type": "float", - "name": "fontSize" - }, - { - "type": "float", - "name": "spacing" - }, - { - "type": "Color", - "name": "tint" - } - ] + "params": { + "font": "Font", + "text": "const char *", + "position": "Vector2", + "fontSize": "float", + "spacing": "float", + "tint": "Color" + } + }, + { + "name": "DrawTextRec", + "description": "Draw text using font inside rectangle limits", + "returnType": "void", + "params": { + "font": "Font", + "text": "const char *", + "rec": "Rectangle", + "fontSize": "float", + "spacing": "float", + "wordWrap": "bool", + "tint": "Color" + } + }, + { + "name": "DrawTextRecEx", + "description": "Draw text using font inside rectangle limits with support for text selection", + "returnType": "void", + "params": { + "font": "Font", + "text": "const char *", + "rec": "Rectangle", + "fontSize": "float", + "spacing": "float", + "wordWrap": "bool", + "tint": "Color", + "selectStart": "int", + "selectLength": "int", + "selectTint": "Color", + "selectBackTint": "Color" + } }, { "name": "DrawTextCodepoint", "description": "Draw one character (codepoint)", "returnType": "void", - "params": [ - { - "type": "Font", - "name": "font" - }, - { - "type": "int", - "name": "codepoint" - }, - { - "type": "Vector2", - "name": "position" - }, - { - "type": "float", - "name": "fontSize" - }, - { - "type": "Color", - "name": "tint" - } - ] + "params": { + "font": "Font", + "codepoint": "int", + "position": "Vector2", + "fontSize": "float", + "tint": "Color" + } }, { "name": "MeasureText", "description": "Measure string width for default font", "returnType": "int", - "params": [ - { - "type": "const char *", - "name": "text" - }, - { - "type": "int", - "name": "fontSize" - } - ] + "params": { + "text": "const char *", + "fontSize": "int" + } }, { "name": "MeasureTextEx", "description": "Measure string size for Font", "returnType": "Vector2", - "params": [ - { - "type": "Font", - "name": "font" - }, - { - "type": "const char *", - "name": "text" - }, - { - "type": "float", - "name": "fontSize" - }, - { - "type": "float", - "name": "spacing" - } - ] + "params": { + "font": "Font", + "text": "const char *", + "fontSize": "float", + "spacing": "float" + } }, { "name": "GetGlyphIndex", - "description": "Get glyph index position in font for a codepoint (unicode character), fallback to '?' if not found", - "returnType": "int", - "params": [ - { - "type": "Font", - "name": "font" - }, - { - "type": "int", - "name": "codepoint" - } - ] - }, - { - "name": "GetGlyphInfo", - "description": "Get glyph font info data for a codepoint (unicode character), fallback to '?' if not found", - "returnType": "GlyphInfo", - "params": [ - { - "type": "Font", - "name": "font" - }, - { - "type": "int", - "name": "codepoint" - } - ] - }, - { - "name": "GetGlyphAtlasRec", - "description": "Get glyph rectangle in font atlas for a codepoint (unicode character), fallback to '?' if not found", - "returnType": "Rectangle", - "params": [ - { - "type": "Font", - "name": "font" - }, - { - "type": "int", - "name": "codepoint" - } - ] - }, - { - "name": "LoadCodepoints", - "description": "Load all codepoints from a UTF-8 text string, codepoints count returned by parameter", - "returnType": "int *", - "params": [ - { - "type": "const char *", - "name": "text" - }, - { - "type": "int *", - "name": "count" - } - ] - }, - { - "name": "UnloadCodepoints", - "description": "Unload codepoints data from memory", - "returnType": "void", - "params": [ - { - "type": "int *", - "name": "codepoints" - } - ] - }, - { - "name": "GetCodepointCount", - "description": "Get total number of codepoints in a UTF-8 encoded string", - "returnType": "int", - "params": [ - { - "type": "const char *", - "name": "text" - } - ] - }, - { - "name": "GetCodepoint", - "description": "Get next codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure", + "description": "Get index position for a unicode character on font", "returnType": "int", - "params": [ - { - "type": "const char *", - "name": "text" - }, - { - "type": "int *", - "name": "bytesProcessed" - } - ] - }, - { - "name": "CodepointToUTF8", - "description": "Encode one codepoint into UTF-8 byte array (array length returned as parameter)", - "returnType": "const char *", - "params": [ - { - "type": "int", - "name": "codepoint" - }, - { - "type": "int *", - "name": "byteSize" - } - ] - }, - { - "name": "TextCodepointsToUTF8", - "description": "Encode text as codepoints array into UTF-8 text string (WARNING: memory must be freed!)", - "returnType": "char *", - "params": [ - { - "type": "int *", - "name": "codepoints" - }, - { - "type": "int", - "name": "length" - } - ] + "params": { + "font": "Font", + "codepoint": "int" + } }, { "name": "TextCopy", "description": "Copy one string to another, returns bytes copied", "returnType": "int", - "params": [ - { - "type": "char *", - "name": "dst" - }, - { - "type": "const char *", - "name": "src" - } - ] + "params": { + "dst": "char *", + "src": "const char *" + } }, { "name": "TextIsEqual", "description": "Check if two text string are equal", "returnType": "bool", - "params": [ - { - "type": "const char *", - "name": "text1" - }, - { - "type": "const char *", - "name": "text2" - } - ] + "params": { + "text1": "const char *", + "text2": "const char *" + } }, { "name": "TextLength", - "description": "Get text length, checks for '\\0' ending", + "description": "Get text length, checks for ' 0' ending", "returnType": "unsigned int", - "params": [ - { - "type": "const char *", - "name": "text" - } - ] + "params": { + "text": "const char *" + } }, { "name": "TextFormat", - "description": "Text formatting with variables (sprintf() style)", + "description": "Text formatting with variables (sprintf style)", "returnType": "const char *", - "params": [ - { - "type": "const char *", - "name": "text" - }, - { - "type": "", - "name": "" - } - ] + "params": { + "text": "const char *", + "": "" + } }, { "name": "TextSubtext", "description": "Get a piece of a text string", "returnType": "const char *", - "params": [ - { - "type": "const char *", - "name": "text" - }, - { - "type": "int", - "name": "position" - }, - { - "type": "int", - "name": "length" - } - ] + "params": { + "text": "const char *", + "position": "int", + "length": "int" + } }, { "name": "TextReplace", - "description": "Replace text string (WARNING: memory must be freed!)", + "description": "Replace text string (memory must be freed!)", "returnType": "char *", - "params": [ - { - "type": "char *", - "name": "text" - }, - { - "type": "const char *", - "name": "replace" - }, - { - "type": "const char *", - "name": "by" - } - ] + "params": { + "text": "char *", + "replace": "const char *", + "by": "const char *" + } }, { "name": "TextInsert", - "description": "Insert text in a position (WARNING: memory must be freed!)", + "description": "Insert text in a position (memory must be freed!)", "returnType": "char *", - "params": [ - { - "type": "const char *", - "name": "text" - }, - { - "type": "const char *", - "name": "insert" - }, - { - "type": "int", - "name": "position" - } - ] + "params": { + "text": "const char *", + "insert": "const char *", + "position": "int" + } }, { "name": "TextJoin", "description": "Join text strings with delimiter", "returnType": "const char *", - "params": [ - { - "type": "const char **", - "name": "textList" - }, - { - "type": "int", - "name": "count" - }, - { - "type": "const char *", - "name": "delimiter" - } - ] + "params": { + "textList": "const char **", + "count": "int", + "delimiter": "const char *" + } }, { "name": "TextSplit", "description": "Split text into multiple strings", "returnType": "const char **", - "params": [ - { - "type": "const char *", - "name": "text" - }, - { - "type": "char", - "name": "delimiter" - }, - { - "type": "int *", - "name": "count" - } - ] + "params": { + "text": "const char *", + "delimiter": "char", + "count": "int *" + } }, { "name": "TextAppend", "description": "Append text at specific position and move cursor!", "returnType": "void", - "params": [ - { - "type": "char *", - "name": "text" - }, - { - "type": "const char *", - "name": "append" - }, - { - "type": "int *", - "name": "position" - } - ] + "params": { + "text": "char *", + "append": "const char *", + "position": "int *" + } }, { "name": "TextFindIndex", "description": "Find first text occurrence within a string", "returnType": "int", - "params": [ - { - "type": "const char *", - "name": "text" - }, - { - "type": "const char *", - "name": "find" - } - ] + "params": { + "text": "const char *", + "find": "const char *" + } }, { "name": "TextToUpper", "description": "Get upper case version of provided string", "returnType": "const char *", - "params": [ - { - "type": "const char *", - "name": "text" - } - ] + "params": { + "text": "const char *" + } }, { "name": "TextToLower", "description": "Get lower case version of provided string", "returnType": "const char *", - "params": [ - { - "type": "const char *", - "name": "text" - } - ] + "params": { + "text": "const char *" + } }, { "name": "TextToPascal", "description": "Get Pascal case notation version of provided string", "returnType": "const char *", - "params": [ - { - "type": "const char *", - "name": "text" - } - ] + "params": { + "text": "const char *" + } }, { "name": "TextToInteger", "description": "Get integer value from text (negative values not supported)", "returnType": "int", - "params": [ - { - "type": "const char *", - "name": "text" - } - ] + "params": { + "text": "const char *" + } + }, + { + "name": "TextToUtf8", + "description": "Encode text codepoint into utf8 text (memory must be freed!)", + "returnType": "char *", + "params": { + "codepoints": "int *", + "length": "int" + } + }, + { + "name": "GetCodepoints", + "description": "Get all codepoints in a string, codepoints count returned by parameters", + "returnType": "int *", + "params": { + "text": "const char *", + "count": "int *" + } + }, + { + "name": "GetCodepointsCount", + "description": "Get total number of characters (codepoints) in a UTF8 encoded string", + "returnType": "int", + "params": { + "text": "const char *" + } + }, + { + "name": "GetNextCodepoint", + "description": "Get next codepoint in a UTF8 encoded string; 0x3f('?') is returned on failure", + "returnType": "int", + "params": { + "text": "const char *", + "bytesProcessed": "int *" + } + }, + { + "name": "CodepointToUtf8", + "description": "Encode codepoint into utf8 text (char array length returned as parameter)", + "returnType": "const char *", + "params": { + "codepoint": "int", + "byteLength": "int *" + } }, { "name": "DrawLine3D", "description": "Draw a line in 3D world space", "returnType": "void", - "params": [ - { - "type": "Vector3", - "name": "startPos" - }, - { - "type": "Vector3", - "name": "endPos" - }, - { - "type": "Color", - "name": "color" - } - ] + "params": { + "startPos": "Vector3", + "endPos": "Vector3", + "color": "Color" + } }, { "name": "DrawPoint3D", "description": "Draw a point in 3D space, actually a small line", "returnType": "void", - "params": [ - { - "type": "Vector3", - "name": "position" - }, - { - "type": "Color", - "name": "color" - } - ] + "params": { + "position": "Vector3", + "color": "Color" + } }, { "name": "DrawCircle3D", "description": "Draw a circle in 3D world space", "returnType": "void", - "params": [ - { - "type": "Vector3", - "name": "center" - }, - { - "type": "float", - "name": "radius" - }, - { - "type": "Vector3", - "name": "rotationAxis" - }, - { - "type": "float", - "name": "rotationAngle" - }, - { - "type": "Color", - "name": "color" - } - ] + "params": { + "center": "Vector3", + "radius": "float", + "rotationAxis": "Vector3", + "rotationAngle": "float", + "color": "Color" + } }, { "name": "DrawTriangle3D", "description": "Draw a color-filled triangle (vertex in counter-clockwise order!)", "returnType": "void", - "params": [ - { - "type": "Vector3", - "name": "v1" - }, - { - "type": "Vector3", - "name": "v2" - }, - { - "type": "Vector3", - "name": "v3" - }, - { - "type": "Color", - "name": "color" - } - ] + "params": { + "v1": "Vector3", + "v2": "Vector3", + "v3": "Vector3", + "color": "Color" + } }, { "name": "DrawTriangleStrip3D", "description": "Draw a triangle strip defined by points", "returnType": "void", - "params": [ - { - "type": "Vector3 *", - "name": "points" - }, - { - "type": "int", - "name": "pointCount" - }, - { - "type": "Color", - "name": "color" - } - ] + "params": { + "points": "Vector3 *", + "pointsCount": "int", + "color": "Color" + } }, { "name": "DrawCube", "description": "Draw cube", "returnType": "void", - "params": [ - { - "type": "Vector3", - "name": "position" - }, - { - "type": "float", - "name": "width" - }, - { - "type": "float", - "name": "height" - }, - { - "type": "float", - "name": "length" - }, - { - "type": "Color", - "name": "color" - } - ] + "params": { + "position": "Vector3", + "width": "float", + "height": "float", + "length": "float", + "color": "Color" + } }, { "name": "DrawCubeV", "description": "Draw cube (Vector version)", "returnType": "void", - "params": [ - { - "type": "Vector3", - "name": "position" - }, - { - "type": "Vector3", - "name": "size" - }, - { - "type": "Color", - "name": "color" - } - ] + "params": { + "position": "Vector3", + "size": "Vector3", + "color": "Color" + } }, { "name": "DrawCubeWires", "description": "Draw cube wires", "returnType": "void", - "params": [ - { - "type": "Vector3", - "name": "position" - }, - { - "type": "float", - "name": "width" - }, - { - "type": "float", - "name": "height" - }, - { - "type": "float", - "name": "length" - }, - { - "type": "Color", - "name": "color" - } - ] + "params": { + "position": "Vector3", + "width": "float", + "height": "float", + "length": "float", + "color": "Color" + } }, { "name": "DrawCubeWiresV", "description": "Draw cube wires (Vector version)", "returnType": "void", - "params": [ - { - "type": "Vector3", - "name": "position" - }, - { - "type": "Vector3", - "name": "size" - }, - { - "type": "Color", - "name": "color" - } - ] + "params": { + "position": "Vector3", + "size": "Vector3", + "color": "Color" + } }, { "name": "DrawCubeTexture", "description": "Draw cube textured", "returnType": "void", - "params": [ - { - "type": "Texture2D", - "name": "texture" - }, - { - "type": "Vector3", - "name": "position" - }, - { - "type": "float", - "name": "width" - }, - { - "type": "float", - "name": "height" - }, - { - "type": "float", - "name": "length" - }, - { - "type": "Color", - "name": "color" - } - ] - }, - { - "name": "DrawCubeTextureRec", - "description": "Draw cube with a region of a texture", - "returnType": "void", - "params": [ - { - "type": "Texture2D", - "name": "texture" - }, - { - "type": "Rectangle", - "name": "source" - }, - { - "type": "Vector3", - "name": "position" - }, - { - "type": "float", - "name": "width" - }, - { - "type": "float", - "name": "height" - }, - { - "type": "float", - "name": "length" - }, - { - "type": "Color", - "name": "color" - } - ] + "params": { + "texture": "Texture2D", + "position": "Vector3", + "width": "float", + "height": "float", + "length": "float", + "color": "Color" + } }, { "name": "DrawSphere", "description": "Draw sphere", "returnType": "void", - "params": [ - { - "type": "Vector3", - "name": "centerPos" - }, - { - "type": "float", - "name": "radius" - }, - { - "type": "Color", - "name": "color" - } - ] + "params": { + "centerPos": "Vector3", + "radius": "float", + "color": "Color" + } }, { "name": "DrawSphereEx", "description": "Draw sphere with extended parameters", "returnType": "void", - "params": [ - { - "type": "Vector3", - "name": "centerPos" - }, - { - "type": "float", - "name": "radius" - }, - { - "type": "int", - "name": "rings" - }, - { - "type": "int", - "name": "slices" - }, - { - "type": "Color", - "name": "color" - } - ] + "params": { + "centerPos": "Vector3", + "radius": "float", + "rings": "int", + "slices": "int", + "color": "Color" + } }, { "name": "DrawSphereWires", "description": "Draw sphere wires", "returnType": "void", - "params": [ - { - "type": "Vector3", - "name": "centerPos" - }, - { - "type": "float", - "name": "radius" - }, - { - "type": "int", - "name": "rings" - }, - { - "type": "int", - "name": "slices" - }, - { - "type": "Color", - "name": "color" - } - ] + "params": { + "centerPos": "Vector3", + "radius": "float", + "rings": "int", + "slices": "int", + "color": "Color" + } }, { "name": "DrawCylinder", "description": "Draw a cylinder/cone", "returnType": "void", - "params": [ - { - "type": "Vector3", - "name": "position" - }, - { - "type": "float", - "name": "radiusTop" - }, - { - "type": "float", - "name": "radiusBottom" - }, - { - "type": "float", - "name": "height" - }, - { - "type": "int", - "name": "slices" - }, - { - "type": "Color", - "name": "color" - } - ] + "params": { + "position": "Vector3", + "radiusTop": "float", + "radiusBottom": "float", + "height": "float", + "slices": "int", + "color": "Color" + } }, { - "name": "DrawCylinderEx", - "description": "Draw a cylinder with base at startPos and top at endPos", - "returnType": "void", - "params": [ - { - "type": "Vector3", - "name": "startPos" - }, - { - "type": "Vector3", - "name": "endPos" - }, - { - "type": "float", - "name": "startRadius" - }, - { - "type": "float", - "name": "endRadius" - }, - { - "type": "int", - "name": "sides" - }, - { - "type": "Color", - "name": "color" - } - ] - }, - { - "name": "DrawCylinderWires", - "description": "Draw a cylinder/cone wires", - "returnType": "void", - "params": [ - { - "type": "Vector3", - "name": "position" - }, - { - "type": "float", - "name": "radiusTop" - }, - { - "type": "float", - "name": "radiusBottom" - }, - { - "type": "float", - "name": "height" - }, - { - "type": "int", - "name": "slices" - }, - { - "type": "Color", - "name": "color" - } - ] - }, - { - "name": "DrawCylinderWiresEx", - "description": "Draw a cylinder wires with base at startPos and top at endPos", - "returnType": "void", - "params": [ - { - "type": "Vector3", - "name": "startPos" - }, - { - "type": "Vector3", - "name": "endPos" - }, - { - "type": "float", - "name": "startRadius" - }, - { - "type": "float", - "name": "endRadius" - }, - { - "type": "int", - "name": "sides" - }, - { - "type": "Color", - "name": "color" - } - ] - }, - { - "name": "DrawPlane", - "description": "Draw a plane XZ", - "returnType": "void", - "params": [ - { - "type": "Vector3", - "name": "centerPos" - }, - { - "type": "Vector2", - "name": "size" - }, - { - "type": "Color", - "name": "color" - } - ] - }, - { - "name": "DrawRay", - "description": "Draw a ray line", - "returnType": "void", - "params": [ - { - "type": "Ray", - "name": "ray" - }, - { - "type": "Color", - "name": "color" - } - ] - }, - { - "name": "DrawGrid", - "description": "Draw a grid (centered at (0, 0, 0))", - "returnType": "void", - "params": [ - { - "type": "int", - "name": "slices" - }, - { - "type": "float", - "name": "spacing" - } - ] - }, - { - "name": "LoadModel", - "description": "Load model from files (meshes and materials)", - "returnType": "Model", - "params": [ - { - "type": "const char *", - "name": "fileName" - } - ] - }, - { - "name": "LoadModelFromMesh", - "description": "Load model from generated mesh (default material)", - "returnType": "Model", - "params": [ - { - "type": "Mesh", - "name": "mesh" - } - ] - }, - { - "name": "UnloadModel", - "description": "Unload model (including meshes) from memory (RAM and/or VRAM)", - "returnType": "void", - "params": [ - { - "type": "Model", - "name": "model" - } - ] - }, - { - "name": "UnloadModelKeepMeshes", - "description": "Unload model (but not meshes) from memory (RAM and/or VRAM)", - "returnType": "void", - "params": [ - { - "type": "Model", - "name": "model" - } - ] - }, - { - "name": "GetModelBoundingBox", - "description": "Compute model bounding box limits (considers all meshes)", - "returnType": "BoundingBox", - "params": [ - { - "type": "Model", - "name": "model" - } - ] - }, - { - "name": "DrawModel", - "description": "Draw a model (with texture if set)", - "returnType": "void", - "params": [ - { - "type": "Model", - "name": "model" - }, - { - "type": "Vector3", - "name": "position" - }, - { - "type": "float", - "name": "scale" - }, - { - "type": "Color", - "name": "tint" - } - ] - }, - { - "name": "DrawModelEx", - "description": "Draw a model with extended parameters", - "returnType": "void", - "params": [ - { - "type": "Model", - "name": "model" - }, - { - "type": "Vector3", - "name": "position" - }, - { - "type": "Vector3", - "name": "rotationAxis" - }, - { - "type": "float", - "name": "rotationAngle" - }, - { - "type": "Vector3", - "name": "scale" - }, - { - "type": "Color", - "name": "tint" - } - ] - }, - { - "name": "DrawModelWires", - "description": "Draw a model wires (with texture if set)", - "returnType": "void", - "params": [ - { - "type": "Model", - "name": "model" - }, - { - "type": "Vector3", - "name": "position" - }, - { - "type": "float", - "name": "scale" - }, - { - "type": "Color", - "name": "tint" - } - ] - }, - { - "name": "DrawModelWiresEx", - "description": "Draw a model wires (with texture if set) with extended parameters", - "returnType": "void", - "params": [ - { - "type": "Model", - "name": "model" - }, - { - "type": "Vector3", - "name": "position" - }, - { - "type": "Vector3", - "name": "rotationAxis" - }, - { - "type": "float", - "name": "rotationAngle" - }, - { - "type": "Vector3", - "name": "scale" - }, - { - "type": "Color", - "name": "tint" - } - ] + "name": "DrawCylinderWires", + "description": "Draw a cylinder/cone wires", + "returnType": "void", + "params": { + "position": "Vector3", + "radiusTop": "float", + "radiusBottom": "float", + "height": "float", + "slices": "int", + "color": "Color" + } }, { - "name": "DrawBoundingBox", - "description": "Draw bounding box (wires)", + "name": "DrawPlane", + "description": "Draw a plane XZ", "returnType": "void", - "params": [ - { - "type": "BoundingBox", - "name": "box" - }, - { - "type": "Color", - "name": "color" - } - ] + "params": { + "centerPos": "Vector3", + "size": "Vector2", + "color": "Color" + } }, { - "name": "DrawBillboard", - "description": "Draw a billboard texture", + "name": "DrawRay", + "description": "Draw a ray line", "returnType": "void", - "params": [ - { - "type": "Camera", - "name": "camera" - }, - { - "type": "Texture2D", - "name": "texture" - }, - { - "type": "Vector3", - "name": "position" - }, - { - "type": "float", - "name": "size" - }, - { - "type": "Color", - "name": "tint" - } - ] + "params": { + "ray": "Ray", + "color": "Color" + } }, { - "name": "DrawBillboardRec", - "description": "Draw a billboard texture defined by source", + "name": "DrawGrid", + "description": "Draw a grid (centered at (0, 0, 0))", "returnType": "void", - "params": [ - { - "type": "Camera", - "name": "camera" - }, - { - "type": "Texture2D", - "name": "texture" - }, - { - "type": "Rectangle", - "name": "source" - }, - { - "type": "Vector3", - "name": "position" - }, - { - "type": "Vector2", - "name": "size" - }, - { - "type": "Color", - "name": "tint" - } - ] + "params": { + "slices": "int", + "spacing": "float" + } }, { - "name": "DrawBillboardPro", - "description": "Draw a billboard texture defined by source and rotation", + "name": "LoadModel", + "description": "Load model from files (meshes and materials)", + "returnType": "Model", + "params": { + "fileName": "const char *" + } + }, + { + "name": "LoadModelFromMesh", + "description": "Load model from generated mesh (default material)", + "returnType": "Model", + "params": { + "mesh": "Mesh" + } + }, + { + "name": "UnloadModel", + "description": "Unload model (including meshes) from memory (RAM and/or VRAM)", "returnType": "void", - "params": [ - { - "type": "Camera", - "name": "camera" - }, - { - "type": "Texture2D", - "name": "texture" - }, - { - "type": "Rectangle", - "name": "source" - }, - { - "type": "Vector3", - "name": "position" - }, - { - "type": "Vector3", - "name": "up" - }, - { - "type": "Vector2", - "name": "size" - }, - { - "type": "Vector2", - "name": "origin" - }, - { - "type": "float", - "name": "rotation" - }, - { - "type": "Color", - "name": "tint" - } - ] + "params": { + "model": "Model" + } + }, + { + "name": "UnloadModelKeepMeshes", + "description": "Unload model (but not meshes) from memory (RAM and/or VRAM)", + "returnType": "void", + "params": { + "model": "Model" + } }, { "name": "UploadMesh", "description": "Upload mesh vertex data in GPU and provide VAO/VBO ids", "returnType": "void", - "params": [ - { - "type": "Mesh *", - "name": "mesh" - }, - { - "type": "bool", - "name": "dynamic" - } - ] + "params": { + "mesh": "Mesh *", + "dynamic": "bool" + } }, { "name": "UpdateMeshBuffer", "description": "Update mesh vertex data in GPU for a specific buffer index", "returnType": "void", - "params": [ - { - "type": "Mesh", - "name": "mesh" - }, - { - "type": "int", - "name": "index" - }, - { - "type": "void *", - "name": "data" - }, - { - "type": "int", - "name": "dataSize" - }, - { - "type": "int", - "name": "offset" - } - ] - }, - { - "name": "UnloadMesh", - "description": "Unload mesh data from CPU and GPU", - "returnType": "void", - "params": [ - { - "type": "Mesh", - "name": "mesh" - } - ] + "params": { + "mesh": "Mesh", + "index": "int", + "data": "void *", + "dataSize": "int", + "offset": "int" + } }, { "name": "DrawMesh", "description": "Draw a 3d mesh with material and transform", "returnType": "void", - "params": [ - { - "type": "Mesh", - "name": "mesh" - }, - { - "type": "Material", - "name": "material" - }, - { - "type": "Matrix", - "name": "transform" - } - ] + "params": { + "mesh": "Mesh", + "material": "Material", + "transform": "Matrix" + } }, { "name": "DrawMeshInstanced", "description": "Draw multiple mesh instances with material and different transforms", "returnType": "void", - "params": [ - { - "type": "Mesh", - "name": "mesh" - }, - { - "type": "Material", - "name": "material" - }, - { - "type": "Matrix *", - "name": "transforms" - }, - { - "type": "int", - "name": "instances" - } - ] + "params": { + "mesh": "Mesh", + "material": "Material", + "transforms": "Matrix *", + "instances": "int" + } + }, + { + "name": "UnloadMesh", + "description": "Unload mesh data from CPU and GPU", + "returnType": "void", + "params": { + "mesh": "Mesh" + } }, { "name": "ExportMesh", "description": "Export mesh data to file, returns true on success", "returnType": "bool", - "params": [ - { - "type": "Mesh", - "name": "mesh" - }, - { - "type": "const char *", - "name": "fileName" - } - ] + "params": { + "mesh": "Mesh", + "fileName": "const char *" + } }, { - "name": "GetMeshBoundingBox", - "description": "Compute mesh bounding box limits", - "returnType": "BoundingBox", - "params": [ - { - "type": "Mesh", - "name": "mesh" - } - ] + "name": "LoadMaterials", + "description": "Load materials from model file", + "returnType": "Material *", + "params": { + "fileName": "const char *", + "materialCount": "int *" + } }, { - "name": "GenMeshTangents", - "description": "Compute mesh tangents", + "name": "LoadMaterialDefault", + "description": "Load default material (Supports: DIFFUSE, SPECULAR, NORMAL maps)", + "returnType": "Material" + }, + { + "name": "UnloadMaterial", + "description": "Unload material from GPU memory (VRAM)", "returnType": "void", - "params": [ - { - "type": "Mesh *", - "name": "mesh" - } - ] + "params": { + "material": "Material" + } }, { - "name": "GenMeshBinormals", - "description": "Compute mesh binormals", + "name": "SetMaterialTexture", + "description": "Set texture for a material map type (MATERIAL_MAP_DIFFUSE, MATERIAL_MAP_SPECULAR...)", "returnType": "void", - "params": [ - { - "type": "Mesh *", - "name": "mesh" - } - ] + "params": { + "material": "Material *", + "mapType": "int", + "texture": "Texture2D" + } + }, + { + "name": "SetModelMeshMaterial", + "description": "Set material for a mesh", + "returnType": "void", + "params": { + "model": "Model *", + "meshId": "int", + "materialId": "int" + } + }, + { + "name": "LoadModelAnimations", + "description": "Load model animations from file", + "returnType": "ModelAnimation *", + "params": { + "fileName": "const char *", + "animsCount": "int *" + } + }, + { + "name": "UpdateModelAnimation", + "description": "Update model animation pose", + "returnType": "void", + "params": { + "model": "Model", + "anim": "ModelAnimation", + "frame": "int" + } + }, + { + "name": "UnloadModelAnimation", + "description": "Unload animation data", + "returnType": "void", + "params": { + "anim": "ModelAnimation" + } + }, + { + "name": "UnloadModelAnimations", + "description": "Unload animation array data", + "returnType": "void", + "params": { + "animations": "ModelAnimation*", + "count": "unsigned int" + } + }, + { + "name": "IsModelAnimationValid", + "description": "Check model animation skeleton match", + "returnType": "bool", + "params": { + "model": "Model", + "anim": "ModelAnimation" + } }, { "name": "GenMeshPoly", "description": "Generate polygonal mesh", "returnType": "Mesh", - "params": [ - { - "type": "int", - "name": "sides" - }, - { - "type": "float", - "name": "radius" - } - ] + "params": { + "sides": "int", + "radius": "float" + } }, { "name": "GenMeshPlane", "description": "Generate plane mesh (with subdivisions)", "returnType": "Mesh", - "params": [ - { - "type": "float", - "name": "width" - }, - { - "type": "float", - "name": "length" - }, - { - "type": "int", - "name": "resX" - }, - { - "type": "int", - "name": "resZ" - } - ] + "params": { + "width": "float", + "length": "float", + "resX": "int", + "resZ": "int" + } }, { "name": "GenMeshCube", "description": "Generate cuboid mesh", "returnType": "Mesh", - "params": [ - { - "type": "float", - "name": "width" - }, - { - "type": "float", - "name": "height" - }, - { - "type": "float", - "name": "length" - } - ] + "params": { + "width": "float", + "height": "float", + "length": "float" + } }, { "name": "GenMeshSphere", "description": "Generate sphere mesh (standard sphere)", "returnType": "Mesh", - "params": [ - { - "type": "float", - "name": "radius" - }, - { - "type": "int", - "name": "rings" - }, - { - "type": "int", - "name": "slices" - } - ] + "params": { + "radius": "float", + "rings": "int", + "slices": "int" + } }, { "name": "GenMeshHemiSphere", "description": "Generate half-sphere mesh (no bottom cap)", "returnType": "Mesh", - "params": [ - { - "type": "float", - "name": "radius" - }, - { - "type": "int", - "name": "rings" - }, - { - "type": "int", - "name": "slices" - } - ] + "params": { + "radius": "float", + "rings": "int", + "slices": "int" + } }, { "name": "GenMeshCylinder", "description": "Generate cylinder mesh", "returnType": "Mesh", - "params": [ - { - "type": "float", - "name": "radius" - }, - { - "type": "float", - "name": "height" - }, - { - "type": "int", - "name": "slices" - } - ] - }, - { - "name": "GenMeshCone", - "description": "Generate cone/pyramid mesh", - "returnType": "Mesh", - "params": [ - { - "type": "float", - "name": "radius" - }, - { - "type": "float", - "name": "height" - }, - { - "type": "int", - "name": "slices" - } - ] + "params": { + "radius": "float", + "height": "float", + "slices": "int" + } }, { "name": "GenMeshTorus", "description": "Generate torus mesh", "returnType": "Mesh", - "params": [ - { - "type": "float", - "name": "radius" - }, - { - "type": "float", - "name": "size" - }, - { - "type": "int", - "name": "radSeg" - }, - { - "type": "int", - "name": "sides" - } - ] + "params": { + "radius": "float", + "size": "float", + "radSeg": "int", + "sides": "int" + } }, { "name": "GenMeshKnot", "description": "Generate trefoil knot mesh", "returnType": "Mesh", - "params": [ - { - "type": "float", - "name": "radius" - }, - { - "type": "float", - "name": "size" - }, - { - "type": "int", - "name": "radSeg" - }, - { - "type": "int", - "name": "sides" - } - ] + "params": { + "radius": "float", + "size": "float", + "radSeg": "int", + "sides": "int" + } }, { "name": "GenMeshHeightmap", "description": "Generate heightmap mesh from image data", "returnType": "Mesh", - "params": [ - { - "type": "Image", - "name": "heightmap" - }, - { - "type": "Vector3", - "name": "size" - } - ] + "params": { + "heightmap": "Image", + "size": "Vector3" + } }, { "name": "GenMeshCubicmap", "description": "Generate cubes-based map mesh from image data", "returnType": "Mesh", - "params": [ - { - "type": "Image", - "name": "cubicmap" - }, - { - "type": "Vector3", - "name": "cubeSize" - } - ] + "params": { + "cubicmap": "Image", + "cubeSize": "Vector3" + } }, { - "name": "LoadMaterials", - "description": "Load materials from model file", - "returnType": "Material *", - "params": [ - { - "type": "const char *", - "name": "fileName" - }, - { - "type": "int *", - "name": "materialCount" - } - ] + "name": "GetMeshBoundingBox", + "description": "Compute mesh bounding box limits", + "returnType": "BoundingBox", + "params": { + "mesh": "Mesh" + } }, { - "name": "LoadMaterialDefault", - "description": "Load default material (Supports: DIFFUSE, SPECULAR, NORMAL maps)", - "returnType": "Material" + "name": "MeshTangents", + "description": "Compute mesh tangents", + "returnType": "void", + "params": { + "mesh": "Mesh *" + } }, { - "name": "UnloadMaterial", - "description": "Unload material from GPU memory (VRAM)", + "name": "MeshBinormals", + "description": "Compute mesh binormals", "returnType": "void", - "params": [ - { - "type": "Material", - "name": "material" - } - ] + "params": { + "mesh": "Mesh *" + } }, { - "name": "SetMaterialTexture", - "description": "Set texture for a material map type (MATERIAL_MAP_DIFFUSE, MATERIAL_MAP_SPECULAR...)", + "name": "DrawModel", + "description": "Draw a model (with texture if set)", "returnType": "void", - "params": [ - { - "type": "Material *", - "name": "material" - }, - { - "type": "int", - "name": "mapType" - }, - { - "type": "Texture2D", - "name": "texture" - } - ] + "params": { + "model": "Model", + "position": "Vector3", + "scale": "float", + "tint": "Color" + } }, { - "name": "SetModelMeshMaterial", - "description": "Set material for a mesh", + "name": "DrawModelEx", + "description": "Draw a model with extended parameters", "returnType": "void", - "params": [ - { - "type": "Model *", - "name": "model" - }, - { - "type": "int", - "name": "meshId" - }, - { - "type": "int", - "name": "materialId" - } - ] + "params": { + "model": "Model", + "position": "Vector3", + "rotationAxis": "Vector3", + "rotationAngle": "float", + "scale": "Vector3", + "tint": "Color" + } }, { - "name": "LoadModelAnimations", - "description": "Load model animations from file", - "returnType": "ModelAnimation *", - "params": [ - { - "type": "const char *", - "name": "fileName" - }, - { - "type": "unsigned int *", - "name": "animCount" - } - ] + "name": "DrawModelWires", + "description": "Draw a model wires (with texture if set)", + "returnType": "void", + "params": { + "model": "Model", + "position": "Vector3", + "scale": "float", + "tint": "Color" + } }, { - "name": "UpdateModelAnimation", - "description": "Update model animation pose", + "name": "DrawModelWiresEx", + "description": "Draw a model wires (with texture if set) with extended parameters", "returnType": "void", - "params": [ - { - "type": "Model", - "name": "model" - }, - { - "type": "ModelAnimation", - "name": "anim" - }, - { - "type": "int", - "name": "frame" - } - ] + "params": { + "model": "Model", + "position": "Vector3", + "rotationAxis": "Vector3", + "rotationAngle": "float", + "scale": "Vector3", + "tint": "Color" + } }, { - "name": "UnloadModelAnimation", - "description": "Unload animation data", + "name": "DrawBoundingBox", + "description": "Draw bounding box (wires)", "returnType": "void", - "params": [ - { - "type": "ModelAnimation", - "name": "anim" - } - ] + "params": { + "box": "BoundingBox", + "color": "Color" + } }, { - "name": "UnloadModelAnimations", - "description": "Unload animation array data", + "name": "DrawBillboard", + "description": "Draw a billboard texture", "returnType": "void", - "params": [ - { - "type": "ModelAnimation*", - "name": "animations" - }, - { - "type": "unsigned int", - "name": "count" - } - ] + "params": { + "camera": "Camera", + "texture": "Texture2D", + "position": "Vector3", + "size": "float", + "tint": "Color" + } }, { - "name": "IsModelAnimationValid", - "description": "Check model animation skeleton match", - "returnType": "bool", - "params": [ - { - "type": "Model", - "name": "model" - }, - { - "type": "ModelAnimation", - "name": "anim" - } - ] + "name": "DrawBillboardRec", + "description": "Draw a billboard texture defined by source", + "returnType": "void", + "params": { + "camera": "Camera", + "texture": "Texture2D", + "source": "Rectangle", + "position": "Vector3", + "size": "Vector2", + "tint": "Color" + } + }, + { + "name": "DrawBillboardPro", + "description": "Draw a billboard texture defined by source and rotation", + "returnType": "void", + "params": { + "camera": "Camera", + "texture": "Texture2D", + "source": "Rectangle", + "position": "Vector3", + "size": "Vector2", + "origin": "Vector2", + "rotation": "float", + "tint": "Color" + } }, { "name": "CheckCollisionSpheres", "description": "Check collision between two spheres", "returnType": "bool", - "params": [ - { - "type": "Vector3", - "name": "center1" - }, - { - "type": "float", - "name": "radius1" - }, - { - "type": "Vector3", - "name": "center2" - }, - { - "type": "float", - "name": "radius2" - } - ] + "params": { + "center1": "Vector3", + "radius1": "float", + "center2": "Vector3", + "radius2": "float" + } }, { "name": "CheckCollisionBoxes", "description": "Check collision between two bounding boxes", "returnType": "bool", - "params": [ - { - "type": "BoundingBox", - "name": "box1" - }, - { - "type": "BoundingBox", - "name": "box2" - } - ] + "params": { + "box1": "BoundingBox", + "box2": "BoundingBox" + } }, { "name": "CheckCollisionBoxSphere", "description": "Check collision between box and sphere", "returnType": "bool", - "params": [ - { - "type": "BoundingBox", - "name": "box" - }, - { - "type": "Vector3", - "name": "center" - }, - { - "type": "float", - "name": "radius" - } - ] + "params": { + "box": "BoundingBox", + "center": "Vector3", + "radius": "float" + } }, { "name": "GetRayCollisionSphere", "description": "Get collision info between ray and sphere", "returnType": "RayCollision", - "params": [ - { - "type": "Ray", - "name": "ray" - }, - { - "type": "Vector3", - "name": "center" - }, - { - "type": "float", - "name": "radius" - } - ] + "params": { + "ray": "Ray", + "center": "Vector3", + "radius": "float" + } }, { "name": "GetRayCollisionBox", "description": "Get collision info between ray and box", "returnType": "RayCollision", - "params": [ - { - "type": "Ray", - "name": "ray" - }, - { - "type": "BoundingBox", - "name": "box" - } - ] + "params": { + "ray": "Ray", + "box": "BoundingBox" + } }, { "name": "GetRayCollisionModel", "description": "Get collision info between ray and model", "returnType": "RayCollision", - "params": [ - { - "type": "Ray", - "name": "ray" - }, - { - "type": "Model", - "name": "model" - } - ] - }, - { - "name": "GetRayCollisionMesh", - "description": "Get collision info between ray and mesh", - "returnType": "RayCollision", - "params": [ - { - "type": "Ray", - "name": "ray" - }, - { - "type": "Mesh", - "name": "mesh" - }, - { - "type": "Matrix", - "name": "transform" - } - ] - }, - { - "name": "GetRayCollisionTriangle", - "description": "Get collision info between ray and triangle", - "returnType": "RayCollision", - "params": [ - { - "type": "Ray", - "name": "ray" - }, - { - "type": "Vector3", - "name": "p1" - }, - { - "type": "Vector3", - "name": "p2" - }, - { - "type": "Vector3", - "name": "p3" - } - ] + "params": { + "ray": "Ray", + "model": "Model" + } + }, + { + "name": "GetRayCollisionMesh", + "description": "Get collision info between ray and mesh", + "returnType": "RayCollision", + "params": { + "ray": "Ray", + "mesh": "Mesh", + "transform": "Matrix" + } + }, + { + "name": "GetRayCollisionTriangle", + "description": "Get collision info between ray and triangle", + "returnType": "RayCollision", + "params": { + "ray": "Ray", + "p1": "Vector3", + "p2": "Vector3", + "p3": "Vector3" + } }, { "name": "GetRayCollisionQuad", "description": "Get collision info between ray and quad", "returnType": "RayCollision", - "params": [ - { - "type": "Ray", - "name": "ray" - }, - { - "type": "Vector3", - "name": "p1" - }, - { - "type": "Vector3", - "name": "p2" - }, - { - "type": "Vector3", - "name": "p3" - }, - { - "type": "Vector3", - "name": "p4" - } - ] + "params": { + "ray": "Ray", + "p1": "Vector3", + "p2": "Vector3", + "p3": "Vector3", + "p4": "Vector3" + } }, { "name": "InitAudioDevice", @@ -9378,190 +6251,127 @@ "name": "SetMasterVolume", "description": "Set master volume (listener)", "returnType": "void", - "params": [ - { - "type": "float", - "name": "volume" - } - ] + "params": { + "volume": "float" + } }, { "name": "LoadWave", "description": "Load wave data from file", "returnType": "Wave", - "params": [ - { - "type": "const char *", - "name": "fileName" - } - ] + "params": { + "fileName": "const char *" + } }, { "name": "LoadWaveFromMemory", "description": "Load wave from memory buffer, fileType refers to extension: i.e. '.wav'", "returnType": "Wave", - "params": [ - { - "type": "const char *", - "name": "fileType" - }, - { - "type": "const unsigned char *", - "name": "fileData" - }, - { - "type": "int", - "name": "dataSize" - } - ] + "params": { + "fileType": "const char *", + "fileData": "const unsigned char *", + "dataSize": "int" + } }, { "name": "LoadSound", "description": "Load sound from file", "returnType": "Sound", - "params": [ - { - "type": "const char *", - "name": "fileName" - } - ] + "params": { + "fileName": "const char *" + } }, { "name": "LoadSoundFromWave", "description": "Load sound from wave data", "returnType": "Sound", - "params": [ - { - "type": "Wave", - "name": "wave" - } - ] + "params": { + "wave": "Wave" + } }, { "name": "UpdateSound", "description": "Update sound buffer with new data", "returnType": "void", - "params": [ - { - "type": "Sound", - "name": "sound" - }, - { - "type": "const void *", - "name": "data" - }, - { - "type": "int", - "name": "sampleCount" - } - ] + "params": { + "sound": "Sound", + "data": "const void *", + "samplesCount": "int" + } }, { "name": "UnloadWave", "description": "Unload wave data", "returnType": "void", - "params": [ - { - "type": "Wave", - "name": "wave" - } - ] + "params": { + "wave": "Wave" + } }, { "name": "UnloadSound", "description": "Unload sound", "returnType": "void", - "params": [ - { - "type": "Sound", - "name": "sound" - } - ] + "params": { + "sound": "Sound" + } }, { "name": "ExportWave", "description": "Export wave data to file, returns true on success", "returnType": "bool", - "params": [ - { - "type": "Wave", - "name": "wave" - }, - { - "type": "const char *", - "name": "fileName" - } - ] + "params": { + "wave": "Wave", + "fileName": "const char *" + } }, { "name": "ExportWaveAsCode", "description": "Export wave sample data to code (.h), returns true on success", "returnType": "bool", - "params": [ - { - "type": "Wave", - "name": "wave" - }, - { - "type": "const char *", - "name": "fileName" - } - ] + "params": { + "wave": "Wave", + "fileName": "const char *" + } }, { "name": "PlaySound", "description": "Play a sound", "returnType": "void", - "params": [ - { - "type": "Sound", - "name": "sound" - } - ] + "params": { + "sound": "Sound" + } }, { "name": "StopSound", "description": "Stop playing a sound", "returnType": "void", - "params": [ - { - "type": "Sound", - "name": "sound" - } - ] + "params": { + "sound": "Sound" + } }, { "name": "PauseSound", "description": "Pause a sound", "returnType": "void", - "params": [ - { - "type": "Sound", - "name": "sound" - } - ] + "params": { + "sound": "Sound" + } }, { "name": "ResumeSound", "description": "Resume a paused sound", "returnType": "void", - "params": [ - { - "type": "Sound", - "name": "sound" - } - ] + "params": { + "sound": "Sound" + } }, { "name": "PlaySoundMulti", "description": "Play a sound (using multichannel buffer pool)", "returnType": "void", - "params": [ - { - "type": "Sound", - "name": "sound" - } - ] + "params": { + "sound": "Sound" + } }, { "name": "StopSoundMulti", @@ -9577,447 +6387,282 @@ "name": "IsSoundPlaying", "description": "Check if a sound is currently playing", "returnType": "bool", - "params": [ - { - "type": "Sound", - "name": "sound" - } - ] + "params": { + "sound": "Sound" + } }, { "name": "SetSoundVolume", "description": "Set volume for a sound (1.0 is max level)", "returnType": "void", - "params": [ - { - "type": "Sound", - "name": "sound" - }, - { - "type": "float", - "name": "volume" - } - ] + "params": { + "sound": "Sound", + "volume": "float" + } }, { "name": "SetSoundPitch", "description": "Set pitch for a sound (1.0 is base level)", "returnType": "void", - "params": [ - { - "type": "Sound", - "name": "sound" - }, - { - "type": "float", - "name": "pitch" - } - ] + "params": { + "sound": "Sound", + "pitch": "float" + } }, { "name": "WaveFormat", "description": "Convert wave data to desired format", "returnType": "void", - "params": [ - { - "type": "Wave *", - "name": "wave" - }, - { - "type": "int", - "name": "sampleRate" - }, - { - "type": "int", - "name": "sampleSize" - }, - { - "type": "int", - "name": "channels" - } - ] + "params": { + "wave": "Wave *", + "sampleRate": "int", + "sampleSize": "int", + "channels": "int" + } }, { "name": "WaveCopy", "description": "Copy a wave to a new wave", "returnType": "Wave", - "params": [ - { - "type": "Wave", - "name": "wave" - } - ] + "params": { + "wave": "Wave" + } }, { "name": "WaveCrop", "description": "Crop a wave to defined samples range", "returnType": "void", - "params": [ - { - "type": "Wave *", - "name": "wave" - }, - { - "type": "int", - "name": "initSample" - }, - { - "type": "int", - "name": "finalSample" - } - ] + "params": { + "wave": "Wave *", + "initSample": "int", + "finalSample": "int" + } }, { "name": "LoadWaveSamples", "description": "Load samples data from wave as a floats array", "returnType": "float *", - "params": [ - { - "type": "Wave", - "name": "wave" - } - ] + "params": { + "wave": "Wave" + } }, { "name": "UnloadWaveSamples", "description": "Unload samples data loaded with LoadWaveSamples()", "returnType": "void", - "params": [ - { - "type": "float *", - "name": "samples" - } - ] + "params": { + "samples": "float *" + } }, { "name": "LoadMusicStream", "description": "Load music stream from file", "returnType": "Music", - "params": [ - { - "type": "const char *", - "name": "fileName" - } - ] + "params": { + "fileName": "const char *" + } }, { "name": "LoadMusicStreamFromMemory", "description": "Load music stream from data", "returnType": "Music", - "params": [ - { - "type": "const char *", - "name": "fileType" - }, - { - "type": "unsigned char *", - "name": "data" - }, - { - "type": "int", - "name": "dataSize" - } - ] + "params": { + "fileType": "const char *", + "data": "unsigned char *", + "dataSize": "int" + } }, { "name": "UnloadMusicStream", "description": "Unload music stream", "returnType": "void", - "params": [ - { - "type": "Music", - "name": "music" - } - ] + "params": { + "music": "Music" + } }, { "name": "PlayMusicStream", "description": "Start music playing", "returnType": "void", - "params": [ - { - "type": "Music", - "name": "music" - } - ] + "params": { + "music": "Music" + } }, { "name": "IsMusicStreamPlaying", "description": "Check if music is playing", "returnType": "bool", - "params": [ - { - "type": "Music", - "name": "music" - } - ] + "params": { + "music": "Music" + } }, { "name": "UpdateMusicStream", "description": "Updates buffers for music streaming", "returnType": "void", - "params": [ - { - "type": "Music", - "name": "music" - } - ] + "params": { + "music": "Music" + } }, { "name": "StopMusicStream", "description": "Stop music playing", "returnType": "void", - "params": [ - { - "type": "Music", - "name": "music" - } - ] + "params": { + "music": "Music" + } }, { "name": "PauseMusicStream", "description": "Pause music playing", "returnType": "void", - "params": [ - { - "type": "Music", - "name": "music" - } - ] + "params": { + "music": "Music" + } }, { "name": "ResumeMusicStream", "description": "Resume playing paused music", "returnType": "void", - "params": [ - { - "type": "Music", - "name": "music" - } - ] - }, - { - "name": "SeekMusicStream", - "description": "Seek music to a position (in seconds)", - "returnType": "void", - "params": [ - { - "type": "Music", - "name": "music" - }, - { - "type": "float", - "name": "position" - } - ] + "params": { + "music": "Music" + } }, { "name": "SetMusicVolume", "description": "Set volume for music (1.0 is max level)", "returnType": "void", - "params": [ - { - "type": "Music", - "name": "music" - }, - { - "type": "float", - "name": "volume" - } - ] + "params": { + "music": "Music", + "volume": "float" + } }, { "name": "SetMusicPitch", "description": "Set pitch for a music (1.0 is base level)", "returnType": "void", - "params": [ - { - "type": "Music", - "name": "music" - }, - { - "type": "float", - "name": "pitch" - } - ] + "params": { + "music": "Music", + "pitch": "float" + } }, { "name": "GetMusicTimeLength", "description": "Get music time length (in seconds)", "returnType": "float", - "params": [ - { - "type": "Music", - "name": "music" - } - ] + "params": { + "music": "Music" + } }, { "name": "GetMusicTimePlayed", "description": "Get current music time played (in seconds)", "returnType": "float", - "params": [ - { - "type": "Music", - "name": "music" - } - ] + "params": { + "music": "Music" + } }, { "name": "LoadAudioStream", "description": "Load audio stream (to stream raw audio pcm data)", "returnType": "AudioStream", - "params": [ - { - "type": "unsigned int", - "name": "sampleRate" - }, - { - "type": "unsigned int", - "name": "sampleSize" - }, - { - "type": "unsigned int", - "name": "channels" - } - ] + "params": { + "sampleRate": "unsigned int", + "sampleSize": "unsigned int", + "channels": "unsigned int" + } }, { "name": "UnloadAudioStream", "description": "Unload audio stream and free memory", "returnType": "void", - "params": [ - { - "type": "AudioStream", - "name": "stream" - } - ] + "params": { + "stream": "AudioStream" + } }, { "name": "UpdateAudioStream", "description": "Update audio stream buffers with data", "returnType": "void", - "params": [ - { - "type": "AudioStream", - "name": "stream" - }, - { - "type": "const void *", - "name": "data" - }, - { - "type": "int", - "name": "frameCount" - } - ] + "params": { + "stream": "AudioStream", + "data": "const void *", + "samplesCount": "int" + } }, { "name": "IsAudioStreamProcessed", "description": "Check if any audio stream buffers requires refill", "returnType": "bool", - "params": [ - { - "type": "AudioStream", - "name": "stream" - } - ] + "params": { + "stream": "AudioStream" + } }, { "name": "PlayAudioStream", "description": "Play audio stream", "returnType": "void", - "params": [ - { - "type": "AudioStream", - "name": "stream" - } - ] + "params": { + "stream": "AudioStream" + } }, { "name": "PauseAudioStream", "description": "Pause audio stream", "returnType": "void", - "params": [ - { - "type": "AudioStream", - "name": "stream" - } - ] + "params": { + "stream": "AudioStream" + } }, { "name": "ResumeAudioStream", "description": "Resume audio stream", "returnType": "void", - "params": [ - { - "type": "AudioStream", - "name": "stream" - } - ] + "params": { + "stream": "AudioStream" + } }, { "name": "IsAudioStreamPlaying", "description": "Check if audio stream is playing", "returnType": "bool", - "params": [ - { - "type": "AudioStream", - "name": "stream" - } - ] + "params": { + "stream": "AudioStream" + } }, { "name": "StopAudioStream", "description": "Stop audio stream", "returnType": "void", - "params": [ - { - "type": "AudioStream", - "name": "stream" - } - ] + "params": { + "stream": "AudioStream" + } }, { "name": "SetAudioStreamVolume", "description": "Set volume for audio stream (1.0 is max level)", "returnType": "void", - "params": [ - { - "type": "AudioStream", - "name": "stream" - }, - { - "type": "float", - "name": "volume" - } - ] + "params": { + "stream": "AudioStream", + "volume": "float" + } }, { "name": "SetAudioStreamPitch", "description": "Set pitch for audio stream (1.0 is base level)", "returnType": "void", - "params": [ - { - "type": "AudioStream", - "name": "stream" - }, - { - "type": "float", - "name": "pitch" - } - ] + "params": { + "stream": "AudioStream", + "pitch": "float" + } }, { "name": "SetAudioStreamBufferSizeDefault", "description": "Default size for new audio streams", "returnType": "void", - "params": [ - { - "type": "int", - "name": "size" - } - ] + "params": { + "size": "int" + } } ] } diff --git a/src/Command/GenerateRaylibWrappers.php b/src/Command/GenerateRaylibWrappers.php new file mode 100644 index 0000000..daf481e --- /dev/null +++ b/src/Command/GenerateRaylibWrappers.php @@ -0,0 +1,294 @@ +structs as $struct) { + self::generateTypeFromDefinition($struct); + } + + self::$knownTypes = array_unique(self::$knownTypes); + + $fileGenerator = new FileGenerator(); + $functions = []; + $uses = []; + foreach ($spec->functions as $function) { + if (in_array($function->name, self::SKIP_FUNCTIONS)) { + continue; + } + + $functionDefinition = self::generateFunctionFromDefinition($function); + + $functions[] = $functionDefinition->generate(); + } + + $fileGenerator + ->setDeclares([DeclareStatement::strictTypes(1)]) + ->setUses($uses) + ->setBody(implode(PHP_EOL, $functions)) + ->setFilename(self::OUTPUT_DIR . '/functions.php') + ->setNamespace('Nawarian\\Raylib\\Generated') + ->write(); + } + + private static function generateFunctionFromDefinition(stdClass $definition): CustomMethodGenerator + { + $method = new CustomMethodGenerator(); + $method + ->setDocBlock(new DocBlockGenerator($definition->description)) + ->setName($definition->name) + ->removeFlag(AbstractMemberGenerator::FLAG_PUBLIC) + ->setIndentation(''); + + $params = []; + foreach ($definition->params ?? [] as $key => $param) { + $paramGen = new CustomParameterGenerator("param{$key}"); + $paramGen->setType(self::getTypeFromParam($param)); + $params[] = $paramGen; + } + + $method + ->setParameters($params) + ->setReturnType(self::getTypeFromParam($definition->returnType)); + + $paramsStr = implode( + ', ', + array_map(function (CustomParameterGenerator $param) { + $toCData = self::shouldCallToCData($param->getType()) ? '->toCData()' : ''; + + return "\${$param->getName()}{$toCData}"; + }, $params) + ); + $returnType = $method->getReturnType()->generate(); + $returnStr = $returnType !== 'void' ? 'return ' : ''; + + $raylibGlobalVar = '$raylib'; + $methodBody = ["global {$raylibGlobalVar};"]; + + if (in_array($returnType, self::$knownTypes)) { + $methodBody[] = "return {$returnType}::fromCData({$raylibGlobalVar}->{$definition->name}({$paramsStr}));"; + } else { + $methodBody[] = "{$returnStr}{$raylibGlobalVar}->{$definition->name}({$paramsStr});"; + } + + $method->setBody(implode(PHP_EOL, $methodBody)); + + return $method; + } + + private static function generateTypeFromDefinition(stdClass $definition): void + { + $class = new ClassGenerator($definition->name, 'Nawarian\\Raylib\\Generated'); + $constructor = new CustomMethodGenerator('__construct'); + $constructor->setVisibility(AbstractMemberGenerator::VISIBILITY_PUBLIC); + $class->addMethodFromGenerator($constructor); + + $constructorParams = []; + + foreach ($definition->fields as $field) { + $docBlock = new DocBlockGenerator($field->description); + + $newPropertyNames = [$field->name]; + if ($definition->name === 'Matrix') { + $newPropertyNames = array_map('trim', explode(', ', $field->name)); + } + foreach ($newPropertyNames as $propertyName) { + $propertyName = self::sanitizePropertyName($propertyName); + $property = new CustomPropertyGenerator($propertyName); + + $type = self::getTypeFromField($field); + + $property + ->addFlag(AbstractMemberGenerator::FLAG_PUBLIC) + ->setDocBlock($docBlock) + ->omitDefaultValue(true) + ->setType($type); + $class->addPropertyFromGenerator($property); + + $paramGen = new CustomParameterGenerator($propertyName); + $paramGen->setType($type); + + $constructorParams[] = $paramGen; + } + } + + $constructorBody = implode( + PHP_EOL, + array_map( + fn (CustomParameterGenerator $p) => "\$this->{$p->getName()} = \${$p->getName()};", + $constructorParams + ) + ); + $constructor + ->setParameters($constructorParams) + ->setBody($constructorBody); + + $class->addMethodFromGenerator(self::generateToCData($class)); + $class->addMethodFromGenerator(self::generateFromCData($class)); + + self::$knownTypes[] = '\\' . $class->getNamespaceName() . '\\' . $class->getName(); + + $fileGenerator = new FileGenerator(); + $fileGenerator + ->setDeclares([DeclareStatement::strictTypes(1)]) + ->setClass($class) + ->setFilename(self::OUTPUT_DIR . '/' . $definition->name . '.php') + ->write(); + } + + private static function generateFromCData(ClassGenerator $class): CustomMethodGenerator + { + $cdataParameter = new CustomParameterGenerator('cdata'); + $cdataParameter->setType(CData::class); + + $method = new CustomMethodGenerator('fromCData'); + + $constructorArgs = array_map(function (CustomPropertyGenerator $p) { + if (self::shouldCallToCData($p->getType())) { + return "{$p->getType()}::fromCData(\$cdata->{$p->getName()})"; + } + return "\$cdata->{$p->getName()}"; + }, $class->getProperties()); + $constructorArgs = implode(', ', $constructorArgs); + + return $method + ->setParameters([$cdataParameter]) + ->setBody( + "return new self({$constructorArgs});" + ) + ->setVisibility(AbstractMemberGenerator::VISIBILITY_PUBLIC) + ->setStatic(true); + } + + private static function generateToCData(ClassGenerator $class): CustomMethodGenerator + { + $class->addUse('FFI'); + + $method = new CustomMethodGenerator('toCData'); + $functionBody = [ + "global \$raylib;", + "\$type = \$raylib->new('{$class->getName()}');", + ]; + + /** @var CustomPropertyGenerator $property */ + foreach ($class->getProperties() as $property) { + $callToCData = self::shouldCallToCData($property->getType()) + ? '->toCData()' : ''; + + $functionBody[] = "\$type->{$property->getName()} = \$this->{$property->getName()}{$callToCData};"; + } + + $functionBody[] = 'return $type;'; + + $method + ->setVisibility(AbstractMemberGenerator::VISIBILITY_PUBLIC) + ->setReturnType(CData::class) + ->setBody(implode(PHP_EOL, $functionBody)); + + return $method; + } + + private static function shouldCallToCData(?string $type): bool + { + return match ($type) { + 'float', 'int', 'string', CData::class, 'array' => false, + default => true, + }; + } + + private static function sanitizePropertyName(string $name): string + { + return explode('[', $name)[0]; + } + + private static function getTypeFromField(stdClass $field): string + { + if (preg_match('#\[[\w]+\]$#', $field->name)) { + return 'array'; + } + + return match($field->type) { + 'char', 'const char *', 'char *' => 'string', + 'float' => 'float', + 'bool' => 'bool', + 'int', 'unsigned char', 'unsigned int' => 'int', + 'Texture', 'Rectangle', 'Image', 'Vector2', 'Vector3', 'Color', 'Shader', + 'Matrix', 'AudioStream', 'Camera2D', 'RenderTexture2D', 'VrStereoConfig', 'VrDeviceInfo' + => "\\Nawarian\\Raylib\\Generated\\{$field->type}", + 'Camera' => "\\Nawarian\\Raylib\\Generated\\Camera3D", + 'Texture2D' => "\\Nawarian\\Raylib\\Generated\\Texture", + 'Quaternion' => "\\Nawarian\\Raylib\\Generated\\Vector4", + 'CharInfo *' => "\\Nawarian\\Raylib\\Generated\\CharInfo", + 'Rectangle *', 'Rectangle **', 'GlyphInfo *', 'float *', 'unsigned char *', 'unsigned short *', + 'MaterialMap *', 'unsigned int *', 'int *', 'Mesh *', 'Material *', 'BoneInfo *', 'Transform *', + 'Transform **' => 'array', + 'void *', 'rAudioBuffer *', 'const void *' => CData::class, + default => throw new RuntimeException("Unknown type {$field->type} found at raylib_api.json.") + }; + } + + private static function getTypeFromParam(string $param): string + { + return match($param) { + 'char', 'const char *', 'char *' => 'string', + 'double', 'float' => 'float', + 'bool' => 'bool', + 'void' => 'void', + 'long', 'int', 'unsigned char', 'unsigned int' => 'int', + 'Texture', 'Rectangle', 'Image', 'Vector2', 'Vector3', 'Color', 'Shader', 'Font', 'NPatchInfo', 'Vector4', + 'Matrix', 'AudioStream', 'Camera2D', 'Camera3D', 'RenderTexture', 'VrStereoConfig', 'VrDeviceInfo', 'Ray', + 'Mesh', 'Model', 'BoundingBox', 'Material', 'ModelAnimation', 'Wave', 'Sound', 'Music', 'GlyphInfo', + 'RayCollision' => "\\Nawarian\\Raylib\\Generated\\{$param}", + 'Camera', 'Camera *' => "\\Nawarian\\Raylib\\Generated\\Camera3D", + 'Color *' => "\\Nawarian\\Raylib\\Generated\\Color", + 'CharInfo *', 'const CharInfo *' => "\\Nawarian\\Raylib\\Generated\\CharInfo", + 'Image *' => "\\Nawarian\\Raylib\\Generated\\Image", + 'Model *' => "\\Nawarian\\Raylib\\Generated\\Model", + 'Vector2 *' => "\\Nawarian\\Raylib\\Generated\\Vector2", + 'GlyphInfo *', 'const GlyphInfo *' => "\\Nawarian\\Raylib\\Generated\\GlyphInfo", + 'Texture2D', 'Texture2D *', 'TextureCubemap' => "\\Nawarian\\Raylib\\Generated\\Texture", + 'Quaternion' => "\\Nawarian\\Raylib\\Generated\\Vector4", + 'Wave *' => "\\Nawarian\\Raylib\\Generated\\Wave", + 'RenderTexture2D' => "\\Nawarian\\Raylib\\Generated\\RenderTexture", + 'Rectangle *', 'Rectangle **', 'float *', 'unsigned char *', 'const unsigned char *', + 'unsigned short *', 'MaterialMap *', 'unsigned int *', 'int *', 'Mesh *', 'Material *', 'BoneInfo *', + 'Transform *', 'Transform **', 'Vector3 *', 'Matrix *', 'ModelAnimation*', 'ModelAnimation *', 'char **', + 'const char **' => 'array', + 'void *', 'rAudioBuffer *', 'const void *' => CData::class, + default => throw new RuntimeException("Unknown type {$param} found at raylib_api.json.") + }; + } +} diff --git a/src/Generator/CustomMethodGenerator.php b/src/Generator/CustomMethodGenerator.php new file mode 100644 index 0000000..0e5c1fa --- /dev/null +++ b/src/Generator/CustomMethodGenerator.php @@ -0,0 +1,22 @@ +flags & self::FLAG_PROTECTED: + return self::VISIBILITY_PROTECTED; + case $this->flags & self::FLAG_PRIVATE: + return self::VISIBILITY_PRIVATE; + case $this->flags & self::FLAG_PUBLIC: + return self::VISIBILITY_PUBLIC; + default: + return ''; + } + } +} diff --git a/src/Generator/CustomParameterGenerator.php b/src/Generator/CustomParameterGenerator.php new file mode 100644 index 0000000..7ca97ef --- /dev/null +++ b/src/Generator/CustomParameterGenerator.php @@ -0,0 +1,49 @@ +generateTypeHint(); + + if (true === $this->passedByReference) { + $output .= '&'; + } + + if ($this->variadic) { + $output .= '... '; + } + + $output .= '$' . $this->name; + + if ($this->omitDefaultValue) { + return $output; + } + + if ($this->defaultValue instanceof ValueGenerator) { + $output .= ' = '; + $this->defaultValue->setOutputMode(ValueGenerator::OUTPUT_SINGLE_LINE); + $output .= $this->defaultValue; + } + + return $output; + } + + private function generateTypeHint() + { + if (null === $this->type) { + return ''; + } + + return $this->type->generate() . ' '; + } +} diff --git a/src/Generator/CustomPropertyGenerator.php b/src/Generator/CustomPropertyGenerator.php new file mode 100644 index 0000000..7364ad9 --- /dev/null +++ b/src/Generator/CustomPropertyGenerator.php @@ -0,0 +1,68 @@ +type; + } + + public function setType(?string $type): self + { + $this->type = $type; + + return $this; + } + + public function generate(): string + { + $name = $this->getName(); + $defaultValue = $this->getDefaultValue(); + + $output = ''; + + if (($docBlock = $this->getDocBlock()) !== null) { + $docBlock->setIndentation(' '); + $output .= $docBlock->generate(); + } + + if ($this->isConst()) { + if ($defaultValue !== null && ! $defaultValue->isValidConstantType()) { + throw new RuntimeException(sprintf( + 'The property %s is said to be ' + . 'constant but does not have a valid constant value.', + $this->name + )); + } + return $output + . $this->indentation + . ($this->isFinal() ? 'final ' : '') + . $this->getVisibility() + . ' const ' + . $name . ' = ' + . ($defaultValue !== null ? $defaultValue->generate() : 'null;'); + } + + $output .= $this->indentation + . $this->getVisibility() + . ($this->isReadonly() ? ' readonly' : '') + . ($this->isStatic() ? ' static' : '') + . ($this->getType() ? " {$this->getType()}" : '') + . ' $' . $name; + + if ($this->omitDefaultValue()) { + return $output . ';'; + } + + return $output . ' = ' . ($defaultValue !== null ? $defaultValue->generate() : 'null;'); + } +} From e9c4df7a93e14f258c402c8ba074ff9de60d27cc Mon Sep 17 00:00:00 2001 From: Nawarian Date: Tue, 22 Feb 2022 19:45:19 +0100 Subject: [PATCH 3/3] Extract generators into their own classes --- generated/AudioStream.php | 7 +- generated/BoneInfo.php | 17 +- generated/BoundingBox.php | 7 +- generated/Camera2D.php | 7 +- generated/Camera3D.php | 7 +- generated/CharInfo.php | 7 +- generated/Color.php | 7 +- generated/Font.php | 7 +- generated/Image.php | 7 +- generated/Material.php | 17 +- generated/MaterialMap.php | 7 +- generated/Matrix.php | 7 +- generated/Mesh.php | 7 +- generated/Model.php | 13 +- generated/ModelAnimation.php | 7 +- generated/Music.php | 7 +- generated/NPatchInfo.php | 7 +- generated/Ray.php | 7 +- generated/RayCollision.php | 7 +- generated/Rectangle.php | 7 +- generated/RenderTexture.php | 7 +- generated/Shader.php | 7 +- generated/Sound.php | 7 +- generated/Texture.php | 7 +- generated/Transform.php | 7 +- generated/Vector2.php | 7 +- generated/Vector3.php | 7 +- generated/Vector4.php | 7 +- generated/VrDeviceInfo.php | 23 +- generated/VrStereoConfig.php | 59 +- generated/Wave.php | 7 +- generated/functions.php | 2772 ++++++++++---------- src/Command/GenerateRaylibWrappers.php | 261 +- src/Generator/RaylibClassTypeGenerator.php | 153 ++ src/Generator/RaylibFieldGenerator.php | 117 + src/Generator/RaylibFunctionGenerator.php | 115 + 36 files changed, 1894 insertions(+), 1835 deletions(-) create mode 100644 src/Generator/RaylibClassTypeGenerator.php create mode 100644 src/Generator/RaylibFieldGenerator.php create mode 100644 src/Generator/RaylibFunctionGenerator.php diff --git a/generated/AudioStream.php b/generated/AudioStream.php index f8aab88..14f66bb 100644 --- a/generated/AudioStream.php +++ b/generated/AudioStream.php @@ -4,8 +4,6 @@ namespace Nawarian\Raylib\Generated; -use FFI; - class AudioStream { /** @@ -36,7 +34,7 @@ public function __construct(\FFI\CData $buffer, int $sampleRate, int $sampleSize $this->channels = $channels; } - public function toCData() : \FFI\CData + public function toCData(): \FFI\CData { global $raylib; $type = $raylib->new('AudioStream'); @@ -47,9 +45,8 @@ public function toCData() : \FFI\CData return $type; } - public static function fromCData(\FFI\CData $cdata) + public static function fromCData(\FFI\CData $cdata): \Nawarian\Raylib\Generated\AudioStream { return new self($cdata->buffer, $cdata->sampleRate, $cdata->sampleSize, $cdata->channels); } } - diff --git a/generated/BoneInfo.php b/generated/BoneInfo.php index 5e207bc..418da57 100644 --- a/generated/BoneInfo.php +++ b/generated/BoneInfo.php @@ -4,38 +4,35 @@ namespace Nawarian\Raylib\Generated; -use FFI; - class BoneInfo { /** * Bone name */ - public array $name; + public array $name[32]; /** * Bone parent */ public int $parent; - public function __construct(array $name, int $parent) + public function __construct(array $name[32], int $parent) { - $this->name = $name; + $this->name[32] = $name[32]; $this->parent = $parent; } - public function toCData() : \FFI\CData + public function toCData(): \FFI\CData { global $raylib; $type = $raylib->new('BoneInfo'); - $type->name = $this->name; + $type->name[32] = $this->name[32]; $type->parent = $this->parent; return $type; } - public static function fromCData(\FFI\CData $cdata) + public static function fromCData(\FFI\CData $cdata): \Nawarian\Raylib\Generated\BoneInfo { - return new self($cdata->name, $cdata->parent); + return new self($cdata->name[32], $cdata->parent); } } - diff --git a/generated/BoundingBox.php b/generated/BoundingBox.php index d2c0d34..f2937b8 100644 --- a/generated/BoundingBox.php +++ b/generated/BoundingBox.php @@ -4,8 +4,6 @@ namespace Nawarian\Raylib\Generated; -use FFI; - class BoundingBox { /** @@ -24,7 +22,7 @@ public function __construct(\Nawarian\Raylib\Generated\Vector3 $min, \Nawarian\R $this->max = $max; } - public function toCData() : \FFI\CData + public function toCData(): \FFI\CData { global $raylib; $type = $raylib->new('BoundingBox'); @@ -33,9 +31,8 @@ public function toCData() : \FFI\CData return $type; } - public static function fromCData(\FFI\CData $cdata) + public static function fromCData(\FFI\CData $cdata): \Nawarian\Raylib\Generated\BoundingBox { return new self(\Nawarian\Raylib\Generated\Vector3::fromCData($cdata->min), \Nawarian\Raylib\Generated\Vector3::fromCData($cdata->max)); } } - diff --git a/generated/Camera2D.php b/generated/Camera2D.php index 29682e1..144f12e 100644 --- a/generated/Camera2D.php +++ b/generated/Camera2D.php @@ -4,8 +4,6 @@ namespace Nawarian\Raylib\Generated; -use FFI; - class Camera2D { /** @@ -36,7 +34,7 @@ public function __construct(\Nawarian\Raylib\Generated\Vector2 $offset, \Nawaria $this->zoom = $zoom; } - public function toCData() : \FFI\CData + public function toCData(): \FFI\CData { global $raylib; $type = $raylib->new('Camera2D'); @@ -47,9 +45,8 @@ public function toCData() : \FFI\CData return $type; } - public static function fromCData(\FFI\CData $cdata) + public static function fromCData(\FFI\CData $cdata): \Nawarian\Raylib\Generated\Camera2D { return new self(\Nawarian\Raylib\Generated\Vector2::fromCData($cdata->offset), \Nawarian\Raylib\Generated\Vector2::fromCData($cdata->target), $cdata->rotation, $cdata->zoom); } } - diff --git a/generated/Camera3D.php b/generated/Camera3D.php index 6900c34..928555e 100644 --- a/generated/Camera3D.php +++ b/generated/Camera3D.php @@ -4,8 +4,6 @@ namespace Nawarian\Raylib\Generated; -use FFI; - class Camera3D { /** @@ -43,7 +41,7 @@ public function __construct(\Nawarian\Raylib\Generated\Vector3 $position, \Nawar $this->projection = $projection; } - public function toCData() : \FFI\CData + public function toCData(): \FFI\CData { global $raylib; $type = $raylib->new('Camera3D'); @@ -55,9 +53,8 @@ public function toCData() : \FFI\CData return $type; } - public static function fromCData(\FFI\CData $cdata) + public static function fromCData(\FFI\CData $cdata): \Nawarian\Raylib\Generated\Camera3D { return new self(\Nawarian\Raylib\Generated\Vector3::fromCData($cdata->position), \Nawarian\Raylib\Generated\Vector3::fromCData($cdata->target), \Nawarian\Raylib\Generated\Vector3::fromCData($cdata->up), $cdata->fovy, $cdata->projection); } } - diff --git a/generated/CharInfo.php b/generated/CharInfo.php index 572c87c..ffd853b 100644 --- a/generated/CharInfo.php +++ b/generated/CharInfo.php @@ -4,8 +4,6 @@ namespace Nawarian\Raylib\Generated; -use FFI; - class CharInfo { /** @@ -42,7 +40,7 @@ public function __construct(int $value, int $offsetX, int $offsetY, int $advance $this->image = $image; } - public function toCData() : \FFI\CData + public function toCData(): \FFI\CData { global $raylib; $type = $raylib->new('CharInfo'); @@ -54,9 +52,8 @@ public function toCData() : \FFI\CData return $type; } - public static function fromCData(\FFI\CData $cdata) + public static function fromCData(\FFI\CData $cdata): \Nawarian\Raylib\Generated\CharInfo { return new self($cdata->value, $cdata->offsetX, $cdata->offsetY, $cdata->advanceX, \Nawarian\Raylib\Generated\Image::fromCData($cdata->image)); } } - diff --git a/generated/Color.php b/generated/Color.php index 0200f6f..85d68e5 100644 --- a/generated/Color.php +++ b/generated/Color.php @@ -4,8 +4,6 @@ namespace Nawarian\Raylib\Generated; -use FFI; - class Color { /** @@ -36,7 +34,7 @@ public function __construct(int $r, int $g, int $b, int $a) $this->a = $a; } - public function toCData() : \FFI\CData + public function toCData(): \FFI\CData { global $raylib; $type = $raylib->new('Color'); @@ -47,9 +45,8 @@ public function toCData() : \FFI\CData return $type; } - public static function fromCData(\FFI\CData $cdata) + public static function fromCData(\FFI\CData $cdata): \Nawarian\Raylib\Generated\Color { return new self($cdata->r, $cdata->g, $cdata->b, $cdata->a); } } - diff --git a/generated/Font.php b/generated/Font.php index aab971d..1e8798c 100644 --- a/generated/Font.php +++ b/generated/Font.php @@ -4,8 +4,6 @@ namespace Nawarian\Raylib\Generated; -use FFI; - class Font { /** @@ -48,7 +46,7 @@ public function __construct(int $baseSize, int $charsCount, int $charsPadding, \ $this->chars = $chars; } - public function toCData() : \FFI\CData + public function toCData(): \FFI\CData { global $raylib; $type = $raylib->new('Font'); @@ -61,9 +59,8 @@ public function toCData() : \FFI\CData return $type; } - public static function fromCData(\FFI\CData $cdata) + public static function fromCData(\FFI\CData $cdata): \Nawarian\Raylib\Generated\Font { return new self($cdata->baseSize, $cdata->charsCount, $cdata->charsPadding, \Nawarian\Raylib\Generated\Texture::fromCData($cdata->texture), $cdata->recs, \Nawarian\Raylib\Generated\CharInfo::fromCData($cdata->chars)); } } - diff --git a/generated/Image.php b/generated/Image.php index 0aca515..5598226 100644 --- a/generated/Image.php +++ b/generated/Image.php @@ -4,8 +4,6 @@ namespace Nawarian\Raylib\Generated; -use FFI; - class Image { /** @@ -42,7 +40,7 @@ public function __construct(\FFI\CData $data, int $width, int $height, int $mipm $this->format = $format; } - public function toCData() : \FFI\CData + public function toCData(): \FFI\CData { global $raylib; $type = $raylib->new('Image'); @@ -54,9 +52,8 @@ public function toCData() : \FFI\CData return $type; } - public static function fromCData(\FFI\CData $cdata) + public static function fromCData(\FFI\CData $cdata): \Nawarian\Raylib\Generated\Image { return new self($cdata->data, $cdata->width, $cdata->height, $cdata->mipmaps, $cdata->format); } } - diff --git a/generated/Material.php b/generated/Material.php index f57fd7b..8b3e624 100644 --- a/generated/Material.php +++ b/generated/Material.php @@ -4,8 +4,6 @@ namespace Nawarian\Raylib\Generated; -use FFI; - class Material { /** @@ -21,28 +19,27 @@ class Material /** * Material generic parameters (if required) */ - public array $params; + public array $params[4]; - public function __construct(\Nawarian\Raylib\Generated\Shader $shader, array $maps, array $params) + public function __construct(\Nawarian\Raylib\Generated\Shader $shader, array $maps, array $params[4]) { $this->shader = $shader; $this->maps = $maps; - $this->params = $params; + $this->params[4] = $params[4]; } - public function toCData() : \FFI\CData + public function toCData(): \FFI\CData { global $raylib; $type = $raylib->new('Material'); $type->shader = $this->shader->toCData(); $type->maps = $this->maps; - $type->params = $this->params; + $type->params[4] = $this->params[4]; return $type; } - public static function fromCData(\FFI\CData $cdata) + public static function fromCData(\FFI\CData $cdata): \Nawarian\Raylib\Generated\Material { - return new self(\Nawarian\Raylib\Generated\Shader::fromCData($cdata->shader), $cdata->maps, $cdata->params); + return new self(\Nawarian\Raylib\Generated\Shader::fromCData($cdata->shader), $cdata->maps, $cdata->params[4]); } } - diff --git a/generated/MaterialMap.php b/generated/MaterialMap.php index 090c9e4..27e20e6 100644 --- a/generated/MaterialMap.php +++ b/generated/MaterialMap.php @@ -4,8 +4,6 @@ namespace Nawarian\Raylib\Generated; -use FFI; - class MaterialMap { /** @@ -30,7 +28,7 @@ public function __construct(\Nawarian\Raylib\Generated\Texture $texture, \Nawari $this->value = $value; } - public function toCData() : \FFI\CData + public function toCData(): \FFI\CData { global $raylib; $type = $raylib->new('MaterialMap'); @@ -40,9 +38,8 @@ public function toCData() : \FFI\CData return $type; } - public static function fromCData(\FFI\CData $cdata) + public static function fromCData(\FFI\CData $cdata): \Nawarian\Raylib\Generated\MaterialMap { return new self(\Nawarian\Raylib\Generated\Texture::fromCData($cdata->texture), \Nawarian\Raylib\Generated\Color::fromCData($cdata->color), $cdata->value); } } - diff --git a/generated/Matrix.php b/generated/Matrix.php index 1a6992e..52501cd1 100644 --- a/generated/Matrix.php +++ b/generated/Matrix.php @@ -4,8 +4,6 @@ namespace Nawarian\Raylib\Generated; -use FFI; - class Matrix { /** @@ -108,7 +106,7 @@ public function __construct(float $m0, float $m4, float $m8, float $m12, float $ $this->m15 = $m15; } - public function toCData() : \FFI\CData + public function toCData(): \FFI\CData { global $raylib; $type = $raylib->new('Matrix'); @@ -131,9 +129,8 @@ public function toCData() : \FFI\CData return $type; } - public static function fromCData(\FFI\CData $cdata) + public static function fromCData(\FFI\CData $cdata): \Nawarian\Raylib\Generated\Matrix { return new self($cdata->m0, $cdata->m4, $cdata->m8, $cdata->m12, $cdata->m1, $cdata->m5, $cdata->m9, $cdata->m13, $cdata->m2, $cdata->m6, $cdata->m10, $cdata->m14, $cdata->m3, $cdata->m7, $cdata->m11, $cdata->m15); } } - diff --git a/generated/Mesh.php b/generated/Mesh.php index 77f4605..6870c11 100644 --- a/generated/Mesh.php +++ b/generated/Mesh.php @@ -4,8 +4,6 @@ namespace Nawarian\Raylib\Generated; -use FFI; - class Mesh { /** @@ -102,7 +100,7 @@ public function __construct(int $vertexCount, int $triangleCount, array $vertice $this->vboId = $vboId; } - public function toCData() : \FFI\CData + public function toCData(): \FFI\CData { global $raylib; $type = $raylib->new('Mesh'); @@ -124,9 +122,8 @@ public function toCData() : \FFI\CData return $type; } - public static function fromCData(\FFI\CData $cdata) + public static function fromCData(\FFI\CData $cdata): \Nawarian\Raylib\Generated\Mesh { return new self($cdata->vertexCount, $cdata->triangleCount, $cdata->vertices, $cdata->texcoords, $cdata->texcoords2, $cdata->normals, $cdata->tangents, $cdata->colors, $cdata->indices, $cdata->animVertices, $cdata->animNormals, $cdata->boneIds, $cdata->boneWeights, $cdata->vaoId, $cdata->vboId); } } - diff --git a/generated/Model.php b/generated/Model.php index 44315f6..5748061 100644 --- a/generated/Model.php +++ b/generated/Model.php @@ -4,8 +4,6 @@ namespace Nawarian\Raylib\Generated; -use FFI; - class Model { /** @@ -66,7 +64,7 @@ public function __construct(\Nawarian\Raylib\Generated\Matrix $transform, int $m $this->bindPose = $bindPose; } - public function toCData() : \FFI\CData + public function toCData(): \FFI\CData { global $raylib; $type = $raylib->new('Model'); @@ -82,13 +80,8 @@ public function toCData() : \FFI\CData return $type; } - public static function fromCData(\FFI\CData $cdata) + public static function fromCData(\FFI\CData $cdata): \Nawarian\Raylib\Generated\Model { - return new self( - \Nawarian\Raylib\Generated\Matrix::fromCData($cdata->transform), - $cdata->meshCount, - $cdata->materialCount, - $cdata->meshes, $cdata->materials, $cdata->meshMaterial, $cdata->boneCount, $cdata->bones, $cdata->bindPose); + return new self(\Nawarian\Raylib\Generated\Matrix::fromCData($cdata->transform), $cdata->meshCount, $cdata->materialCount, $cdata->meshes, $cdata->materials, $cdata->meshMaterial, $cdata->boneCount, $cdata->bones, $cdata->bindPose); } } - diff --git a/generated/ModelAnimation.php b/generated/ModelAnimation.php index c61b8b3..31e36de 100644 --- a/generated/ModelAnimation.php +++ b/generated/ModelAnimation.php @@ -4,8 +4,6 @@ namespace Nawarian\Raylib\Generated; -use FFI; - class ModelAnimation { /** @@ -36,7 +34,7 @@ public function __construct(int $boneCount, int $frameCount, array $bones, array $this->framePoses = $framePoses; } - public function toCData() : \FFI\CData + public function toCData(): \FFI\CData { global $raylib; $type = $raylib->new('ModelAnimation'); @@ -47,9 +45,8 @@ public function toCData() : \FFI\CData return $type; } - public static function fromCData(\FFI\CData $cdata) + public static function fromCData(\FFI\CData $cdata): \Nawarian\Raylib\Generated\ModelAnimation { return new self($cdata->boneCount, $cdata->frameCount, $cdata->bones, $cdata->framePoses); } } - diff --git a/generated/Music.php b/generated/Music.php index 61ae40b..ca55003 100644 --- a/generated/Music.php +++ b/generated/Music.php @@ -4,8 +4,6 @@ namespace Nawarian\Raylib\Generated; -use FFI; - class Music { /** @@ -42,7 +40,7 @@ public function __construct(\Nawarian\Raylib\Generated\AudioStream $stream, int $this->ctxData = $ctxData; } - public function toCData() : \FFI\CData + public function toCData(): \FFI\CData { global $raylib; $type = $raylib->new('Music'); @@ -54,9 +52,8 @@ public function toCData() : \FFI\CData return $type; } - public static function fromCData(\FFI\CData $cdata) + public static function fromCData(\FFI\CData $cdata): \Nawarian\Raylib\Generated\Music { return new self(\Nawarian\Raylib\Generated\AudioStream::fromCData($cdata->stream), $cdata->sampleCount, bool::fromCData($cdata->looping), $cdata->ctxType, $cdata->ctxData); } } - diff --git a/generated/NPatchInfo.php b/generated/NPatchInfo.php index 4680475..4fbd95f 100644 --- a/generated/NPatchInfo.php +++ b/generated/NPatchInfo.php @@ -4,8 +4,6 @@ namespace Nawarian\Raylib\Generated; -use FFI; - class NPatchInfo { /** @@ -48,7 +46,7 @@ public function __construct(\Nawarian\Raylib\Generated\Rectangle $source, int $l $this->layout = $layout; } - public function toCData() : \FFI\CData + public function toCData(): \FFI\CData { global $raylib; $type = $raylib->new('NPatchInfo'); @@ -61,9 +59,8 @@ public function toCData() : \FFI\CData return $type; } - public static function fromCData(\FFI\CData $cdata) + public static function fromCData(\FFI\CData $cdata): \Nawarian\Raylib\Generated\NPatchInfo { return new self(\Nawarian\Raylib\Generated\Rectangle::fromCData($cdata->source), $cdata->left, $cdata->top, $cdata->right, $cdata->bottom, $cdata->layout); } } - diff --git a/generated/Ray.php b/generated/Ray.php index c17de1c..32e8350 100644 --- a/generated/Ray.php +++ b/generated/Ray.php @@ -4,8 +4,6 @@ namespace Nawarian\Raylib\Generated; -use FFI; - class Ray { /** @@ -24,7 +22,7 @@ public function __construct(\Nawarian\Raylib\Generated\Vector3 $position, \Nawar $this->direction = $direction; } - public function toCData() : \FFI\CData + public function toCData(): \FFI\CData { global $raylib; $type = $raylib->new('Ray'); @@ -33,9 +31,8 @@ public function toCData() : \FFI\CData return $type; } - public static function fromCData(\FFI\CData $cdata) + public static function fromCData(\FFI\CData $cdata): \Nawarian\Raylib\Generated\Ray { return new self(\Nawarian\Raylib\Generated\Vector3::fromCData($cdata->position), \Nawarian\Raylib\Generated\Vector3::fromCData($cdata->direction)); } } - diff --git a/generated/RayCollision.php b/generated/RayCollision.php index f61292a..8c42cc6 100644 --- a/generated/RayCollision.php +++ b/generated/RayCollision.php @@ -4,8 +4,6 @@ namespace Nawarian\Raylib\Generated; -use FFI; - class RayCollision { /** @@ -36,7 +34,7 @@ public function __construct(bool $hit, float $distance, \Nawarian\Raylib\Generat $this->normal = $normal; } - public function toCData() : \FFI\CData + public function toCData(): \FFI\CData { global $raylib; $type = $raylib->new('RayCollision'); @@ -47,9 +45,8 @@ public function toCData() : \FFI\CData return $type; } - public static function fromCData(\FFI\CData $cdata) + public static function fromCData(\FFI\CData $cdata): \Nawarian\Raylib\Generated\RayCollision { return new self(bool::fromCData($cdata->hit), $cdata->distance, \Nawarian\Raylib\Generated\Vector3::fromCData($cdata->point), \Nawarian\Raylib\Generated\Vector3::fromCData($cdata->normal)); } } - diff --git a/generated/Rectangle.php b/generated/Rectangle.php index fb41245..450c55d 100644 --- a/generated/Rectangle.php +++ b/generated/Rectangle.php @@ -4,8 +4,6 @@ namespace Nawarian\Raylib\Generated; -use FFI; - class Rectangle { /** @@ -36,7 +34,7 @@ public function __construct(float $x, float $y, float $width, float $height) $this->height = $height; } - public function toCData() : \FFI\CData + public function toCData(): \FFI\CData { global $raylib; $type = $raylib->new('Rectangle'); @@ -47,9 +45,8 @@ public function toCData() : \FFI\CData return $type; } - public static function fromCData(\FFI\CData $cdata) + public static function fromCData(\FFI\CData $cdata): \Nawarian\Raylib\Generated\Rectangle { return new self($cdata->x, $cdata->y, $cdata->width, $cdata->height); } } - diff --git a/generated/RenderTexture.php b/generated/RenderTexture.php index c58014e..444db4d 100644 --- a/generated/RenderTexture.php +++ b/generated/RenderTexture.php @@ -4,8 +4,6 @@ namespace Nawarian\Raylib\Generated; -use FFI; - class RenderTexture { /** @@ -30,7 +28,7 @@ public function __construct(int $id, \Nawarian\Raylib\Generated\Texture $texture $this->depth = $depth; } - public function toCData() : \FFI\CData + public function toCData(): \FFI\CData { global $raylib; $type = $raylib->new('RenderTexture'); @@ -40,9 +38,8 @@ public function toCData() : \FFI\CData return $type; } - public static function fromCData(\FFI\CData $cdata) + public static function fromCData(\FFI\CData $cdata): \Nawarian\Raylib\Generated\RenderTexture { return new self($cdata->id, \Nawarian\Raylib\Generated\Texture::fromCData($cdata->texture), \Nawarian\Raylib\Generated\Texture::fromCData($cdata->depth)); } } - diff --git a/generated/Shader.php b/generated/Shader.php index a40d125..ed96602 100644 --- a/generated/Shader.php +++ b/generated/Shader.php @@ -4,8 +4,6 @@ namespace Nawarian\Raylib\Generated; -use FFI; - class Shader { /** @@ -24,7 +22,7 @@ public function __construct(int $id, array $locs) $this->locs = $locs; } - public function toCData() : \FFI\CData + public function toCData(): \FFI\CData { global $raylib; $type = $raylib->new('Shader'); @@ -33,9 +31,8 @@ public function toCData() : \FFI\CData return $type; } - public static function fromCData(\FFI\CData $cdata) + public static function fromCData(\FFI\CData $cdata): \Nawarian\Raylib\Generated\Shader { return new self($cdata->id, $cdata->locs); } } - diff --git a/generated/Sound.php b/generated/Sound.php index 60a443d..f44012f 100644 --- a/generated/Sound.php +++ b/generated/Sound.php @@ -4,8 +4,6 @@ namespace Nawarian\Raylib\Generated; -use FFI; - class Sound { /** @@ -24,7 +22,7 @@ public function __construct(\Nawarian\Raylib\Generated\AudioStream $stream, int $this->frameCount = $frameCount; } - public function toCData() : \FFI\CData + public function toCData(): \FFI\CData { global $raylib; $type = $raylib->new('Sound'); @@ -33,9 +31,8 @@ public function toCData() : \FFI\CData return $type; } - public static function fromCData(\FFI\CData $cdata) + public static function fromCData(\FFI\CData $cdata): \Nawarian\Raylib\Generated\Sound { return new self(\Nawarian\Raylib\Generated\AudioStream::fromCData($cdata->stream), $cdata->frameCount); } } - diff --git a/generated/Texture.php b/generated/Texture.php index 3c1ad35..37c1862 100644 --- a/generated/Texture.php +++ b/generated/Texture.php @@ -4,8 +4,6 @@ namespace Nawarian\Raylib\Generated; -use FFI; - class Texture { /** @@ -42,7 +40,7 @@ public function __construct(int $id, int $width, int $height, int $mipmaps, int $this->format = $format; } - public function toCData() : \FFI\CData + public function toCData(): \FFI\CData { global $raylib; $type = $raylib->new('Texture'); @@ -54,9 +52,8 @@ public function toCData() : \FFI\CData return $type; } - public static function fromCData(\FFI\CData $cdata) + public static function fromCData(\FFI\CData $cdata): \Nawarian\Raylib\Generated\Texture { return new self($cdata->id, $cdata->width, $cdata->height, $cdata->mipmaps, $cdata->format); } } - diff --git a/generated/Transform.php b/generated/Transform.php index 22e2917..b685d87 100644 --- a/generated/Transform.php +++ b/generated/Transform.php @@ -4,8 +4,6 @@ namespace Nawarian\Raylib\Generated; -use FFI; - class Transform { /** @@ -30,7 +28,7 @@ public function __construct(\Nawarian\Raylib\Generated\Vector3 $translation, \Na $this->scale = $scale; } - public function toCData() : \FFI\CData + public function toCData(): \FFI\CData { global $raylib; $type = $raylib->new('Transform'); @@ -40,9 +38,8 @@ public function toCData() : \FFI\CData return $type; } - public static function fromCData(\FFI\CData $cdata) + public static function fromCData(\FFI\CData $cdata): \Nawarian\Raylib\Generated\Transform { return new self(\Nawarian\Raylib\Generated\Vector3::fromCData($cdata->translation), \Nawarian\Raylib\Generated\Vector4::fromCData($cdata->rotation), \Nawarian\Raylib\Generated\Vector3::fromCData($cdata->scale)); } } - diff --git a/generated/Vector2.php b/generated/Vector2.php index ecd90c9..d26815b 100644 --- a/generated/Vector2.php +++ b/generated/Vector2.php @@ -4,8 +4,6 @@ namespace Nawarian\Raylib\Generated; -use FFI; - class Vector2 { /** @@ -24,7 +22,7 @@ public function __construct(float $x, float $y) $this->y = $y; } - public function toCData() : \FFI\CData + public function toCData(): \FFI\CData { global $raylib; $type = $raylib->new('Vector2'); @@ -33,9 +31,8 @@ public function toCData() : \FFI\CData return $type; } - public static function fromCData(\FFI\CData $cdata) + public static function fromCData(\FFI\CData $cdata): \Nawarian\Raylib\Generated\Vector2 { return new self($cdata->x, $cdata->y); } } - diff --git a/generated/Vector3.php b/generated/Vector3.php index 13b3e2f..dbe3145 100644 --- a/generated/Vector3.php +++ b/generated/Vector3.php @@ -4,8 +4,6 @@ namespace Nawarian\Raylib\Generated; -use FFI; - class Vector3 { /** @@ -30,7 +28,7 @@ public function __construct(float $x, float $y, float $z) $this->z = $z; } - public function toCData() : \FFI\CData + public function toCData(): \FFI\CData { global $raylib; $type = $raylib->new('Vector3'); @@ -40,9 +38,8 @@ public function toCData() : \FFI\CData return $type; } - public static function fromCData(\FFI\CData $cdata) + public static function fromCData(\FFI\CData $cdata): \Nawarian\Raylib\Generated\Vector3 { return new self($cdata->x, $cdata->y, $cdata->z); } } - diff --git a/generated/Vector4.php b/generated/Vector4.php index dfadba6..4d22bb9 100644 --- a/generated/Vector4.php +++ b/generated/Vector4.php @@ -4,8 +4,6 @@ namespace Nawarian\Raylib\Generated; -use FFI; - class Vector4 { /** @@ -36,7 +34,7 @@ public function __construct(float $x, float $y, float $z, float $w) $this->w = $w; } - public function toCData() : \FFI\CData + public function toCData(): \FFI\CData { global $raylib; $type = $raylib->new('Vector4'); @@ -47,9 +45,8 @@ public function toCData() : \FFI\CData return $type; } - public static function fromCData(\FFI\CData $cdata) + public static function fromCData(\FFI\CData $cdata): \Nawarian\Raylib\Generated\Vector4 { return new self($cdata->x, $cdata->y, $cdata->z, $cdata->w); } } - diff --git a/generated/VrDeviceInfo.php b/generated/VrDeviceInfo.php index 908317a..4667d29 100644 --- a/generated/VrDeviceInfo.php +++ b/generated/VrDeviceInfo.php @@ -4,8 +4,6 @@ namespace Nawarian\Raylib\Generated; -use FFI; - class VrDeviceInfo { /** @@ -51,14 +49,14 @@ class VrDeviceInfo /** * Lens distortion constant parameters */ - public array $lensDistortionValues; + public array $lensDistortionValues[4]; /** * Chromatic aberration correction parameters */ - public array $chromaAbCorrection; + public array $chromaAbCorrection[4]; - public function __construct(int $hResolution, int $vResolution, float $hScreenSize, float $vScreenSize, float $vScreenCenter, float $eyeToScreenDistance, float $lensSeparationDistance, float $interpupillaryDistance, array $lensDistortionValues, array $chromaAbCorrection) + public function __construct(int $hResolution, int $vResolution, float $hScreenSize, float $vScreenSize, float $vScreenCenter, float $eyeToScreenDistance, float $lensSeparationDistance, float $interpupillaryDistance, array $lensDistortionValues[4], array $chromaAbCorrection[4]) { $this->hResolution = $hResolution; $this->vResolution = $vResolution; @@ -68,11 +66,11 @@ public function __construct(int $hResolution, int $vResolution, float $hScreenSi $this->eyeToScreenDistance = $eyeToScreenDistance; $this->lensSeparationDistance = $lensSeparationDistance; $this->interpupillaryDistance = $interpupillaryDistance; - $this->lensDistortionValues = $lensDistortionValues; - $this->chromaAbCorrection = $chromaAbCorrection; + $this->lensDistortionValues[4] = $lensDistortionValues[4]; + $this->chromaAbCorrection[4] = $chromaAbCorrection[4]; } - public function toCData() : \FFI\CData + public function toCData(): \FFI\CData { global $raylib; $type = $raylib->new('VrDeviceInfo'); @@ -84,14 +82,13 @@ public function toCData() : \FFI\CData $type->eyeToScreenDistance = $this->eyeToScreenDistance; $type->lensSeparationDistance = $this->lensSeparationDistance; $type->interpupillaryDistance = $this->interpupillaryDistance; - $type->lensDistortionValues = $this->lensDistortionValues; - $type->chromaAbCorrection = $this->chromaAbCorrection; + $type->lensDistortionValues[4] = $this->lensDistortionValues[4]; + $type->chromaAbCorrection[4] = $this->chromaAbCorrection[4]; return $type; } - public static function fromCData(\FFI\CData $cdata) + public static function fromCData(\FFI\CData $cdata): \Nawarian\Raylib\Generated\VrDeviceInfo { - return new self($cdata->hResolution, $cdata->vResolution, $cdata->hScreenSize, $cdata->vScreenSize, $cdata->vScreenCenter, $cdata->eyeToScreenDistance, $cdata->lensSeparationDistance, $cdata->interpupillaryDistance, $cdata->lensDistortionValues, $cdata->chromaAbCorrection); + return new self($cdata->hResolution, $cdata->vResolution, $cdata->hScreenSize, $cdata->vScreenSize, $cdata->vScreenCenter, $cdata->eyeToScreenDistance, $cdata->lensSeparationDistance, $cdata->interpupillaryDistance, $cdata->lensDistortionValues[4], $cdata->chromaAbCorrection[4]); } } - diff --git a/generated/VrStereoConfig.php b/generated/VrStereoConfig.php index 4a33a62..b1dd069 100644 --- a/generated/VrStereoConfig.php +++ b/generated/VrStereoConfig.php @@ -4,80 +4,77 @@ namespace Nawarian\Raylib\Generated; -use FFI; - class VrStereoConfig { /** * VR projection matrices (per eye) */ - public array $projection; + public array $projection[2]; /** * VR view offset matrices (per eye) */ - public array $viewOffset; + public array $viewOffset[2]; /** * VR left lens center */ - public array $leftLensCenter; + public array $leftLensCenter[2]; /** * VR right lens center */ - public array $rightLensCenter; + public array $rightLensCenter[2]; /** * VR left screen center */ - public array $leftScreenCenter; + public array $leftScreenCenter[2]; /** * VR right screen center */ - public array $rightScreenCenter; + public array $rightScreenCenter[2]; /** * VR distortion scale */ - public array $scale; + public array $scale[2]; /** * VR distortion scale in */ - public array $scaleIn; + public array $scaleIn[2]; - public function __construct(array $projection, array $viewOffset, array $leftLensCenter, array $rightLensCenter, array $leftScreenCenter, array $rightScreenCenter, array $scale, array $scaleIn) + public function __construct(array $projection[2], array $viewOffset[2], array $leftLensCenter[2], array $rightLensCenter[2], array $leftScreenCenter[2], array $rightScreenCenter[2], array $scale[2], array $scaleIn[2]) { - $this->projection = $projection; - $this->viewOffset = $viewOffset; - $this->leftLensCenter = $leftLensCenter; - $this->rightLensCenter = $rightLensCenter; - $this->leftScreenCenter = $leftScreenCenter; - $this->rightScreenCenter = $rightScreenCenter; - $this->scale = $scale; - $this->scaleIn = $scaleIn; + $this->projection[2] = $projection[2]; + $this->viewOffset[2] = $viewOffset[2]; + $this->leftLensCenter[2] = $leftLensCenter[2]; + $this->rightLensCenter[2] = $rightLensCenter[2]; + $this->leftScreenCenter[2] = $leftScreenCenter[2]; + $this->rightScreenCenter[2] = $rightScreenCenter[2]; + $this->scale[2] = $scale[2]; + $this->scaleIn[2] = $scaleIn[2]; } - public function toCData() : \FFI\CData + public function toCData(): \FFI\CData { global $raylib; $type = $raylib->new('VrStereoConfig'); - $type->projection = $this->projection; - $type->viewOffset = $this->viewOffset; - $type->leftLensCenter = $this->leftLensCenter; - $type->rightLensCenter = $this->rightLensCenter; - $type->leftScreenCenter = $this->leftScreenCenter; - $type->rightScreenCenter = $this->rightScreenCenter; - $type->scale = $this->scale; - $type->scaleIn = $this->scaleIn; + $type->projection[2] = $this->projection[2]; + $type->viewOffset[2] = $this->viewOffset[2]; + $type->leftLensCenter[2] = $this->leftLensCenter[2]; + $type->rightLensCenter[2] = $this->rightLensCenter[2]; + $type->leftScreenCenter[2] = $this->leftScreenCenter[2]; + $type->rightScreenCenter[2] = $this->rightScreenCenter[2]; + $type->scale[2] = $this->scale[2]; + $type->scaleIn[2] = $this->scaleIn[2]; return $type; } - public static function fromCData(\FFI\CData $cdata) + public static function fromCData(\FFI\CData $cdata): \Nawarian\Raylib\Generated\VrStereoConfig { - return new self($cdata->projection, $cdata->viewOffset, $cdata->leftLensCenter, $cdata->rightLensCenter, $cdata->leftScreenCenter, $cdata->rightScreenCenter, $cdata->scale, $cdata->scaleIn); + return new self($cdata->projection[2], $cdata->viewOffset[2], $cdata->leftLensCenter[2], $cdata->rightLensCenter[2], $cdata->leftScreenCenter[2], $cdata->rightScreenCenter[2], $cdata->scale[2], $cdata->scaleIn[2]); } } - diff --git a/generated/Wave.php b/generated/Wave.php index d874362..723e9b7 100644 --- a/generated/Wave.php +++ b/generated/Wave.php @@ -4,8 +4,6 @@ namespace Nawarian\Raylib\Generated; -use FFI; - class Wave { /** @@ -42,7 +40,7 @@ public function __construct(int $sampleCount, int $sampleRate, int $sampleSize, $this->data = $data; } - public function toCData() : \FFI\CData + public function toCData(): \FFI\CData { global $raylib; $type = $raylib->new('Wave'); @@ -54,9 +52,8 @@ public function toCData() : \FFI\CData return $type; } - public static function fromCData(\FFI\CData $cdata) + public static function fromCData(\FFI\CData $cdata): \Nawarian\Raylib\Generated\Wave { return new self($cdata->sampleCount, $cdata->sampleRate, $cdata->sampleSize, $cdata->channels, $cdata->data); } } - diff --git a/generated/functions.php b/generated/functions.php index 999eceb..a6a74b1 100644 --- a/generated/functions.php +++ b/generated/functions.php @@ -7,4162 +7,4162 @@ /** * Initialize window and OpenGL context */ - function InitWindow(int $paramwidth, int $paramheight, string $paramtitle) : void +function InitWindow(int $width, int $height, string $title): void { -global $raylib; -$raylib->InitWindow($paramwidth, $paramheight, $paramtitle); + global $raylib; + $raylib->InitWindow($width, $height, $title); } /** * Check if KEY_ESCAPE pressed or Close icon pressed */ - function WindowShouldClose() : bool +function WindowShouldClose(): bool { -global $raylib; -return $raylib->WindowShouldClose(); + global $raylib; + return $raylib->WindowShouldClose(); } /** * Close window and unload OpenGL context */ - function CloseWindow() : void +function CloseWindow(): void { -global $raylib; -$raylib->CloseWindow(); + global $raylib; + $raylib->CloseWindow(); } /** * Check if window has been initialized successfully */ - function IsWindowReady() : bool +function IsWindowReady(): bool { -global $raylib; -return $raylib->IsWindowReady(); + global $raylib; + return $raylib->IsWindowReady(); } /** * Check if window is currently fullscreen */ - function IsWindowFullscreen() : bool +function IsWindowFullscreen(): bool { -global $raylib; -return $raylib->IsWindowFullscreen(); + global $raylib; + return $raylib->IsWindowFullscreen(); } /** * Check if window is currently hidden (only PLATFORM_DESKTOP) */ - function IsWindowHidden() : bool +function IsWindowHidden(): bool { -global $raylib; -return $raylib->IsWindowHidden(); + global $raylib; + return $raylib->IsWindowHidden(); } /** * Check if window is currently minimized (only PLATFORM_DESKTOP) */ - function IsWindowMinimized() : bool +function IsWindowMinimized(): bool { -global $raylib; -return $raylib->IsWindowMinimized(); + global $raylib; + return $raylib->IsWindowMinimized(); } /** * Check if window is currently maximized (only PLATFORM_DESKTOP) */ - function IsWindowMaximized() : bool +function IsWindowMaximized(): bool { -global $raylib; -return $raylib->IsWindowMaximized(); + global $raylib; + return $raylib->IsWindowMaximized(); } /** * Check if window is currently focused (only PLATFORM_DESKTOP) */ - function IsWindowFocused() : bool +function IsWindowFocused(): bool { -global $raylib; -return $raylib->IsWindowFocused(); + global $raylib; + return $raylib->IsWindowFocused(); } /** * Check if window has been resized last frame */ - function IsWindowResized() : bool +function IsWindowResized(): bool { -global $raylib; -return $raylib->IsWindowResized(); + global $raylib; + return $raylib->IsWindowResized(); } /** * Check if one specific window flag is enabled */ - function IsWindowState(int $paramflag) : bool +function IsWindowState(int $flag): bool { -global $raylib; -return $raylib->IsWindowState($paramflag); + global $raylib; + return $raylib->IsWindowState($flag); } /** * Set window configuration state using flags */ - function SetWindowState(int $paramflags) : void +function SetWindowState(int $flags): void { -global $raylib; -$raylib->SetWindowState($paramflags); + global $raylib; + $raylib->SetWindowState($flags); } /** * Clear window configuration state flags */ - function ClearWindowState(int $paramflags) : void +function ClearWindowState(int $flags): void { -global $raylib; -$raylib->ClearWindowState($paramflags); + global $raylib; + $raylib->ClearWindowState($flags); } /** * Toggle window state: fullscreen/windowed (only PLATFORM_DESKTOP) */ - function ToggleFullscreen() : void +function ToggleFullscreen(): void { -global $raylib; -$raylib->ToggleFullscreen(); + global $raylib; + $raylib->ToggleFullscreen(); } /** * Set window state: maximized, if resizable (only PLATFORM_DESKTOP) */ - function MaximizeWindow() : void +function MaximizeWindow(): void { -global $raylib; -$raylib->MaximizeWindow(); + global $raylib; + $raylib->MaximizeWindow(); } /** * Set window state: minimized, if resizable (only PLATFORM_DESKTOP) */ - function MinimizeWindow() : void +function MinimizeWindow(): void { -global $raylib; -$raylib->MinimizeWindow(); + global $raylib; + $raylib->MinimizeWindow(); } /** * Set window state: not minimized/maximized (only PLATFORM_DESKTOP) */ - function RestoreWindow() : void +function RestoreWindow(): void { -global $raylib; -$raylib->RestoreWindow(); + global $raylib; + $raylib->RestoreWindow(); } /** * Set icon for window (only PLATFORM_DESKTOP) */ - function SetWindowIcon(\Nawarian\Raylib\Generated\Image $paramimage) : void +function SetWindowIcon(\Nawarian\Raylib\Generated\Image $image): void { -global $raylib; -$raylib->SetWindowIcon($paramimage->toCData()); + global $raylib; + $raylib->SetWindowIcon($image->toCData()); } /** * Set title for window (only PLATFORM_DESKTOP) */ - function SetWindowTitle(string $paramtitle) : void +function SetWindowTitle(string $title): void { -global $raylib; -$raylib->SetWindowTitle($paramtitle); + global $raylib; + $raylib->SetWindowTitle($title); } /** * Set window position on screen (only PLATFORM_DESKTOP) */ - function SetWindowPosition(int $paramx, int $paramy) : void +function SetWindowPosition(int $x, int $y): void { -global $raylib; -$raylib->SetWindowPosition($paramx, $paramy); + global $raylib; + $raylib->SetWindowPosition($x, $y); } /** * Set monitor for the current window (fullscreen mode) */ - function SetWindowMonitor(int $parammonitor) : void +function SetWindowMonitor(int $monitor): void { -global $raylib; -$raylib->SetWindowMonitor($parammonitor); + global $raylib; + $raylib->SetWindowMonitor($monitor); } /** * Set window minimum dimensions (for FLAG_WINDOW_RESIZABLE) */ - function SetWindowMinSize(int $paramwidth, int $paramheight) : void +function SetWindowMinSize(int $width, int $height): void { -global $raylib; -$raylib->SetWindowMinSize($paramwidth, $paramheight); + global $raylib; + $raylib->SetWindowMinSize($width, $height); } /** * Set window dimensions */ - function SetWindowSize(int $paramwidth, int $paramheight) : void +function SetWindowSize(int $width, int $height): void { -global $raylib; -$raylib->SetWindowSize($paramwidth, $paramheight); + global $raylib; + $raylib->SetWindowSize($width, $height); } /** * Get native window handle */ - function GetWindowHandle() : \FFI\CData +function GetWindowHandle(): \FFI\CData { -global $raylib; -return $raylib->GetWindowHandle(); + global $raylib; + return $raylib->GetWindowHandle(); } /** * Get current screen width */ - function GetScreenWidth() : int +function GetScreenWidth(): int { -global $raylib; -return $raylib->GetScreenWidth(); + global $raylib; + return $raylib->GetScreenWidth(); } /** * Get current screen height */ - function GetScreenHeight() : int +function GetScreenHeight(): int { -global $raylib; -return $raylib->GetScreenHeight(); + global $raylib; + return $raylib->GetScreenHeight(); } /** * Get number of connected monitors */ - function GetMonitorCount() : int +function GetMonitorCount(): int { -global $raylib; -return $raylib->GetMonitorCount(); + global $raylib; + return $raylib->GetMonitorCount(); } /** * Get current connected monitor */ - function GetCurrentMonitor() : int +function GetCurrentMonitor(): int { -global $raylib; -return $raylib->GetCurrentMonitor(); + global $raylib; + return $raylib->GetCurrentMonitor(); } /** * Get specified monitor position */ - function GetMonitorPosition(int $parammonitor) : \Nawarian\Raylib\Generated\Vector2 +function GetMonitorPosition(int $monitor): \Nawarian\Raylib\Generated\Vector2 { -global $raylib; -return \Nawarian\Raylib\Generated\Vector2::fromCData($raylib->GetMonitorPosition($parammonitor)); + global $raylib; + return \Nawarian\Raylib\Generated\Vector2::fromCData($raylib->GetMonitorPosition($monitor)); } /** * Get specified monitor width (max available by monitor) */ - function GetMonitorWidth(int $parammonitor) : int +function GetMonitorWidth(int $monitor): int { -global $raylib; -return $raylib->GetMonitorWidth($parammonitor); + global $raylib; + return $raylib->GetMonitorWidth($monitor); } /** * Get specified monitor height (max available by monitor) */ - function GetMonitorHeight(int $parammonitor) : int +function GetMonitorHeight(int $monitor): int { -global $raylib; -return $raylib->GetMonitorHeight($parammonitor); + global $raylib; + return $raylib->GetMonitorHeight($monitor); } /** * Get specified monitor physical width in millimetres */ - function GetMonitorPhysicalWidth(int $parammonitor) : int +function GetMonitorPhysicalWidth(int $monitor): int { -global $raylib; -return $raylib->GetMonitorPhysicalWidth($parammonitor); + global $raylib; + return $raylib->GetMonitorPhysicalWidth($monitor); } /** * Get specified monitor physical height in millimetres */ - function GetMonitorPhysicalHeight(int $parammonitor) : int +function GetMonitorPhysicalHeight(int $monitor): int { -global $raylib; -return $raylib->GetMonitorPhysicalHeight($parammonitor); + global $raylib; + return $raylib->GetMonitorPhysicalHeight($monitor); } /** * Get specified monitor refresh rate */ - function GetMonitorRefreshRate(int $parammonitor) : int +function GetMonitorRefreshRate(int $monitor): int { -global $raylib; -return $raylib->GetMonitorRefreshRate($parammonitor); + global $raylib; + return $raylib->GetMonitorRefreshRate($monitor); } /** * Get window position XY on monitor */ - function GetWindowPosition() : \Nawarian\Raylib\Generated\Vector2 +function GetWindowPosition(): \Nawarian\Raylib\Generated\Vector2 { -global $raylib; -return \Nawarian\Raylib\Generated\Vector2::fromCData($raylib->GetWindowPosition()); + global $raylib; + return \Nawarian\Raylib\Generated\Vector2::fromCData($raylib->GetWindowPosition()); } /** * Get window scale DPI factor */ - function GetWindowScaleDPI() : \Nawarian\Raylib\Generated\Vector2 +function GetWindowScaleDPI(): \Nawarian\Raylib\Generated\Vector2 { -global $raylib; -return \Nawarian\Raylib\Generated\Vector2::fromCData($raylib->GetWindowScaleDPI()); + global $raylib; + return \Nawarian\Raylib\Generated\Vector2::fromCData($raylib->GetWindowScaleDPI()); } /** * Get the human-readable, UTF-8 encoded name of the primary monitor */ - function GetMonitorName(int $parammonitor) : string +function GetMonitorName(int $monitor): string { -global $raylib; -return $raylib->GetMonitorName($parammonitor); + global $raylib; + return $raylib->GetMonitorName($monitor); } /** * Set clipboard text content */ - function SetClipboardText(string $paramtext) : void +function SetClipboardText(string $text): void { -global $raylib; -$raylib->SetClipboardText($paramtext); + global $raylib; + $raylib->SetClipboardText($text); } /** * Get clipboard text content */ - function GetClipboardText() : string +function GetClipboardText(): string { -global $raylib; -return $raylib->GetClipboardText(); + global $raylib; + return $raylib->GetClipboardText(); } /** * Shows cursor */ - function ShowCursor() : void +function ShowCursor(): void { -global $raylib; -$raylib->ShowCursor(); + global $raylib; + $raylib->ShowCursor(); } /** * Hides cursor */ - function HideCursor() : void +function HideCursor(): void { -global $raylib; -$raylib->HideCursor(); + global $raylib; + $raylib->HideCursor(); } /** * Check if cursor is not visible */ - function IsCursorHidden() : bool +function IsCursorHidden(): bool { -global $raylib; -return $raylib->IsCursorHidden(); + global $raylib; + return $raylib->IsCursorHidden(); } /** * Enables cursor (unlock cursor) */ - function EnableCursor() : void +function EnableCursor(): void { -global $raylib; -$raylib->EnableCursor(); + global $raylib; + $raylib->EnableCursor(); } /** * Disables cursor (lock cursor) */ - function DisableCursor() : void +function DisableCursor(): void { -global $raylib; -$raylib->DisableCursor(); + global $raylib; + $raylib->DisableCursor(); } /** * Check if cursor is on the screen */ - function IsCursorOnScreen() : bool +function IsCursorOnScreen(): bool { -global $raylib; -return $raylib->IsCursorOnScreen(); + global $raylib; + return $raylib->IsCursorOnScreen(); } /** * Set background color (framebuffer clear color) */ - function ClearBackground(\Nawarian\Raylib\Generated\Color $paramcolor) : void +function ClearBackground(\Nawarian\Raylib\Generated\Color $color): void { -global $raylib; -$raylib->ClearBackground($paramcolor->toCData()); + global $raylib; + $raylib->ClearBackground($color->toCData()); } /** * Setup canvas (framebuffer) to start drawing */ - function BeginDrawing() : void +function BeginDrawing(): void { -global $raylib; -$raylib->BeginDrawing(); + global $raylib; + $raylib->BeginDrawing(); } /** * End canvas drawing and swap buffers (double buffering) */ - function EndDrawing() : void +function EndDrawing(): void { -global $raylib; -$raylib->EndDrawing(); + global $raylib; + $raylib->EndDrawing(); } /** * Begin 2D mode with custom camera (2D) */ - function BeginMode2D(\Nawarian\Raylib\Generated\Camera2D $paramcamera) : void +function BeginMode2D(\Nawarian\Raylib\Generated\Camera2D $camera): void { -global $raylib; -$raylib->BeginMode2D($paramcamera->toCData()); + global $raylib; + $raylib->BeginMode2D($camera->toCData()); } /** * Ends 2D mode with custom camera */ - function EndMode2D() : void +function EndMode2D(): void { -global $raylib; -$raylib->EndMode2D(); + global $raylib; + $raylib->EndMode2D(); } /** * Begin 3D mode with custom camera (3D) */ - function BeginMode3D(\Nawarian\Raylib\Generated\Camera3D $paramcamera) : void +function BeginMode3D(\Nawarian\Raylib\Generated\Camera3D $camera): void { -global $raylib; -$raylib->BeginMode3D($paramcamera->toCData()); + global $raylib; + $raylib->BeginMode3D($camera->toCData()); } /** * Ends 3D mode and returns to default 2D orthographic mode */ - function EndMode3D() : void +function EndMode3D(): void { -global $raylib; -$raylib->EndMode3D(); + global $raylib; + $raylib->EndMode3D(); } /** * Begin drawing to render texture */ - function BeginTextureMode(\Nawarian\Raylib\Generated\RenderTexture $paramtarget) : void +function BeginTextureMode(\Nawarian\Raylib\Generated\RenderTexture $target): void { -global $raylib; -$raylib->BeginTextureMode($paramtarget->toCData()); + global $raylib; + $raylib->BeginTextureMode($target->toCData()); } /** * Ends drawing to render texture */ - function EndTextureMode() : void +function EndTextureMode(): void { -global $raylib; -$raylib->EndTextureMode(); + global $raylib; + $raylib->EndTextureMode(); } /** * Begin custom shader drawing */ - function BeginShaderMode(\Nawarian\Raylib\Generated\Shader $paramshader) : void +function BeginShaderMode(\Nawarian\Raylib\Generated\Shader $shader): void { -global $raylib; -$raylib->BeginShaderMode($paramshader->toCData()); + global $raylib; + $raylib->BeginShaderMode($shader->toCData()); } /** * End custom shader drawing (use default shader) */ - function EndShaderMode() : void +function EndShaderMode(): void { -global $raylib; -$raylib->EndShaderMode(); + global $raylib; + $raylib->EndShaderMode(); } /** * Begin blending mode (alpha, additive, multiplied, subtract, custom) */ - function BeginBlendMode(int $parammode) : void +function BeginBlendMode(int $mode): void { -global $raylib; -$raylib->BeginBlendMode($parammode); + global $raylib; + $raylib->BeginBlendMode($mode); } /** * End blending mode (reset to default: alpha blending) */ - function EndBlendMode() : void +function EndBlendMode(): void { -global $raylib; -$raylib->EndBlendMode(); + global $raylib; + $raylib->EndBlendMode(); } /** * Begin scissor mode (define screen area for following drawing) */ - function BeginScissorMode(int $paramx, int $paramy, int $paramwidth, int $paramheight) : void +function BeginScissorMode(int $x, int $y, int $width, int $height): void { -global $raylib; -$raylib->BeginScissorMode($paramx, $paramy, $paramwidth, $paramheight); + global $raylib; + $raylib->BeginScissorMode($x, $y, $width, $height); } /** * End scissor mode */ - function EndScissorMode() : void +function EndScissorMode(): void { -global $raylib; -$raylib->EndScissorMode(); + global $raylib; + $raylib->EndScissorMode(); } /** * Begin stereo rendering (requires VR simulator) */ - function BeginVrStereoMode(\Nawarian\Raylib\Generated\VrStereoConfig $paramconfig) : void +function BeginVrStereoMode(\Nawarian\Raylib\Generated\VrStereoConfig $config): void { -global $raylib; -$raylib->BeginVrStereoMode($paramconfig->toCData()); + global $raylib; + $raylib->BeginVrStereoMode($config->toCData()); } /** * End stereo rendering (requires VR simulator) */ - function EndVrStereoMode() : void +function EndVrStereoMode(): void { -global $raylib; -$raylib->EndVrStereoMode(); + global $raylib; + $raylib->EndVrStereoMode(); } /** * Load VR stereo config for VR simulator device parameters */ - function LoadVrStereoConfig(\Nawarian\Raylib\Generated\VrDeviceInfo $paramdevice) : \Nawarian\Raylib\Generated\VrStereoConfig +function LoadVrStereoConfig(\Nawarian\Raylib\Generated\VrDeviceInfo $device): \Nawarian\Raylib\Generated\VrStereoConfig { -global $raylib; -return \Nawarian\Raylib\Generated\VrStereoConfig::fromCData($raylib->LoadVrStereoConfig($paramdevice->toCData())); + global $raylib; + return \Nawarian\Raylib\Generated\VrStereoConfig::fromCData($raylib->LoadVrStereoConfig($device->toCData())); } /** * Unload VR stereo config */ - function UnloadVrStereoConfig(\Nawarian\Raylib\Generated\VrStereoConfig $paramconfig) : void +function UnloadVrStereoConfig(\Nawarian\Raylib\Generated\VrStereoConfig $config): void { -global $raylib; -$raylib->UnloadVrStereoConfig($paramconfig->toCData()); + global $raylib; + $raylib->UnloadVrStereoConfig($config->toCData()); } /** * Load shader from files and bind default locations */ - function LoadShader(string $paramvsFileName, string $paramfsFileName) : \Nawarian\Raylib\Generated\Shader +function LoadShader(string $vsFileName, string $fsFileName): \Nawarian\Raylib\Generated\Shader { -global $raylib; -return \Nawarian\Raylib\Generated\Shader::fromCData($raylib->LoadShader($paramvsFileName, $paramfsFileName)); + global $raylib; + return \Nawarian\Raylib\Generated\Shader::fromCData($raylib->LoadShader($vsFileName, $fsFileName)); } /** * Load shader from code strings and bind default locations */ - function LoadShaderFromMemory(string $paramvsCode, string $paramfsCode) : \Nawarian\Raylib\Generated\Shader +function LoadShaderFromMemory(string $vsCode, string $fsCode): \Nawarian\Raylib\Generated\Shader { -global $raylib; -return \Nawarian\Raylib\Generated\Shader::fromCData($raylib->LoadShaderFromMemory($paramvsCode, $paramfsCode)); + global $raylib; + return \Nawarian\Raylib\Generated\Shader::fromCData($raylib->LoadShaderFromMemory($vsCode, $fsCode)); } /** * Get shader uniform location */ - function GetShaderLocation(\Nawarian\Raylib\Generated\Shader $paramshader, string $paramuniformName) : int +function GetShaderLocation(\Nawarian\Raylib\Generated\Shader $shader, string $uniformName): int { -global $raylib; -return $raylib->GetShaderLocation($paramshader->toCData(), $paramuniformName); + global $raylib; + return $raylib->GetShaderLocation($shader->toCData(), $uniformName); } /** * Get shader attribute location */ - function GetShaderLocationAttrib(\Nawarian\Raylib\Generated\Shader $paramshader, string $paramattribName) : int +function GetShaderLocationAttrib(\Nawarian\Raylib\Generated\Shader $shader, string $attribName): int { -global $raylib; -return $raylib->GetShaderLocationAttrib($paramshader->toCData(), $paramattribName); + global $raylib; + return $raylib->GetShaderLocationAttrib($shader->toCData(), $attribName); } /** * Set shader uniform value */ - function SetShaderValue(\Nawarian\Raylib\Generated\Shader $paramshader, int $paramlocIndex, \FFI\CData $paramvalue, int $paramuniformType) : void +function SetShaderValue(\Nawarian\Raylib\Generated\Shader $shader, int $locIndex, \FFI\CData $value, int $uniformType): void { -global $raylib; -$raylib->SetShaderValue($paramshader->toCData(), $paramlocIndex, $paramvalue, $paramuniformType); + global $raylib; + $raylib->SetShaderValue($shader->toCData(), $locIndex, $value, $uniformType); } /** * Set shader uniform value vector */ - function SetShaderValueV(\Nawarian\Raylib\Generated\Shader $paramshader, int $paramlocIndex, \FFI\CData $paramvalue, int $paramuniformType, int $paramcount) : void +function SetShaderValueV(\Nawarian\Raylib\Generated\Shader $shader, int $locIndex, \FFI\CData $value, int $uniformType, int $count): void { -global $raylib; -$raylib->SetShaderValueV($paramshader->toCData(), $paramlocIndex, $paramvalue, $paramuniformType, $paramcount); + global $raylib; + $raylib->SetShaderValueV($shader->toCData(), $locIndex, $value, $uniformType, $count); } /** * Set shader uniform value (matrix 4x4) */ - function SetShaderValueMatrix(\Nawarian\Raylib\Generated\Shader $paramshader, int $paramlocIndex, \Nawarian\Raylib\Generated\Matrix $parammat) : void +function SetShaderValueMatrix(\Nawarian\Raylib\Generated\Shader $shader, int $locIndex, \Nawarian\Raylib\Generated\Matrix $mat): void { -global $raylib; -$raylib->SetShaderValueMatrix($paramshader->toCData(), $paramlocIndex, $parammat->toCData()); + global $raylib; + $raylib->SetShaderValueMatrix($shader->toCData(), $locIndex, $mat->toCData()); } /** * Set shader uniform value for texture (sampler2d) */ - function SetShaderValueTexture(\Nawarian\Raylib\Generated\Shader $paramshader, int $paramlocIndex, \Nawarian\Raylib\Generated\Texture $paramtexture) : void +function SetShaderValueTexture(\Nawarian\Raylib\Generated\Shader $shader, int $locIndex, \Nawarian\Raylib\Generated\Texture $texture): void { -global $raylib; -$raylib->SetShaderValueTexture($paramshader->toCData(), $paramlocIndex, $paramtexture->toCData()); + global $raylib; + $raylib->SetShaderValueTexture($shader->toCData(), $locIndex, $texture->toCData()); } /** * Unload shader from GPU memory (VRAM) */ - function UnloadShader(\Nawarian\Raylib\Generated\Shader $paramshader) : void +function UnloadShader(\Nawarian\Raylib\Generated\Shader $shader): void { -global $raylib; -$raylib->UnloadShader($paramshader->toCData()); + global $raylib; + $raylib->UnloadShader($shader->toCData()); } /** * Get a ray trace from mouse position */ - function GetMouseRay(\Nawarian\Raylib\Generated\Vector2 $parammousePosition, \Nawarian\Raylib\Generated\Camera3D $paramcamera) : \Nawarian\Raylib\Generated\Ray +function GetMouseRay(\Nawarian\Raylib\Generated\Vector2 $mousePosition, \Nawarian\Raylib\Generated\Camera3D $camera): \Nawarian\Raylib\Generated\Ray { -global $raylib; -return \Nawarian\Raylib\Generated\Ray::fromCData($raylib->GetMouseRay($parammousePosition->toCData(), $paramcamera->toCData())); + global $raylib; + return \Nawarian\Raylib\Generated\Ray::fromCData($raylib->GetMouseRay($mousePosition->toCData(), $camera->toCData())); } /** * Get camera transform matrix (view matrix) */ - function GetCameraMatrix(\Nawarian\Raylib\Generated\Camera3D $paramcamera) : \Nawarian\Raylib\Generated\Matrix +function GetCameraMatrix(\Nawarian\Raylib\Generated\Camera3D $camera): \Nawarian\Raylib\Generated\Matrix { -global $raylib; -return \Nawarian\Raylib\Generated\Matrix::fromCData($raylib->GetCameraMatrix($paramcamera->toCData())); + global $raylib; + return \Nawarian\Raylib\Generated\Matrix::fromCData($raylib->GetCameraMatrix($camera->toCData())); } /** * Get camera 2d transform matrix */ - function GetCameraMatrix2D(\Nawarian\Raylib\Generated\Camera2D $paramcamera) : \Nawarian\Raylib\Generated\Matrix +function GetCameraMatrix2D(\Nawarian\Raylib\Generated\Camera2D $camera): \Nawarian\Raylib\Generated\Matrix { -global $raylib; -return \Nawarian\Raylib\Generated\Matrix::fromCData($raylib->GetCameraMatrix2D($paramcamera->toCData())); + global $raylib; + return \Nawarian\Raylib\Generated\Matrix::fromCData($raylib->GetCameraMatrix2D($camera->toCData())); } /** * Get the screen space position for a 3d world space position */ - function GetWorldToScreen(\Nawarian\Raylib\Generated\Vector3 $paramposition, \Nawarian\Raylib\Generated\Camera3D $paramcamera) : \Nawarian\Raylib\Generated\Vector2 +function GetWorldToScreen(\Nawarian\Raylib\Generated\Vector3 $position, \Nawarian\Raylib\Generated\Camera3D $camera): \Nawarian\Raylib\Generated\Vector2 { -global $raylib; -return \Nawarian\Raylib\Generated\Vector2::fromCData($raylib->GetWorldToScreen($paramposition->toCData(), $paramcamera->toCData())); + global $raylib; + return \Nawarian\Raylib\Generated\Vector2::fromCData($raylib->GetWorldToScreen($position->toCData(), $camera->toCData())); } /** * Get size position for a 3d world space position */ - function GetWorldToScreenEx(\Nawarian\Raylib\Generated\Vector3 $paramposition, \Nawarian\Raylib\Generated\Camera3D $paramcamera, int $paramwidth, int $paramheight) : \Nawarian\Raylib\Generated\Vector2 +function GetWorldToScreenEx(\Nawarian\Raylib\Generated\Vector3 $position, \Nawarian\Raylib\Generated\Camera3D $camera, int $width, int $height): \Nawarian\Raylib\Generated\Vector2 { -global $raylib; -return \Nawarian\Raylib\Generated\Vector2::fromCData($raylib->GetWorldToScreenEx($paramposition->toCData(), $paramcamera->toCData(), $paramwidth, $paramheight)); + global $raylib; + return \Nawarian\Raylib\Generated\Vector2::fromCData($raylib->GetWorldToScreenEx($position->toCData(), $camera->toCData(), $width, $height)); } /** * Get the screen space position for a 2d camera world space position */ - function GetWorldToScreen2D(\Nawarian\Raylib\Generated\Vector2 $paramposition, \Nawarian\Raylib\Generated\Camera2D $paramcamera) : \Nawarian\Raylib\Generated\Vector2 +function GetWorldToScreen2D(\Nawarian\Raylib\Generated\Vector2 $position, \Nawarian\Raylib\Generated\Camera2D $camera): \Nawarian\Raylib\Generated\Vector2 { -global $raylib; -return \Nawarian\Raylib\Generated\Vector2::fromCData($raylib->GetWorldToScreen2D($paramposition->toCData(), $paramcamera->toCData())); + global $raylib; + return \Nawarian\Raylib\Generated\Vector2::fromCData($raylib->GetWorldToScreen2D($position->toCData(), $camera->toCData())); } /** * Get the world space position for a 2d camera screen space position */ - function GetScreenToWorld2D(\Nawarian\Raylib\Generated\Vector2 $paramposition, \Nawarian\Raylib\Generated\Camera2D $paramcamera) : \Nawarian\Raylib\Generated\Vector2 +function GetScreenToWorld2D(\Nawarian\Raylib\Generated\Vector2 $position, \Nawarian\Raylib\Generated\Camera2D $camera): \Nawarian\Raylib\Generated\Vector2 { -global $raylib; -return \Nawarian\Raylib\Generated\Vector2::fromCData($raylib->GetScreenToWorld2D($paramposition->toCData(), $paramcamera->toCData())); + global $raylib; + return \Nawarian\Raylib\Generated\Vector2::fromCData($raylib->GetScreenToWorld2D($position->toCData(), $camera->toCData())); } /** * Set target FPS (maximum) */ - function SetTargetFPS(int $paramfps) : void +function SetTargetFPS(int $fps): void { -global $raylib; -$raylib->SetTargetFPS($paramfps); + global $raylib; + $raylib->SetTargetFPS($fps); } /** * Get current FPS */ - function GetFPS() : int +function GetFPS(): int { -global $raylib; -return $raylib->GetFPS(); + global $raylib; + return $raylib->GetFPS(); } /** * Get time in seconds for last frame drawn (delta time) */ - function GetFrameTime() : float +function GetFrameTime(): float { -global $raylib; -return $raylib->GetFrameTime(); + global $raylib; + return $raylib->GetFrameTime(); } /** * Get elapsed time in seconds since InitWindow() */ - function GetTime() : float +function GetTime(): float { -global $raylib; -return $raylib->GetTime(); + global $raylib; + return $raylib->GetTime(); } /** * Get a random value between min and max (both included) */ - function GetRandomValue(int $parammin, int $parammax) : int +function GetRandomValue(int $min, int $max): int { -global $raylib; -return $raylib->GetRandomValue($parammin, $parammax); + global $raylib; + return $raylib->GetRandomValue($min, $max); } /** * Takes a screenshot of current screen (filename extension defines format) */ - function TakeScreenshot(string $paramfileName) : void +function TakeScreenshot(string $fileName): void { -global $raylib; -$raylib->TakeScreenshot($paramfileName); + global $raylib; + $raylib->TakeScreenshot($fileName); } /** * Setup init configuration flags (view FLAGS) */ - function SetConfigFlags(int $paramflags) : void +function SetConfigFlags(int $flags): void { -global $raylib; -$raylib->SetConfigFlags($paramflags); + global $raylib; + $raylib->SetConfigFlags($flags); } /** * Set the current threshold (minimum) log level */ - function SetTraceLogLevel(int $paramlogLevel) : void +function SetTraceLogLevel(int $logLevel): void { -global $raylib; -$raylib->SetTraceLogLevel($paramlogLevel); + global $raylib; + $raylib->SetTraceLogLevel($logLevel); } /** * Internal memory allocator */ - function MemAlloc(int $paramsize) : \FFI\CData +function MemAlloc(int $size): \FFI\CData { -global $raylib; -return $raylib->MemAlloc($paramsize); + global $raylib; + return $raylib->MemAlloc($size); } /** * Internal memory reallocator */ - function MemRealloc(\FFI\CData $paramptr, int $paramsize) : \FFI\CData +function MemRealloc(\FFI\CData $ptr, int $size): \FFI\CData { -global $raylib; -return $raylib->MemRealloc($paramptr, $paramsize); + global $raylib; + return $raylib->MemRealloc($ptr, $size); } /** * Internal memory free */ - function MemFree(\FFI\CData $paramptr) : void +function MemFree(\FFI\CData $ptr): void { -global $raylib; -$raylib->MemFree($paramptr); + global $raylib; + $raylib->MemFree($ptr); } /** * Load file data as byte array (read) */ - function LoadFileData(string $paramfileName, array $parambytesRead) : array +function LoadFileData(string $fileName, array $bytesRead): array { -global $raylib; -return $raylib->LoadFileData($paramfileName, $parambytesRead); + global $raylib; + return $raylib->LoadFileData($fileName, $bytesRead); } /** * Unload file data allocated by LoadFileData() */ - function UnloadFileData(array $paramdata) : void +function UnloadFileData(array $data): void { -global $raylib; -$raylib->UnloadFileData($paramdata); + global $raylib; + $raylib->UnloadFileData($data); } /** * Save data to file from byte array (write), returns true on success */ - function SaveFileData(string $paramfileName, \FFI\CData $paramdata, int $parambytesToWrite) : bool +function SaveFileData(string $fileName, \FFI\CData $data, int $bytesToWrite): bool { -global $raylib; -return $raylib->SaveFileData($paramfileName, $paramdata, $parambytesToWrite); + global $raylib; + return $raylib->SaveFileData($fileName, $data, $bytesToWrite); } /** * Load text data from file (read), returns a ' 0' terminated string */ - function LoadFileText(string $paramfileName) : string +function LoadFileText(string $fileName): string { -global $raylib; -return $raylib->LoadFileText($paramfileName); + global $raylib; + return $raylib->LoadFileText($fileName); } /** * Unload file text data allocated by LoadFileText() */ - function UnloadFileText(string $paramtext) : void +function UnloadFileText(string $text): void { -global $raylib; -$raylib->UnloadFileText($paramtext); + global $raylib; + $raylib->UnloadFileText($text); } /** * Save text data to file (write), string must be ' 0' terminated, returns true on * success */ - function SaveFileText(string $paramfileName, string $paramtext) : bool +function SaveFileText(string $fileName, string $text): bool { -global $raylib; -return $raylib->SaveFileText($paramfileName, $paramtext); + global $raylib; + return $raylib->SaveFileText($fileName, $text); } /** * Check if file exists */ - function FileExists(string $paramfileName) : bool +function FileExists(string $fileName): bool { -global $raylib; -return $raylib->FileExists($paramfileName); + global $raylib; + return $raylib->FileExists($fileName); } /** * Check if a directory path exists */ - function DirectoryExists(string $paramdirPath) : bool +function DirectoryExists(string $dirPath): bool { -global $raylib; -return $raylib->DirectoryExists($paramdirPath); + global $raylib; + return $raylib->DirectoryExists($dirPath); } /** * Check file extension (including point: .png, .wav) */ - function IsFileExtension(string $paramfileName, string $paramext) : bool +function IsFileExtension(string $fileName, string $ext): bool { -global $raylib; -return $raylib->IsFileExtension($paramfileName, $paramext); + global $raylib; + return $raylib->IsFileExtension($fileName, $ext); } /** * Get pointer to extension for a filename string (includes dot: '.png') */ - function GetFileExtension(string $paramfileName) : string +function GetFileExtension(string $fileName): string { -global $raylib; -return $raylib->GetFileExtension($paramfileName); + global $raylib; + return $raylib->GetFileExtension($fileName); } /** * Get pointer to filename for a path string */ - function GetFileName(string $paramfilePath) : string +function GetFileName(string $filePath): string { -global $raylib; -return $raylib->GetFileName($paramfilePath); + global $raylib; + return $raylib->GetFileName($filePath); } /** * Get filename string without extension (uses static string) */ - function GetFileNameWithoutExt(string $paramfilePath) : string +function GetFileNameWithoutExt(string $filePath): string { -global $raylib; -return $raylib->GetFileNameWithoutExt($paramfilePath); + global $raylib; + return $raylib->GetFileNameWithoutExt($filePath); } /** * Get full path for a given fileName with path (uses static string) */ - function GetDirectoryPath(string $paramfilePath) : string +function GetDirectoryPath(string $filePath): string { -global $raylib; -return $raylib->GetDirectoryPath($paramfilePath); + global $raylib; + return $raylib->GetDirectoryPath($filePath); } /** * Get previous directory path for a given path (uses static string) */ - function GetPrevDirectoryPath(string $paramdirPath) : string +function GetPrevDirectoryPath(string $dirPath): string { -global $raylib; -return $raylib->GetPrevDirectoryPath($paramdirPath); + global $raylib; + return $raylib->GetPrevDirectoryPath($dirPath); } /** * Get current working directory (uses static string) */ - function GetWorkingDirectory() : string +function GetWorkingDirectory(): string { -global $raylib; -return $raylib->GetWorkingDirectory(); + global $raylib; + return $raylib->GetWorkingDirectory(); } /** * Get filenames in a directory path (memory should be freed) */ - function GetDirectoryFiles(string $paramdirPath, array $paramcount) : array +function GetDirectoryFiles(string $dirPath, array $count): array { -global $raylib; -return $raylib->GetDirectoryFiles($paramdirPath, $paramcount); + global $raylib; + return $raylib->GetDirectoryFiles($dirPath, $count); } /** * Clear directory files paths buffers (free memory) */ - function ClearDirectoryFiles() : void +function ClearDirectoryFiles(): void { -global $raylib; -$raylib->ClearDirectoryFiles(); + global $raylib; + $raylib->ClearDirectoryFiles(); } /** * Change working directory, return true on success */ - function ChangeDirectory(string $paramdir) : bool +function ChangeDirectory(string $dir): bool { -global $raylib; -return $raylib->ChangeDirectory($paramdir); + global $raylib; + return $raylib->ChangeDirectory($dir); } /** * Check if a file has been dropped into window */ - function IsFileDropped() : bool +function IsFileDropped(): bool { -global $raylib; -return $raylib->IsFileDropped(); + global $raylib; + return $raylib->IsFileDropped(); } /** * Get dropped files names (memory should be freed) */ - function GetDroppedFiles(array $paramcount) : array +function GetDroppedFiles(array $count): array { -global $raylib; -return $raylib->GetDroppedFiles($paramcount); + global $raylib; + return $raylib->GetDroppedFiles($count); } /** * Clear dropped files paths buffer (free memory) */ - function ClearDroppedFiles() : void +function ClearDroppedFiles(): void { -global $raylib; -$raylib->ClearDroppedFiles(); + global $raylib; + $raylib->ClearDroppedFiles(); } /** * Get file modification time (last write time) */ - function GetFileModTime(string $paramfileName) : int +function GetFileModTime(string $fileName): int { -global $raylib; -return $raylib->GetFileModTime($paramfileName); + global $raylib; + return $raylib->GetFileModTime($fileName); } /** * Compress data (DEFLATE algorithm) */ - function CompressData(array $paramdata, int $paramdataLength, array $paramcompDataLength) : array +function CompressData(array $data, int $dataLength, array $compDataLength): array { -global $raylib; -return $raylib->CompressData($paramdata, $paramdataLength, $paramcompDataLength); + global $raylib; + return $raylib->CompressData($data, $dataLength, $compDataLength); } /** * Decompress data (DEFLATE algorithm) */ - function DecompressData(array $paramcompData, int $paramcompDataLength, array $paramdataLength) : array +function DecompressData(array $compData, int $compDataLength, array $dataLength): array { -global $raylib; -return $raylib->DecompressData($paramcompData, $paramcompDataLength, $paramdataLength); + global $raylib; + return $raylib->DecompressData($compData, $compDataLength, $dataLength); } /** * Save integer value to storage file (to defined position), returns true on * success */ - function SaveStorageValue(int $paramposition, int $paramvalue) : bool +function SaveStorageValue(int $position, int $value): bool { -global $raylib; -return $raylib->SaveStorageValue($paramposition, $paramvalue); + global $raylib; + return $raylib->SaveStorageValue($position, $value); } /** * Load integer value from storage file (from defined position) */ - function LoadStorageValue(int $paramposition) : int +function LoadStorageValue(int $position): int { -global $raylib; -return $raylib->LoadStorageValue($paramposition); + global $raylib; + return $raylib->LoadStorageValue($position); } /** * Open URL with default system browser (if available) */ - function OpenURL(string $paramurl) : void +function OpenURL(string $url): void { -global $raylib; -$raylib->OpenURL($paramurl); + global $raylib; + $raylib->OpenURL($url); } /** * Check if a key has been pressed once */ - function IsKeyPressed(int $paramkey) : bool +function IsKeyPressed(int $key): bool { -global $raylib; -return $raylib->IsKeyPressed($paramkey); + global $raylib; + return $raylib->IsKeyPressed($key); } /** * Check if a key is being pressed */ - function IsKeyDown(int $paramkey) : bool +function IsKeyDown(int $key): bool { -global $raylib; -return $raylib->IsKeyDown($paramkey); + global $raylib; + return $raylib->IsKeyDown($key); } /** * Check if a key has been released once */ - function IsKeyReleased(int $paramkey) : bool +function IsKeyReleased(int $key): bool { -global $raylib; -return $raylib->IsKeyReleased($paramkey); + global $raylib; + return $raylib->IsKeyReleased($key); } /** * Check if a key is NOT being pressed */ - function IsKeyUp(int $paramkey) : bool +function IsKeyUp(int $key): bool { -global $raylib; -return $raylib->IsKeyUp($paramkey); + global $raylib; + return $raylib->IsKeyUp($key); } /** * Set a custom key to exit program (default is ESC) */ - function SetExitKey(int $paramkey) : void +function SetExitKey(int $key): void { -global $raylib; -$raylib->SetExitKey($paramkey); + global $raylib; + $raylib->SetExitKey($key); } /** * Get key pressed (keycode), call it multiple times for keys queued */ - function GetKeyPressed() : int +function GetKeyPressed(): int { -global $raylib; -return $raylib->GetKeyPressed(); + global $raylib; + return $raylib->GetKeyPressed(); } /** * Get char pressed (unicode), call it multiple times for chars queued */ - function GetCharPressed() : int +function GetCharPressed(): int { -global $raylib; -return $raylib->GetCharPressed(); + global $raylib; + return $raylib->GetCharPressed(); } /** * Check if a gamepad is available */ - function IsGamepadAvailable(int $paramgamepad) : bool +function IsGamepadAvailable(int $gamepad): bool { -global $raylib; -return $raylib->IsGamepadAvailable($paramgamepad); + global $raylib; + return $raylib->IsGamepadAvailable($gamepad); } /** * Check gamepad name (if available) */ - function IsGamepadName(int $paramgamepad, string $paramname) : bool +function IsGamepadName(int $gamepad, string $name): bool { -global $raylib; -return $raylib->IsGamepadName($paramgamepad, $paramname); + global $raylib; + return $raylib->IsGamepadName($gamepad, $name); } /** * Get gamepad internal name id */ - function GetGamepadName(int $paramgamepad) : string +function GetGamepadName(int $gamepad): string { -global $raylib; -return $raylib->GetGamepadName($paramgamepad); + global $raylib; + return $raylib->GetGamepadName($gamepad); } /** * Check if a gamepad button has been pressed once */ - function IsGamepadButtonPressed(int $paramgamepad, int $parambutton) : bool +function IsGamepadButtonPressed(int $gamepad, int $button): bool { -global $raylib; -return $raylib->IsGamepadButtonPressed($paramgamepad, $parambutton); + global $raylib; + return $raylib->IsGamepadButtonPressed($gamepad, $button); } /** * Check if a gamepad button is being pressed */ - function IsGamepadButtonDown(int $paramgamepad, int $parambutton) : bool +function IsGamepadButtonDown(int $gamepad, int $button): bool { -global $raylib; -return $raylib->IsGamepadButtonDown($paramgamepad, $parambutton); + global $raylib; + return $raylib->IsGamepadButtonDown($gamepad, $button); } /** * Check if a gamepad button has been released once */ - function IsGamepadButtonReleased(int $paramgamepad, int $parambutton) : bool +function IsGamepadButtonReleased(int $gamepad, int $button): bool { -global $raylib; -return $raylib->IsGamepadButtonReleased($paramgamepad, $parambutton); + global $raylib; + return $raylib->IsGamepadButtonReleased($gamepad, $button); } /** * Check if a gamepad button is NOT being pressed */ - function IsGamepadButtonUp(int $paramgamepad, int $parambutton) : bool +function IsGamepadButtonUp(int $gamepad, int $button): bool { -global $raylib; -return $raylib->IsGamepadButtonUp($paramgamepad, $parambutton); + global $raylib; + return $raylib->IsGamepadButtonUp($gamepad, $button); } /** * Get the last gamepad button pressed */ - function GetGamepadButtonPressed() : int +function GetGamepadButtonPressed(): int { -global $raylib; -return $raylib->GetGamepadButtonPressed(); + global $raylib; + return $raylib->GetGamepadButtonPressed(); } /** * Get gamepad axis count for a gamepad */ - function GetGamepadAxisCount(int $paramgamepad) : int +function GetGamepadAxisCount(int $gamepad): int { -global $raylib; -return $raylib->GetGamepadAxisCount($paramgamepad); + global $raylib; + return $raylib->GetGamepadAxisCount($gamepad); } /** * Get axis movement value for a gamepad axis */ - function GetGamepadAxisMovement(int $paramgamepad, int $paramaxis) : float +function GetGamepadAxisMovement(int $gamepad, int $axis): float { -global $raylib; -return $raylib->GetGamepadAxisMovement($paramgamepad, $paramaxis); + global $raylib; + return $raylib->GetGamepadAxisMovement($gamepad, $axis); } /** * Set internal gamepad mappings (SDL_GameControllerDB) */ - function SetGamepadMappings(string $parammappings) : int +function SetGamepadMappings(string $mappings): int { -global $raylib; -return $raylib->SetGamepadMappings($parammappings); + global $raylib; + return $raylib->SetGamepadMappings($mappings); } /** * Check if a mouse button has been pressed once */ - function IsMouseButtonPressed(int $parambutton) : bool +function IsMouseButtonPressed(int $button): bool { -global $raylib; -return $raylib->IsMouseButtonPressed($parambutton); + global $raylib; + return $raylib->IsMouseButtonPressed($button); } /** * Check if a mouse button is being pressed */ - function IsMouseButtonDown(int $parambutton) : bool +function IsMouseButtonDown(int $button): bool { -global $raylib; -return $raylib->IsMouseButtonDown($parambutton); + global $raylib; + return $raylib->IsMouseButtonDown($button); } /** * Check if a mouse button has been released once */ - function IsMouseButtonReleased(int $parambutton) : bool +function IsMouseButtonReleased(int $button): bool { -global $raylib; -return $raylib->IsMouseButtonReleased($parambutton); + global $raylib; + return $raylib->IsMouseButtonReleased($button); } /** * Check if a mouse button is NOT being pressed */ - function IsMouseButtonUp(int $parambutton) : bool +function IsMouseButtonUp(int $button): bool { -global $raylib; -return $raylib->IsMouseButtonUp($parambutton); + global $raylib; + return $raylib->IsMouseButtonUp($button); } /** * Get mouse position X */ - function GetMouseX() : int +function GetMouseX(): int { -global $raylib; -return $raylib->GetMouseX(); + global $raylib; + return $raylib->GetMouseX(); } /** * Get mouse position Y */ - function GetMouseY() : int +function GetMouseY(): int { -global $raylib; -return $raylib->GetMouseY(); + global $raylib; + return $raylib->GetMouseY(); } /** * Get mouse position XY */ - function GetMousePosition() : \Nawarian\Raylib\Generated\Vector2 +function GetMousePosition(): \Nawarian\Raylib\Generated\Vector2 { -global $raylib; -return \Nawarian\Raylib\Generated\Vector2::fromCData($raylib->GetMousePosition()); + global $raylib; + return \Nawarian\Raylib\Generated\Vector2::fromCData($raylib->GetMousePosition()); } /** * Set mouse position XY */ - function SetMousePosition(int $paramx, int $paramy) : void +function SetMousePosition(int $x, int $y): void { -global $raylib; -$raylib->SetMousePosition($paramx, $paramy); + global $raylib; + $raylib->SetMousePosition($x, $y); } /** * Set mouse offset */ - function SetMouseOffset(int $paramoffsetX, int $paramoffsetY) : void +function SetMouseOffset(int $offsetX, int $offsetY): void { -global $raylib; -$raylib->SetMouseOffset($paramoffsetX, $paramoffsetY); + global $raylib; + $raylib->SetMouseOffset($offsetX, $offsetY); } /** * Set mouse scaling */ - function SetMouseScale(float $paramscaleX, float $paramscaleY) : void +function SetMouseScale(float $scaleX, float $scaleY): void { -global $raylib; -$raylib->SetMouseScale($paramscaleX, $paramscaleY); + global $raylib; + $raylib->SetMouseScale($scaleX, $scaleY); } /** * Get mouse wheel movement Y */ - function GetMouseWheelMove() : float +function GetMouseWheelMove(): float { -global $raylib; -return $raylib->GetMouseWheelMove(); + global $raylib; + return $raylib->GetMouseWheelMove(); } /** * Set mouse cursor */ - function SetMouseCursor(int $paramcursor) : void +function SetMouseCursor(int $cursor): void { -global $raylib; -$raylib->SetMouseCursor($paramcursor); + global $raylib; + $raylib->SetMouseCursor($cursor); } /** * Get touch position X for touch point 0 (relative to screen size) */ - function GetTouchX() : int +function GetTouchX(): int { -global $raylib; -return $raylib->GetTouchX(); + global $raylib; + return $raylib->GetTouchX(); } /** * Get touch position Y for touch point 0 (relative to screen size) */ - function GetTouchY() : int +function GetTouchY(): int { -global $raylib; -return $raylib->GetTouchY(); + global $raylib; + return $raylib->GetTouchY(); } /** * Get touch position XY for a touch point index (relative to screen size) */ - function GetTouchPosition(int $paramindex) : \Nawarian\Raylib\Generated\Vector2 +function GetTouchPosition(int $index): \Nawarian\Raylib\Generated\Vector2 { -global $raylib; -return \Nawarian\Raylib\Generated\Vector2::fromCData($raylib->GetTouchPosition($paramindex)); + global $raylib; + return \Nawarian\Raylib\Generated\Vector2::fromCData($raylib->GetTouchPosition($index)); } /** * Enable a set of gestures using flags */ - function SetGesturesEnabled(int $paramflags) : void +function SetGesturesEnabled(int $flags): void { -global $raylib; -$raylib->SetGesturesEnabled($paramflags); + global $raylib; + $raylib->SetGesturesEnabled($flags); } /** * Check if a gesture have been detected */ - function IsGestureDetected(int $paramgesture) : bool +function IsGestureDetected(int $gesture): bool { -global $raylib; -return $raylib->IsGestureDetected($paramgesture); + global $raylib; + return $raylib->IsGestureDetected($gesture); } /** * Get latest detected gesture */ - function GetGestureDetected() : int +function GetGestureDetected(): int { -global $raylib; -return $raylib->GetGestureDetected(); + global $raylib; + return $raylib->GetGestureDetected(); } /** * Get touch points count */ - function GetTouchPointsCount() : int +function GetTouchPointsCount(): int { -global $raylib; -return $raylib->GetTouchPointsCount(); + global $raylib; + return $raylib->GetTouchPointsCount(); } /** * Get gesture hold time in milliseconds */ - function GetGestureHoldDuration() : float +function GetGestureHoldDuration(): float { -global $raylib; -return $raylib->GetGestureHoldDuration(); + global $raylib; + return $raylib->GetGestureHoldDuration(); } /** * Get gesture drag vector */ - function GetGestureDragVector() : \Nawarian\Raylib\Generated\Vector2 +function GetGestureDragVector(): \Nawarian\Raylib\Generated\Vector2 { -global $raylib; -return \Nawarian\Raylib\Generated\Vector2::fromCData($raylib->GetGestureDragVector()); + global $raylib; + return \Nawarian\Raylib\Generated\Vector2::fromCData($raylib->GetGestureDragVector()); } /** * Get gesture drag angle */ - function GetGestureDragAngle() : float +function GetGestureDragAngle(): float { -global $raylib; -return $raylib->GetGestureDragAngle(); + global $raylib; + return $raylib->GetGestureDragAngle(); } /** * Get gesture pinch delta */ - function GetGesturePinchVector() : \Nawarian\Raylib\Generated\Vector2 +function GetGesturePinchVector(): \Nawarian\Raylib\Generated\Vector2 { -global $raylib; -return \Nawarian\Raylib\Generated\Vector2::fromCData($raylib->GetGesturePinchVector()); + global $raylib; + return \Nawarian\Raylib\Generated\Vector2::fromCData($raylib->GetGesturePinchVector()); } /** * Get gesture pinch angle */ - function GetGesturePinchAngle() : float +function GetGesturePinchAngle(): float { -global $raylib; -return $raylib->GetGesturePinchAngle(); + global $raylib; + return $raylib->GetGesturePinchAngle(); } /** * Set camera mode (multiple camera modes available) */ - function SetCameraMode(\Nawarian\Raylib\Generated\Camera3D $paramcamera, int $parammode) : void +function SetCameraMode(\Nawarian\Raylib\Generated\Camera3D $camera, int $mode): void { -global $raylib; -$raylib->SetCameraMode($paramcamera->toCData(), $parammode); + global $raylib; + $raylib->SetCameraMode($camera->toCData(), $mode); } /** * Update camera position for selected mode */ - function UpdateCamera(\Nawarian\Raylib\Generated\Camera3D $paramcamera) : void +function UpdateCamera(\Nawarian\Raylib\Generated\Camera3D $camera): void { -global $raylib; -$raylib->UpdateCamera($paramcamera->toCData()); + global $raylib; + $raylib->UpdateCamera($camera->toCData()); } /** * Set camera pan key to combine with mouse movement (free camera) */ - function SetCameraPanControl(int $paramkeyPan) : void +function SetCameraPanControl(int $keyPan): void { -global $raylib; -$raylib->SetCameraPanControl($paramkeyPan); + global $raylib; + $raylib->SetCameraPanControl($keyPan); } /** * Set camera alt key to combine with mouse movement (free camera) */ - function SetCameraAltControl(int $paramkeyAlt) : void +function SetCameraAltControl(int $keyAlt): void { -global $raylib; -$raylib->SetCameraAltControl($paramkeyAlt); + global $raylib; + $raylib->SetCameraAltControl($keyAlt); } /** * Set camera smooth zoom key to combine with mouse (free camera) */ - function SetCameraSmoothZoomControl(int $paramkeySmoothZoom) : void +function SetCameraSmoothZoomControl(int $keySmoothZoom): void { -global $raylib; -$raylib->SetCameraSmoothZoomControl($paramkeySmoothZoom); + global $raylib; + $raylib->SetCameraSmoothZoomControl($keySmoothZoom); } /** * Set camera move controls (1st person and 3rd person cameras) */ - function SetCameraMoveControls(int $paramkeyFront, int $paramkeyBack, int $paramkeyRight, int $paramkeyLeft, int $paramkeyUp, int $paramkeyDown) : void +function SetCameraMoveControls(int $keyFront, int $keyBack, int $keyRight, int $keyLeft, int $keyUp, int $keyDown): void { -global $raylib; -$raylib->SetCameraMoveControls($paramkeyFront, $paramkeyBack, $paramkeyRight, $paramkeyLeft, $paramkeyUp, $paramkeyDown); + global $raylib; + $raylib->SetCameraMoveControls($keyFront, $keyBack, $keyRight, $keyLeft, $keyUp, $keyDown); } /** * Set texture and rectangle to be used on shapes drawing */ - function SetShapesTexture(\Nawarian\Raylib\Generated\Texture $paramtexture, \Nawarian\Raylib\Generated\Rectangle $paramsource) : void +function SetShapesTexture(\Nawarian\Raylib\Generated\Texture $texture, \Nawarian\Raylib\Generated\Rectangle $source): void { -global $raylib; -$raylib->SetShapesTexture($paramtexture->toCData(), $paramsource->toCData()); + global $raylib; + $raylib->SetShapesTexture($texture->toCData(), $source->toCData()); } /** * Draw a pixel */ - function DrawPixel(int $paramposX, int $paramposY, \Nawarian\Raylib\Generated\Color $paramcolor) : void +function DrawPixel(int $posX, int $posY, \Nawarian\Raylib\Generated\Color $color): void { -global $raylib; -$raylib->DrawPixel($paramposX, $paramposY, $paramcolor->toCData()); + global $raylib; + $raylib->DrawPixel($posX, $posY, $color->toCData()); } /** * Draw a pixel (Vector version) */ - function DrawPixelV(\Nawarian\Raylib\Generated\Vector2 $paramposition, \Nawarian\Raylib\Generated\Color $paramcolor) : void +function DrawPixelV(\Nawarian\Raylib\Generated\Vector2 $position, \Nawarian\Raylib\Generated\Color $color): void { -global $raylib; -$raylib->DrawPixelV($paramposition->toCData(), $paramcolor->toCData()); + global $raylib; + $raylib->DrawPixelV($position->toCData(), $color->toCData()); } /** * Draw a line */ - function DrawLine(int $paramstartPosX, int $paramstartPosY, int $paramendPosX, int $paramendPosY, \Nawarian\Raylib\Generated\Color $paramcolor) : void +function DrawLine(int $startPosX, int $startPosY, int $endPosX, int $endPosY, \Nawarian\Raylib\Generated\Color $color): void { -global $raylib; -$raylib->DrawLine($paramstartPosX, $paramstartPosY, $paramendPosX, $paramendPosY, $paramcolor->toCData()); + global $raylib; + $raylib->DrawLine($startPosX, $startPosY, $endPosX, $endPosY, $color->toCData()); } /** * Draw a line (Vector version) */ - function DrawLineV(\Nawarian\Raylib\Generated\Vector2 $paramstartPos, \Nawarian\Raylib\Generated\Vector2 $paramendPos, \Nawarian\Raylib\Generated\Color $paramcolor) : void +function DrawLineV(\Nawarian\Raylib\Generated\Vector2 $startPos, \Nawarian\Raylib\Generated\Vector2 $endPos, \Nawarian\Raylib\Generated\Color $color): void { -global $raylib; -$raylib->DrawLineV($paramstartPos->toCData(), $paramendPos->toCData(), $paramcolor->toCData()); + global $raylib; + $raylib->DrawLineV($startPos->toCData(), $endPos->toCData(), $color->toCData()); } /** * Draw a line defining thickness */ - function DrawLineEx(\Nawarian\Raylib\Generated\Vector2 $paramstartPos, \Nawarian\Raylib\Generated\Vector2 $paramendPos, float $paramthick, \Nawarian\Raylib\Generated\Color $paramcolor) : void +function DrawLineEx(\Nawarian\Raylib\Generated\Vector2 $startPos, \Nawarian\Raylib\Generated\Vector2 $endPos, float $thick, \Nawarian\Raylib\Generated\Color $color): void { -global $raylib; -$raylib->DrawLineEx($paramstartPos->toCData(), $paramendPos->toCData(), $paramthick, $paramcolor->toCData()); + global $raylib; + $raylib->DrawLineEx($startPos->toCData(), $endPos->toCData(), $thick, $color->toCData()); } /** * Draw a line using cubic-bezier curves in-out */ - function DrawLineBezier(\Nawarian\Raylib\Generated\Vector2 $paramstartPos, \Nawarian\Raylib\Generated\Vector2 $paramendPos, float $paramthick, \Nawarian\Raylib\Generated\Color $paramcolor) : void +function DrawLineBezier(\Nawarian\Raylib\Generated\Vector2 $startPos, \Nawarian\Raylib\Generated\Vector2 $endPos, float $thick, \Nawarian\Raylib\Generated\Color $color): void { -global $raylib; -$raylib->DrawLineBezier($paramstartPos->toCData(), $paramendPos->toCData(), $paramthick, $paramcolor->toCData()); + global $raylib; + $raylib->DrawLineBezier($startPos->toCData(), $endPos->toCData(), $thick, $color->toCData()); } /** * raw line using quadratic bezier curves with a control point */ - function DrawLineBezierQuad(\Nawarian\Raylib\Generated\Vector2 $paramstartPos, \Nawarian\Raylib\Generated\Vector2 $paramendPos, \Nawarian\Raylib\Generated\Vector2 $paramcontrolPos, float $paramthick, \Nawarian\Raylib\Generated\Color $paramcolor) : void +function DrawLineBezierQuad(\Nawarian\Raylib\Generated\Vector2 $startPos, \Nawarian\Raylib\Generated\Vector2 $endPos, \Nawarian\Raylib\Generated\Vector2 $controlPos, float $thick, \Nawarian\Raylib\Generated\Color $color): void { -global $raylib; -$raylib->DrawLineBezierQuad($paramstartPos->toCData(), $paramendPos->toCData(), $paramcontrolPos->toCData(), $paramthick, $paramcolor->toCData()); + global $raylib; + $raylib->DrawLineBezierQuad($startPos->toCData(), $endPos->toCData(), $controlPos->toCData(), $thick, $color->toCData()); } /** * Draw lines sequence */ - function DrawLineStrip(\Nawarian\Raylib\Generated\Vector2 $parampoints, int $parampointsCount, \Nawarian\Raylib\Generated\Color $paramcolor) : void +function DrawLineStrip(\Nawarian\Raylib\Generated\Vector2 $points, int $pointsCount, \Nawarian\Raylib\Generated\Color $color): void { -global $raylib; -$raylib->DrawLineStrip($parampoints->toCData(), $parampointsCount, $paramcolor->toCData()); + global $raylib; + $raylib->DrawLineStrip($points->toCData(), $pointsCount, $color->toCData()); } /** * Draw a color-filled circle */ - function DrawCircle(int $paramcenterX, int $paramcenterY, float $paramradius, \Nawarian\Raylib\Generated\Color $paramcolor) : void +function DrawCircle(int $centerX, int $centerY, float $radius, \Nawarian\Raylib\Generated\Color $color): void { -global $raylib; -$raylib->DrawCircle($paramcenterX, $paramcenterY, $paramradius, $paramcolor->toCData()); + global $raylib; + $raylib->DrawCircle($centerX, $centerY, $radius, $color->toCData()); } /** * Draw a piece of a circle */ - function DrawCircleSector(\Nawarian\Raylib\Generated\Vector2 $paramcenter, float $paramradius, float $paramstartAngle, float $paramendAngle, int $paramsegments, \Nawarian\Raylib\Generated\Color $paramcolor) : void +function DrawCircleSector(\Nawarian\Raylib\Generated\Vector2 $center, float $radius, float $startAngle, float $endAngle, int $segments, \Nawarian\Raylib\Generated\Color $color): void { -global $raylib; -$raylib->DrawCircleSector($paramcenter->toCData(), $paramradius, $paramstartAngle, $paramendAngle, $paramsegments, $paramcolor->toCData()); + global $raylib; + $raylib->DrawCircleSector($center->toCData(), $radius, $startAngle, $endAngle, $segments, $color->toCData()); } /** * Draw circle sector outline */ - function DrawCircleSectorLines(\Nawarian\Raylib\Generated\Vector2 $paramcenter, float $paramradius, float $paramstartAngle, float $paramendAngle, int $paramsegments, \Nawarian\Raylib\Generated\Color $paramcolor) : void +function DrawCircleSectorLines(\Nawarian\Raylib\Generated\Vector2 $center, float $radius, float $startAngle, float $endAngle, int $segments, \Nawarian\Raylib\Generated\Color $color): void { -global $raylib; -$raylib->DrawCircleSectorLines($paramcenter->toCData(), $paramradius, $paramstartAngle, $paramendAngle, $paramsegments, $paramcolor->toCData()); + global $raylib; + $raylib->DrawCircleSectorLines($center->toCData(), $radius, $startAngle, $endAngle, $segments, $color->toCData()); } /** * Draw a gradient-filled circle */ - function DrawCircleGradient(int $paramcenterX, int $paramcenterY, float $paramradius, \Nawarian\Raylib\Generated\Color $paramcolor1, \Nawarian\Raylib\Generated\Color $paramcolor2) : void +function DrawCircleGradient(int $centerX, int $centerY, float $radius, \Nawarian\Raylib\Generated\Color $color1, \Nawarian\Raylib\Generated\Color $color2): void { -global $raylib; -$raylib->DrawCircleGradient($paramcenterX, $paramcenterY, $paramradius, $paramcolor1->toCData(), $paramcolor2->toCData()); + global $raylib; + $raylib->DrawCircleGradient($centerX, $centerY, $radius, $color1->toCData(), $color2->toCData()); } /** * Draw a color-filled circle (Vector version) */ - function DrawCircleV(\Nawarian\Raylib\Generated\Vector2 $paramcenter, float $paramradius, \Nawarian\Raylib\Generated\Color $paramcolor) : void +function DrawCircleV(\Nawarian\Raylib\Generated\Vector2 $center, float $radius, \Nawarian\Raylib\Generated\Color $color): void { -global $raylib; -$raylib->DrawCircleV($paramcenter->toCData(), $paramradius, $paramcolor->toCData()); + global $raylib; + $raylib->DrawCircleV($center->toCData(), $radius, $color->toCData()); } /** * Draw circle outline */ - function DrawCircleLines(int $paramcenterX, int $paramcenterY, float $paramradius, \Nawarian\Raylib\Generated\Color $paramcolor) : void +function DrawCircleLines(int $centerX, int $centerY, float $radius, \Nawarian\Raylib\Generated\Color $color): void { -global $raylib; -$raylib->DrawCircleLines($paramcenterX, $paramcenterY, $paramradius, $paramcolor->toCData()); + global $raylib; + $raylib->DrawCircleLines($centerX, $centerY, $radius, $color->toCData()); } /** * Draw ellipse */ - function DrawEllipse(int $paramcenterX, int $paramcenterY, float $paramradiusH, float $paramradiusV, \Nawarian\Raylib\Generated\Color $paramcolor) : void +function DrawEllipse(int $centerX, int $centerY, float $radiusH, float $radiusV, \Nawarian\Raylib\Generated\Color $color): void { -global $raylib; -$raylib->DrawEllipse($paramcenterX, $paramcenterY, $paramradiusH, $paramradiusV, $paramcolor->toCData()); + global $raylib; + $raylib->DrawEllipse($centerX, $centerY, $radiusH, $radiusV, $color->toCData()); } /** * Draw ellipse outline */ - function DrawEllipseLines(int $paramcenterX, int $paramcenterY, float $paramradiusH, float $paramradiusV, \Nawarian\Raylib\Generated\Color $paramcolor) : void +function DrawEllipseLines(int $centerX, int $centerY, float $radiusH, float $radiusV, \Nawarian\Raylib\Generated\Color $color): void { -global $raylib; -$raylib->DrawEllipseLines($paramcenterX, $paramcenterY, $paramradiusH, $paramradiusV, $paramcolor->toCData()); + global $raylib; + $raylib->DrawEllipseLines($centerX, $centerY, $radiusH, $radiusV, $color->toCData()); } /** * Draw ring */ - function DrawRing(\Nawarian\Raylib\Generated\Vector2 $paramcenter, float $paraminnerRadius, float $paramouterRadius, float $paramstartAngle, float $paramendAngle, int $paramsegments, \Nawarian\Raylib\Generated\Color $paramcolor) : void +function DrawRing(\Nawarian\Raylib\Generated\Vector2 $center, float $innerRadius, float $outerRadius, float $startAngle, float $endAngle, int $segments, \Nawarian\Raylib\Generated\Color $color): void { -global $raylib; -$raylib->DrawRing($paramcenter->toCData(), $paraminnerRadius, $paramouterRadius, $paramstartAngle, $paramendAngle, $paramsegments, $paramcolor->toCData()); + global $raylib; + $raylib->DrawRing($center->toCData(), $innerRadius, $outerRadius, $startAngle, $endAngle, $segments, $color->toCData()); } /** * Draw ring outline */ - function DrawRingLines(\Nawarian\Raylib\Generated\Vector2 $paramcenter, float $paraminnerRadius, float $paramouterRadius, float $paramstartAngle, float $paramendAngle, int $paramsegments, \Nawarian\Raylib\Generated\Color $paramcolor) : void +function DrawRingLines(\Nawarian\Raylib\Generated\Vector2 $center, float $innerRadius, float $outerRadius, float $startAngle, float $endAngle, int $segments, \Nawarian\Raylib\Generated\Color $color): void { -global $raylib; -$raylib->DrawRingLines($paramcenter->toCData(), $paraminnerRadius, $paramouterRadius, $paramstartAngle, $paramendAngle, $paramsegments, $paramcolor->toCData()); + global $raylib; + $raylib->DrawRingLines($center->toCData(), $innerRadius, $outerRadius, $startAngle, $endAngle, $segments, $color->toCData()); } /** * Draw a color-filled rectangle */ - function DrawRectangle(int $paramposX, int $paramposY, int $paramwidth, int $paramheight, \Nawarian\Raylib\Generated\Color $paramcolor) : void +function DrawRectangle(int $posX, int $posY, int $width, int $height, \Nawarian\Raylib\Generated\Color $color): void { -global $raylib; -$raylib->DrawRectangle($paramposX, $paramposY, $paramwidth, $paramheight, $paramcolor->toCData()); + global $raylib; + $raylib->DrawRectangle($posX, $posY, $width, $height, $color->toCData()); } /** * Draw a color-filled rectangle (Vector version) */ - function DrawRectangleV(\Nawarian\Raylib\Generated\Vector2 $paramposition, \Nawarian\Raylib\Generated\Vector2 $paramsize, \Nawarian\Raylib\Generated\Color $paramcolor) : void +function DrawRectangleV(\Nawarian\Raylib\Generated\Vector2 $position, \Nawarian\Raylib\Generated\Vector2 $size, \Nawarian\Raylib\Generated\Color $color): void { -global $raylib; -$raylib->DrawRectangleV($paramposition->toCData(), $paramsize->toCData(), $paramcolor->toCData()); + global $raylib; + $raylib->DrawRectangleV($position->toCData(), $size->toCData(), $color->toCData()); } /** * Draw a color-filled rectangle */ - function DrawRectangleRec(\Nawarian\Raylib\Generated\Rectangle $paramrec, \Nawarian\Raylib\Generated\Color $paramcolor) : void +function DrawRectangleRec(\Nawarian\Raylib\Generated\Rectangle $rec, \Nawarian\Raylib\Generated\Color $color): void { -global $raylib; -$raylib->DrawRectangleRec($paramrec->toCData(), $paramcolor->toCData()); + global $raylib; + $raylib->DrawRectangleRec($rec->toCData(), $color->toCData()); } /** * Draw a color-filled rectangle with pro parameters */ - function DrawRectanglePro(\Nawarian\Raylib\Generated\Rectangle $paramrec, \Nawarian\Raylib\Generated\Vector2 $paramorigin, float $paramrotation, \Nawarian\Raylib\Generated\Color $paramcolor) : void +function DrawRectanglePro(\Nawarian\Raylib\Generated\Rectangle $rec, \Nawarian\Raylib\Generated\Vector2 $origin, float $rotation, \Nawarian\Raylib\Generated\Color $color): void { -global $raylib; -$raylib->DrawRectanglePro($paramrec->toCData(), $paramorigin->toCData(), $paramrotation, $paramcolor->toCData()); + global $raylib; + $raylib->DrawRectanglePro($rec->toCData(), $origin->toCData(), $rotation, $color->toCData()); } /** * Draw a vertical-gradient-filled rectangle */ - function DrawRectangleGradientV(int $paramposX, int $paramposY, int $paramwidth, int $paramheight, \Nawarian\Raylib\Generated\Color $paramcolor1, \Nawarian\Raylib\Generated\Color $paramcolor2) : void +function DrawRectangleGradientV(int $posX, int $posY, int $width, int $height, \Nawarian\Raylib\Generated\Color $color1, \Nawarian\Raylib\Generated\Color $color2): void { -global $raylib; -$raylib->DrawRectangleGradientV($paramposX, $paramposY, $paramwidth, $paramheight, $paramcolor1->toCData(), $paramcolor2->toCData()); + global $raylib; + $raylib->DrawRectangleGradientV($posX, $posY, $width, $height, $color1->toCData(), $color2->toCData()); } /** * Draw a horizontal-gradient-filled rectangle */ - function DrawRectangleGradientH(int $paramposX, int $paramposY, int $paramwidth, int $paramheight, \Nawarian\Raylib\Generated\Color $paramcolor1, \Nawarian\Raylib\Generated\Color $paramcolor2) : void +function DrawRectangleGradientH(int $posX, int $posY, int $width, int $height, \Nawarian\Raylib\Generated\Color $color1, \Nawarian\Raylib\Generated\Color $color2): void { -global $raylib; -$raylib->DrawRectangleGradientH($paramposX, $paramposY, $paramwidth, $paramheight, $paramcolor1->toCData(), $paramcolor2->toCData()); + global $raylib; + $raylib->DrawRectangleGradientH($posX, $posY, $width, $height, $color1->toCData(), $color2->toCData()); } /** * Draw a gradient-filled rectangle with custom vertex colors */ - function DrawRectangleGradientEx(\Nawarian\Raylib\Generated\Rectangle $paramrec, \Nawarian\Raylib\Generated\Color $paramcol1, \Nawarian\Raylib\Generated\Color $paramcol2, \Nawarian\Raylib\Generated\Color $paramcol3, \Nawarian\Raylib\Generated\Color $paramcol4) : void +function DrawRectangleGradientEx(\Nawarian\Raylib\Generated\Rectangle $rec, \Nawarian\Raylib\Generated\Color $col1, \Nawarian\Raylib\Generated\Color $col2, \Nawarian\Raylib\Generated\Color $col3, \Nawarian\Raylib\Generated\Color $col4): void { -global $raylib; -$raylib->DrawRectangleGradientEx($paramrec->toCData(), $paramcol1->toCData(), $paramcol2->toCData(), $paramcol3->toCData(), $paramcol4->toCData()); + global $raylib; + $raylib->DrawRectangleGradientEx($rec->toCData(), $col1->toCData(), $col2->toCData(), $col3->toCData(), $col4->toCData()); } /** * Draw rectangle outline */ - function DrawRectangleLines(int $paramposX, int $paramposY, int $paramwidth, int $paramheight, \Nawarian\Raylib\Generated\Color $paramcolor) : void +function DrawRectangleLines(int $posX, int $posY, int $width, int $height, \Nawarian\Raylib\Generated\Color $color): void { -global $raylib; -$raylib->DrawRectangleLines($paramposX, $paramposY, $paramwidth, $paramheight, $paramcolor->toCData()); + global $raylib; + $raylib->DrawRectangleLines($posX, $posY, $width, $height, $color->toCData()); } /** * Draw rectangle outline with extended parameters */ - function DrawRectangleLinesEx(\Nawarian\Raylib\Generated\Rectangle $paramrec, float $paramlineThick, \Nawarian\Raylib\Generated\Color $paramcolor) : void +function DrawRectangleLinesEx(\Nawarian\Raylib\Generated\Rectangle $rec, float $lineThick, \Nawarian\Raylib\Generated\Color $color): void { -global $raylib; -$raylib->DrawRectangleLinesEx($paramrec->toCData(), $paramlineThick, $paramcolor->toCData()); + global $raylib; + $raylib->DrawRectangleLinesEx($rec->toCData(), $lineThick, $color->toCData()); } /** * Draw rectangle with rounded edges */ - function DrawRectangleRounded(\Nawarian\Raylib\Generated\Rectangle $paramrec, float $paramroundness, int $paramsegments, \Nawarian\Raylib\Generated\Color $paramcolor) : void +function DrawRectangleRounded(\Nawarian\Raylib\Generated\Rectangle $rec, float $roundness, int $segments, \Nawarian\Raylib\Generated\Color $color): void { -global $raylib; -$raylib->DrawRectangleRounded($paramrec->toCData(), $paramroundness, $paramsegments, $paramcolor->toCData()); + global $raylib; + $raylib->DrawRectangleRounded($rec->toCData(), $roundness, $segments, $color->toCData()); } /** * Draw rectangle with rounded edges outline */ - function DrawRectangleRoundedLines(\Nawarian\Raylib\Generated\Rectangle $paramrec, float $paramroundness, int $paramsegments, float $paramlineThick, \Nawarian\Raylib\Generated\Color $paramcolor) : void +function DrawRectangleRoundedLines(\Nawarian\Raylib\Generated\Rectangle $rec, float $roundness, int $segments, float $lineThick, \Nawarian\Raylib\Generated\Color $color): void { -global $raylib; -$raylib->DrawRectangleRoundedLines($paramrec->toCData(), $paramroundness, $paramsegments, $paramlineThick, $paramcolor->toCData()); + global $raylib; + $raylib->DrawRectangleRoundedLines($rec->toCData(), $roundness, $segments, $lineThick, $color->toCData()); } /** * Draw a color-filled triangle (vertex in counter-clockwise order!) */ - function DrawTriangle(\Nawarian\Raylib\Generated\Vector2 $paramv1, \Nawarian\Raylib\Generated\Vector2 $paramv2, \Nawarian\Raylib\Generated\Vector2 $paramv3, \Nawarian\Raylib\Generated\Color $paramcolor) : void +function DrawTriangle(\Nawarian\Raylib\Generated\Vector2 $v1, \Nawarian\Raylib\Generated\Vector2 $v2, \Nawarian\Raylib\Generated\Vector2 $v3, \Nawarian\Raylib\Generated\Color $color): void { -global $raylib; -$raylib->DrawTriangle($paramv1->toCData(), $paramv2->toCData(), $paramv3->toCData(), $paramcolor->toCData()); + global $raylib; + $raylib->DrawTriangle($v1->toCData(), $v2->toCData(), $v3->toCData(), $color->toCData()); } /** * Draw triangle outline (vertex in counter-clockwise order!) */ - function DrawTriangleLines(\Nawarian\Raylib\Generated\Vector2 $paramv1, \Nawarian\Raylib\Generated\Vector2 $paramv2, \Nawarian\Raylib\Generated\Vector2 $paramv3, \Nawarian\Raylib\Generated\Color $paramcolor) : void +function DrawTriangleLines(\Nawarian\Raylib\Generated\Vector2 $v1, \Nawarian\Raylib\Generated\Vector2 $v2, \Nawarian\Raylib\Generated\Vector2 $v3, \Nawarian\Raylib\Generated\Color $color): void { -global $raylib; -$raylib->DrawTriangleLines($paramv1->toCData(), $paramv2->toCData(), $paramv3->toCData(), $paramcolor->toCData()); + global $raylib; + $raylib->DrawTriangleLines($v1->toCData(), $v2->toCData(), $v3->toCData(), $color->toCData()); } /** * Draw a triangle fan defined by points (first vertex is the center) */ - function DrawTriangleFan(\Nawarian\Raylib\Generated\Vector2 $parampoints, int $parampointsCount, \Nawarian\Raylib\Generated\Color $paramcolor) : void +function DrawTriangleFan(\Nawarian\Raylib\Generated\Vector2 $points, int $pointsCount, \Nawarian\Raylib\Generated\Color $color): void { -global $raylib; -$raylib->DrawTriangleFan($parampoints->toCData(), $parampointsCount, $paramcolor->toCData()); + global $raylib; + $raylib->DrawTriangleFan($points->toCData(), $pointsCount, $color->toCData()); } /** * Draw a triangle strip defined by points */ - function DrawTriangleStrip(\Nawarian\Raylib\Generated\Vector2 $parampoints, int $parampointsCount, \Nawarian\Raylib\Generated\Color $paramcolor) : void +function DrawTriangleStrip(\Nawarian\Raylib\Generated\Vector2 $points, int $pointsCount, \Nawarian\Raylib\Generated\Color $color): void { -global $raylib; -$raylib->DrawTriangleStrip($parampoints->toCData(), $parampointsCount, $paramcolor->toCData()); + global $raylib; + $raylib->DrawTriangleStrip($points->toCData(), $pointsCount, $color->toCData()); } /** * Draw a regular polygon (Vector version) */ - function DrawPoly(\Nawarian\Raylib\Generated\Vector2 $paramcenter, int $paramsides, float $paramradius, float $paramrotation, \Nawarian\Raylib\Generated\Color $paramcolor) : void +function DrawPoly(\Nawarian\Raylib\Generated\Vector2 $center, int $sides, float $radius, float $rotation, \Nawarian\Raylib\Generated\Color $color): void { -global $raylib; -$raylib->DrawPoly($paramcenter->toCData(), $paramsides, $paramradius, $paramrotation, $paramcolor->toCData()); + global $raylib; + $raylib->DrawPoly($center->toCData(), $sides, $radius, $rotation, $color->toCData()); } /** * Draw a polygon outline of n sides */ - function DrawPolyLines(\Nawarian\Raylib\Generated\Vector2 $paramcenter, int $paramsides, float $paramradius, float $paramrotation, \Nawarian\Raylib\Generated\Color $paramcolor) : void +function DrawPolyLines(\Nawarian\Raylib\Generated\Vector2 $center, int $sides, float $radius, float $rotation, \Nawarian\Raylib\Generated\Color $color): void { -global $raylib; -$raylib->DrawPolyLines($paramcenter->toCData(), $paramsides, $paramradius, $paramrotation, $paramcolor->toCData()); + global $raylib; + $raylib->DrawPolyLines($center->toCData(), $sides, $radius, $rotation, $color->toCData()); } /** * Draw a polygon outline of n sides with extended parameters */ - function DrawPolyLinesEx(\Nawarian\Raylib\Generated\Vector2 $paramcenter, int $paramsides, float $paramradius, float $paramrotation, float $paramlineThick, \Nawarian\Raylib\Generated\Color $paramcolor) : void +function DrawPolyLinesEx(\Nawarian\Raylib\Generated\Vector2 $center, int $sides, float $radius, float $rotation, float $lineThick, \Nawarian\Raylib\Generated\Color $color): void { -global $raylib; -$raylib->DrawPolyLinesEx($paramcenter->toCData(), $paramsides, $paramradius, $paramrotation, $paramlineThick, $paramcolor->toCData()); + global $raylib; + $raylib->DrawPolyLinesEx($center->toCData(), $sides, $radius, $rotation, $lineThick, $color->toCData()); } /** * Check collision between two rectangles */ - function CheckCollisionRecs(\Nawarian\Raylib\Generated\Rectangle $paramrec1, \Nawarian\Raylib\Generated\Rectangle $paramrec2) : bool +function CheckCollisionRecs(\Nawarian\Raylib\Generated\Rectangle $rec1, \Nawarian\Raylib\Generated\Rectangle $rec2): bool { -global $raylib; -return $raylib->CheckCollisionRecs($paramrec1->toCData(), $paramrec2->toCData()); + global $raylib; + return $raylib->CheckCollisionRecs($rec1->toCData(), $rec2->toCData()); } /** * Check collision between two circles */ - function CheckCollisionCircles(\Nawarian\Raylib\Generated\Vector2 $paramcenter1, float $paramradius1, \Nawarian\Raylib\Generated\Vector2 $paramcenter2, float $paramradius2) : bool +function CheckCollisionCircles(\Nawarian\Raylib\Generated\Vector2 $center1, float $radius1, \Nawarian\Raylib\Generated\Vector2 $center2, float $radius2): bool { -global $raylib; -return $raylib->CheckCollisionCircles($paramcenter1->toCData(), $paramradius1, $paramcenter2->toCData(), $paramradius2); + global $raylib; + return $raylib->CheckCollisionCircles($center1->toCData(), $radius1, $center2->toCData(), $radius2); } /** * Check collision between circle and rectangle */ - function CheckCollisionCircleRec(\Nawarian\Raylib\Generated\Vector2 $paramcenter, float $paramradius, \Nawarian\Raylib\Generated\Rectangle $paramrec) : bool +function CheckCollisionCircleRec(\Nawarian\Raylib\Generated\Vector2 $center, float $radius, \Nawarian\Raylib\Generated\Rectangle $rec): bool { -global $raylib; -return $raylib->CheckCollisionCircleRec($paramcenter->toCData(), $paramradius, $paramrec->toCData()); + global $raylib; + return $raylib->CheckCollisionCircleRec($center->toCData(), $radius, $rec->toCData()); } /** * Check if point is inside rectangle */ - function CheckCollisionPointRec(\Nawarian\Raylib\Generated\Vector2 $parampoint, \Nawarian\Raylib\Generated\Rectangle $paramrec) : bool +function CheckCollisionPointRec(\Nawarian\Raylib\Generated\Vector2 $point, \Nawarian\Raylib\Generated\Rectangle $rec): bool { -global $raylib; -return $raylib->CheckCollisionPointRec($parampoint->toCData(), $paramrec->toCData()); + global $raylib; + return $raylib->CheckCollisionPointRec($point->toCData(), $rec->toCData()); } /** * Check if point is inside circle */ - function CheckCollisionPointCircle(\Nawarian\Raylib\Generated\Vector2 $parampoint, \Nawarian\Raylib\Generated\Vector2 $paramcenter, float $paramradius) : bool +function CheckCollisionPointCircle(\Nawarian\Raylib\Generated\Vector2 $point, \Nawarian\Raylib\Generated\Vector2 $center, float $radius): bool { -global $raylib; -return $raylib->CheckCollisionPointCircle($parampoint->toCData(), $paramcenter->toCData(), $paramradius); + global $raylib; + return $raylib->CheckCollisionPointCircle($point->toCData(), $center->toCData(), $radius); } /** * Check if point is inside a triangle */ - function CheckCollisionPointTriangle(\Nawarian\Raylib\Generated\Vector2 $parampoint, \Nawarian\Raylib\Generated\Vector2 $paramp1, \Nawarian\Raylib\Generated\Vector2 $paramp2, \Nawarian\Raylib\Generated\Vector2 $paramp3) : bool +function CheckCollisionPointTriangle(\Nawarian\Raylib\Generated\Vector2 $point, \Nawarian\Raylib\Generated\Vector2 $p1, \Nawarian\Raylib\Generated\Vector2 $p2, \Nawarian\Raylib\Generated\Vector2 $p3): bool { -global $raylib; -return $raylib->CheckCollisionPointTriangle($parampoint->toCData(), $paramp1->toCData(), $paramp2->toCData(), $paramp3->toCData()); + global $raylib; + return $raylib->CheckCollisionPointTriangle($point->toCData(), $p1->toCData(), $p2->toCData(), $p3->toCData()); } /** * Check the collision between two lines defined by two points each, returns * collision point by reference */ - function CheckCollisionLines(\Nawarian\Raylib\Generated\Vector2 $paramstartPos1, \Nawarian\Raylib\Generated\Vector2 $paramendPos1, \Nawarian\Raylib\Generated\Vector2 $paramstartPos2, \Nawarian\Raylib\Generated\Vector2 $paramendPos2, \Nawarian\Raylib\Generated\Vector2 $paramcollisionPoint) : bool +function CheckCollisionLines(\Nawarian\Raylib\Generated\Vector2 $startPos1, \Nawarian\Raylib\Generated\Vector2 $endPos1, \Nawarian\Raylib\Generated\Vector2 $startPos2, \Nawarian\Raylib\Generated\Vector2 $endPos2, \Nawarian\Raylib\Generated\Vector2 $collisionPoint): bool { -global $raylib; -return $raylib->CheckCollisionLines($paramstartPos1->toCData(), $paramendPos1->toCData(), $paramstartPos2->toCData(), $paramendPos2->toCData(), $paramcollisionPoint->toCData()); + global $raylib; + return $raylib->CheckCollisionLines($startPos1->toCData(), $endPos1->toCData(), $startPos2->toCData(), $endPos2->toCData(), $collisionPoint->toCData()); } /** * Get collision rectangle for two rectangles collision */ - function GetCollisionRec(\Nawarian\Raylib\Generated\Rectangle $paramrec1, \Nawarian\Raylib\Generated\Rectangle $paramrec2) : \Nawarian\Raylib\Generated\Rectangle +function GetCollisionRec(\Nawarian\Raylib\Generated\Rectangle $rec1, \Nawarian\Raylib\Generated\Rectangle $rec2): \Nawarian\Raylib\Generated\Rectangle { -global $raylib; -return \Nawarian\Raylib\Generated\Rectangle::fromCData($raylib->GetCollisionRec($paramrec1->toCData(), $paramrec2->toCData())); + global $raylib; + return \Nawarian\Raylib\Generated\Rectangle::fromCData($raylib->GetCollisionRec($rec1->toCData(), $rec2->toCData())); } /** * Load image from file into CPU memory (RAM) */ - function LoadImage(string $paramfileName) : \Nawarian\Raylib\Generated\Image +function LoadImage(string $fileName): \Nawarian\Raylib\Generated\Image { -global $raylib; -return \Nawarian\Raylib\Generated\Image::fromCData($raylib->LoadImage($paramfileName)); + global $raylib; + return \Nawarian\Raylib\Generated\Image::fromCData($raylib->LoadImage($fileName)); } /** * Load image from RAW file data */ - function LoadImageRaw(string $paramfileName, int $paramwidth, int $paramheight, int $paramformat, int $paramheaderSize) : \Nawarian\Raylib\Generated\Image +function LoadImageRaw(string $fileName, int $width, int $height, int $format, int $headerSize): \Nawarian\Raylib\Generated\Image { -global $raylib; -return \Nawarian\Raylib\Generated\Image::fromCData($raylib->LoadImageRaw($paramfileName, $paramwidth, $paramheight, $paramformat, $paramheaderSize)); + global $raylib; + return \Nawarian\Raylib\Generated\Image::fromCData($raylib->LoadImageRaw($fileName, $width, $height, $format, $headerSize)); } /** * Load image sequence from file (frames appended to image.data) */ - function LoadImageAnim(string $paramfileName, array $paramframes) : \Nawarian\Raylib\Generated\Image +function LoadImageAnim(string $fileName, array $frames): \Nawarian\Raylib\Generated\Image { -global $raylib; -return \Nawarian\Raylib\Generated\Image::fromCData($raylib->LoadImageAnim($paramfileName, $paramframes)); + global $raylib; + return \Nawarian\Raylib\Generated\Image::fromCData($raylib->LoadImageAnim($fileName, $frames)); } /** * Load image from memory buffer, fileType refers to extension: i.e. '.png' */ - function LoadImageFromMemory(string $paramfileType, array $paramfileData, int $paramdataSize) : \Nawarian\Raylib\Generated\Image +function LoadImageFromMemory(string $fileType, array $fileData, int $dataSize): \Nawarian\Raylib\Generated\Image { -global $raylib; -return \Nawarian\Raylib\Generated\Image::fromCData($raylib->LoadImageFromMemory($paramfileType, $paramfileData, $paramdataSize)); + global $raylib; + return \Nawarian\Raylib\Generated\Image::fromCData($raylib->LoadImageFromMemory($fileType, $fileData, $dataSize)); } /** * Unload image from CPU memory (RAM) */ - function UnloadImage(\Nawarian\Raylib\Generated\Image $paramimage) : void +function UnloadImage(\Nawarian\Raylib\Generated\Image $image): void { -global $raylib; -$raylib->UnloadImage($paramimage->toCData()); + global $raylib; + $raylib->UnloadImage($image->toCData()); } /** * Export image data to file, returns true on success */ - function ExportImage(\Nawarian\Raylib\Generated\Image $paramimage, string $paramfileName) : bool +function ExportImage(\Nawarian\Raylib\Generated\Image $image, string $fileName): bool { -global $raylib; -return $raylib->ExportImage($paramimage->toCData(), $paramfileName); + global $raylib; + return $raylib->ExportImage($image->toCData(), $fileName); } /** * Export image as code file defining an array of bytes, returns true on success */ - function ExportImageAsCode(\Nawarian\Raylib\Generated\Image $paramimage, string $paramfileName) : bool +function ExportImageAsCode(\Nawarian\Raylib\Generated\Image $image, string $fileName): bool { -global $raylib; -return $raylib->ExportImageAsCode($paramimage->toCData(), $paramfileName); + global $raylib; + return $raylib->ExportImageAsCode($image->toCData(), $fileName); } /** * Generate image: plain color */ - function GenImageColor(int $paramwidth, int $paramheight, \Nawarian\Raylib\Generated\Color $paramcolor) : \Nawarian\Raylib\Generated\Image +function GenImageColor(int $width, int $height, \Nawarian\Raylib\Generated\Color $color): \Nawarian\Raylib\Generated\Image { -global $raylib; -return \Nawarian\Raylib\Generated\Image::fromCData($raylib->GenImageColor($paramwidth, $paramheight, $paramcolor->toCData())); + global $raylib; + return \Nawarian\Raylib\Generated\Image::fromCData($raylib->GenImageColor($width, $height, $color->toCData())); } /** * Generate image: vertical gradient */ - function GenImageGradientV(int $paramwidth, int $paramheight, \Nawarian\Raylib\Generated\Color $paramtop, \Nawarian\Raylib\Generated\Color $parambottom) : \Nawarian\Raylib\Generated\Image +function GenImageGradientV(int $width, int $height, \Nawarian\Raylib\Generated\Color $top, \Nawarian\Raylib\Generated\Color $bottom): \Nawarian\Raylib\Generated\Image { -global $raylib; -return \Nawarian\Raylib\Generated\Image::fromCData($raylib->GenImageGradientV($paramwidth, $paramheight, $paramtop->toCData(), $parambottom->toCData())); + global $raylib; + return \Nawarian\Raylib\Generated\Image::fromCData($raylib->GenImageGradientV($width, $height, $top->toCData(), $bottom->toCData())); } /** * Generate image: horizontal gradient */ - function GenImageGradientH(int $paramwidth, int $paramheight, \Nawarian\Raylib\Generated\Color $paramleft, \Nawarian\Raylib\Generated\Color $paramright) : \Nawarian\Raylib\Generated\Image +function GenImageGradientH(int $width, int $height, \Nawarian\Raylib\Generated\Color $left, \Nawarian\Raylib\Generated\Color $right): \Nawarian\Raylib\Generated\Image { -global $raylib; -return \Nawarian\Raylib\Generated\Image::fromCData($raylib->GenImageGradientH($paramwidth, $paramheight, $paramleft->toCData(), $paramright->toCData())); + global $raylib; + return \Nawarian\Raylib\Generated\Image::fromCData($raylib->GenImageGradientH($width, $height, $left->toCData(), $right->toCData())); } /** * Generate image: radial gradient */ - function GenImageGradientRadial(int $paramwidth, int $paramheight, float $paramdensity, \Nawarian\Raylib\Generated\Color $paraminner, \Nawarian\Raylib\Generated\Color $paramouter) : \Nawarian\Raylib\Generated\Image +function GenImageGradientRadial(int $width, int $height, float $density, \Nawarian\Raylib\Generated\Color $inner, \Nawarian\Raylib\Generated\Color $outer): \Nawarian\Raylib\Generated\Image { -global $raylib; -return \Nawarian\Raylib\Generated\Image::fromCData($raylib->GenImageGradientRadial($paramwidth, $paramheight, $paramdensity, $paraminner->toCData(), $paramouter->toCData())); + global $raylib; + return \Nawarian\Raylib\Generated\Image::fromCData($raylib->GenImageGradientRadial($width, $height, $density, $inner->toCData(), $outer->toCData())); } /** * Generate image: checked */ - function GenImageChecked(int $paramwidth, int $paramheight, int $paramchecksX, int $paramchecksY, \Nawarian\Raylib\Generated\Color $paramcol1, \Nawarian\Raylib\Generated\Color $paramcol2) : \Nawarian\Raylib\Generated\Image +function GenImageChecked(int $width, int $height, int $checksX, int $checksY, \Nawarian\Raylib\Generated\Color $col1, \Nawarian\Raylib\Generated\Color $col2): \Nawarian\Raylib\Generated\Image { -global $raylib; -return \Nawarian\Raylib\Generated\Image::fromCData($raylib->GenImageChecked($paramwidth, $paramheight, $paramchecksX, $paramchecksY, $paramcol1->toCData(), $paramcol2->toCData())); + global $raylib; + return \Nawarian\Raylib\Generated\Image::fromCData($raylib->GenImageChecked($width, $height, $checksX, $checksY, $col1->toCData(), $col2->toCData())); } /** * Generate image: white noise */ - function GenImageWhiteNoise(int $paramwidth, int $paramheight, float $paramfactor) : \Nawarian\Raylib\Generated\Image +function GenImageWhiteNoise(int $width, int $height, float $factor): \Nawarian\Raylib\Generated\Image { -global $raylib; -return \Nawarian\Raylib\Generated\Image::fromCData($raylib->GenImageWhiteNoise($paramwidth, $paramheight, $paramfactor)); + global $raylib; + return \Nawarian\Raylib\Generated\Image::fromCData($raylib->GenImageWhiteNoise($width, $height, $factor)); } /** * Generate image: perlin noise */ - function GenImagePerlinNoise(int $paramwidth, int $paramheight, int $paramoffsetX, int $paramoffsetY, float $paramscale) : \Nawarian\Raylib\Generated\Image +function GenImagePerlinNoise(int $width, int $height, int $offsetX, int $offsetY, float $scale): \Nawarian\Raylib\Generated\Image { -global $raylib; -return \Nawarian\Raylib\Generated\Image::fromCData($raylib->GenImagePerlinNoise($paramwidth, $paramheight, $paramoffsetX, $paramoffsetY, $paramscale)); + global $raylib; + return \Nawarian\Raylib\Generated\Image::fromCData($raylib->GenImagePerlinNoise($width, $height, $offsetX, $offsetY, $scale)); } /** * Generate image: cellular algorithm. Bigger tileSize means bigger cells */ - function GenImageCellular(int $paramwidth, int $paramheight, int $paramtileSize) : \Nawarian\Raylib\Generated\Image +function GenImageCellular(int $width, int $height, int $tileSize): \Nawarian\Raylib\Generated\Image { -global $raylib; -return \Nawarian\Raylib\Generated\Image::fromCData($raylib->GenImageCellular($paramwidth, $paramheight, $paramtileSize)); + global $raylib; + return \Nawarian\Raylib\Generated\Image::fromCData($raylib->GenImageCellular($width, $height, $tileSize)); } /** * Create an image duplicate (useful for transformations) */ - function ImageCopy(\Nawarian\Raylib\Generated\Image $paramimage) : \Nawarian\Raylib\Generated\Image +function ImageCopy(\Nawarian\Raylib\Generated\Image $image): \Nawarian\Raylib\Generated\Image { -global $raylib; -return \Nawarian\Raylib\Generated\Image::fromCData($raylib->ImageCopy($paramimage->toCData())); + global $raylib; + return \Nawarian\Raylib\Generated\Image::fromCData($raylib->ImageCopy($image->toCData())); } /** * Create an image from another image piece */ - function ImageFromImage(\Nawarian\Raylib\Generated\Image $paramimage, \Nawarian\Raylib\Generated\Rectangle $paramrec) : \Nawarian\Raylib\Generated\Image +function ImageFromImage(\Nawarian\Raylib\Generated\Image $image, \Nawarian\Raylib\Generated\Rectangle $rec): \Nawarian\Raylib\Generated\Image { -global $raylib; -return \Nawarian\Raylib\Generated\Image::fromCData($raylib->ImageFromImage($paramimage->toCData(), $paramrec->toCData())); + global $raylib; + return \Nawarian\Raylib\Generated\Image::fromCData($raylib->ImageFromImage($image->toCData(), $rec->toCData())); } /** * Create an image from text (default font) */ - function ImageText(string $paramtext, int $paramfontSize, \Nawarian\Raylib\Generated\Color $paramcolor) : \Nawarian\Raylib\Generated\Image +function ImageText(string $text, int $fontSize, \Nawarian\Raylib\Generated\Color $color): \Nawarian\Raylib\Generated\Image { -global $raylib; -return \Nawarian\Raylib\Generated\Image::fromCData($raylib->ImageText($paramtext, $paramfontSize, $paramcolor->toCData())); + global $raylib; + return \Nawarian\Raylib\Generated\Image::fromCData($raylib->ImageText($text, $fontSize, $color->toCData())); } /** * Create an image from text (custom sprite font) */ - function ImageTextEx(\Nawarian\Raylib\Generated\Font $paramfont, string $paramtext, float $paramfontSize, float $paramspacing, \Nawarian\Raylib\Generated\Color $paramtint) : \Nawarian\Raylib\Generated\Image +function ImageTextEx(\Nawarian\Raylib\Generated\Font $font, string $text, float $fontSize, float $spacing, \Nawarian\Raylib\Generated\Color $tint): \Nawarian\Raylib\Generated\Image { -global $raylib; -return \Nawarian\Raylib\Generated\Image::fromCData($raylib->ImageTextEx($paramfont->toCData(), $paramtext, $paramfontSize, $paramspacing, $paramtint->toCData())); + global $raylib; + return \Nawarian\Raylib\Generated\Image::fromCData($raylib->ImageTextEx($font->toCData(), $text, $fontSize, $spacing, $tint->toCData())); } /** * Convert image data to desired format */ - function ImageFormat(\Nawarian\Raylib\Generated\Image $paramimage, int $paramnewFormat) : void +function ImageFormat(\Nawarian\Raylib\Generated\Image $image, int $newFormat): void { -global $raylib; -$raylib->ImageFormat($paramimage->toCData(), $paramnewFormat); + global $raylib; + $raylib->ImageFormat($image->toCData(), $newFormat); } /** * Convert image to POT (power-of-two) */ - function ImageToPOT(\Nawarian\Raylib\Generated\Image $paramimage, \Nawarian\Raylib\Generated\Color $paramfill) : void +function ImageToPOT(\Nawarian\Raylib\Generated\Image $image, \Nawarian\Raylib\Generated\Color $fill): void { -global $raylib; -$raylib->ImageToPOT($paramimage->toCData(), $paramfill->toCData()); + global $raylib; + $raylib->ImageToPOT($image->toCData(), $fill->toCData()); } /** * Crop an image to a defined rectangle */ - function ImageCrop(\Nawarian\Raylib\Generated\Image $paramimage, \Nawarian\Raylib\Generated\Rectangle $paramcrop) : void +function ImageCrop(\Nawarian\Raylib\Generated\Image $image, \Nawarian\Raylib\Generated\Rectangle $crop): void { -global $raylib; -$raylib->ImageCrop($paramimage->toCData(), $paramcrop->toCData()); + global $raylib; + $raylib->ImageCrop($image->toCData(), $crop->toCData()); } /** * Crop image depending on alpha value */ - function ImageAlphaCrop(\Nawarian\Raylib\Generated\Image $paramimage, float $paramthreshold) : void +function ImageAlphaCrop(\Nawarian\Raylib\Generated\Image $image, float $threshold): void { -global $raylib; -$raylib->ImageAlphaCrop($paramimage->toCData(), $paramthreshold); + global $raylib; + $raylib->ImageAlphaCrop($image->toCData(), $threshold); } /** * Clear alpha channel to desired color */ - function ImageAlphaClear(\Nawarian\Raylib\Generated\Image $paramimage, \Nawarian\Raylib\Generated\Color $paramcolor, float $paramthreshold) : void +function ImageAlphaClear(\Nawarian\Raylib\Generated\Image $image, \Nawarian\Raylib\Generated\Color $color, float $threshold): void { -global $raylib; -$raylib->ImageAlphaClear($paramimage->toCData(), $paramcolor->toCData(), $paramthreshold); + global $raylib; + $raylib->ImageAlphaClear($image->toCData(), $color->toCData(), $threshold); } /** * Apply alpha mask to image */ - function ImageAlphaMask(\Nawarian\Raylib\Generated\Image $paramimage, \Nawarian\Raylib\Generated\Image $paramalphaMask) : void +function ImageAlphaMask(\Nawarian\Raylib\Generated\Image $image, \Nawarian\Raylib\Generated\Image $alphaMask): void { -global $raylib; -$raylib->ImageAlphaMask($paramimage->toCData(), $paramalphaMask->toCData()); + global $raylib; + $raylib->ImageAlphaMask($image->toCData(), $alphaMask->toCData()); } /** * Premultiply alpha channel */ - function ImageAlphaPremultiply(\Nawarian\Raylib\Generated\Image $paramimage) : void +function ImageAlphaPremultiply(\Nawarian\Raylib\Generated\Image $image): void { -global $raylib; -$raylib->ImageAlphaPremultiply($paramimage->toCData()); + global $raylib; + $raylib->ImageAlphaPremultiply($image->toCData()); } /** * Resize image (Bicubic scaling algorithm) */ - function ImageResize(\Nawarian\Raylib\Generated\Image $paramimage, int $paramnewWidth, int $paramnewHeight) : void +function ImageResize(\Nawarian\Raylib\Generated\Image $image, int $newWidth, int $newHeight): void { -global $raylib; -$raylib->ImageResize($paramimage->toCData(), $paramnewWidth, $paramnewHeight); + global $raylib; + $raylib->ImageResize($image->toCData(), $newWidth, $newHeight); } /** * Resize image (Nearest-Neighbor scaling algorithm) */ - function ImageResizeNN(\Nawarian\Raylib\Generated\Image $paramimage, int $paramnewWidth, int $paramnewHeight) : void +function ImageResizeNN(\Nawarian\Raylib\Generated\Image $image, int $newWidth, int $newHeight): void { -global $raylib; -$raylib->ImageResizeNN($paramimage->toCData(), $paramnewWidth, $paramnewHeight); + global $raylib; + $raylib->ImageResizeNN($image->toCData(), $newWidth, $newHeight); } /** * Resize canvas and fill with color */ - function ImageResizeCanvas(\Nawarian\Raylib\Generated\Image $paramimage, int $paramnewWidth, int $paramnewHeight, int $paramoffsetX, int $paramoffsetY, \Nawarian\Raylib\Generated\Color $paramfill) : void +function ImageResizeCanvas(\Nawarian\Raylib\Generated\Image $image, int $newWidth, int $newHeight, int $offsetX, int $offsetY, \Nawarian\Raylib\Generated\Color $fill): void { -global $raylib; -$raylib->ImageResizeCanvas($paramimage->toCData(), $paramnewWidth, $paramnewHeight, $paramoffsetX, $paramoffsetY, $paramfill->toCData()); + global $raylib; + $raylib->ImageResizeCanvas($image->toCData(), $newWidth, $newHeight, $offsetX, $offsetY, $fill->toCData()); } /** * Compute all mipmap levels for a provided image */ - function ImageMipmaps(\Nawarian\Raylib\Generated\Image $paramimage) : void +function ImageMipmaps(\Nawarian\Raylib\Generated\Image $image): void { -global $raylib; -$raylib->ImageMipmaps($paramimage->toCData()); + global $raylib; + $raylib->ImageMipmaps($image->toCData()); } /** * Dither image data to 16bpp or lower (Floyd-Steinberg dithering) */ - function ImageDither(\Nawarian\Raylib\Generated\Image $paramimage, int $paramrBpp, int $paramgBpp, int $parambBpp, int $paramaBpp) : void +function ImageDither(\Nawarian\Raylib\Generated\Image $image, int $rBpp, int $gBpp, int $bBpp, int $aBpp): void { -global $raylib; -$raylib->ImageDither($paramimage->toCData(), $paramrBpp, $paramgBpp, $parambBpp, $paramaBpp); + global $raylib; + $raylib->ImageDither($image->toCData(), $rBpp, $gBpp, $bBpp, $aBpp); } /** * Flip image vertically */ - function ImageFlipVertical(\Nawarian\Raylib\Generated\Image $paramimage) : void +function ImageFlipVertical(\Nawarian\Raylib\Generated\Image $image): void { -global $raylib; -$raylib->ImageFlipVertical($paramimage->toCData()); + global $raylib; + $raylib->ImageFlipVertical($image->toCData()); } /** * Flip image horizontally */ - function ImageFlipHorizontal(\Nawarian\Raylib\Generated\Image $paramimage) : void +function ImageFlipHorizontal(\Nawarian\Raylib\Generated\Image $image): void { -global $raylib; -$raylib->ImageFlipHorizontal($paramimage->toCData()); + global $raylib; + $raylib->ImageFlipHorizontal($image->toCData()); } /** * Rotate image clockwise 90deg */ - function ImageRotateCW(\Nawarian\Raylib\Generated\Image $paramimage) : void +function ImageRotateCW(\Nawarian\Raylib\Generated\Image $image): void { -global $raylib; -$raylib->ImageRotateCW($paramimage->toCData()); + global $raylib; + $raylib->ImageRotateCW($image->toCData()); } /** * Rotate image counter-clockwise 90deg */ - function ImageRotateCCW(\Nawarian\Raylib\Generated\Image $paramimage) : void +function ImageRotateCCW(\Nawarian\Raylib\Generated\Image $image): void { -global $raylib; -$raylib->ImageRotateCCW($paramimage->toCData()); + global $raylib; + $raylib->ImageRotateCCW($image->toCData()); } /** * Modify image color: tint */ - function ImageColorTint(\Nawarian\Raylib\Generated\Image $paramimage, \Nawarian\Raylib\Generated\Color $paramcolor) : void +function ImageColorTint(\Nawarian\Raylib\Generated\Image $image, \Nawarian\Raylib\Generated\Color $color): void { -global $raylib; -$raylib->ImageColorTint($paramimage->toCData(), $paramcolor->toCData()); + global $raylib; + $raylib->ImageColorTint($image->toCData(), $color->toCData()); } /** * Modify image color: invert */ - function ImageColorInvert(\Nawarian\Raylib\Generated\Image $paramimage) : void +function ImageColorInvert(\Nawarian\Raylib\Generated\Image $image): void { -global $raylib; -$raylib->ImageColorInvert($paramimage->toCData()); + global $raylib; + $raylib->ImageColorInvert($image->toCData()); } /** * Modify image color: grayscale */ - function ImageColorGrayscale(\Nawarian\Raylib\Generated\Image $paramimage) : void +function ImageColorGrayscale(\Nawarian\Raylib\Generated\Image $image): void { -global $raylib; -$raylib->ImageColorGrayscale($paramimage->toCData()); + global $raylib; + $raylib->ImageColorGrayscale($image->toCData()); } /** * Modify image color: contrast (-100 to 100) */ - function ImageColorContrast(\Nawarian\Raylib\Generated\Image $paramimage, float $paramcontrast) : void +function ImageColorContrast(\Nawarian\Raylib\Generated\Image $image, float $contrast): void { -global $raylib; -$raylib->ImageColorContrast($paramimage->toCData(), $paramcontrast); + global $raylib; + $raylib->ImageColorContrast($image->toCData(), $contrast); } /** * Modify image color: brightness (-255 to 255) */ - function ImageColorBrightness(\Nawarian\Raylib\Generated\Image $paramimage, int $parambrightness) : void +function ImageColorBrightness(\Nawarian\Raylib\Generated\Image $image, int $brightness): void { -global $raylib; -$raylib->ImageColorBrightness($paramimage->toCData(), $parambrightness); + global $raylib; + $raylib->ImageColorBrightness($image->toCData(), $brightness); } /** * Modify image color: replace color */ - function ImageColorReplace(\Nawarian\Raylib\Generated\Image $paramimage, \Nawarian\Raylib\Generated\Color $paramcolor, \Nawarian\Raylib\Generated\Color $paramreplace) : void +function ImageColorReplace(\Nawarian\Raylib\Generated\Image $image, \Nawarian\Raylib\Generated\Color $color, \Nawarian\Raylib\Generated\Color $replace): void { -global $raylib; -$raylib->ImageColorReplace($paramimage->toCData(), $paramcolor->toCData(), $paramreplace->toCData()); + global $raylib; + $raylib->ImageColorReplace($image->toCData(), $color->toCData(), $replace->toCData()); } /** * Load color data from image as a Color array (RGBA - 32bit) */ - function LoadImageColors(\Nawarian\Raylib\Generated\Image $paramimage) : \Nawarian\Raylib\Generated\Color +function LoadImageColors(\Nawarian\Raylib\Generated\Image $image): \Nawarian\Raylib\Generated\Color { -global $raylib; -return \Nawarian\Raylib\Generated\Color::fromCData($raylib->LoadImageColors($paramimage->toCData())); + global $raylib; + return \Nawarian\Raylib\Generated\Color::fromCData($raylib->LoadImageColors($image->toCData())); } /** * Load colors palette from image as a Color array (RGBA - 32bit) */ - function LoadImagePalette(\Nawarian\Raylib\Generated\Image $paramimage, int $parammaxPaletteSize, array $paramcolorsCount) : \Nawarian\Raylib\Generated\Color +function LoadImagePalette(\Nawarian\Raylib\Generated\Image $image, int $maxPaletteSize, array $colorsCount): \Nawarian\Raylib\Generated\Color { -global $raylib; -return \Nawarian\Raylib\Generated\Color::fromCData($raylib->LoadImagePalette($paramimage->toCData(), $parammaxPaletteSize, $paramcolorsCount)); + global $raylib; + return \Nawarian\Raylib\Generated\Color::fromCData($raylib->LoadImagePalette($image->toCData(), $maxPaletteSize, $colorsCount)); } /** * Unload color data loaded with LoadImageColors() */ - function UnloadImageColors(\Nawarian\Raylib\Generated\Color $paramcolors) : void +function UnloadImageColors(\Nawarian\Raylib\Generated\Color $colors): void { -global $raylib; -$raylib->UnloadImageColors($paramcolors->toCData()); + global $raylib; + $raylib->UnloadImageColors($colors->toCData()); } /** * Unload colors palette loaded with LoadImagePalette() */ - function UnloadImagePalette(\Nawarian\Raylib\Generated\Color $paramcolors) : void +function UnloadImagePalette(\Nawarian\Raylib\Generated\Color $colors): void { -global $raylib; -$raylib->UnloadImagePalette($paramcolors->toCData()); + global $raylib; + $raylib->UnloadImagePalette($colors->toCData()); } /** * Get image alpha border rectangle */ - function GetImageAlphaBorder(\Nawarian\Raylib\Generated\Image $paramimage, float $paramthreshold) : \Nawarian\Raylib\Generated\Rectangle +function GetImageAlphaBorder(\Nawarian\Raylib\Generated\Image $image, float $threshold): \Nawarian\Raylib\Generated\Rectangle { -global $raylib; -return \Nawarian\Raylib\Generated\Rectangle::fromCData($raylib->GetImageAlphaBorder($paramimage->toCData(), $paramthreshold)); + global $raylib; + return \Nawarian\Raylib\Generated\Rectangle::fromCData($raylib->GetImageAlphaBorder($image->toCData(), $threshold)); } /** * Clear image background with given color */ - function ImageClearBackground(\Nawarian\Raylib\Generated\Image $paramdst, \Nawarian\Raylib\Generated\Color $paramcolor) : void +function ImageClearBackground(\Nawarian\Raylib\Generated\Image $dst, \Nawarian\Raylib\Generated\Color $color): void { -global $raylib; -$raylib->ImageClearBackground($paramdst->toCData(), $paramcolor->toCData()); + global $raylib; + $raylib->ImageClearBackground($dst->toCData(), $color->toCData()); } /** * Draw pixel within an image */ - function ImageDrawPixel(\Nawarian\Raylib\Generated\Image $paramdst, int $paramposX, int $paramposY, \Nawarian\Raylib\Generated\Color $paramcolor) : void +function ImageDrawPixel(\Nawarian\Raylib\Generated\Image $dst, int $posX, int $posY, \Nawarian\Raylib\Generated\Color $color): void { -global $raylib; -$raylib->ImageDrawPixel($paramdst->toCData(), $paramposX, $paramposY, $paramcolor->toCData()); + global $raylib; + $raylib->ImageDrawPixel($dst->toCData(), $posX, $posY, $color->toCData()); } /** * Draw pixel within an image (Vector version) */ - function ImageDrawPixelV(\Nawarian\Raylib\Generated\Image $paramdst, \Nawarian\Raylib\Generated\Vector2 $paramposition, \Nawarian\Raylib\Generated\Color $paramcolor) : void +function ImageDrawPixelV(\Nawarian\Raylib\Generated\Image $dst, \Nawarian\Raylib\Generated\Vector2 $position, \Nawarian\Raylib\Generated\Color $color): void { -global $raylib; -$raylib->ImageDrawPixelV($paramdst->toCData(), $paramposition->toCData(), $paramcolor->toCData()); + global $raylib; + $raylib->ImageDrawPixelV($dst->toCData(), $position->toCData(), $color->toCData()); } /** * Draw line within an image */ - function ImageDrawLine(\Nawarian\Raylib\Generated\Image $paramdst, int $paramstartPosX, int $paramstartPosY, int $paramendPosX, int $paramendPosY, \Nawarian\Raylib\Generated\Color $paramcolor) : void +function ImageDrawLine(\Nawarian\Raylib\Generated\Image $dst, int $startPosX, int $startPosY, int $endPosX, int $endPosY, \Nawarian\Raylib\Generated\Color $color): void { -global $raylib; -$raylib->ImageDrawLine($paramdst->toCData(), $paramstartPosX, $paramstartPosY, $paramendPosX, $paramendPosY, $paramcolor->toCData()); + global $raylib; + $raylib->ImageDrawLine($dst->toCData(), $startPosX, $startPosY, $endPosX, $endPosY, $color->toCData()); } /** * Draw line within an image (Vector version) */ - function ImageDrawLineV(\Nawarian\Raylib\Generated\Image $paramdst, \Nawarian\Raylib\Generated\Vector2 $paramstart, \Nawarian\Raylib\Generated\Vector2 $paramend, \Nawarian\Raylib\Generated\Color $paramcolor) : void +function ImageDrawLineV(\Nawarian\Raylib\Generated\Image $dst, \Nawarian\Raylib\Generated\Vector2 $start, \Nawarian\Raylib\Generated\Vector2 $end, \Nawarian\Raylib\Generated\Color $color): void { -global $raylib; -$raylib->ImageDrawLineV($paramdst->toCData(), $paramstart->toCData(), $paramend->toCData(), $paramcolor->toCData()); + global $raylib; + $raylib->ImageDrawLineV($dst->toCData(), $start->toCData(), $end->toCData(), $color->toCData()); } /** * Draw circle within an image */ - function ImageDrawCircle(\Nawarian\Raylib\Generated\Image $paramdst, int $paramcenterX, int $paramcenterY, int $paramradius, \Nawarian\Raylib\Generated\Color $paramcolor) : void +function ImageDrawCircle(\Nawarian\Raylib\Generated\Image $dst, int $centerX, int $centerY, int $radius, \Nawarian\Raylib\Generated\Color $color): void { -global $raylib; -$raylib->ImageDrawCircle($paramdst->toCData(), $paramcenterX, $paramcenterY, $paramradius, $paramcolor->toCData()); + global $raylib; + $raylib->ImageDrawCircle($dst->toCData(), $centerX, $centerY, $radius, $color->toCData()); } /** * Draw circle within an image (Vector version) */ - function ImageDrawCircleV(\Nawarian\Raylib\Generated\Image $paramdst, \Nawarian\Raylib\Generated\Vector2 $paramcenter, int $paramradius, \Nawarian\Raylib\Generated\Color $paramcolor) : void +function ImageDrawCircleV(\Nawarian\Raylib\Generated\Image $dst, \Nawarian\Raylib\Generated\Vector2 $center, int $radius, \Nawarian\Raylib\Generated\Color $color): void { -global $raylib; -$raylib->ImageDrawCircleV($paramdst->toCData(), $paramcenter->toCData(), $paramradius, $paramcolor->toCData()); + global $raylib; + $raylib->ImageDrawCircleV($dst->toCData(), $center->toCData(), $radius, $color->toCData()); } /** * Draw rectangle within an image */ - function ImageDrawRectangle(\Nawarian\Raylib\Generated\Image $paramdst, int $paramposX, int $paramposY, int $paramwidth, int $paramheight, \Nawarian\Raylib\Generated\Color $paramcolor) : void +function ImageDrawRectangle(\Nawarian\Raylib\Generated\Image $dst, int $posX, int $posY, int $width, int $height, \Nawarian\Raylib\Generated\Color $color): void { -global $raylib; -$raylib->ImageDrawRectangle($paramdst->toCData(), $paramposX, $paramposY, $paramwidth, $paramheight, $paramcolor->toCData()); + global $raylib; + $raylib->ImageDrawRectangle($dst->toCData(), $posX, $posY, $width, $height, $color->toCData()); } /** * Draw rectangle within an image (Vector version) */ - function ImageDrawRectangleV(\Nawarian\Raylib\Generated\Image $paramdst, \Nawarian\Raylib\Generated\Vector2 $paramposition, \Nawarian\Raylib\Generated\Vector2 $paramsize, \Nawarian\Raylib\Generated\Color $paramcolor) : void +function ImageDrawRectangleV(\Nawarian\Raylib\Generated\Image $dst, \Nawarian\Raylib\Generated\Vector2 $position, \Nawarian\Raylib\Generated\Vector2 $size, \Nawarian\Raylib\Generated\Color $color): void { -global $raylib; -$raylib->ImageDrawRectangleV($paramdst->toCData(), $paramposition->toCData(), $paramsize->toCData(), $paramcolor->toCData()); + global $raylib; + $raylib->ImageDrawRectangleV($dst->toCData(), $position->toCData(), $size->toCData(), $color->toCData()); } /** * Draw rectangle within an image */ - function ImageDrawRectangleRec(\Nawarian\Raylib\Generated\Image $paramdst, \Nawarian\Raylib\Generated\Rectangle $paramrec, \Nawarian\Raylib\Generated\Color $paramcolor) : void +function ImageDrawRectangleRec(\Nawarian\Raylib\Generated\Image $dst, \Nawarian\Raylib\Generated\Rectangle $rec, \Nawarian\Raylib\Generated\Color $color): void { -global $raylib; -$raylib->ImageDrawRectangleRec($paramdst->toCData(), $paramrec->toCData(), $paramcolor->toCData()); + global $raylib; + $raylib->ImageDrawRectangleRec($dst->toCData(), $rec->toCData(), $color->toCData()); } /** * Draw rectangle lines within an image */ - function ImageDrawRectangleLines(\Nawarian\Raylib\Generated\Image $paramdst, \Nawarian\Raylib\Generated\Rectangle $paramrec, int $paramthick, \Nawarian\Raylib\Generated\Color $paramcolor) : void +function ImageDrawRectangleLines(\Nawarian\Raylib\Generated\Image $dst, \Nawarian\Raylib\Generated\Rectangle $rec, int $thick, \Nawarian\Raylib\Generated\Color $color): void { -global $raylib; -$raylib->ImageDrawRectangleLines($paramdst->toCData(), $paramrec->toCData(), $paramthick, $paramcolor->toCData()); + global $raylib; + $raylib->ImageDrawRectangleLines($dst->toCData(), $rec->toCData(), $thick, $color->toCData()); } /** * Draw a source image within a destination image (tint applied to source) */ - function ImageDraw(\Nawarian\Raylib\Generated\Image $paramdst, \Nawarian\Raylib\Generated\Image $paramsrc, \Nawarian\Raylib\Generated\Rectangle $paramsrcRec, \Nawarian\Raylib\Generated\Rectangle $paramdstRec, \Nawarian\Raylib\Generated\Color $paramtint) : void +function ImageDraw(\Nawarian\Raylib\Generated\Image $dst, \Nawarian\Raylib\Generated\Image $src, \Nawarian\Raylib\Generated\Rectangle $srcRec, \Nawarian\Raylib\Generated\Rectangle $dstRec, \Nawarian\Raylib\Generated\Color $tint): void { -global $raylib; -$raylib->ImageDraw($paramdst->toCData(), $paramsrc->toCData(), $paramsrcRec->toCData(), $paramdstRec->toCData(), $paramtint->toCData()); + global $raylib; + $raylib->ImageDraw($dst->toCData(), $src->toCData(), $srcRec->toCData(), $dstRec->toCData(), $tint->toCData()); } /** * Draw text (using default font) within an image (destination) */ - function ImageDrawText(\Nawarian\Raylib\Generated\Image $paramdst, string $paramtext, int $paramposX, int $paramposY, int $paramfontSize, \Nawarian\Raylib\Generated\Color $paramcolor) : void +function ImageDrawText(\Nawarian\Raylib\Generated\Image $dst, string $text, int $posX, int $posY, int $fontSize, \Nawarian\Raylib\Generated\Color $color): void { -global $raylib; -$raylib->ImageDrawText($paramdst->toCData(), $paramtext, $paramposX, $paramposY, $paramfontSize, $paramcolor->toCData()); + global $raylib; + $raylib->ImageDrawText($dst->toCData(), $text, $posX, $posY, $fontSize, $color->toCData()); } /** * Draw text (custom sprite font) within an image (destination) */ - function ImageDrawTextEx(\Nawarian\Raylib\Generated\Image $paramdst, \Nawarian\Raylib\Generated\Font $paramfont, string $paramtext, \Nawarian\Raylib\Generated\Vector2 $paramposition, float $paramfontSize, float $paramspacing, \Nawarian\Raylib\Generated\Color $paramtint) : void +function ImageDrawTextEx(\Nawarian\Raylib\Generated\Image $dst, \Nawarian\Raylib\Generated\Font $font, string $text, \Nawarian\Raylib\Generated\Vector2 $position, float $fontSize, float $spacing, \Nawarian\Raylib\Generated\Color $tint): void { -global $raylib; -$raylib->ImageDrawTextEx($paramdst->toCData(), $paramfont->toCData(), $paramtext, $paramposition->toCData(), $paramfontSize, $paramspacing, $paramtint->toCData()); + global $raylib; + $raylib->ImageDrawTextEx($dst->toCData(), $font->toCData(), $text, $position->toCData(), $fontSize, $spacing, $tint->toCData()); } /** * Load texture from file into GPU memory (VRAM) */ - function LoadTexture(string $paramfileName) : \Nawarian\Raylib\Generated\Texture +function LoadTexture(string $fileName): \Nawarian\Raylib\Generated\Texture { -global $raylib; -return \Nawarian\Raylib\Generated\Texture::fromCData($raylib->LoadTexture($paramfileName)); + global $raylib; + return \Nawarian\Raylib\Generated\Texture::fromCData($raylib->LoadTexture($fileName)); } /** * Load texture from image data */ - function LoadTextureFromImage(\Nawarian\Raylib\Generated\Image $paramimage) : \Nawarian\Raylib\Generated\Texture +function LoadTextureFromImage(\Nawarian\Raylib\Generated\Image $image): \Nawarian\Raylib\Generated\Texture { -global $raylib; -return \Nawarian\Raylib\Generated\Texture::fromCData($raylib->LoadTextureFromImage($paramimage->toCData())); + global $raylib; + return \Nawarian\Raylib\Generated\Texture::fromCData($raylib->LoadTextureFromImage($image->toCData())); } /** * Load cubemap from image, multiple image cubemap layouts supported */ - function LoadTextureCubemap(\Nawarian\Raylib\Generated\Image $paramimage, int $paramlayout) : \Nawarian\Raylib\Generated\Texture +function LoadTextureCubemap(\Nawarian\Raylib\Generated\Image $image, int $layout): \Nawarian\Raylib\Generated\Texture { -global $raylib; -return \Nawarian\Raylib\Generated\Texture::fromCData($raylib->LoadTextureCubemap($paramimage->toCData(), $paramlayout)); + global $raylib; + return \Nawarian\Raylib\Generated\Texture::fromCData($raylib->LoadTextureCubemap($image->toCData(), $layout)); } /** * Load texture for rendering (framebuffer) */ - function LoadRenderTexture(int $paramwidth, int $paramheight) : \Nawarian\Raylib\Generated\RenderTexture +function LoadRenderTexture(int $width, int $height): \Nawarian\Raylib\Generated\RenderTexture { -global $raylib; -return \Nawarian\Raylib\Generated\RenderTexture::fromCData($raylib->LoadRenderTexture($paramwidth, $paramheight)); + global $raylib; + return \Nawarian\Raylib\Generated\RenderTexture::fromCData($raylib->LoadRenderTexture($width, $height)); } /** * Unload texture from GPU memory (VRAM) */ - function UnloadTexture(\Nawarian\Raylib\Generated\Texture $paramtexture) : void +function UnloadTexture(\Nawarian\Raylib\Generated\Texture $texture): void { -global $raylib; -$raylib->UnloadTexture($paramtexture->toCData()); + global $raylib; + $raylib->UnloadTexture($texture->toCData()); } /** * Unload render texture from GPU memory (VRAM) */ - function UnloadRenderTexture(\Nawarian\Raylib\Generated\RenderTexture $paramtarget) : void +function UnloadRenderTexture(\Nawarian\Raylib\Generated\RenderTexture $target): void { -global $raylib; -$raylib->UnloadRenderTexture($paramtarget->toCData()); + global $raylib; + $raylib->UnloadRenderTexture($target->toCData()); } /** * Update GPU texture with new data */ - function UpdateTexture(\Nawarian\Raylib\Generated\Texture $paramtexture, \FFI\CData $parampixels) : void +function UpdateTexture(\Nawarian\Raylib\Generated\Texture $texture, \FFI\CData $pixels): void { -global $raylib; -$raylib->UpdateTexture($paramtexture->toCData(), $parampixels); + global $raylib; + $raylib->UpdateTexture($texture->toCData(), $pixels); } /** * Update GPU texture rectangle with new data */ - function UpdateTextureRec(\Nawarian\Raylib\Generated\Texture $paramtexture, \Nawarian\Raylib\Generated\Rectangle $paramrec, \FFI\CData $parampixels) : void +function UpdateTextureRec(\Nawarian\Raylib\Generated\Texture $texture, \Nawarian\Raylib\Generated\Rectangle $rec, \FFI\CData $pixels): void { -global $raylib; -$raylib->UpdateTextureRec($paramtexture->toCData(), $paramrec->toCData(), $parampixels); + global $raylib; + $raylib->UpdateTextureRec($texture->toCData(), $rec->toCData(), $pixels); } /** * Get pixel data from GPU texture and return an Image */ - function GetTextureData(\Nawarian\Raylib\Generated\Texture $paramtexture) : \Nawarian\Raylib\Generated\Image +function GetTextureData(\Nawarian\Raylib\Generated\Texture $texture): \Nawarian\Raylib\Generated\Image { -global $raylib; -return \Nawarian\Raylib\Generated\Image::fromCData($raylib->GetTextureData($paramtexture->toCData())); + global $raylib; + return \Nawarian\Raylib\Generated\Image::fromCData($raylib->GetTextureData($texture->toCData())); } /** * Get pixel data from screen buffer and return an Image (screenshot) */ - function GetScreenData() : \Nawarian\Raylib\Generated\Image +function GetScreenData(): \Nawarian\Raylib\Generated\Image { -global $raylib; -return \Nawarian\Raylib\Generated\Image::fromCData($raylib->GetScreenData()); + global $raylib; + return \Nawarian\Raylib\Generated\Image::fromCData($raylib->GetScreenData()); } /** * Generate GPU mipmaps for a texture */ - function GenTextureMipmaps(\Nawarian\Raylib\Generated\Texture $paramtexture) : void +function GenTextureMipmaps(\Nawarian\Raylib\Generated\Texture $texture): void { -global $raylib; -$raylib->GenTextureMipmaps($paramtexture->toCData()); + global $raylib; + $raylib->GenTextureMipmaps($texture->toCData()); } /** * Set texture scaling filter mode */ - function SetTextureFilter(\Nawarian\Raylib\Generated\Texture $paramtexture, int $paramfilter) : void +function SetTextureFilter(\Nawarian\Raylib\Generated\Texture $texture, int $filter): void { -global $raylib; -$raylib->SetTextureFilter($paramtexture->toCData(), $paramfilter); + global $raylib; + $raylib->SetTextureFilter($texture->toCData(), $filter); } /** * Set texture wrapping mode */ - function SetTextureWrap(\Nawarian\Raylib\Generated\Texture $paramtexture, int $paramwrap) : void +function SetTextureWrap(\Nawarian\Raylib\Generated\Texture $texture, int $wrap): void { -global $raylib; -$raylib->SetTextureWrap($paramtexture->toCData(), $paramwrap); + global $raylib; + $raylib->SetTextureWrap($texture->toCData(), $wrap); } /** * Draw a Texture2D */ - function DrawTexture(\Nawarian\Raylib\Generated\Texture $paramtexture, int $paramposX, int $paramposY, \Nawarian\Raylib\Generated\Color $paramtint) : void +function DrawTexture(\Nawarian\Raylib\Generated\Texture $texture, int $posX, int $posY, \Nawarian\Raylib\Generated\Color $tint): void { -global $raylib; -$raylib->DrawTexture($paramtexture->toCData(), $paramposX, $paramposY, $paramtint->toCData()); + global $raylib; + $raylib->DrawTexture($texture->toCData(), $posX, $posY, $tint->toCData()); } /** * Draw a Texture2D with position defined as Vector2 */ - function DrawTextureV(\Nawarian\Raylib\Generated\Texture $paramtexture, \Nawarian\Raylib\Generated\Vector2 $paramposition, \Nawarian\Raylib\Generated\Color $paramtint) : void +function DrawTextureV(\Nawarian\Raylib\Generated\Texture $texture, \Nawarian\Raylib\Generated\Vector2 $position, \Nawarian\Raylib\Generated\Color $tint): void { -global $raylib; -$raylib->DrawTextureV($paramtexture->toCData(), $paramposition->toCData(), $paramtint->toCData()); + global $raylib; + $raylib->DrawTextureV($texture->toCData(), $position->toCData(), $tint->toCData()); } /** * Draw a Texture2D with extended parameters */ - function DrawTextureEx(\Nawarian\Raylib\Generated\Texture $paramtexture, \Nawarian\Raylib\Generated\Vector2 $paramposition, float $paramrotation, float $paramscale, \Nawarian\Raylib\Generated\Color $paramtint) : void +function DrawTextureEx(\Nawarian\Raylib\Generated\Texture $texture, \Nawarian\Raylib\Generated\Vector2 $position, float $rotation, float $scale, \Nawarian\Raylib\Generated\Color $tint): void { -global $raylib; -$raylib->DrawTextureEx($paramtexture->toCData(), $paramposition->toCData(), $paramrotation, $paramscale, $paramtint->toCData()); + global $raylib; + $raylib->DrawTextureEx($texture->toCData(), $position->toCData(), $rotation, $scale, $tint->toCData()); } /** * Draw a part of a texture defined by a rectangle */ - function DrawTextureRec(\Nawarian\Raylib\Generated\Texture $paramtexture, \Nawarian\Raylib\Generated\Rectangle $paramsource, \Nawarian\Raylib\Generated\Vector2 $paramposition, \Nawarian\Raylib\Generated\Color $paramtint) : void +function DrawTextureRec(\Nawarian\Raylib\Generated\Texture $texture, \Nawarian\Raylib\Generated\Rectangle $source, \Nawarian\Raylib\Generated\Vector2 $position, \Nawarian\Raylib\Generated\Color $tint): void { -global $raylib; -$raylib->DrawTextureRec($paramtexture->toCData(), $paramsource->toCData(), $paramposition->toCData(), $paramtint->toCData()); + global $raylib; + $raylib->DrawTextureRec($texture->toCData(), $source->toCData(), $position->toCData(), $tint->toCData()); } /** * Draw texture quad with tiling and offset parameters */ - function DrawTextureQuad(\Nawarian\Raylib\Generated\Texture $paramtexture, \Nawarian\Raylib\Generated\Vector2 $paramtiling, \Nawarian\Raylib\Generated\Vector2 $paramoffset, \Nawarian\Raylib\Generated\Rectangle $paramquad, \Nawarian\Raylib\Generated\Color $paramtint) : void +function DrawTextureQuad(\Nawarian\Raylib\Generated\Texture $texture, \Nawarian\Raylib\Generated\Vector2 $tiling, \Nawarian\Raylib\Generated\Vector2 $offset, \Nawarian\Raylib\Generated\Rectangle $quad, \Nawarian\Raylib\Generated\Color $tint): void { -global $raylib; -$raylib->DrawTextureQuad($paramtexture->toCData(), $paramtiling->toCData(), $paramoffset->toCData(), $paramquad->toCData(), $paramtint->toCData()); + global $raylib; + $raylib->DrawTextureQuad($texture->toCData(), $tiling->toCData(), $offset->toCData(), $quad->toCData(), $tint->toCData()); } /** * Draw part of a texture (defined by a rectangle) with rotation and scale tiled * into dest. */ - function DrawTextureTiled(\Nawarian\Raylib\Generated\Texture $paramtexture, \Nawarian\Raylib\Generated\Rectangle $paramsource, \Nawarian\Raylib\Generated\Rectangle $paramdest, \Nawarian\Raylib\Generated\Vector2 $paramorigin, float $paramrotation, float $paramscale, \Nawarian\Raylib\Generated\Color $paramtint) : void +function DrawTextureTiled(\Nawarian\Raylib\Generated\Texture $texture, \Nawarian\Raylib\Generated\Rectangle $source, \Nawarian\Raylib\Generated\Rectangle $dest, \Nawarian\Raylib\Generated\Vector2 $origin, float $rotation, float $scale, \Nawarian\Raylib\Generated\Color $tint): void { -global $raylib; -$raylib->DrawTextureTiled($paramtexture->toCData(), $paramsource->toCData(), $paramdest->toCData(), $paramorigin->toCData(), $paramrotation, $paramscale, $paramtint->toCData()); + global $raylib; + $raylib->DrawTextureTiled($texture->toCData(), $source->toCData(), $dest->toCData(), $origin->toCData(), $rotation, $scale, $tint->toCData()); } /** * Draw a part of a texture defined by a rectangle with 'pro' parameters */ - function DrawTexturePro(\Nawarian\Raylib\Generated\Texture $paramtexture, \Nawarian\Raylib\Generated\Rectangle $paramsource, \Nawarian\Raylib\Generated\Rectangle $paramdest, \Nawarian\Raylib\Generated\Vector2 $paramorigin, float $paramrotation, \Nawarian\Raylib\Generated\Color $paramtint) : void +function DrawTexturePro(\Nawarian\Raylib\Generated\Texture $texture, \Nawarian\Raylib\Generated\Rectangle $source, \Nawarian\Raylib\Generated\Rectangle $dest, \Nawarian\Raylib\Generated\Vector2 $origin, float $rotation, \Nawarian\Raylib\Generated\Color $tint): void { -global $raylib; -$raylib->DrawTexturePro($paramtexture->toCData(), $paramsource->toCData(), $paramdest->toCData(), $paramorigin->toCData(), $paramrotation, $paramtint->toCData()); + global $raylib; + $raylib->DrawTexturePro($texture->toCData(), $source->toCData(), $dest->toCData(), $origin->toCData(), $rotation, $tint->toCData()); } /** * Draws a texture (or part of it) that stretches or shrinks nicely */ - function DrawTextureNPatch(\Nawarian\Raylib\Generated\Texture $paramtexture, \Nawarian\Raylib\Generated\NPatchInfo $paramnPatchInfo, \Nawarian\Raylib\Generated\Rectangle $paramdest, \Nawarian\Raylib\Generated\Vector2 $paramorigin, float $paramrotation, \Nawarian\Raylib\Generated\Color $paramtint) : void +function DrawTextureNPatch(\Nawarian\Raylib\Generated\Texture $texture, \Nawarian\Raylib\Generated\NPatchInfo $nPatchInfo, \Nawarian\Raylib\Generated\Rectangle $dest, \Nawarian\Raylib\Generated\Vector2 $origin, float $rotation, \Nawarian\Raylib\Generated\Color $tint): void { -global $raylib; -$raylib->DrawTextureNPatch($paramtexture->toCData(), $paramnPatchInfo->toCData(), $paramdest->toCData(), $paramorigin->toCData(), $paramrotation, $paramtint->toCData()); + global $raylib; + $raylib->DrawTextureNPatch($texture->toCData(), $nPatchInfo->toCData(), $dest->toCData(), $origin->toCData(), $rotation, $tint->toCData()); } /** * Draw a textured polygon */ - function DrawTexturePoly(\Nawarian\Raylib\Generated\Texture $paramtexture, \Nawarian\Raylib\Generated\Vector2 $paramcenter, \Nawarian\Raylib\Generated\Vector2 $parampoints, \Nawarian\Raylib\Generated\Vector2 $paramtexcoords, int $parampointsCount, \Nawarian\Raylib\Generated\Color $paramtint) : void +function DrawTexturePoly(\Nawarian\Raylib\Generated\Texture $texture, \Nawarian\Raylib\Generated\Vector2 $center, \Nawarian\Raylib\Generated\Vector2 $points, \Nawarian\Raylib\Generated\Vector2 $texcoords, int $pointsCount, \Nawarian\Raylib\Generated\Color $tint): void { -global $raylib; -$raylib->DrawTexturePoly($paramtexture->toCData(), $paramcenter->toCData(), $parampoints->toCData(), $paramtexcoords->toCData(), $parampointsCount, $paramtint->toCData()); + global $raylib; + $raylib->DrawTexturePoly($texture->toCData(), $center->toCData(), $points->toCData(), $texcoords->toCData(), $pointsCount, $tint->toCData()); } /** * Get color with alpha applied, alpha goes from 0.0f to 1.0f */ - function Fade(\Nawarian\Raylib\Generated\Color $paramcolor, float $paramalpha) : \Nawarian\Raylib\Generated\Color +function Fade(\Nawarian\Raylib\Generated\Color $color, float $alpha): \Nawarian\Raylib\Generated\Color { -global $raylib; -return \Nawarian\Raylib\Generated\Color::fromCData($raylib->Fade($paramcolor->toCData(), $paramalpha)); + global $raylib; + return \Nawarian\Raylib\Generated\Color::fromCData($raylib->Fade($color->toCData(), $alpha)); } /** * Get hexadecimal value for a Color */ - function ColorToInt(\Nawarian\Raylib\Generated\Color $paramcolor) : int +function ColorToInt(\Nawarian\Raylib\Generated\Color $color): int { -global $raylib; -return $raylib->ColorToInt($paramcolor->toCData()); + global $raylib; + return $raylib->ColorToInt($color->toCData()); } /** * Get Color normalized as float [0..1] */ - function ColorNormalize(\Nawarian\Raylib\Generated\Color $paramcolor) : \Nawarian\Raylib\Generated\Vector4 +function ColorNormalize(\Nawarian\Raylib\Generated\Color $color): \Nawarian\Raylib\Generated\Vector4 { -global $raylib; -return \Nawarian\Raylib\Generated\Vector4::fromCData($raylib->ColorNormalize($paramcolor->toCData())); + global $raylib; + return \Nawarian\Raylib\Generated\Vector4::fromCData($raylib->ColorNormalize($color->toCData())); } /** * Get Color from normalized values [0..1] */ - function ColorFromNormalized(\Nawarian\Raylib\Generated\Vector4 $paramnormalized) : \Nawarian\Raylib\Generated\Color +function ColorFromNormalized(\Nawarian\Raylib\Generated\Vector4 $normalized): \Nawarian\Raylib\Generated\Color { -global $raylib; -return \Nawarian\Raylib\Generated\Color::fromCData($raylib->ColorFromNormalized($paramnormalized->toCData())); + global $raylib; + return \Nawarian\Raylib\Generated\Color::fromCData($raylib->ColorFromNormalized($normalized->toCData())); } /** * Get HSV values for a Color, hue [0..360], saturation/value [0..1] */ - function ColorToHSV(\Nawarian\Raylib\Generated\Color $paramcolor) : \Nawarian\Raylib\Generated\Vector3 +function ColorToHSV(\Nawarian\Raylib\Generated\Color $color): \Nawarian\Raylib\Generated\Vector3 { -global $raylib; -return \Nawarian\Raylib\Generated\Vector3::fromCData($raylib->ColorToHSV($paramcolor->toCData())); + global $raylib; + return \Nawarian\Raylib\Generated\Vector3::fromCData($raylib->ColorToHSV($color->toCData())); } /** * Get a Color from HSV values, hue [0..360], saturation/value [0..1] */ - function ColorFromHSV(float $paramhue, float $paramsaturation, float $paramvalue) : \Nawarian\Raylib\Generated\Color +function ColorFromHSV(float $hue, float $saturation, float $value): \Nawarian\Raylib\Generated\Color { -global $raylib; -return \Nawarian\Raylib\Generated\Color::fromCData($raylib->ColorFromHSV($paramhue, $paramsaturation, $paramvalue)); + global $raylib; + return \Nawarian\Raylib\Generated\Color::fromCData($raylib->ColorFromHSV($hue, $saturation, $value)); } /** * Get color with alpha applied, alpha goes from 0.0f to 1.0f */ - function ColorAlpha(\Nawarian\Raylib\Generated\Color $paramcolor, float $paramalpha) : \Nawarian\Raylib\Generated\Color +function ColorAlpha(\Nawarian\Raylib\Generated\Color $color, float $alpha): \Nawarian\Raylib\Generated\Color { -global $raylib; -return \Nawarian\Raylib\Generated\Color::fromCData($raylib->ColorAlpha($paramcolor->toCData(), $paramalpha)); + global $raylib; + return \Nawarian\Raylib\Generated\Color::fromCData($raylib->ColorAlpha($color->toCData(), $alpha)); } /** * Get src alpha-blended into dst color with tint */ - function ColorAlphaBlend(\Nawarian\Raylib\Generated\Color $paramdst, \Nawarian\Raylib\Generated\Color $paramsrc, \Nawarian\Raylib\Generated\Color $paramtint) : \Nawarian\Raylib\Generated\Color +function ColorAlphaBlend(\Nawarian\Raylib\Generated\Color $dst, \Nawarian\Raylib\Generated\Color $src, \Nawarian\Raylib\Generated\Color $tint): \Nawarian\Raylib\Generated\Color { -global $raylib; -return \Nawarian\Raylib\Generated\Color::fromCData($raylib->ColorAlphaBlend($paramdst->toCData(), $paramsrc->toCData(), $paramtint->toCData())); + global $raylib; + return \Nawarian\Raylib\Generated\Color::fromCData($raylib->ColorAlphaBlend($dst->toCData(), $src->toCData(), $tint->toCData())); } /** * Get Color structure from hexadecimal value */ - function GetColor(int $paramhexValue) : \Nawarian\Raylib\Generated\Color +function GetColor(int $hexValue): \Nawarian\Raylib\Generated\Color { -global $raylib; -return \Nawarian\Raylib\Generated\Color::fromCData($raylib->GetColor($paramhexValue)); + global $raylib; + return \Nawarian\Raylib\Generated\Color::fromCData($raylib->GetColor($hexValue)); } /** * Get Color from a source pixel pointer of certain format */ - function GetPixelColor(\FFI\CData $paramsrcPtr, int $paramformat) : \Nawarian\Raylib\Generated\Color +function GetPixelColor(\FFI\CData $srcPtr, int $format): \Nawarian\Raylib\Generated\Color { -global $raylib; -return \Nawarian\Raylib\Generated\Color::fromCData($raylib->GetPixelColor($paramsrcPtr, $paramformat)); + global $raylib; + return \Nawarian\Raylib\Generated\Color::fromCData($raylib->GetPixelColor($srcPtr, $format)); } /** * Set color formatted into destination pixel pointer */ - function SetPixelColor(\FFI\CData $paramdstPtr, \Nawarian\Raylib\Generated\Color $paramcolor, int $paramformat) : void +function SetPixelColor(\FFI\CData $dstPtr, \Nawarian\Raylib\Generated\Color $color, int $format): void { -global $raylib; -$raylib->SetPixelColor($paramdstPtr, $paramcolor->toCData(), $paramformat); + global $raylib; + $raylib->SetPixelColor($dstPtr, $color->toCData(), $format); } /** * Get pixel data size in bytes for certain format */ - function GetPixelDataSize(int $paramwidth, int $paramheight, int $paramformat) : int +function GetPixelDataSize(int $width, int $height, int $format): int { -global $raylib; -return $raylib->GetPixelDataSize($paramwidth, $paramheight, $paramformat); + global $raylib; + return $raylib->GetPixelDataSize($width, $height, $format); } /** * Get the default Font */ - function GetFontDefault() : \Nawarian\Raylib\Generated\Font +function GetFontDefault(): \Nawarian\Raylib\Generated\Font { -global $raylib; -return \Nawarian\Raylib\Generated\Font::fromCData($raylib->GetFontDefault()); + global $raylib; + return \Nawarian\Raylib\Generated\Font::fromCData($raylib->GetFontDefault()); } /** * Load font from file into GPU memory (VRAM) */ - function LoadFont(string $paramfileName) : \Nawarian\Raylib\Generated\Font +function LoadFont(string $fileName): \Nawarian\Raylib\Generated\Font { -global $raylib; -return \Nawarian\Raylib\Generated\Font::fromCData($raylib->LoadFont($paramfileName)); + global $raylib; + return \Nawarian\Raylib\Generated\Font::fromCData($raylib->LoadFont($fileName)); } /** * Load font from file with extended parameters */ - function LoadFontEx(string $paramfileName, int $paramfontSize, array $paramfontChars, int $paramcharsCount) : \Nawarian\Raylib\Generated\Font +function LoadFontEx(string $fileName, int $fontSize, array $fontChars, int $charsCount): \Nawarian\Raylib\Generated\Font { -global $raylib; -return \Nawarian\Raylib\Generated\Font::fromCData($raylib->LoadFontEx($paramfileName, $paramfontSize, $paramfontChars, $paramcharsCount)); + global $raylib; + return \Nawarian\Raylib\Generated\Font::fromCData($raylib->LoadFontEx($fileName, $fontSize, $fontChars, $charsCount)); } /** * Load font from Image (XNA style) */ - function LoadFontFromImage(\Nawarian\Raylib\Generated\Image $paramimage, \Nawarian\Raylib\Generated\Color $paramkey, int $paramfirstChar) : \Nawarian\Raylib\Generated\Font +function LoadFontFromImage(\Nawarian\Raylib\Generated\Image $image, \Nawarian\Raylib\Generated\Color $key, int $firstChar): \Nawarian\Raylib\Generated\Font { -global $raylib; -return \Nawarian\Raylib\Generated\Font::fromCData($raylib->LoadFontFromImage($paramimage->toCData(), $paramkey->toCData(), $paramfirstChar)); + global $raylib; + return \Nawarian\Raylib\Generated\Font::fromCData($raylib->LoadFontFromImage($image->toCData(), $key->toCData(), $firstChar)); } /** * Load font from memory buffer, fileType refers to extension: i.e. '.ttf' */ - function LoadFontFromMemory(string $paramfileType, array $paramfileData, int $paramdataSize, int $paramfontSize, array $paramfontChars, int $paramcharsCount) : \Nawarian\Raylib\Generated\Font +function LoadFontFromMemory(string $fileType, array $fileData, int $dataSize, int $fontSize, array $fontChars, int $charsCount): \Nawarian\Raylib\Generated\Font { -global $raylib; -return \Nawarian\Raylib\Generated\Font::fromCData($raylib->LoadFontFromMemory($paramfileType, $paramfileData, $paramdataSize, $paramfontSize, $paramfontChars, $paramcharsCount)); + global $raylib; + return \Nawarian\Raylib\Generated\Font::fromCData($raylib->LoadFontFromMemory($fileType, $fileData, $dataSize, $fontSize, $fontChars, $charsCount)); } /** * Load font data for further use */ - function LoadFontData(array $paramfileData, int $paramdataSize, int $paramfontSize, array $paramfontChars, int $paramcharsCount, int $paramtype) : \Nawarian\Raylib\Generated\CharInfo +function LoadFontData(array $fileData, int $dataSize, int $fontSize, array $fontChars, int $charsCount, int $type): \Nawarian\Raylib\Generated\CharInfo { -global $raylib; -return \Nawarian\Raylib\Generated\CharInfo::fromCData($raylib->LoadFontData($paramfileData, $paramdataSize, $paramfontSize, $paramfontChars, $paramcharsCount, $paramtype)); + global $raylib; + return \Nawarian\Raylib\Generated\CharInfo::fromCData($raylib->LoadFontData($fileData, $dataSize, $fontSize, $fontChars, $charsCount, $type)); } /** * Generate image font atlas using chars info */ - function GenImageFontAtlas(\Nawarian\Raylib\Generated\CharInfo $paramchars, array $paramrecs, int $paramcharsCount, int $paramfontSize, int $parampadding, int $parampackMethod) : \Nawarian\Raylib\Generated\Image +function GenImageFontAtlas(\Nawarian\Raylib\Generated\CharInfo $chars, array $recs, int $charsCount, int $fontSize, int $padding, int $packMethod): \Nawarian\Raylib\Generated\Image { -global $raylib; -return \Nawarian\Raylib\Generated\Image::fromCData($raylib->GenImageFontAtlas($paramchars->toCData(), $paramrecs, $paramcharsCount, $paramfontSize, $parampadding, $parampackMethod)); + global $raylib; + return \Nawarian\Raylib\Generated\Image::fromCData($raylib->GenImageFontAtlas($chars->toCData(), $recs, $charsCount, $fontSize, $padding, $packMethod)); } /** * Unload font chars info data (RAM) */ - function UnloadFontData(\Nawarian\Raylib\Generated\CharInfo $paramchars, int $paramcharsCount) : void +function UnloadFontData(\Nawarian\Raylib\Generated\CharInfo $chars, int $charsCount): void { -global $raylib; -$raylib->UnloadFontData($paramchars->toCData(), $paramcharsCount); + global $raylib; + $raylib->UnloadFontData($chars->toCData(), $charsCount); } /** * Unload Font from GPU memory (VRAM) */ - function UnloadFont(\Nawarian\Raylib\Generated\Font $paramfont) : void +function UnloadFont(\Nawarian\Raylib\Generated\Font $font): void { -global $raylib; -$raylib->UnloadFont($paramfont->toCData()); + global $raylib; + $raylib->UnloadFont($font->toCData()); } /** * Draw current FPS */ - function DrawFPS(int $paramposX, int $paramposY) : void +function DrawFPS(int $posX, int $posY): void { -global $raylib; -$raylib->DrawFPS($paramposX, $paramposY); + global $raylib; + $raylib->DrawFPS($posX, $posY); } /** * Draw text (using default font) */ - function DrawText(string $paramtext, int $paramposX, int $paramposY, int $paramfontSize, \Nawarian\Raylib\Generated\Color $paramcolor) : void +function DrawText(string $text, int $posX, int $posY, int $fontSize, \Nawarian\Raylib\Generated\Color $color): void { -global $raylib; -$raylib->DrawText($paramtext, $paramposX, $paramposY, $paramfontSize, $paramcolor->toCData()); + global $raylib; + $raylib->DrawText($text, $posX, $posY, $fontSize, $color->toCData()); } /** * Draw text using font and additional parameters */ - function DrawTextEx(\Nawarian\Raylib\Generated\Font $paramfont, string $paramtext, \Nawarian\Raylib\Generated\Vector2 $paramposition, float $paramfontSize, float $paramspacing, \Nawarian\Raylib\Generated\Color $paramtint) : void +function DrawTextEx(\Nawarian\Raylib\Generated\Font $font, string $text, \Nawarian\Raylib\Generated\Vector2 $position, float $fontSize, float $spacing, \Nawarian\Raylib\Generated\Color $tint): void { -global $raylib; -$raylib->DrawTextEx($paramfont->toCData(), $paramtext, $paramposition->toCData(), $paramfontSize, $paramspacing, $paramtint->toCData()); + global $raylib; + $raylib->DrawTextEx($font->toCData(), $text, $position->toCData(), $fontSize, $spacing, $tint->toCData()); } /** * Draw text using font inside rectangle limits */ - function DrawTextRec(\Nawarian\Raylib\Generated\Font $paramfont, string $paramtext, \Nawarian\Raylib\Generated\Rectangle $paramrec, float $paramfontSize, float $paramspacing, bool $paramwordWrap, \Nawarian\Raylib\Generated\Color $paramtint) : void +function DrawTextRec(\Nawarian\Raylib\Generated\Font $font, string $text, \Nawarian\Raylib\Generated\Rectangle $rec, float $fontSize, float $spacing, bool $wordWrap, \Nawarian\Raylib\Generated\Color $tint): void { -global $raylib; -$raylib->DrawTextRec($paramfont->toCData(), $paramtext, $paramrec->toCData(), $paramfontSize, $paramspacing, $paramwordWrap->toCData(), $paramtint->toCData()); + global $raylib; + $raylib->DrawTextRec($font->toCData(), $text, $rec->toCData(), $fontSize, $spacing, $wordWrap->toCData(), $tint->toCData()); } /** * Draw text using font inside rectangle limits with support for text selection */ - function DrawTextRecEx(\Nawarian\Raylib\Generated\Font $paramfont, string $paramtext, \Nawarian\Raylib\Generated\Rectangle $paramrec, float $paramfontSize, float $paramspacing, bool $paramwordWrap, \Nawarian\Raylib\Generated\Color $paramtint, int $paramselectStart, int $paramselectLength, \Nawarian\Raylib\Generated\Color $paramselectTint, \Nawarian\Raylib\Generated\Color $paramselectBackTint) : void +function DrawTextRecEx(\Nawarian\Raylib\Generated\Font $font, string $text, \Nawarian\Raylib\Generated\Rectangle $rec, float $fontSize, float $spacing, bool $wordWrap, \Nawarian\Raylib\Generated\Color $tint, int $selectStart, int $selectLength, \Nawarian\Raylib\Generated\Color $selectTint, \Nawarian\Raylib\Generated\Color $selectBackTint): void { -global $raylib; -$raylib->DrawTextRecEx($paramfont->toCData(), $paramtext, $paramrec->toCData(), $paramfontSize, $paramspacing, $paramwordWrap->toCData(), $paramtint->toCData(), $paramselectStart, $paramselectLength, $paramselectTint->toCData(), $paramselectBackTint->toCData()); + global $raylib; + $raylib->DrawTextRecEx($font->toCData(), $text, $rec->toCData(), $fontSize, $spacing, $wordWrap->toCData(), $tint->toCData(), $selectStart, $selectLength, $selectTint->toCData(), $selectBackTint->toCData()); } /** * Draw one character (codepoint) */ - function DrawTextCodepoint(\Nawarian\Raylib\Generated\Font $paramfont, int $paramcodepoint, \Nawarian\Raylib\Generated\Vector2 $paramposition, float $paramfontSize, \Nawarian\Raylib\Generated\Color $paramtint) : void +function DrawTextCodepoint(\Nawarian\Raylib\Generated\Font $font, int $codepoint, \Nawarian\Raylib\Generated\Vector2 $position, float $fontSize, \Nawarian\Raylib\Generated\Color $tint): void { -global $raylib; -$raylib->DrawTextCodepoint($paramfont->toCData(), $paramcodepoint, $paramposition->toCData(), $paramfontSize, $paramtint->toCData()); + global $raylib; + $raylib->DrawTextCodepoint($font->toCData(), $codepoint, $position->toCData(), $fontSize, $tint->toCData()); } /** * Measure string width for default font */ - function MeasureText(string $paramtext, int $paramfontSize) : int +function MeasureText(string $text, int $fontSize): int { -global $raylib; -return $raylib->MeasureText($paramtext, $paramfontSize); + global $raylib; + return $raylib->MeasureText($text, $fontSize); } /** * Measure string size for Font */ - function MeasureTextEx(\Nawarian\Raylib\Generated\Font $paramfont, string $paramtext, float $paramfontSize, float $paramspacing) : \Nawarian\Raylib\Generated\Vector2 +function MeasureTextEx(\Nawarian\Raylib\Generated\Font $font, string $text, float $fontSize, float $spacing): \Nawarian\Raylib\Generated\Vector2 { -global $raylib; -return \Nawarian\Raylib\Generated\Vector2::fromCData($raylib->MeasureTextEx($paramfont->toCData(), $paramtext, $paramfontSize, $paramspacing)); + global $raylib; + return \Nawarian\Raylib\Generated\Vector2::fromCData($raylib->MeasureTextEx($font->toCData(), $text, $fontSize, $spacing)); } /** * Get index position for a unicode character on font */ - function GetGlyphIndex(\Nawarian\Raylib\Generated\Font $paramfont, int $paramcodepoint) : int +function GetGlyphIndex(\Nawarian\Raylib\Generated\Font $font, int $codepoint): int { -global $raylib; -return $raylib->GetGlyphIndex($paramfont->toCData(), $paramcodepoint); + global $raylib; + return $raylib->GetGlyphIndex($font->toCData(), $codepoint); } /** * Copy one string to another, returns bytes copied */ - function TextCopy(string $paramdst, string $paramsrc) : int +function TextCopy(string $dst, string $src): int { -global $raylib; -return $raylib->TextCopy($paramdst, $paramsrc); + global $raylib; + return $raylib->TextCopy($dst, $src); } /** * Check if two text string are equal */ - function TextIsEqual(string $paramtext1, string $paramtext2) : bool +function TextIsEqual(string $text1, string $text2): bool { -global $raylib; -return $raylib->TextIsEqual($paramtext1, $paramtext2); + global $raylib; + return $raylib->TextIsEqual($text1, $text2); } /** * Get text length, checks for ' 0' ending */ - function TextLength(string $paramtext) : int +function TextLength(string $text): int { -global $raylib; -return $raylib->TextLength($paramtext); + global $raylib; + return $raylib->TextLength($text); } /** * Get a piece of a text string */ - function TextSubtext(string $paramtext, int $paramposition, int $paramlength) : string +function TextSubtext(string $text, int $position, int $length): string { -global $raylib; -return $raylib->TextSubtext($paramtext, $paramposition, $paramlength); + global $raylib; + return $raylib->TextSubtext($text, $position, $length); } /** * Replace text string (memory must be freed!) */ - function TextReplace(string $paramtext, string $paramreplace, string $paramby) : string +function TextReplace(string $text, string $replace, string $by): string { -global $raylib; -return $raylib->TextReplace($paramtext, $paramreplace, $paramby); + global $raylib; + return $raylib->TextReplace($text, $replace, $by); } /** * Insert text in a position (memory must be freed!) */ - function TextInsert(string $paramtext, string $paraminsert, int $paramposition) : string +function TextInsert(string $text, string $insert, int $position): string { -global $raylib; -return $raylib->TextInsert($paramtext, $paraminsert, $paramposition); + global $raylib; + return $raylib->TextInsert($text, $insert, $position); } /** * Split text into multiple strings */ - function TextSplit(string $paramtext, string $paramdelimiter, array $paramcount) : array +function TextSplit(string $text, string $delimiter, array $count): array { -global $raylib; -return $raylib->TextSplit($paramtext, $paramdelimiter, $paramcount); + global $raylib; + return $raylib->TextSplit($text, $delimiter, $count); } /** * Append text at specific position and move cursor! */ - function TextAppend(string $paramtext, string $paramappend, array $paramposition) : void +function TextAppend(string $text, string $append, array $position): void { -global $raylib; -$raylib->TextAppend($paramtext, $paramappend, $paramposition); + global $raylib; + $raylib->TextAppend($text, $append, $position); } /** * Find first text occurrence within a string */ - function TextFindIndex(string $paramtext, string $paramfind) : int +function TextFindIndex(string $text, string $find): int { -global $raylib; -return $raylib->TextFindIndex($paramtext, $paramfind); + global $raylib; + return $raylib->TextFindIndex($text, $find); } /** * Get upper case version of provided string */ - function TextToUpper(string $paramtext) : string +function TextToUpper(string $text): string { -global $raylib; -return $raylib->TextToUpper($paramtext); + global $raylib; + return $raylib->TextToUpper($text); } /** * Get lower case version of provided string */ - function TextToLower(string $paramtext) : string +function TextToLower(string $text): string { -global $raylib; -return $raylib->TextToLower($paramtext); + global $raylib; + return $raylib->TextToLower($text); } /** * Get Pascal case notation version of provided string */ - function TextToPascal(string $paramtext) : string +function TextToPascal(string $text): string { -global $raylib; -return $raylib->TextToPascal($paramtext); + global $raylib; + return $raylib->TextToPascal($text); } /** * Get integer value from text (negative values not supported) */ - function TextToInteger(string $paramtext) : int +function TextToInteger(string $text): int { -global $raylib; -return $raylib->TextToInteger($paramtext); + global $raylib; + return $raylib->TextToInteger($text); } /** * Encode text codepoint into utf8 text (memory must be freed!) */ - function TextToUtf8(array $paramcodepoints, int $paramlength) : string +function TextToUtf8(array $codepoints, int $length): string { -global $raylib; -return $raylib->TextToUtf8($paramcodepoints, $paramlength); + global $raylib; + return $raylib->TextToUtf8($codepoints, $length); } /** * Get all codepoints in a string, codepoints count returned by parameters */ - function GetCodepoints(string $paramtext, array $paramcount) : array +function GetCodepoints(string $text, array $count): array { -global $raylib; -return $raylib->GetCodepoints($paramtext, $paramcount); + global $raylib; + return $raylib->GetCodepoints($text, $count); } /** * Get total number of characters (codepoints) in a UTF8 encoded string */ - function GetCodepointsCount(string $paramtext) : int +function GetCodepointsCount(string $text): int { -global $raylib; -return $raylib->GetCodepointsCount($paramtext); + global $raylib; + return $raylib->GetCodepointsCount($text); } /** * Get next codepoint in a UTF8 encoded string; 0x3f('?') is returned on failure */ - function GetNextCodepoint(string $paramtext, array $parambytesProcessed) : int +function GetNextCodepoint(string $text, array $bytesProcessed): int { -global $raylib; -return $raylib->GetNextCodepoint($paramtext, $parambytesProcessed); + global $raylib; + return $raylib->GetNextCodepoint($text, $bytesProcessed); } /** * Encode codepoint into utf8 text (char array length returned as parameter) */ - function CodepointToUtf8(int $paramcodepoint, array $parambyteLength) : string +function CodepointToUtf8(int $codepoint, array $byteLength): string { -global $raylib; -return $raylib->CodepointToUtf8($paramcodepoint, $parambyteLength); + global $raylib; + return $raylib->CodepointToUtf8($codepoint, $byteLength); } /** * Draw a line in 3D world space */ - function DrawLine3D(\Nawarian\Raylib\Generated\Vector3 $paramstartPos, \Nawarian\Raylib\Generated\Vector3 $paramendPos, \Nawarian\Raylib\Generated\Color $paramcolor) : void +function DrawLine3D(\Nawarian\Raylib\Generated\Vector3 $startPos, \Nawarian\Raylib\Generated\Vector3 $endPos, \Nawarian\Raylib\Generated\Color $color): void { -global $raylib; -$raylib->DrawLine3D($paramstartPos->toCData(), $paramendPos->toCData(), $paramcolor->toCData()); + global $raylib; + $raylib->DrawLine3D($startPos->toCData(), $endPos->toCData(), $color->toCData()); } /** * Draw a point in 3D space, actually a small line */ - function DrawPoint3D(\Nawarian\Raylib\Generated\Vector3 $paramposition, \Nawarian\Raylib\Generated\Color $paramcolor) : void +function DrawPoint3D(\Nawarian\Raylib\Generated\Vector3 $position, \Nawarian\Raylib\Generated\Color $color): void { -global $raylib; -$raylib->DrawPoint3D($paramposition->toCData(), $paramcolor->toCData()); + global $raylib; + $raylib->DrawPoint3D($position->toCData(), $color->toCData()); } /** * Draw a circle in 3D world space */ - function DrawCircle3D(\Nawarian\Raylib\Generated\Vector3 $paramcenter, float $paramradius, \Nawarian\Raylib\Generated\Vector3 $paramrotationAxis, float $paramrotationAngle, \Nawarian\Raylib\Generated\Color $paramcolor) : void +function DrawCircle3D(\Nawarian\Raylib\Generated\Vector3 $center, float $radius, \Nawarian\Raylib\Generated\Vector3 $rotationAxis, float $rotationAngle, \Nawarian\Raylib\Generated\Color $color): void { -global $raylib; -$raylib->DrawCircle3D($paramcenter->toCData(), $paramradius, $paramrotationAxis->toCData(), $paramrotationAngle, $paramcolor->toCData()); + global $raylib; + $raylib->DrawCircle3D($center->toCData(), $radius, $rotationAxis->toCData(), $rotationAngle, $color->toCData()); } /** * Draw a color-filled triangle (vertex in counter-clockwise order!) */ - function DrawTriangle3D(\Nawarian\Raylib\Generated\Vector3 $paramv1, \Nawarian\Raylib\Generated\Vector3 $paramv2, \Nawarian\Raylib\Generated\Vector3 $paramv3, \Nawarian\Raylib\Generated\Color $paramcolor) : void +function DrawTriangle3D(\Nawarian\Raylib\Generated\Vector3 $v1, \Nawarian\Raylib\Generated\Vector3 $v2, \Nawarian\Raylib\Generated\Vector3 $v3, \Nawarian\Raylib\Generated\Color $color): void { -global $raylib; -$raylib->DrawTriangle3D($paramv1->toCData(), $paramv2->toCData(), $paramv3->toCData(), $paramcolor->toCData()); + global $raylib; + $raylib->DrawTriangle3D($v1->toCData(), $v2->toCData(), $v3->toCData(), $color->toCData()); } /** * Draw a triangle strip defined by points */ - function DrawTriangleStrip3D(array $parampoints, int $parampointsCount, \Nawarian\Raylib\Generated\Color $paramcolor) : void +function DrawTriangleStrip3D(array $points, int $pointsCount, \Nawarian\Raylib\Generated\Color $color): void { -global $raylib; -$raylib->DrawTriangleStrip3D($parampoints, $parampointsCount, $paramcolor->toCData()); + global $raylib; + $raylib->DrawTriangleStrip3D($points, $pointsCount, $color->toCData()); } /** * Draw cube */ - function DrawCube(\Nawarian\Raylib\Generated\Vector3 $paramposition, float $paramwidth, float $paramheight, float $paramlength, \Nawarian\Raylib\Generated\Color $paramcolor) : void +function DrawCube(\Nawarian\Raylib\Generated\Vector3 $position, float $width, float $height, float $length, \Nawarian\Raylib\Generated\Color $color): void { -global $raylib; -$raylib->DrawCube($paramposition->toCData(), $paramwidth, $paramheight, $paramlength, $paramcolor->toCData()); + global $raylib; + $raylib->DrawCube($position->toCData(), $width, $height, $length, $color->toCData()); } /** * Draw cube (Vector version) */ - function DrawCubeV(\Nawarian\Raylib\Generated\Vector3 $paramposition, \Nawarian\Raylib\Generated\Vector3 $paramsize, \Nawarian\Raylib\Generated\Color $paramcolor) : void +function DrawCubeV(\Nawarian\Raylib\Generated\Vector3 $position, \Nawarian\Raylib\Generated\Vector3 $size, \Nawarian\Raylib\Generated\Color $color): void { -global $raylib; -$raylib->DrawCubeV($paramposition->toCData(), $paramsize->toCData(), $paramcolor->toCData()); + global $raylib; + $raylib->DrawCubeV($position->toCData(), $size->toCData(), $color->toCData()); } /** * Draw cube wires */ - function DrawCubeWires(\Nawarian\Raylib\Generated\Vector3 $paramposition, float $paramwidth, float $paramheight, float $paramlength, \Nawarian\Raylib\Generated\Color $paramcolor) : void +function DrawCubeWires(\Nawarian\Raylib\Generated\Vector3 $position, float $width, float $height, float $length, \Nawarian\Raylib\Generated\Color $color): void { -global $raylib; -$raylib->DrawCubeWires($paramposition->toCData(), $paramwidth, $paramheight, $paramlength, $paramcolor->toCData()); + global $raylib; + $raylib->DrawCubeWires($position->toCData(), $width, $height, $length, $color->toCData()); } /** * Draw cube wires (Vector version) */ - function DrawCubeWiresV(\Nawarian\Raylib\Generated\Vector3 $paramposition, \Nawarian\Raylib\Generated\Vector3 $paramsize, \Nawarian\Raylib\Generated\Color $paramcolor) : void +function DrawCubeWiresV(\Nawarian\Raylib\Generated\Vector3 $position, \Nawarian\Raylib\Generated\Vector3 $size, \Nawarian\Raylib\Generated\Color $color): void { -global $raylib; -$raylib->DrawCubeWiresV($paramposition->toCData(), $paramsize->toCData(), $paramcolor->toCData()); + global $raylib; + $raylib->DrawCubeWiresV($position->toCData(), $size->toCData(), $color->toCData()); } /** * Draw cube textured */ - function DrawCubeTexture(\Nawarian\Raylib\Generated\Texture $paramtexture, \Nawarian\Raylib\Generated\Vector3 $paramposition, float $paramwidth, float $paramheight, float $paramlength, \Nawarian\Raylib\Generated\Color $paramcolor) : void +function DrawCubeTexture(\Nawarian\Raylib\Generated\Texture $texture, \Nawarian\Raylib\Generated\Vector3 $position, float $width, float $height, float $length, \Nawarian\Raylib\Generated\Color $color): void { -global $raylib; -$raylib->DrawCubeTexture($paramtexture->toCData(), $paramposition->toCData(), $paramwidth, $paramheight, $paramlength, $paramcolor->toCData()); + global $raylib; + $raylib->DrawCubeTexture($texture->toCData(), $position->toCData(), $width, $height, $length, $color->toCData()); } /** * Draw sphere */ - function DrawSphere(\Nawarian\Raylib\Generated\Vector3 $paramcenterPos, float $paramradius, \Nawarian\Raylib\Generated\Color $paramcolor) : void +function DrawSphere(\Nawarian\Raylib\Generated\Vector3 $centerPos, float $radius, \Nawarian\Raylib\Generated\Color $color): void { -global $raylib; -$raylib->DrawSphere($paramcenterPos->toCData(), $paramradius, $paramcolor->toCData()); + global $raylib; + $raylib->DrawSphere($centerPos->toCData(), $radius, $color->toCData()); } /** * Draw sphere with extended parameters */ - function DrawSphereEx(\Nawarian\Raylib\Generated\Vector3 $paramcenterPos, float $paramradius, int $paramrings, int $paramslices, \Nawarian\Raylib\Generated\Color $paramcolor) : void +function DrawSphereEx(\Nawarian\Raylib\Generated\Vector3 $centerPos, float $radius, int $rings, int $slices, \Nawarian\Raylib\Generated\Color $color): void { -global $raylib; -$raylib->DrawSphereEx($paramcenterPos->toCData(), $paramradius, $paramrings, $paramslices, $paramcolor->toCData()); + global $raylib; + $raylib->DrawSphereEx($centerPos->toCData(), $radius, $rings, $slices, $color->toCData()); } /** * Draw sphere wires */ - function DrawSphereWires(\Nawarian\Raylib\Generated\Vector3 $paramcenterPos, float $paramradius, int $paramrings, int $paramslices, \Nawarian\Raylib\Generated\Color $paramcolor) : void +function DrawSphereWires(\Nawarian\Raylib\Generated\Vector3 $centerPos, float $radius, int $rings, int $slices, \Nawarian\Raylib\Generated\Color $color): void { -global $raylib; -$raylib->DrawSphereWires($paramcenterPos->toCData(), $paramradius, $paramrings, $paramslices, $paramcolor->toCData()); + global $raylib; + $raylib->DrawSphereWires($centerPos->toCData(), $radius, $rings, $slices, $color->toCData()); } /** * Draw a cylinder/cone */ - function DrawCylinder(\Nawarian\Raylib\Generated\Vector3 $paramposition, float $paramradiusTop, float $paramradiusBottom, float $paramheight, int $paramslices, \Nawarian\Raylib\Generated\Color $paramcolor) : void +function DrawCylinder(\Nawarian\Raylib\Generated\Vector3 $position, float $radiusTop, float $radiusBottom, float $height, int $slices, \Nawarian\Raylib\Generated\Color $color): void { -global $raylib; -$raylib->DrawCylinder($paramposition->toCData(), $paramradiusTop, $paramradiusBottom, $paramheight, $paramslices, $paramcolor->toCData()); + global $raylib; + $raylib->DrawCylinder($position->toCData(), $radiusTop, $radiusBottom, $height, $slices, $color->toCData()); } /** * Draw a cylinder/cone wires */ - function DrawCylinderWires(\Nawarian\Raylib\Generated\Vector3 $paramposition, float $paramradiusTop, float $paramradiusBottom, float $paramheight, int $paramslices, \Nawarian\Raylib\Generated\Color $paramcolor) : void +function DrawCylinderWires(\Nawarian\Raylib\Generated\Vector3 $position, float $radiusTop, float $radiusBottom, float $height, int $slices, \Nawarian\Raylib\Generated\Color $color): void { -global $raylib; -$raylib->DrawCylinderWires($paramposition->toCData(), $paramradiusTop, $paramradiusBottom, $paramheight, $paramslices, $paramcolor->toCData()); + global $raylib; + $raylib->DrawCylinderWires($position->toCData(), $radiusTop, $radiusBottom, $height, $slices, $color->toCData()); } /** * Draw a plane XZ */ - function DrawPlane(\Nawarian\Raylib\Generated\Vector3 $paramcenterPos, \Nawarian\Raylib\Generated\Vector2 $paramsize, \Nawarian\Raylib\Generated\Color $paramcolor) : void +function DrawPlane(\Nawarian\Raylib\Generated\Vector3 $centerPos, \Nawarian\Raylib\Generated\Vector2 $size, \Nawarian\Raylib\Generated\Color $color): void { -global $raylib; -$raylib->DrawPlane($paramcenterPos->toCData(), $paramsize->toCData(), $paramcolor->toCData()); + global $raylib; + $raylib->DrawPlane($centerPos->toCData(), $size->toCData(), $color->toCData()); } /** * Draw a ray line */ - function DrawRay(\Nawarian\Raylib\Generated\Ray $paramray, \Nawarian\Raylib\Generated\Color $paramcolor) : void +function DrawRay(\Nawarian\Raylib\Generated\Ray $ray, \Nawarian\Raylib\Generated\Color $color): void { -global $raylib; -$raylib->DrawRay($paramray->toCData(), $paramcolor->toCData()); + global $raylib; + $raylib->DrawRay($ray->toCData(), $color->toCData()); } /** * Draw a grid (centered at (0, 0, 0)) */ - function DrawGrid(int $paramslices, float $paramspacing) : void +function DrawGrid(int $slices, float $spacing): void { -global $raylib; -$raylib->DrawGrid($paramslices, $paramspacing); + global $raylib; + $raylib->DrawGrid($slices, $spacing); } /** * Load model from files (meshes and materials) */ - function LoadModel(string $paramfileName) : \Nawarian\Raylib\Generated\Model +function LoadModel(string $fileName): \Nawarian\Raylib\Generated\Model { -global $raylib; -return \Nawarian\Raylib\Generated\Model::fromCData($raylib->LoadModel($paramfileName)); + global $raylib; + return \Nawarian\Raylib\Generated\Model::fromCData($raylib->LoadModel($fileName)); } /** * Load model from generated mesh (default material) */ - function LoadModelFromMesh(\Nawarian\Raylib\Generated\Mesh $parammesh) : \Nawarian\Raylib\Generated\Model +function LoadModelFromMesh(\Nawarian\Raylib\Generated\Mesh $mesh): \Nawarian\Raylib\Generated\Model { -global $raylib; -return \Nawarian\Raylib\Generated\Model::fromCData($raylib->LoadModelFromMesh($parammesh->toCData())); + global $raylib; + return \Nawarian\Raylib\Generated\Model::fromCData($raylib->LoadModelFromMesh($mesh->toCData())); } /** * Unload model (including meshes) from memory (RAM and/or VRAM) */ - function UnloadModel(\Nawarian\Raylib\Generated\Model $parammodel) : void +function UnloadModel(\Nawarian\Raylib\Generated\Model $model): void { -global $raylib; -$raylib->UnloadModel($parammodel->toCData()); + global $raylib; + $raylib->UnloadModel($model->toCData()); } /** * Unload model (but not meshes) from memory (RAM and/or VRAM) */ - function UnloadModelKeepMeshes(\Nawarian\Raylib\Generated\Model $parammodel) : void +function UnloadModelKeepMeshes(\Nawarian\Raylib\Generated\Model $model): void { -global $raylib; -$raylib->UnloadModelKeepMeshes($parammodel->toCData()); + global $raylib; + $raylib->UnloadModelKeepMeshes($model->toCData()); } /** * Upload mesh vertex data in GPU and provide VAO/VBO ids */ - function UploadMesh(array $parammesh, bool $paramdynamic) : void +function UploadMesh(array $mesh, bool $dynamic): void { -global $raylib; -$raylib->UploadMesh($parammesh, $paramdynamic->toCData()); + global $raylib; + $raylib->UploadMesh($mesh, $dynamic->toCData()); } /** * Update mesh vertex data in GPU for a specific buffer index */ - function UpdateMeshBuffer(\Nawarian\Raylib\Generated\Mesh $parammesh, int $paramindex, \FFI\CData $paramdata, int $paramdataSize, int $paramoffset) : void +function UpdateMeshBuffer(\Nawarian\Raylib\Generated\Mesh $mesh, int $index, \FFI\CData $data, int $dataSize, int $offset): void { -global $raylib; -$raylib->UpdateMeshBuffer($parammesh->toCData(), $paramindex, $paramdata, $paramdataSize, $paramoffset); + global $raylib; + $raylib->UpdateMeshBuffer($mesh->toCData(), $index, $data, $dataSize, $offset); } /** * Draw a 3d mesh with material and transform */ - function DrawMesh(\Nawarian\Raylib\Generated\Mesh $parammesh, \Nawarian\Raylib\Generated\Material $parammaterial, \Nawarian\Raylib\Generated\Matrix $paramtransform) : void +function DrawMesh(\Nawarian\Raylib\Generated\Mesh $mesh, \Nawarian\Raylib\Generated\Material $material, \Nawarian\Raylib\Generated\Matrix $transform): void { -global $raylib; -$raylib->DrawMesh($parammesh->toCData(), $parammaterial->toCData(), $paramtransform->toCData()); + global $raylib; + $raylib->DrawMesh($mesh->toCData(), $material->toCData(), $transform->toCData()); } /** * Draw multiple mesh instances with material and different transforms */ - function DrawMeshInstanced(\Nawarian\Raylib\Generated\Mesh $parammesh, \Nawarian\Raylib\Generated\Material $parammaterial, array $paramtransforms, int $paraminstances) : void +function DrawMeshInstanced(\Nawarian\Raylib\Generated\Mesh $mesh, \Nawarian\Raylib\Generated\Material $material, array $transforms, int $instances): void { -global $raylib; -$raylib->DrawMeshInstanced($parammesh->toCData(), $parammaterial->toCData(), $paramtransforms, $paraminstances); + global $raylib; + $raylib->DrawMeshInstanced($mesh->toCData(), $material->toCData(), $transforms, $instances); } /** * Unload mesh data from CPU and GPU */ - function UnloadMesh(\Nawarian\Raylib\Generated\Mesh $parammesh) : void +function UnloadMesh(\Nawarian\Raylib\Generated\Mesh $mesh): void { -global $raylib; -$raylib->UnloadMesh($parammesh->toCData()); + global $raylib; + $raylib->UnloadMesh($mesh->toCData()); } /** * Export mesh data to file, returns true on success */ - function ExportMesh(\Nawarian\Raylib\Generated\Mesh $parammesh, string $paramfileName) : bool +function ExportMesh(\Nawarian\Raylib\Generated\Mesh $mesh, string $fileName): bool { -global $raylib; -return $raylib->ExportMesh($parammesh->toCData(), $paramfileName); + global $raylib; + return $raylib->ExportMesh($mesh->toCData(), $fileName); } /** * Load materials from model file */ - function LoadMaterials(string $paramfileName, array $parammaterialCount) : array +function LoadMaterials(string $fileName, array $materialCount): array { -global $raylib; -return $raylib->LoadMaterials($paramfileName, $parammaterialCount); + global $raylib; + return $raylib->LoadMaterials($fileName, $materialCount); } /** * Load default material (Supports: DIFFUSE, SPECULAR, NORMAL maps) */ - function LoadMaterialDefault() : \Nawarian\Raylib\Generated\Material +function LoadMaterialDefault(): \Nawarian\Raylib\Generated\Material { -global $raylib; -return \Nawarian\Raylib\Generated\Material::fromCData($raylib->LoadMaterialDefault()); + global $raylib; + return \Nawarian\Raylib\Generated\Material::fromCData($raylib->LoadMaterialDefault()); } /** * Unload material from GPU memory (VRAM) */ - function UnloadMaterial(\Nawarian\Raylib\Generated\Material $parammaterial) : void +function UnloadMaterial(\Nawarian\Raylib\Generated\Material $material): void { -global $raylib; -$raylib->UnloadMaterial($parammaterial->toCData()); + global $raylib; + $raylib->UnloadMaterial($material->toCData()); } /** * Set texture for a material map type (MATERIAL_MAP_DIFFUSE, * MATERIAL_MAP_SPECULAR...) */ - function SetMaterialTexture(array $parammaterial, int $parammapType, \Nawarian\Raylib\Generated\Texture $paramtexture) : void +function SetMaterialTexture(array $material, int $mapType, \Nawarian\Raylib\Generated\Texture $texture): void { -global $raylib; -$raylib->SetMaterialTexture($parammaterial, $parammapType, $paramtexture->toCData()); + global $raylib; + $raylib->SetMaterialTexture($material, $mapType, $texture->toCData()); } /** * Set material for a mesh */ - function SetModelMeshMaterial(\Nawarian\Raylib\Generated\Model $parammodel, int $parammeshId, int $parammaterialId) : void +function SetModelMeshMaterial(\Nawarian\Raylib\Generated\Model $model, int $meshId, int $materialId): void { -global $raylib; -$raylib->SetModelMeshMaterial($parammodel->toCData(), $parammeshId, $parammaterialId); + global $raylib; + $raylib->SetModelMeshMaterial($model->toCData(), $meshId, $materialId); } /** * Load model animations from file */ - function LoadModelAnimations(string $paramfileName, array $paramanimsCount) : array +function LoadModelAnimations(string $fileName, array $animsCount): array { -global $raylib; -return $raylib->LoadModelAnimations($paramfileName, $paramanimsCount); + global $raylib; + return $raylib->LoadModelAnimations($fileName, $animsCount); } /** * Update model animation pose */ - function UpdateModelAnimation(\Nawarian\Raylib\Generated\Model $parammodel, \Nawarian\Raylib\Generated\ModelAnimation $paramanim, int $paramframe) : void +function UpdateModelAnimation(\Nawarian\Raylib\Generated\Model $model, \Nawarian\Raylib\Generated\ModelAnimation $anim, int $frame): void { -global $raylib; -$raylib->UpdateModelAnimation($parammodel->toCData(), $paramanim->toCData(), $paramframe); + global $raylib; + $raylib->UpdateModelAnimation($model->toCData(), $anim->toCData(), $frame); } /** * Unload animation data */ - function UnloadModelAnimation(\Nawarian\Raylib\Generated\ModelAnimation $paramanim) : void +function UnloadModelAnimation(\Nawarian\Raylib\Generated\ModelAnimation $anim): void { -global $raylib; -$raylib->UnloadModelAnimation($paramanim->toCData()); + global $raylib; + $raylib->UnloadModelAnimation($anim->toCData()); } /** * Unload animation array data */ - function UnloadModelAnimations(array $paramanimations, int $paramcount) : void +function UnloadModelAnimations(array $animations, int $count): void { -global $raylib; -$raylib->UnloadModelAnimations($paramanimations, $paramcount); + global $raylib; + $raylib->UnloadModelAnimations($animations, $count); } /** * Check model animation skeleton match */ - function IsModelAnimationValid(\Nawarian\Raylib\Generated\Model $parammodel, \Nawarian\Raylib\Generated\ModelAnimation $paramanim) : bool +function IsModelAnimationValid(\Nawarian\Raylib\Generated\Model $model, \Nawarian\Raylib\Generated\ModelAnimation $anim): bool { -global $raylib; -return $raylib->IsModelAnimationValid($parammodel->toCData(), $paramanim->toCData()); + global $raylib; + return $raylib->IsModelAnimationValid($model->toCData(), $anim->toCData()); } /** * Generate polygonal mesh */ - function GenMeshPoly(int $paramsides, float $paramradius) : \Nawarian\Raylib\Generated\Mesh +function GenMeshPoly(int $sides, float $radius): \Nawarian\Raylib\Generated\Mesh { -global $raylib; -return \Nawarian\Raylib\Generated\Mesh::fromCData($raylib->GenMeshPoly($paramsides, $paramradius)); + global $raylib; + return \Nawarian\Raylib\Generated\Mesh::fromCData($raylib->GenMeshPoly($sides, $radius)); } /** * Generate plane mesh (with subdivisions) */ - function GenMeshPlane(float $paramwidth, float $paramlength, int $paramresX, int $paramresZ) : \Nawarian\Raylib\Generated\Mesh +function GenMeshPlane(float $width, float $length, int $resX, int $resZ): \Nawarian\Raylib\Generated\Mesh { -global $raylib; -return \Nawarian\Raylib\Generated\Mesh::fromCData($raylib->GenMeshPlane($paramwidth, $paramlength, $paramresX, $paramresZ)); + global $raylib; + return \Nawarian\Raylib\Generated\Mesh::fromCData($raylib->GenMeshPlane($width, $length, $resX, $resZ)); } /** * Generate cuboid mesh */ - function GenMeshCube(float $paramwidth, float $paramheight, float $paramlength) : \Nawarian\Raylib\Generated\Mesh +function GenMeshCube(float $width, float $height, float $length): \Nawarian\Raylib\Generated\Mesh { -global $raylib; -return \Nawarian\Raylib\Generated\Mesh::fromCData($raylib->GenMeshCube($paramwidth, $paramheight, $paramlength)); + global $raylib; + return \Nawarian\Raylib\Generated\Mesh::fromCData($raylib->GenMeshCube($width, $height, $length)); } /** * Generate sphere mesh (standard sphere) */ - function GenMeshSphere(float $paramradius, int $paramrings, int $paramslices) : \Nawarian\Raylib\Generated\Mesh +function GenMeshSphere(float $radius, int $rings, int $slices): \Nawarian\Raylib\Generated\Mesh { -global $raylib; -return \Nawarian\Raylib\Generated\Mesh::fromCData($raylib->GenMeshSphere($paramradius, $paramrings, $paramslices)); + global $raylib; + return \Nawarian\Raylib\Generated\Mesh::fromCData($raylib->GenMeshSphere($radius, $rings, $slices)); } /** * Generate half-sphere mesh (no bottom cap) */ - function GenMeshHemiSphere(float $paramradius, int $paramrings, int $paramslices) : \Nawarian\Raylib\Generated\Mesh +function GenMeshHemiSphere(float $radius, int $rings, int $slices): \Nawarian\Raylib\Generated\Mesh { -global $raylib; -return \Nawarian\Raylib\Generated\Mesh::fromCData($raylib->GenMeshHemiSphere($paramradius, $paramrings, $paramslices)); + global $raylib; + return \Nawarian\Raylib\Generated\Mesh::fromCData($raylib->GenMeshHemiSphere($radius, $rings, $slices)); } /** * Generate cylinder mesh */ - function GenMeshCylinder(float $paramradius, float $paramheight, int $paramslices) : \Nawarian\Raylib\Generated\Mesh +function GenMeshCylinder(float $radius, float $height, int $slices): \Nawarian\Raylib\Generated\Mesh { -global $raylib; -return \Nawarian\Raylib\Generated\Mesh::fromCData($raylib->GenMeshCylinder($paramradius, $paramheight, $paramslices)); + global $raylib; + return \Nawarian\Raylib\Generated\Mesh::fromCData($raylib->GenMeshCylinder($radius, $height, $slices)); } /** * Generate torus mesh */ - function GenMeshTorus(float $paramradius, float $paramsize, int $paramradSeg, int $paramsides) : \Nawarian\Raylib\Generated\Mesh +function GenMeshTorus(float $radius, float $size, int $radSeg, int $sides): \Nawarian\Raylib\Generated\Mesh { -global $raylib; -return \Nawarian\Raylib\Generated\Mesh::fromCData($raylib->GenMeshTorus($paramradius, $paramsize, $paramradSeg, $paramsides)); + global $raylib; + return \Nawarian\Raylib\Generated\Mesh::fromCData($raylib->GenMeshTorus($radius, $size, $radSeg, $sides)); } /** * Generate trefoil knot mesh */ - function GenMeshKnot(float $paramradius, float $paramsize, int $paramradSeg, int $paramsides) : \Nawarian\Raylib\Generated\Mesh +function GenMeshKnot(float $radius, float $size, int $radSeg, int $sides): \Nawarian\Raylib\Generated\Mesh { -global $raylib; -return \Nawarian\Raylib\Generated\Mesh::fromCData($raylib->GenMeshKnot($paramradius, $paramsize, $paramradSeg, $paramsides)); + global $raylib; + return \Nawarian\Raylib\Generated\Mesh::fromCData($raylib->GenMeshKnot($radius, $size, $radSeg, $sides)); } /** * Generate heightmap mesh from image data */ - function GenMeshHeightmap(\Nawarian\Raylib\Generated\Image $paramheightmap, \Nawarian\Raylib\Generated\Vector3 $paramsize) : \Nawarian\Raylib\Generated\Mesh +function GenMeshHeightmap(\Nawarian\Raylib\Generated\Image $heightmap, \Nawarian\Raylib\Generated\Vector3 $size): \Nawarian\Raylib\Generated\Mesh { -global $raylib; -return \Nawarian\Raylib\Generated\Mesh::fromCData($raylib->GenMeshHeightmap($paramheightmap->toCData(), $paramsize->toCData())); + global $raylib; + return \Nawarian\Raylib\Generated\Mesh::fromCData($raylib->GenMeshHeightmap($heightmap->toCData(), $size->toCData())); } /** * Generate cubes-based map mesh from image data */ - function GenMeshCubicmap(\Nawarian\Raylib\Generated\Image $paramcubicmap, \Nawarian\Raylib\Generated\Vector3 $paramcubeSize) : \Nawarian\Raylib\Generated\Mesh +function GenMeshCubicmap(\Nawarian\Raylib\Generated\Image $cubicmap, \Nawarian\Raylib\Generated\Vector3 $cubeSize): \Nawarian\Raylib\Generated\Mesh { -global $raylib; -return \Nawarian\Raylib\Generated\Mesh::fromCData($raylib->GenMeshCubicmap($paramcubicmap->toCData(), $paramcubeSize->toCData())); + global $raylib; + return \Nawarian\Raylib\Generated\Mesh::fromCData($raylib->GenMeshCubicmap($cubicmap->toCData(), $cubeSize->toCData())); } /** * Compute mesh bounding box limits */ - function GetMeshBoundingBox(\Nawarian\Raylib\Generated\Mesh $parammesh) : \Nawarian\Raylib\Generated\BoundingBox +function GetMeshBoundingBox(\Nawarian\Raylib\Generated\Mesh $mesh): \Nawarian\Raylib\Generated\BoundingBox { -global $raylib; -return \Nawarian\Raylib\Generated\BoundingBox::fromCData($raylib->GetMeshBoundingBox($parammesh->toCData())); + global $raylib; + return \Nawarian\Raylib\Generated\BoundingBox::fromCData($raylib->GetMeshBoundingBox($mesh->toCData())); } /** * Compute mesh tangents */ - function MeshTangents(array $parammesh) : void +function MeshTangents(array $mesh): void { -global $raylib; -$raylib->MeshTangents($parammesh); + global $raylib; + $raylib->MeshTangents($mesh); } /** * Compute mesh binormals */ - function MeshBinormals(array $parammesh) : void +function MeshBinormals(array $mesh): void { -global $raylib; -$raylib->MeshBinormals($parammesh); + global $raylib; + $raylib->MeshBinormals($mesh); } /** * Draw a model (with texture if set) */ - function DrawModel(\Nawarian\Raylib\Generated\Model $parammodel, \Nawarian\Raylib\Generated\Vector3 $paramposition, float $paramscale, \Nawarian\Raylib\Generated\Color $paramtint) : void +function DrawModel(\Nawarian\Raylib\Generated\Model $model, \Nawarian\Raylib\Generated\Vector3 $position, float $scale, \Nawarian\Raylib\Generated\Color $tint): void { -global $raylib; -$raylib->DrawModel($parammodel->toCData(), $paramposition->toCData(), $paramscale, $paramtint->toCData()); + global $raylib; + $raylib->DrawModel($model->toCData(), $position->toCData(), $scale, $tint->toCData()); } /** * Draw a model with extended parameters */ - function DrawModelEx(\Nawarian\Raylib\Generated\Model $parammodel, \Nawarian\Raylib\Generated\Vector3 $paramposition, \Nawarian\Raylib\Generated\Vector3 $paramrotationAxis, float $paramrotationAngle, \Nawarian\Raylib\Generated\Vector3 $paramscale, \Nawarian\Raylib\Generated\Color $paramtint) : void +function DrawModelEx(\Nawarian\Raylib\Generated\Model $model, \Nawarian\Raylib\Generated\Vector3 $position, \Nawarian\Raylib\Generated\Vector3 $rotationAxis, float $rotationAngle, \Nawarian\Raylib\Generated\Vector3 $scale, \Nawarian\Raylib\Generated\Color $tint): void { -global $raylib; -$raylib->DrawModelEx($parammodel->toCData(), $paramposition->toCData(), $paramrotationAxis->toCData(), $paramrotationAngle, $paramscale->toCData(), $paramtint->toCData()); + global $raylib; + $raylib->DrawModelEx($model->toCData(), $position->toCData(), $rotationAxis->toCData(), $rotationAngle, $scale->toCData(), $tint->toCData()); } /** * Draw a model wires (with texture if set) */ - function DrawModelWires(\Nawarian\Raylib\Generated\Model $parammodel, \Nawarian\Raylib\Generated\Vector3 $paramposition, float $paramscale, \Nawarian\Raylib\Generated\Color $paramtint) : void +function DrawModelWires(\Nawarian\Raylib\Generated\Model $model, \Nawarian\Raylib\Generated\Vector3 $position, float $scale, \Nawarian\Raylib\Generated\Color $tint): void { -global $raylib; -$raylib->DrawModelWires($parammodel->toCData(), $paramposition->toCData(), $paramscale, $paramtint->toCData()); + global $raylib; + $raylib->DrawModelWires($model->toCData(), $position->toCData(), $scale, $tint->toCData()); } /** * Draw a model wires (with texture if set) with extended parameters */ - function DrawModelWiresEx(\Nawarian\Raylib\Generated\Model $parammodel, \Nawarian\Raylib\Generated\Vector3 $paramposition, \Nawarian\Raylib\Generated\Vector3 $paramrotationAxis, float $paramrotationAngle, \Nawarian\Raylib\Generated\Vector3 $paramscale, \Nawarian\Raylib\Generated\Color $paramtint) : void +function DrawModelWiresEx(\Nawarian\Raylib\Generated\Model $model, \Nawarian\Raylib\Generated\Vector3 $position, \Nawarian\Raylib\Generated\Vector3 $rotationAxis, float $rotationAngle, \Nawarian\Raylib\Generated\Vector3 $scale, \Nawarian\Raylib\Generated\Color $tint): void { -global $raylib; -$raylib->DrawModelWiresEx($parammodel->toCData(), $paramposition->toCData(), $paramrotationAxis->toCData(), $paramrotationAngle, $paramscale->toCData(), $paramtint->toCData()); + global $raylib; + $raylib->DrawModelWiresEx($model->toCData(), $position->toCData(), $rotationAxis->toCData(), $rotationAngle, $scale->toCData(), $tint->toCData()); } /** * Draw bounding box (wires) */ - function DrawBoundingBox(\Nawarian\Raylib\Generated\BoundingBox $parambox, \Nawarian\Raylib\Generated\Color $paramcolor) : void +function DrawBoundingBox(\Nawarian\Raylib\Generated\BoundingBox $box, \Nawarian\Raylib\Generated\Color $color): void { -global $raylib; -$raylib->DrawBoundingBox($parambox->toCData(), $paramcolor->toCData()); + global $raylib; + $raylib->DrawBoundingBox($box->toCData(), $color->toCData()); } /** * Draw a billboard texture */ - function DrawBillboard(\Nawarian\Raylib\Generated\Camera3D $paramcamera, \Nawarian\Raylib\Generated\Texture $paramtexture, \Nawarian\Raylib\Generated\Vector3 $paramposition, float $paramsize, \Nawarian\Raylib\Generated\Color $paramtint) : void +function DrawBillboard(\Nawarian\Raylib\Generated\Camera3D $camera, \Nawarian\Raylib\Generated\Texture $texture, \Nawarian\Raylib\Generated\Vector3 $position, float $size, \Nawarian\Raylib\Generated\Color $tint): void { -global $raylib; -$raylib->DrawBillboard($paramcamera->toCData(), $paramtexture->toCData(), $paramposition->toCData(), $paramsize, $paramtint->toCData()); + global $raylib; + $raylib->DrawBillboard($camera->toCData(), $texture->toCData(), $position->toCData(), $size, $tint->toCData()); } /** * Draw a billboard texture defined by source */ - function DrawBillboardRec(\Nawarian\Raylib\Generated\Camera3D $paramcamera, \Nawarian\Raylib\Generated\Texture $paramtexture, \Nawarian\Raylib\Generated\Rectangle $paramsource, \Nawarian\Raylib\Generated\Vector3 $paramposition, \Nawarian\Raylib\Generated\Vector2 $paramsize, \Nawarian\Raylib\Generated\Color $paramtint) : void +function DrawBillboardRec(\Nawarian\Raylib\Generated\Camera3D $camera, \Nawarian\Raylib\Generated\Texture $texture, \Nawarian\Raylib\Generated\Rectangle $source, \Nawarian\Raylib\Generated\Vector3 $position, \Nawarian\Raylib\Generated\Vector2 $size, \Nawarian\Raylib\Generated\Color $tint): void { -global $raylib; -$raylib->DrawBillboardRec($paramcamera->toCData(), $paramtexture->toCData(), $paramsource->toCData(), $paramposition->toCData(), $paramsize->toCData(), $paramtint->toCData()); + global $raylib; + $raylib->DrawBillboardRec($camera->toCData(), $texture->toCData(), $source->toCData(), $position->toCData(), $size->toCData(), $tint->toCData()); } /** * Draw a billboard texture defined by source and rotation */ - function DrawBillboardPro(\Nawarian\Raylib\Generated\Camera3D $paramcamera, \Nawarian\Raylib\Generated\Texture $paramtexture, \Nawarian\Raylib\Generated\Rectangle $paramsource, \Nawarian\Raylib\Generated\Vector3 $paramposition, \Nawarian\Raylib\Generated\Vector2 $paramsize, \Nawarian\Raylib\Generated\Vector2 $paramorigin, float $paramrotation, \Nawarian\Raylib\Generated\Color $paramtint) : void +function DrawBillboardPro(\Nawarian\Raylib\Generated\Camera3D $camera, \Nawarian\Raylib\Generated\Texture $texture, \Nawarian\Raylib\Generated\Rectangle $source, \Nawarian\Raylib\Generated\Vector3 $position, \Nawarian\Raylib\Generated\Vector2 $size, \Nawarian\Raylib\Generated\Vector2 $origin, float $rotation, \Nawarian\Raylib\Generated\Color $tint): void { -global $raylib; -$raylib->DrawBillboardPro($paramcamera->toCData(), $paramtexture->toCData(), $paramsource->toCData(), $paramposition->toCData(), $paramsize->toCData(), $paramorigin->toCData(), $paramrotation, $paramtint->toCData()); + global $raylib; + $raylib->DrawBillboardPro($camera->toCData(), $texture->toCData(), $source->toCData(), $position->toCData(), $size->toCData(), $origin->toCData(), $rotation, $tint->toCData()); } /** * Check collision between two spheres */ - function CheckCollisionSpheres(\Nawarian\Raylib\Generated\Vector3 $paramcenter1, float $paramradius1, \Nawarian\Raylib\Generated\Vector3 $paramcenter2, float $paramradius2) : bool +function CheckCollisionSpheres(\Nawarian\Raylib\Generated\Vector3 $center1, float $radius1, \Nawarian\Raylib\Generated\Vector3 $center2, float $radius2): bool { -global $raylib; -return $raylib->CheckCollisionSpheres($paramcenter1->toCData(), $paramradius1, $paramcenter2->toCData(), $paramradius2); + global $raylib; + return $raylib->CheckCollisionSpheres($center1->toCData(), $radius1, $center2->toCData(), $radius2); } /** * Check collision between two bounding boxes */ - function CheckCollisionBoxes(\Nawarian\Raylib\Generated\BoundingBox $parambox1, \Nawarian\Raylib\Generated\BoundingBox $parambox2) : bool +function CheckCollisionBoxes(\Nawarian\Raylib\Generated\BoundingBox $box1, \Nawarian\Raylib\Generated\BoundingBox $box2): bool { -global $raylib; -return $raylib->CheckCollisionBoxes($parambox1->toCData(), $parambox2->toCData()); + global $raylib; + return $raylib->CheckCollisionBoxes($box1->toCData(), $box2->toCData()); } /** * Check collision between box and sphere */ - function CheckCollisionBoxSphere(\Nawarian\Raylib\Generated\BoundingBox $parambox, \Nawarian\Raylib\Generated\Vector3 $paramcenter, float $paramradius) : bool +function CheckCollisionBoxSphere(\Nawarian\Raylib\Generated\BoundingBox $box, \Nawarian\Raylib\Generated\Vector3 $center, float $radius): bool { -global $raylib; -return $raylib->CheckCollisionBoxSphere($parambox->toCData(), $paramcenter->toCData(), $paramradius); + global $raylib; + return $raylib->CheckCollisionBoxSphere($box->toCData(), $center->toCData(), $radius); } /** * Get collision info between ray and sphere */ - function GetRayCollisionSphere(\Nawarian\Raylib\Generated\Ray $paramray, \Nawarian\Raylib\Generated\Vector3 $paramcenter, float $paramradius) : \Nawarian\Raylib\Generated\RayCollision +function GetRayCollisionSphere(\Nawarian\Raylib\Generated\Ray $ray, \Nawarian\Raylib\Generated\Vector3 $center, float $radius): \Nawarian\Raylib\Generated\RayCollision { -global $raylib; -return \Nawarian\Raylib\Generated\RayCollision::fromCData($raylib->GetRayCollisionSphere($paramray->toCData(), $paramcenter->toCData(), $paramradius)); + global $raylib; + return \Nawarian\Raylib\Generated\RayCollision::fromCData($raylib->GetRayCollisionSphere($ray->toCData(), $center->toCData(), $radius)); } /** * Get collision info between ray and box */ - function GetRayCollisionBox(\Nawarian\Raylib\Generated\Ray $paramray, \Nawarian\Raylib\Generated\BoundingBox $parambox) : \Nawarian\Raylib\Generated\RayCollision +function GetRayCollisionBox(\Nawarian\Raylib\Generated\Ray $ray, \Nawarian\Raylib\Generated\BoundingBox $box): \Nawarian\Raylib\Generated\RayCollision { -global $raylib; -return \Nawarian\Raylib\Generated\RayCollision::fromCData($raylib->GetRayCollisionBox($paramray->toCData(), $parambox->toCData())); + global $raylib; + return \Nawarian\Raylib\Generated\RayCollision::fromCData($raylib->GetRayCollisionBox($ray->toCData(), $box->toCData())); } /** * Get collision info between ray and model */ - function GetRayCollisionModel(\Nawarian\Raylib\Generated\Ray $paramray, \Nawarian\Raylib\Generated\Model $parammodel) : \Nawarian\Raylib\Generated\RayCollision +function GetRayCollisionModel(\Nawarian\Raylib\Generated\Ray $ray, \Nawarian\Raylib\Generated\Model $model): \Nawarian\Raylib\Generated\RayCollision { -global $raylib; -return \Nawarian\Raylib\Generated\RayCollision::fromCData($raylib->GetRayCollisionModel($paramray->toCData(), $parammodel->toCData())); + global $raylib; + return \Nawarian\Raylib\Generated\RayCollision::fromCData($raylib->GetRayCollisionModel($ray->toCData(), $model->toCData())); } /** * Get collision info between ray and mesh */ - function GetRayCollisionMesh(\Nawarian\Raylib\Generated\Ray $paramray, \Nawarian\Raylib\Generated\Mesh $parammesh, \Nawarian\Raylib\Generated\Matrix $paramtransform) : \Nawarian\Raylib\Generated\RayCollision +function GetRayCollisionMesh(\Nawarian\Raylib\Generated\Ray $ray, \Nawarian\Raylib\Generated\Mesh $mesh, \Nawarian\Raylib\Generated\Matrix $transform): \Nawarian\Raylib\Generated\RayCollision { -global $raylib; -return \Nawarian\Raylib\Generated\RayCollision::fromCData($raylib->GetRayCollisionMesh($paramray->toCData(), $parammesh->toCData(), $paramtransform->toCData())); + global $raylib; + return \Nawarian\Raylib\Generated\RayCollision::fromCData($raylib->GetRayCollisionMesh($ray->toCData(), $mesh->toCData(), $transform->toCData())); } /** * Get collision info between ray and triangle */ - function GetRayCollisionTriangle(\Nawarian\Raylib\Generated\Ray $paramray, \Nawarian\Raylib\Generated\Vector3 $paramp1, \Nawarian\Raylib\Generated\Vector3 $paramp2, \Nawarian\Raylib\Generated\Vector3 $paramp3) : \Nawarian\Raylib\Generated\RayCollision +function GetRayCollisionTriangle(\Nawarian\Raylib\Generated\Ray $ray, \Nawarian\Raylib\Generated\Vector3 $p1, \Nawarian\Raylib\Generated\Vector3 $p2, \Nawarian\Raylib\Generated\Vector3 $p3): \Nawarian\Raylib\Generated\RayCollision { -global $raylib; -return \Nawarian\Raylib\Generated\RayCollision::fromCData($raylib->GetRayCollisionTriangle($paramray->toCData(), $paramp1->toCData(), $paramp2->toCData(), $paramp3->toCData())); + global $raylib; + return \Nawarian\Raylib\Generated\RayCollision::fromCData($raylib->GetRayCollisionTriangle($ray->toCData(), $p1->toCData(), $p2->toCData(), $p3->toCData())); } /** * Get collision info between ray and quad */ - function GetRayCollisionQuad(\Nawarian\Raylib\Generated\Ray $paramray, \Nawarian\Raylib\Generated\Vector3 $paramp1, \Nawarian\Raylib\Generated\Vector3 $paramp2, \Nawarian\Raylib\Generated\Vector3 $paramp3, \Nawarian\Raylib\Generated\Vector3 $paramp4) : \Nawarian\Raylib\Generated\RayCollision +function GetRayCollisionQuad(\Nawarian\Raylib\Generated\Ray $ray, \Nawarian\Raylib\Generated\Vector3 $p1, \Nawarian\Raylib\Generated\Vector3 $p2, \Nawarian\Raylib\Generated\Vector3 $p3, \Nawarian\Raylib\Generated\Vector3 $p4): \Nawarian\Raylib\Generated\RayCollision { -global $raylib; -return \Nawarian\Raylib\Generated\RayCollision::fromCData($raylib->GetRayCollisionQuad($paramray->toCData(), $paramp1->toCData(), $paramp2->toCData(), $paramp3->toCData(), $paramp4->toCData())); + global $raylib; + return \Nawarian\Raylib\Generated\RayCollision::fromCData($raylib->GetRayCollisionQuad($ray->toCData(), $p1->toCData(), $p2->toCData(), $p3->toCData(), $p4->toCData())); } /** * Initialize audio device and context */ - function InitAudioDevice() : void +function InitAudioDevice(): void { -global $raylib; -$raylib->InitAudioDevice(); + global $raylib; + $raylib->InitAudioDevice(); } /** * Close the audio device and context */ - function CloseAudioDevice() : void +function CloseAudioDevice(): void { -global $raylib; -$raylib->CloseAudioDevice(); + global $raylib; + $raylib->CloseAudioDevice(); } /** * Check if audio device has been initialized successfully */ - function IsAudioDeviceReady() : bool +function IsAudioDeviceReady(): bool { -global $raylib; -return $raylib->IsAudioDeviceReady(); + global $raylib; + return $raylib->IsAudioDeviceReady(); } /** * Set master volume (listener) */ - function SetMasterVolume(float $paramvolume) : void +function SetMasterVolume(float $volume): void { -global $raylib; -$raylib->SetMasterVolume($paramvolume); + global $raylib; + $raylib->SetMasterVolume($volume); } /** * Load wave data from file */ - function LoadWave(string $paramfileName) : \Nawarian\Raylib\Generated\Wave +function LoadWave(string $fileName): \Nawarian\Raylib\Generated\Wave { -global $raylib; -return \Nawarian\Raylib\Generated\Wave::fromCData($raylib->LoadWave($paramfileName)); + global $raylib; + return \Nawarian\Raylib\Generated\Wave::fromCData($raylib->LoadWave($fileName)); } /** * Load wave from memory buffer, fileType refers to extension: i.e. '.wav' */ - function LoadWaveFromMemory(string $paramfileType, array $paramfileData, int $paramdataSize) : \Nawarian\Raylib\Generated\Wave +function LoadWaveFromMemory(string $fileType, array $fileData, int $dataSize): \Nawarian\Raylib\Generated\Wave { -global $raylib; -return \Nawarian\Raylib\Generated\Wave::fromCData($raylib->LoadWaveFromMemory($paramfileType, $paramfileData, $paramdataSize)); + global $raylib; + return \Nawarian\Raylib\Generated\Wave::fromCData($raylib->LoadWaveFromMemory($fileType, $fileData, $dataSize)); } /** * Load sound from file */ - function LoadSound(string $paramfileName) : \Nawarian\Raylib\Generated\Sound +function LoadSound(string $fileName): \Nawarian\Raylib\Generated\Sound { -global $raylib; -return \Nawarian\Raylib\Generated\Sound::fromCData($raylib->LoadSound($paramfileName)); + global $raylib; + return \Nawarian\Raylib\Generated\Sound::fromCData($raylib->LoadSound($fileName)); } /** * Load sound from wave data */ - function LoadSoundFromWave(\Nawarian\Raylib\Generated\Wave $paramwave) : \Nawarian\Raylib\Generated\Sound +function LoadSoundFromWave(\Nawarian\Raylib\Generated\Wave $wave): \Nawarian\Raylib\Generated\Sound { -global $raylib; -return \Nawarian\Raylib\Generated\Sound::fromCData($raylib->LoadSoundFromWave($paramwave->toCData())); + global $raylib; + return \Nawarian\Raylib\Generated\Sound::fromCData($raylib->LoadSoundFromWave($wave->toCData())); } /** * Update sound buffer with new data */ - function UpdateSound(\Nawarian\Raylib\Generated\Sound $paramsound, \FFI\CData $paramdata, int $paramsamplesCount) : void +function UpdateSound(\Nawarian\Raylib\Generated\Sound $sound, \FFI\CData $data, int $samplesCount): void { -global $raylib; -$raylib->UpdateSound($paramsound->toCData(), $paramdata, $paramsamplesCount); + global $raylib; + $raylib->UpdateSound($sound->toCData(), $data, $samplesCount); } /** * Unload wave data */ - function UnloadWave(\Nawarian\Raylib\Generated\Wave $paramwave) : void +function UnloadWave(\Nawarian\Raylib\Generated\Wave $wave): void { -global $raylib; -$raylib->UnloadWave($paramwave->toCData()); + global $raylib; + $raylib->UnloadWave($wave->toCData()); } /** * Unload sound */ - function UnloadSound(\Nawarian\Raylib\Generated\Sound $paramsound) : void +function UnloadSound(\Nawarian\Raylib\Generated\Sound $sound): void { -global $raylib; -$raylib->UnloadSound($paramsound->toCData()); + global $raylib; + $raylib->UnloadSound($sound->toCData()); } /** * Export wave data to file, returns true on success */ - function ExportWave(\Nawarian\Raylib\Generated\Wave $paramwave, string $paramfileName) : bool +function ExportWave(\Nawarian\Raylib\Generated\Wave $wave, string $fileName): bool { -global $raylib; -return $raylib->ExportWave($paramwave->toCData(), $paramfileName); + global $raylib; + return $raylib->ExportWave($wave->toCData(), $fileName); } /** * Export wave sample data to code (.h), returns true on success */ - function ExportWaveAsCode(\Nawarian\Raylib\Generated\Wave $paramwave, string $paramfileName) : bool +function ExportWaveAsCode(\Nawarian\Raylib\Generated\Wave $wave, string $fileName): bool { -global $raylib; -return $raylib->ExportWaveAsCode($paramwave->toCData(), $paramfileName); + global $raylib; + return $raylib->ExportWaveAsCode($wave->toCData(), $fileName); } /** * Play a sound */ - function PlaySound(\Nawarian\Raylib\Generated\Sound $paramsound) : void +function PlaySound(\Nawarian\Raylib\Generated\Sound $sound): void { -global $raylib; -$raylib->PlaySound($paramsound->toCData()); + global $raylib; + $raylib->PlaySound($sound->toCData()); } /** * Stop playing a sound */ - function StopSound(\Nawarian\Raylib\Generated\Sound $paramsound) : void +function StopSound(\Nawarian\Raylib\Generated\Sound $sound): void { -global $raylib; -$raylib->StopSound($paramsound->toCData()); + global $raylib; + $raylib->StopSound($sound->toCData()); } /** * Pause a sound */ - function PauseSound(\Nawarian\Raylib\Generated\Sound $paramsound) : void +function PauseSound(\Nawarian\Raylib\Generated\Sound $sound): void { -global $raylib; -$raylib->PauseSound($paramsound->toCData()); + global $raylib; + $raylib->PauseSound($sound->toCData()); } /** * Resume a paused sound */ - function ResumeSound(\Nawarian\Raylib\Generated\Sound $paramsound) : void +function ResumeSound(\Nawarian\Raylib\Generated\Sound $sound): void { -global $raylib; -$raylib->ResumeSound($paramsound->toCData()); + global $raylib; + $raylib->ResumeSound($sound->toCData()); } /** * Play a sound (using multichannel buffer pool) */ - function PlaySoundMulti(\Nawarian\Raylib\Generated\Sound $paramsound) : void +function PlaySoundMulti(\Nawarian\Raylib\Generated\Sound $sound): void { -global $raylib; -$raylib->PlaySoundMulti($paramsound->toCData()); + global $raylib; + $raylib->PlaySoundMulti($sound->toCData()); } /** * Stop any sound playing (using multichannel buffer pool) */ - function StopSoundMulti() : void +function StopSoundMulti(): void { -global $raylib; -$raylib->StopSoundMulti(); + global $raylib; + $raylib->StopSoundMulti(); } /** * Get number of sounds playing in the multichannel */ - function GetSoundsPlaying() : int +function GetSoundsPlaying(): int { -global $raylib; -return $raylib->GetSoundsPlaying(); + global $raylib; + return $raylib->GetSoundsPlaying(); } /** * Check if a sound is currently playing */ - function IsSoundPlaying(\Nawarian\Raylib\Generated\Sound $paramsound) : bool +function IsSoundPlaying(\Nawarian\Raylib\Generated\Sound $sound): bool { -global $raylib; -return $raylib->IsSoundPlaying($paramsound->toCData()); + global $raylib; + return $raylib->IsSoundPlaying($sound->toCData()); } /** * Set volume for a sound (1.0 is max level) */ - function SetSoundVolume(\Nawarian\Raylib\Generated\Sound $paramsound, float $paramvolume) : void +function SetSoundVolume(\Nawarian\Raylib\Generated\Sound $sound, float $volume): void { -global $raylib; -$raylib->SetSoundVolume($paramsound->toCData(), $paramvolume); + global $raylib; + $raylib->SetSoundVolume($sound->toCData(), $volume); } /** * Set pitch for a sound (1.0 is base level) */ - function SetSoundPitch(\Nawarian\Raylib\Generated\Sound $paramsound, float $parampitch) : void +function SetSoundPitch(\Nawarian\Raylib\Generated\Sound $sound, float $pitch): void { -global $raylib; -$raylib->SetSoundPitch($paramsound->toCData(), $parampitch); + global $raylib; + $raylib->SetSoundPitch($sound->toCData(), $pitch); } /** * Convert wave data to desired format */ - function WaveFormat(\Nawarian\Raylib\Generated\Wave $paramwave, int $paramsampleRate, int $paramsampleSize, int $paramchannels) : void +function WaveFormat(\Nawarian\Raylib\Generated\Wave $wave, int $sampleRate, int $sampleSize, int $channels): void { -global $raylib; -$raylib->WaveFormat($paramwave->toCData(), $paramsampleRate, $paramsampleSize, $paramchannels); + global $raylib; + $raylib->WaveFormat($wave->toCData(), $sampleRate, $sampleSize, $channels); } /** * Copy a wave to a new wave */ - function WaveCopy(\Nawarian\Raylib\Generated\Wave $paramwave) : \Nawarian\Raylib\Generated\Wave +function WaveCopy(\Nawarian\Raylib\Generated\Wave $wave): \Nawarian\Raylib\Generated\Wave { -global $raylib; -return \Nawarian\Raylib\Generated\Wave::fromCData($raylib->WaveCopy($paramwave->toCData())); + global $raylib; + return \Nawarian\Raylib\Generated\Wave::fromCData($raylib->WaveCopy($wave->toCData())); } /** * Crop a wave to defined samples range */ - function WaveCrop(\Nawarian\Raylib\Generated\Wave $paramwave, int $paraminitSample, int $paramfinalSample) : void +function WaveCrop(\Nawarian\Raylib\Generated\Wave $wave, int $initSample, int $finalSample): void { -global $raylib; -$raylib->WaveCrop($paramwave->toCData(), $paraminitSample, $paramfinalSample); + global $raylib; + $raylib->WaveCrop($wave->toCData(), $initSample, $finalSample); } /** * Load samples data from wave as a floats array */ - function LoadWaveSamples(\Nawarian\Raylib\Generated\Wave $paramwave) : array +function LoadWaveSamples(\Nawarian\Raylib\Generated\Wave $wave): array { -global $raylib; -return $raylib->LoadWaveSamples($paramwave->toCData()); + global $raylib; + return $raylib->LoadWaveSamples($wave->toCData()); } /** * Unload samples data loaded with LoadWaveSamples() */ - function UnloadWaveSamples(array $paramsamples) : void +function UnloadWaveSamples(array $samples): void { -global $raylib; -$raylib->UnloadWaveSamples($paramsamples); + global $raylib; + $raylib->UnloadWaveSamples($samples); } /** * Load music stream from file */ - function LoadMusicStream(string $paramfileName) : \Nawarian\Raylib\Generated\Music +function LoadMusicStream(string $fileName): \Nawarian\Raylib\Generated\Music { -global $raylib; -return \Nawarian\Raylib\Generated\Music::fromCData($raylib->LoadMusicStream($paramfileName)); + global $raylib; + return \Nawarian\Raylib\Generated\Music::fromCData($raylib->LoadMusicStream($fileName)); } /** * Load music stream from data */ - function LoadMusicStreamFromMemory(string $paramfileType, array $paramdata, int $paramdataSize) : \Nawarian\Raylib\Generated\Music +function LoadMusicStreamFromMemory(string $fileType, array $data, int $dataSize): \Nawarian\Raylib\Generated\Music { -global $raylib; -return \Nawarian\Raylib\Generated\Music::fromCData($raylib->LoadMusicStreamFromMemory($paramfileType, $paramdata, $paramdataSize)); + global $raylib; + return \Nawarian\Raylib\Generated\Music::fromCData($raylib->LoadMusicStreamFromMemory($fileType, $data, $dataSize)); } /** * Unload music stream */ - function UnloadMusicStream(\Nawarian\Raylib\Generated\Music $parammusic) : void +function UnloadMusicStream(\Nawarian\Raylib\Generated\Music $music): void { -global $raylib; -$raylib->UnloadMusicStream($parammusic->toCData()); + global $raylib; + $raylib->UnloadMusicStream($music->toCData()); } /** * Start music playing */ - function PlayMusicStream(\Nawarian\Raylib\Generated\Music $parammusic) : void +function PlayMusicStream(\Nawarian\Raylib\Generated\Music $music): void { -global $raylib; -$raylib->PlayMusicStream($parammusic->toCData()); + global $raylib; + $raylib->PlayMusicStream($music->toCData()); } /** * Check if music is playing */ - function IsMusicStreamPlaying(\Nawarian\Raylib\Generated\Music $parammusic) : bool +function IsMusicStreamPlaying(\Nawarian\Raylib\Generated\Music $music): bool { -global $raylib; -return $raylib->IsMusicStreamPlaying($parammusic->toCData()); + global $raylib; + return $raylib->IsMusicStreamPlaying($music->toCData()); } /** * Updates buffers for music streaming */ - function UpdateMusicStream(\Nawarian\Raylib\Generated\Music $parammusic) : void +function UpdateMusicStream(\Nawarian\Raylib\Generated\Music $music): void { -global $raylib; -$raylib->UpdateMusicStream($parammusic->toCData()); + global $raylib; + $raylib->UpdateMusicStream($music->toCData()); } /** * Stop music playing */ - function StopMusicStream(\Nawarian\Raylib\Generated\Music $parammusic) : void +function StopMusicStream(\Nawarian\Raylib\Generated\Music $music): void { -global $raylib; -$raylib->StopMusicStream($parammusic->toCData()); + global $raylib; + $raylib->StopMusicStream($music->toCData()); } /** * Pause music playing */ - function PauseMusicStream(\Nawarian\Raylib\Generated\Music $parammusic) : void +function PauseMusicStream(\Nawarian\Raylib\Generated\Music $music): void { -global $raylib; -$raylib->PauseMusicStream($parammusic->toCData()); + global $raylib; + $raylib->PauseMusicStream($music->toCData()); } /** * Resume playing paused music */ - function ResumeMusicStream(\Nawarian\Raylib\Generated\Music $parammusic) : void +function ResumeMusicStream(\Nawarian\Raylib\Generated\Music $music): void { -global $raylib; -$raylib->ResumeMusicStream($parammusic->toCData()); + global $raylib; + $raylib->ResumeMusicStream($music->toCData()); } /** * Set volume for music (1.0 is max level) */ - function SetMusicVolume(\Nawarian\Raylib\Generated\Music $parammusic, float $paramvolume) : void +function SetMusicVolume(\Nawarian\Raylib\Generated\Music $music, float $volume): void { -global $raylib; -$raylib->SetMusicVolume($parammusic->toCData(), $paramvolume); + global $raylib; + $raylib->SetMusicVolume($music->toCData(), $volume); } /** * Set pitch for a music (1.0 is base level) */ - function SetMusicPitch(\Nawarian\Raylib\Generated\Music $parammusic, float $parampitch) : void +function SetMusicPitch(\Nawarian\Raylib\Generated\Music $music, float $pitch): void { -global $raylib; -$raylib->SetMusicPitch($parammusic->toCData(), $parampitch); + global $raylib; + $raylib->SetMusicPitch($music->toCData(), $pitch); } /** * Get music time length (in seconds) */ - function GetMusicTimeLength(\Nawarian\Raylib\Generated\Music $parammusic) : float +function GetMusicTimeLength(\Nawarian\Raylib\Generated\Music $music): float { -global $raylib; -return $raylib->GetMusicTimeLength($parammusic->toCData()); + global $raylib; + return $raylib->GetMusicTimeLength($music->toCData()); } /** * Get current music time played (in seconds) */ - function GetMusicTimePlayed(\Nawarian\Raylib\Generated\Music $parammusic) : float +function GetMusicTimePlayed(\Nawarian\Raylib\Generated\Music $music): float { -global $raylib; -return $raylib->GetMusicTimePlayed($parammusic->toCData()); + global $raylib; + return $raylib->GetMusicTimePlayed($music->toCData()); } /** * Load audio stream (to stream raw audio pcm data) */ - function LoadAudioStream(int $paramsampleRate, int $paramsampleSize, int $paramchannels) : \Nawarian\Raylib\Generated\AudioStream +function LoadAudioStream(int $sampleRate, int $sampleSize, int $channels): \Nawarian\Raylib\Generated\AudioStream { -global $raylib; -return \Nawarian\Raylib\Generated\AudioStream::fromCData($raylib->LoadAudioStream($paramsampleRate, $paramsampleSize, $paramchannels)); + global $raylib; + return \Nawarian\Raylib\Generated\AudioStream::fromCData($raylib->LoadAudioStream($sampleRate, $sampleSize, $channels)); } /** * Unload audio stream and free memory */ - function UnloadAudioStream(\Nawarian\Raylib\Generated\AudioStream $paramstream) : void +function UnloadAudioStream(\Nawarian\Raylib\Generated\AudioStream $stream): void { -global $raylib; -$raylib->UnloadAudioStream($paramstream->toCData()); + global $raylib; + $raylib->UnloadAudioStream($stream->toCData()); } /** * Update audio stream buffers with data */ - function UpdateAudioStream(\Nawarian\Raylib\Generated\AudioStream $paramstream, \FFI\CData $paramdata, int $paramsamplesCount) : void +function UpdateAudioStream(\Nawarian\Raylib\Generated\AudioStream $stream, \FFI\CData $data, int $samplesCount): void { -global $raylib; -$raylib->UpdateAudioStream($paramstream->toCData(), $paramdata, $paramsamplesCount); + global $raylib; + $raylib->UpdateAudioStream($stream->toCData(), $data, $samplesCount); } /** * Check if any audio stream buffers requires refill */ - function IsAudioStreamProcessed(\Nawarian\Raylib\Generated\AudioStream $paramstream) : bool +function IsAudioStreamProcessed(\Nawarian\Raylib\Generated\AudioStream $stream): bool { -global $raylib; -return $raylib->IsAudioStreamProcessed($paramstream->toCData()); + global $raylib; + return $raylib->IsAudioStreamProcessed($stream->toCData()); } /** * Play audio stream */ - function PlayAudioStream(\Nawarian\Raylib\Generated\AudioStream $paramstream) : void +function PlayAudioStream(\Nawarian\Raylib\Generated\AudioStream $stream): void { -global $raylib; -$raylib->PlayAudioStream($paramstream->toCData()); + global $raylib; + $raylib->PlayAudioStream($stream->toCData()); } /** * Pause audio stream */ - function PauseAudioStream(\Nawarian\Raylib\Generated\AudioStream $paramstream) : void +function PauseAudioStream(\Nawarian\Raylib\Generated\AudioStream $stream): void { -global $raylib; -$raylib->PauseAudioStream($paramstream->toCData()); + global $raylib; + $raylib->PauseAudioStream($stream->toCData()); } /** * Resume audio stream */ - function ResumeAudioStream(\Nawarian\Raylib\Generated\AudioStream $paramstream) : void +function ResumeAudioStream(\Nawarian\Raylib\Generated\AudioStream $stream): void { -global $raylib; -$raylib->ResumeAudioStream($paramstream->toCData()); + global $raylib; + $raylib->ResumeAudioStream($stream->toCData()); } /** * Check if audio stream is playing */ - function IsAudioStreamPlaying(\Nawarian\Raylib\Generated\AudioStream $paramstream) : bool +function IsAudioStreamPlaying(\Nawarian\Raylib\Generated\AudioStream $stream): bool { -global $raylib; -return $raylib->IsAudioStreamPlaying($paramstream->toCData()); + global $raylib; + return $raylib->IsAudioStreamPlaying($stream->toCData()); } /** * Stop audio stream */ - function StopAudioStream(\Nawarian\Raylib\Generated\AudioStream $paramstream) : void +function StopAudioStream(\Nawarian\Raylib\Generated\AudioStream $stream): void { -global $raylib; -$raylib->StopAudioStream($paramstream->toCData()); + global $raylib; + $raylib->StopAudioStream($stream->toCData()); } /** * Set volume for audio stream (1.0 is max level) */ - function SetAudioStreamVolume(\Nawarian\Raylib\Generated\AudioStream $paramstream, float $paramvolume) : void +function SetAudioStreamVolume(\Nawarian\Raylib\Generated\AudioStream $stream, float $volume): void { -global $raylib; -$raylib->SetAudioStreamVolume($paramstream->toCData(), $paramvolume); + global $raylib; + $raylib->SetAudioStreamVolume($stream->toCData(), $volume); } /** * Set pitch for audio stream (1.0 is base level) */ - function SetAudioStreamPitch(\Nawarian\Raylib\Generated\AudioStream $paramstream, float $parampitch) : void +function SetAudioStreamPitch(\Nawarian\Raylib\Generated\AudioStream $stream, float $pitch): void { -global $raylib; -$raylib->SetAudioStreamPitch($paramstream->toCData(), $parampitch); + global $raylib; + $raylib->SetAudioStreamPitch($stream->toCData(), $pitch); } /** * Default size for new audio streams */ - function SetAudioStreamBufferSizeDefault(int $paramsize) : void +function SetAudioStreamBufferSizeDefault(int $size): void { -global $raylib; -$raylib->SetAudioStreamBufferSizeDefault($paramsize); + global $raylib; + $raylib->SetAudioStreamBufferSizeDefault($size); } diff --git a/src/Command/GenerateRaylibWrappers.php b/src/Command/GenerateRaylibWrappers.php index daf481e..1d63b94 100644 --- a/src/Command/GenerateRaylibWrappers.php +++ b/src/Command/GenerateRaylibWrappers.php @@ -4,17 +4,10 @@ namespace Nawarian\Raylib\Command; -use FFI\CData; use Laminas\Code\DeclareStatement; -use Laminas\Code\Generator\AbstractMemberGenerator; -use Laminas\Code\Generator\ClassGenerator; -use Laminas\Code\Generator\DocBlockGenerator; use Laminas\Code\Generator\FileGenerator; -use Nawarian\Raylib\Generator\CustomMethodGenerator; -use Nawarian\Raylib\Generator\CustomParameterGenerator; -use Nawarian\Raylib\Generator\CustomPropertyGenerator; -use RuntimeException; -use stdClass; +use Nawarian\Raylib\Generator\RaylibClassTypeGenerator; +use Nawarian\Raylib\Generator\RaylibFunctionGenerator; final class GenerateRaylibWrappers { @@ -30,265 +23,43 @@ final class GenerateRaylibWrappers 'TextJoin', ]; - private static array $knownTypes = []; + public static array $knownTypes = []; + public static string $globalRaylibVariable = '$raylib'; public static function generate(): void { $spec = json_decode(file_get_contents(__DIR__ . '/../../resources/raylib_api.json')); + // Generate class types foreach ($spec->structs as $struct) { - self::generateTypeFromDefinition($struct); + $class = RaylibClassTypeGenerator::fromRaylibStruct($struct); + self::$knownTypes[] = '\\' . $class->getNamespaceName() . '\\' . $class->getName(); + + $fileGenerator = new FileGenerator(); + $fileGenerator + ->setDeclares([DeclareStatement::strictTypes(1)]) + ->setClass($class) + ->setFilename(self::OUTPUT_DIR . '/' . $struct->name . '.php') + ->write(); } - self::$knownTypes = array_unique(self::$knownTypes); + // Generate functions.php $fileGenerator = new FileGenerator(); $functions = []; - $uses = []; foreach ($spec->functions as $function) { if (in_array($function->name, self::SKIP_FUNCTIONS)) { continue; } - $functionDefinition = self::generateFunctionFromDefinition($function); - - $functions[] = $functionDefinition->generate(); + $functions[] = RaylibFunctionGenerator::fromRaylibStruct($function)->generate(); } $fileGenerator ->setDeclares([DeclareStatement::strictTypes(1)]) - ->setUses($uses) ->setBody(implode(PHP_EOL, $functions)) ->setFilename(self::OUTPUT_DIR . '/functions.php') ->setNamespace('Nawarian\\Raylib\\Generated') ->write(); } - - private static function generateFunctionFromDefinition(stdClass $definition): CustomMethodGenerator - { - $method = new CustomMethodGenerator(); - $method - ->setDocBlock(new DocBlockGenerator($definition->description)) - ->setName($definition->name) - ->removeFlag(AbstractMemberGenerator::FLAG_PUBLIC) - ->setIndentation(''); - - $params = []; - foreach ($definition->params ?? [] as $key => $param) { - $paramGen = new CustomParameterGenerator("param{$key}"); - $paramGen->setType(self::getTypeFromParam($param)); - $params[] = $paramGen; - } - - $method - ->setParameters($params) - ->setReturnType(self::getTypeFromParam($definition->returnType)); - - $paramsStr = implode( - ', ', - array_map(function (CustomParameterGenerator $param) { - $toCData = self::shouldCallToCData($param->getType()) ? '->toCData()' : ''; - - return "\${$param->getName()}{$toCData}"; - }, $params) - ); - $returnType = $method->getReturnType()->generate(); - $returnStr = $returnType !== 'void' ? 'return ' : ''; - - $raylibGlobalVar = '$raylib'; - $methodBody = ["global {$raylibGlobalVar};"]; - - if (in_array($returnType, self::$knownTypes)) { - $methodBody[] = "return {$returnType}::fromCData({$raylibGlobalVar}->{$definition->name}({$paramsStr}));"; - } else { - $methodBody[] = "{$returnStr}{$raylibGlobalVar}->{$definition->name}({$paramsStr});"; - } - - $method->setBody(implode(PHP_EOL, $methodBody)); - - return $method; - } - - private static function generateTypeFromDefinition(stdClass $definition): void - { - $class = new ClassGenerator($definition->name, 'Nawarian\\Raylib\\Generated'); - $constructor = new CustomMethodGenerator('__construct'); - $constructor->setVisibility(AbstractMemberGenerator::VISIBILITY_PUBLIC); - $class->addMethodFromGenerator($constructor); - - $constructorParams = []; - - foreach ($definition->fields as $field) { - $docBlock = new DocBlockGenerator($field->description); - - $newPropertyNames = [$field->name]; - if ($definition->name === 'Matrix') { - $newPropertyNames = array_map('trim', explode(', ', $field->name)); - } - foreach ($newPropertyNames as $propertyName) { - $propertyName = self::sanitizePropertyName($propertyName); - $property = new CustomPropertyGenerator($propertyName); - - $type = self::getTypeFromField($field); - - $property - ->addFlag(AbstractMemberGenerator::FLAG_PUBLIC) - ->setDocBlock($docBlock) - ->omitDefaultValue(true) - ->setType($type); - $class->addPropertyFromGenerator($property); - - $paramGen = new CustomParameterGenerator($propertyName); - $paramGen->setType($type); - - $constructorParams[] = $paramGen; - } - } - - $constructorBody = implode( - PHP_EOL, - array_map( - fn (CustomParameterGenerator $p) => "\$this->{$p->getName()} = \${$p->getName()};", - $constructorParams - ) - ); - $constructor - ->setParameters($constructorParams) - ->setBody($constructorBody); - - $class->addMethodFromGenerator(self::generateToCData($class)); - $class->addMethodFromGenerator(self::generateFromCData($class)); - - self::$knownTypes[] = '\\' . $class->getNamespaceName() . '\\' . $class->getName(); - - $fileGenerator = new FileGenerator(); - $fileGenerator - ->setDeclares([DeclareStatement::strictTypes(1)]) - ->setClass($class) - ->setFilename(self::OUTPUT_DIR . '/' . $definition->name . '.php') - ->write(); - } - - private static function generateFromCData(ClassGenerator $class): CustomMethodGenerator - { - $cdataParameter = new CustomParameterGenerator('cdata'); - $cdataParameter->setType(CData::class); - - $method = new CustomMethodGenerator('fromCData'); - - $constructorArgs = array_map(function (CustomPropertyGenerator $p) { - if (self::shouldCallToCData($p->getType())) { - return "{$p->getType()}::fromCData(\$cdata->{$p->getName()})"; - } - return "\$cdata->{$p->getName()}"; - }, $class->getProperties()); - $constructorArgs = implode(', ', $constructorArgs); - - return $method - ->setParameters([$cdataParameter]) - ->setBody( - "return new self({$constructorArgs});" - ) - ->setVisibility(AbstractMemberGenerator::VISIBILITY_PUBLIC) - ->setStatic(true); - } - - private static function generateToCData(ClassGenerator $class): CustomMethodGenerator - { - $class->addUse('FFI'); - - $method = new CustomMethodGenerator('toCData'); - $functionBody = [ - "global \$raylib;", - "\$type = \$raylib->new('{$class->getName()}');", - ]; - - /** @var CustomPropertyGenerator $property */ - foreach ($class->getProperties() as $property) { - $callToCData = self::shouldCallToCData($property->getType()) - ? '->toCData()' : ''; - - $functionBody[] = "\$type->{$property->getName()} = \$this->{$property->getName()}{$callToCData};"; - } - - $functionBody[] = 'return $type;'; - - $method - ->setVisibility(AbstractMemberGenerator::VISIBILITY_PUBLIC) - ->setReturnType(CData::class) - ->setBody(implode(PHP_EOL, $functionBody)); - - return $method; - } - - private static function shouldCallToCData(?string $type): bool - { - return match ($type) { - 'float', 'int', 'string', CData::class, 'array' => false, - default => true, - }; - } - - private static function sanitizePropertyName(string $name): string - { - return explode('[', $name)[0]; - } - - private static function getTypeFromField(stdClass $field): string - { - if (preg_match('#\[[\w]+\]$#', $field->name)) { - return 'array'; - } - - return match($field->type) { - 'char', 'const char *', 'char *' => 'string', - 'float' => 'float', - 'bool' => 'bool', - 'int', 'unsigned char', 'unsigned int' => 'int', - 'Texture', 'Rectangle', 'Image', 'Vector2', 'Vector3', 'Color', 'Shader', - 'Matrix', 'AudioStream', 'Camera2D', 'RenderTexture2D', 'VrStereoConfig', 'VrDeviceInfo' - => "\\Nawarian\\Raylib\\Generated\\{$field->type}", - 'Camera' => "\\Nawarian\\Raylib\\Generated\\Camera3D", - 'Texture2D' => "\\Nawarian\\Raylib\\Generated\\Texture", - 'Quaternion' => "\\Nawarian\\Raylib\\Generated\\Vector4", - 'CharInfo *' => "\\Nawarian\\Raylib\\Generated\\CharInfo", - 'Rectangle *', 'Rectangle **', 'GlyphInfo *', 'float *', 'unsigned char *', 'unsigned short *', - 'MaterialMap *', 'unsigned int *', 'int *', 'Mesh *', 'Material *', 'BoneInfo *', 'Transform *', - 'Transform **' => 'array', - 'void *', 'rAudioBuffer *', 'const void *' => CData::class, - default => throw new RuntimeException("Unknown type {$field->type} found at raylib_api.json.") - }; - } - - private static function getTypeFromParam(string $param): string - { - return match($param) { - 'char', 'const char *', 'char *' => 'string', - 'double', 'float' => 'float', - 'bool' => 'bool', - 'void' => 'void', - 'long', 'int', 'unsigned char', 'unsigned int' => 'int', - 'Texture', 'Rectangle', 'Image', 'Vector2', 'Vector3', 'Color', 'Shader', 'Font', 'NPatchInfo', 'Vector4', - 'Matrix', 'AudioStream', 'Camera2D', 'Camera3D', 'RenderTexture', 'VrStereoConfig', 'VrDeviceInfo', 'Ray', - 'Mesh', 'Model', 'BoundingBox', 'Material', 'ModelAnimation', 'Wave', 'Sound', 'Music', 'GlyphInfo', - 'RayCollision' => "\\Nawarian\\Raylib\\Generated\\{$param}", - 'Camera', 'Camera *' => "\\Nawarian\\Raylib\\Generated\\Camera3D", - 'Color *' => "\\Nawarian\\Raylib\\Generated\\Color", - 'CharInfo *', 'const CharInfo *' => "\\Nawarian\\Raylib\\Generated\\CharInfo", - 'Image *' => "\\Nawarian\\Raylib\\Generated\\Image", - 'Model *' => "\\Nawarian\\Raylib\\Generated\\Model", - 'Vector2 *' => "\\Nawarian\\Raylib\\Generated\\Vector2", - 'GlyphInfo *', 'const GlyphInfo *' => "\\Nawarian\\Raylib\\Generated\\GlyphInfo", - 'Texture2D', 'Texture2D *', 'TextureCubemap' => "\\Nawarian\\Raylib\\Generated\\Texture", - 'Quaternion' => "\\Nawarian\\Raylib\\Generated\\Vector4", - 'Wave *' => "\\Nawarian\\Raylib\\Generated\\Wave", - 'RenderTexture2D' => "\\Nawarian\\Raylib\\Generated\\RenderTexture", - 'Rectangle *', 'Rectangle **', 'float *', 'unsigned char *', 'const unsigned char *', - 'unsigned short *', 'MaterialMap *', 'unsigned int *', 'int *', 'Mesh *', 'Material *', 'BoneInfo *', - 'Transform *', 'Transform **', 'Vector3 *', 'Matrix *', 'ModelAnimation*', 'ModelAnimation *', 'char **', - 'const char **' => 'array', - 'void *', 'rAudioBuffer *', 'const void *' => CData::class, - default => throw new RuntimeException("Unknown type {$param} found at raylib_api.json.") - }; - } } diff --git a/src/Generator/RaylibClassTypeGenerator.php b/src/Generator/RaylibClassTypeGenerator.php new file mode 100644 index 0000000..eab0a66 --- /dev/null +++ b/src/Generator/RaylibClassTypeGenerator.php @@ -0,0 +1,153 @@ +fields; + } + + /** + * @param RaylibFieldGenerator[] $fields + */ + public function setFields(array $fields): self + { + $this->fields = $fields; + return $this; + } + + public static function fromRaylibStruct(stdClass $struct): self + { + $instance = new self(); + $instance->name = $struct->name; + $instance->namespaceName = self::TYPES_NAMESPACE; + $instance->setDocBlock(new DocBlockGenerator($struct->description)); + + $fields = []; + foreach ($struct->fields as $field) { + $properties = explode(', ', $field->name); + foreach ($properties as $name) { + $fields[] = RaylibFieldGenerator::fromRaylibStruct($field, $name); + } + } + + $instance->fields = $fields; + + return $instance; + } + + public function generate(): string + { + $classGenerator = new ClassGenerator($this->name, $this->getNamespaceName()); + $classGenerator->addProperties($this->fields); + + $constructor = new CustomMethodGenerator('__construct'); + $constructor->setVisibility(AbstractMemberGenerator::VISIBILITY_PUBLIC); + + $constructor + ->setParameters(array_map( + function (RaylibFieldGenerator $p) { + return new ParameterGenerator($p->getName(), $p->getType()); + }, + $this->fields + )) + ->setBody(implode( + PHP_EOL, + array_map( + fn (RaylibFieldGenerator $p) => "\$this->{$p->getName()} = \${$p->getName()};", + $this->fields + ) + )); + + $classGenerator->addMethodFromGenerator($constructor); + $classGenerator->addMethodFromGenerator($this->craftToCDataMethodGenerator()); + $classGenerator->addMethodFromGenerator($this->craftFromCDataMethodGenerator()); + + return $classGenerator->generate(); + } + + private function craftToCDataMethodGenerator(): MethodGenerator + { + $globalRaylibVar = GenerateRaylibWrappers::$globalRaylibVariable; + $this->addUse('FFI'); + + $method = new CustomMethodGenerator('toCData'); + $functionBody = [ + "global {$globalRaylibVar};", + "\$type = \$raylib->new('{$this->getName()}');", + ]; + + /** @var CustomPropertyGenerator $property */ + foreach ($this->getFields() as $property) { + $callToCData = $this->shouldCallToCData($property->getType()) + ? '->toCData()' : ''; + + $functionBody[] = "\$type->{$property->getName()} = \$this->{$property->getName()}{$callToCData};"; + } + + $functionBody[] = 'return $type;'; + + $method + ->setVisibility(AbstractMemberGenerator::VISIBILITY_PUBLIC) + ->setReturnType(CData::class) + ->setBody(implode(PHP_EOL, $functionBody)); + + return $method; + } + + private function shouldCallToCData(string $type): bool + { + return match ($type) { + 'float', 'int', 'string', CData::class, 'array' => false, + default => true, + }; + } + + private function craftFromCDataMethodGenerator(): MethodGenerator + { + $cdataParameter = new CustomParameterGenerator('cdata'); + $cdataParameter->setType(CData::class); + + $method = new CustomMethodGenerator('fromCData'); + + $constructorArgs = array_map(function (RaylibFieldGenerator $p) { + if (self::shouldCallToCData($p->getType())) { + return "{$p->getType()}::fromCData(\$cdata->{$p->getName()})"; + } + return "\$cdata->{$p->getName()}"; + }, $this->getFields()); + $constructorArgs = implode(', ', $constructorArgs); + + return $method + ->setParameters([$cdataParameter]) + ->setBody( + "return new self({$constructorArgs});" + ) + ->setVisibility(AbstractMemberGenerator::VISIBILITY_PUBLIC) + ->setReturnType($this->getNamespaceName() . '\\' . $this->getName()) + ->setStatic(true); + } +} diff --git a/src/Generator/RaylibFieldGenerator.php b/src/Generator/RaylibFieldGenerator.php new file mode 100644 index 0000000..97c0183 --- /dev/null +++ b/src/Generator/RaylibFieldGenerator.php @@ -0,0 +1,117 @@ +normalizeType($this->getName(), $this->type); + } + + public function setType(string $type): self + { + $this->type = $type; + return $this; + } + + public function omitDefaultValue(bool $omit = true): self + { + $this->omitDefaultValue = $omit; + + return $this; + } + + public static function fromRaylibStruct(stdClass $field, string $propertyName): self + { + $instance = new self(); + $instance + ->omitDefaultValue() + ->setName($propertyName) + ->setType($field->type !== 'array' ? $field->type : '') + ->setVisibility(AbstractMemberGenerator::VISIBILITY_PUBLIC) + ->setDocBlock($field->description); + + return $instance; + } + + public function generate() + { + $name = $this->getName(); + $defaultValue = $this->getDefaultValue(); + + $output = ''; + + if (($docBlock = $this->getDocBlock()) !== null) { + $docBlock->setIndentation(' '); + $output .= $docBlock->generate(); + } + + if ($this->isConst()) { + if ($defaultValue !== null && ! $defaultValue->isValidConstantType()) { + throw new RuntimeException(sprintf( + 'The property %s is said to be ' + . 'constant but does not have a valid constant value.', + $this->name + )); + } + return $output + . $this->indentation + . ($this->isFinal() ? 'final ' : '') + . $this->getVisibility() + . ' const ' + . $name . ' = ' + . ($defaultValue !== null ? $defaultValue->generate() : 'null;'); + } + + $output .= $this->indentation + . $this->getVisibility() + . ($this->isReadonly() ? ' readonly' : '') + . ($this->getType() ? " {$this->getType()}" : '') + . ($this->isStatic() ? ' static' : '') + . ' $' . $name; + + if ($this->omitDefaultValue) { + return $output . ';'; + } + + return $output . ' = ' . ($defaultValue !== null ? $defaultValue->generate() : 'null;'); + } + + private function normalizeType(string $name, string $type): string + { + if (preg_match('#\[[\w]+\]$#', $name)) { + return 'array'; + } + + return match($type) { + 'char', 'const char *', 'char *' => 'string', + 'float' => 'float', + 'bool' => 'bool', + 'int', 'unsigned char', 'unsigned int' => 'int', + 'Texture', 'Rectangle', 'Image', 'Vector2', 'Vector3', 'Color', 'Shader', + 'Matrix', 'AudioStream', 'Camera2D', 'RenderTexture2D', 'VrStereoConfig', 'VrDeviceInfo' + => "\\Nawarian\\Raylib\\Generated\\{$type}", + 'Camera' => "\\Nawarian\\Raylib\\Generated\\Camera3D", + 'Texture2D' => "\\Nawarian\\Raylib\\Generated\\Texture", + 'Quaternion' => "\\Nawarian\\Raylib\\Generated\\Vector4", + 'CharInfo *' => "\\Nawarian\\Raylib\\Generated\\CharInfo", + 'Rectangle *', 'Rectangle **', 'GlyphInfo *', 'float *', 'unsigned char *', 'unsigned short *', + 'MaterialMap *', 'unsigned int *', 'int *', 'Mesh *', 'Material *', 'BoneInfo *', 'Transform *', + 'Transform **' => 'array', + 'void *', 'rAudioBuffer *', 'const void *' => CData::class, + default => throw new RuntimeException("Unknown type {$type} found at raylib_api.json.") + }; + } +} diff --git a/src/Generator/RaylibFunctionGenerator.php b/src/Generator/RaylibFunctionGenerator.php new file mode 100644 index 0000000..6f04c1d --- /dev/null +++ b/src/Generator/RaylibFunctionGenerator.php @@ -0,0 +1,115 @@ +flags & self::FLAG_PROTECTED: + return self::VISIBILITY_PROTECTED; + case $this->flags & self::FLAG_PRIVATE: + return self::VISIBILITY_PRIVATE; + case $this->flags & self::FLAG_PUBLIC: + return self::VISIBILITY_PUBLIC; + default: + return ''; + } + } + + public static function fromRaylibStruct(stdClass $struct): self + { + $method = new self(); + $method + ->setDocBlock(new DocBlockGenerator($struct->description)) + ->setName($struct->name) + ->removeFlag(AbstractMemberGenerator::FLAG_PUBLIC) + ->setIndentation(''); + + $params = []; + foreach ($struct->params ?? [] as $key => $param) { + $paramGen = new CustomParameterGenerator($key); + $paramGen->setType(self::getTypeFromParam($param)); + $params[] = $paramGen; + } + + $method + ->setParameters($params) + ->setReturnType(self::getTypeFromParam($struct->returnType)); + + $paramsStr = implode( + ', ', + array_map(function (CustomParameterGenerator $param) { + $toCData = self::shouldCallToCData($param->getType()) ? '->toCData()' : ''; + + return "\${$param->getName()}{$toCData}"; + }, $params) + ); + $returnType = $method->getReturnType()->generate(); + $returnStr = $returnType !== 'void' ? 'return ' : ''; + + $raylibGlobalVar = GenerateRaylibWrappers::$globalRaylibVariable; + $methodBody = ["global {$raylibGlobalVar};"]; + + if (in_array($returnType, GenerateRaylibWrappers::$knownTypes)) { + $methodBody[] = "return {$returnType}::fromCData({$raylibGlobalVar}->{$struct->name}({$paramsStr}));"; + } else { + $methodBody[] = "{$returnStr}{$raylibGlobalVar}->{$struct->name}({$paramsStr});"; + } + + $method->setBody(implode(PHP_EOL, $methodBody)); + + return $method; + } + + private static function shouldCallToCData(?string $type): bool + { + return match ($type) { + 'float', 'int', 'string', CData::class, 'array' => false, + default => true, + }; + } + + private static function getTypeFromParam(string $param): string + { + return match($param) { + 'char', 'const char *', 'char *' => 'string', + 'double', 'float' => 'float', + 'bool' => 'bool', + 'void' => 'void', + 'long', 'int', 'unsigned char', 'unsigned int' => 'int', + 'Texture', 'Rectangle', 'Image', 'Vector2', 'Vector3', 'Color', 'Shader', 'Font', 'NPatchInfo', 'Vector4', + 'Matrix', 'AudioStream', 'Camera2D', 'Camera3D', 'RenderTexture', 'VrStereoConfig', 'VrDeviceInfo', 'Ray', + 'Mesh', 'Model', 'BoundingBox', 'Material', 'ModelAnimation', 'Wave', 'Sound', 'Music', 'GlyphInfo', + 'RayCollision' => "\\Nawarian\\Raylib\\Generated\\{$param}", + 'Camera', 'Camera *' => "\\Nawarian\\Raylib\\Generated\\Camera3D", + 'Color *' => "\\Nawarian\\Raylib\\Generated\\Color", + 'CharInfo *', 'const CharInfo *' => "\\Nawarian\\Raylib\\Generated\\CharInfo", + 'Image *' => "\\Nawarian\\Raylib\\Generated\\Image", + 'Model *' => "\\Nawarian\\Raylib\\Generated\\Model", + 'Vector2 *' => "\\Nawarian\\Raylib\\Generated\\Vector2", + 'GlyphInfo *', 'const GlyphInfo *' => "\\Nawarian\\Raylib\\Generated\\GlyphInfo", + 'Texture2D', 'Texture2D *', 'TextureCubemap' => "\\Nawarian\\Raylib\\Generated\\Texture", + 'Quaternion' => "\\Nawarian\\Raylib\\Generated\\Vector4", + 'Wave *' => "\\Nawarian\\Raylib\\Generated\\Wave", + 'RenderTexture2D' => "\\Nawarian\\Raylib\\Generated\\RenderTexture", + 'Rectangle *', 'Rectangle **', 'float *', 'unsigned char *', 'const unsigned char *', + 'unsigned short *', 'MaterialMap *', 'unsigned int *', 'int *', 'Mesh *', 'Material *', 'BoneInfo *', + 'Transform *', 'Transform **', 'Vector3 *', 'Matrix *', 'ModelAnimation*', 'ModelAnimation *', 'char **', + 'const char **' => 'array', + 'void *', 'rAudioBuffer *', 'const void *' => CData::class, + default => throw new RuntimeException("Unknown type {$param} found at raylib_api.json.") + }; + } +}