From 963a178bb557c56b4243f560a4f28109b17c334c Mon Sep 17 00:00:00 2001 From: Rob Loach Date: Wed, 11 May 2022 21:53:28 -0400 Subject: [PATCH 01/19] Update raylib_api.json with new parser for 4.0.0 --- tools/generate.js | 14 +- tools/raylib_api.json | 10469 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 10474 insertions(+), 9 deletions(-) create mode 100644 tools/raylib_api.json diff --git a/tools/generate.js b/tools/generate.js index 9f8a791..93287b0 100644 --- a/tools/generate.js +++ b/tools/generate.js @@ -93,12 +93,9 @@ const rSize = /\[([0-9]+)\]/g // pre-process the data for later analysis function getDefs () { - console.log('Downloading definitions') + const { structs, enums, functions } = require('./raylib_api.json') - return fetch('https://raw.githubusercontent.com/raysan5/raylib/2e3cfdcc2f5c70e82536caa57d4aa72e3f00fd40/parser/raylib_api.json') - .then(r => r.json()) - .then(defs => { - const { structs, enums, functions } = defs + // Structs for (const struct of structs) { // take multi-fields (like in Matrix) and make them all distinct fields @@ -148,6 +145,7 @@ function getDefs () { // XXX: Since array support isn't complete, just filter out all structs & functions that use them, // so we get an (incomplete) wrapper that will build. + // Structs for (const struct of structs) { const usesArray = struct.fields.find(f => f.size !== 1) if (usesArray) { @@ -155,7 +153,7 @@ function getDefs () { } } - // filter out all functions that use blocked types + // Functions for (const f of functions) { if (blocklist.includes(f.returnType.replace(/[* ]/g, ''))) { blocklist.push(f.name) @@ -174,14 +172,12 @@ function getDefs () { functions.push(...easings.functions) return { structs, enums, functions } - }) } -getDefs().then(({ structs, enums, functions }) => { +const { structs, enums, functions } = getDefs() const GenBindings = require('./generate_templates/node-raylib-bindings.js') const GenWrapper = require('./generate_templates/node-raylib-wrapper.js') const GenTSDefs = require('./generate_templates/node-raylib-definitions.js') writeFileSync(path.join(__dirname, '..', 'src', 'generated', 'node-raylib.cc'), GenBindings({ enums, blocklist, functions, structs, byreflist })) writeFileSync(path.join(__dirname, '..', 'src', 'generated', 'node-raylib.js'), GenWrapper({ enums, blocklist, functions, structs, byreflist })) writeFileSync(path.join(__dirname, '..', 'src', 'generated', 'node-raylib.d.ts'), GenTSDefs({ enums, blocklist, functions, structs, byreflist })) -}) diff --git a/tools/raylib_api.json b/tools/raylib_api.json new file mode 100644 index 0000000..933e0b3 --- /dev/null +++ b/tools/raylib_api.json @@ -0,0 +1,10469 @@ +{ + "defines": [ + { + "name": "RAYLIB_H", + "type": "GUARD", + "value": "", + "description": "" + }, + { + "name": "RAYLIB_VERSION", + "type": "STRING", + "value": "4.0", + "description": "" + }, + { + "name": "RLAPI", + "type": "UNKNOWN", + "value": "__declspec(dllexport)", + "description": "We are building the library as a Win32 shared library (.dll)" + }, + { + "name": "PI", + "type": "FLOAT", + "value": 3.14159265358979323846, + "description": "" + }, + { + "name": "DEG2RAD", + "type": "FLOAT_MATH", + "value": "(PI/180.0f)", + "description": "" + }, + { + "name": "RAD2DEG", + "type": "FLOAT_MATH", + "value": "(180.0f/PI)", + "description": "" + }, + { + "name": "RL_MALLOC(sz)", + "type": "MACRO", + "value": "malloc(sz)", + "description": "" + }, + { + "name": "RL_CALLOC(n,sz)", + "type": "MACRO", + "value": "calloc(n,sz)", + "description": "" + }, + { + "name": "RL_REALLOC(ptr,sz)", + "type": "MACRO", + "value": "realloc(ptr,sz)", + "description": "" + }, + { + "name": "RL_FREE(ptr)", + "type": "MACRO", + "value": "free(ptr)", + "description": "" + }, + { + "name": "CLITERAL(type)", + "type": "MACRO", + "value": "type", + "description": "" + }, + { + "name": "RL_COLOR_TYPE", + "type": "GUARD", + "value": "", + "description": "" + }, + { + "name": "RL_RECTANGLE_TYPE", + "type": "GUARD", + "value": "", + "description": "" + }, + { + "name": "RL_VECTOR2_TYPE", + "type": "GUARD", + "value": "", + "description": "" + }, + { + "name": "RL_VECTOR3_TYPE", + "type": "GUARD", + "value": "", + "description": "" + }, + { + "name": "RL_VECTOR4_TYPE", + "type": "GUARD", + "value": "", + "description": "" + }, + { + "name": "RL_QUATERNION_TYPE", + "type": "GUARD", + "value": "", + "description": "" + }, + { + "name": "RL_MATRIX_TYPE", + "type": "GUARD", + "value": "", + "description": "" + }, + { + "name": "LIGHTGRAY", + "type": "COLOR", + "value": "CLITERAL(Color){ 200, 200, 200, 255 }", + "description": "Light Gray" + }, + { + "name": "GRAY", + "type": "COLOR", + "value": "CLITERAL(Color){ 130, 130, 130, 255 }", + "description": "Gray" + }, + { + "name": "DARKGRAY", + "type": "COLOR", + "value": "CLITERAL(Color){ 80, 80, 80, 255 }", + "description": "Dark Gray" + }, + { + "name": "YELLOW", + "type": "COLOR", + "value": "CLITERAL(Color){ 253, 249, 0, 255 }", + "description": "Yellow" + }, + { + "name": "GOLD", + "type": "COLOR", + "value": "CLITERAL(Color){ 255, 203, 0, 255 }", + "description": "Gold" + }, + { + "name": "ORANGE", + "type": "COLOR", + "value": "CLITERAL(Color){ 255, 161, 0, 255 }", + "description": "Orange" + }, + { + "name": "PINK", + "type": "COLOR", + "value": "CLITERAL(Color){ 255, 109, 194, 255 }", + "description": "Pink" + }, + { + "name": "RED", + "type": "COLOR", + "value": "CLITERAL(Color){ 230, 41, 55, 255 }", + "description": "Red" + }, + { + "name": "MAROON", + "type": "COLOR", + "value": "CLITERAL(Color){ 190, 33, 55, 255 }", + "description": "Maroon" + }, + { + "name": "GREEN", + "type": "COLOR", + "value": "CLITERAL(Color){ 0, 228, 48, 255 }", + "description": "Green" + }, + { + "name": "LIME", + "type": "COLOR", + "value": "CLITERAL(Color){ 0, 158, 47, 255 }", + "description": "Lime" + }, + { + "name": "DARKGREEN", + "type": "COLOR", + "value": "CLITERAL(Color){ 0, 117, 44, 255 }", + "description": "Dark Green" + }, + { + "name": "SKYBLUE", + "type": "COLOR", + "value": "CLITERAL(Color){ 102, 191, 255, 255 }", + "description": "Sky Blue" + }, + { + "name": "BLUE", + "type": "COLOR", + "value": "CLITERAL(Color){ 0, 121, 241, 255 }", + "description": "Blue" + }, + { + "name": "DARKBLUE", + "type": "COLOR", + "value": "CLITERAL(Color){ 0, 82, 172, 255 }", + "description": "Dark Blue" + }, + { + "name": "PURPLE", + "type": "COLOR", + "value": "CLITERAL(Color){ 200, 122, 255, 255 }", + "description": "Purple" + }, + { + "name": "VIOLET", + "type": "COLOR", + "value": "CLITERAL(Color){ 135, 60, 190, 255 }", + "description": "Violet" + }, + { + "name": "DARKPURPLE", + "type": "COLOR", + "value": "CLITERAL(Color){ 112, 31, 126, 255 }", + "description": "Dark Purple" + }, + { + "name": "BEIGE", + "type": "COLOR", + "value": "CLITERAL(Color){ 211, 176, 131, 255 }", + "description": "Beige" + }, + { + "name": "BROWN", + "type": "COLOR", + "value": "CLITERAL(Color){ 127, 106, 79, 255 }", + "description": "Brown" + }, + { + "name": "DARKBROWN", + "type": "COLOR", + "value": "CLITERAL(Color){ 76, 63, 47, 255 }", + "description": "Dark Brown" + }, + { + "name": "WHITE", + "type": "COLOR", + "value": "CLITERAL(Color){ 255, 255, 255, 255 }", + "description": "White" + }, + { + "name": "BLACK", + "type": "COLOR", + "value": "CLITERAL(Color){ 0, 0, 0, 255 }", + "description": "Black" + }, + { + "name": "BLANK", + "type": "COLOR", + "value": "CLITERAL(Color){ 0, 0, 0, 0 }", + "description": "Blank (Transparent)" + }, + { + "name": "MAGENTA", + "type": "COLOR", + "value": "CLITERAL(Color){ 255, 0, 255, 255 }", + "description": "Magenta" + }, + { + "name": "RAYWHITE", + "type": "COLOR", + "value": "CLITERAL(Color){ 245, 245, 245, 255 }", + "description": "My own White (raylib logo)" + }, + { + "name": "RL_BOOL_TYPE", + "type": "GUARD", + "value": "", + "description": "" + }, + { + "name": "MOUSE_LEFT_BUTTON", + "type": "UNKNOWN", + "value": "MOUSE_BUTTON_LEFT", + "description": "" + }, + { + "name": "MOUSE_RIGHT_BUTTON", + "type": "UNKNOWN", + "value": "MOUSE_BUTTON_RIGHT", + "description": "" + }, + { + "name": "MOUSE_MIDDLE_BUTTON", + "type": "UNKNOWN", + "value": "MOUSE_BUTTON_MIDDLE", + "description": "" + }, + { + "name": "MATERIAL_MAP_DIFFUSE", + "type": "UNKNOWN", + "value": "MATERIAL_MAP_ALBEDO", + "description": "" + }, + { + "name": "MATERIAL_MAP_SPECULAR", + "type": "UNKNOWN", + "value": "MATERIAL_MAP_METALNESS", + "description": "" + }, + { + "name": "SHADER_LOC_MAP_DIFFUSE", + "type": "UNKNOWN", + "value": "SHADER_LOC_MAP_ALBEDO", + "description": "" + }, + { + "name": "SHADER_LOC_MAP_SPECULAR", + "type": "UNKNOWN", + "value": "SHADER_LOC_MAP_METALNESS", + "description": "" + } + ], + "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", + "description": "Matrix first row (4 components)" + }, + { + "type": "float", + "name": "m4", + "description": "Matrix first row (4 components)" + }, + { + "type": "float", + "name": "m8", + "description": "Matrix first row (4 components)" + }, + { + "type": "float", + "name": "m12", + "description": "Matrix first row (4 components)" + }, + { + "type": "float", + "name": "m1", + "description": "Matrix second row (4 components)" + }, + { + "type": "float", + "name": "m5", + "description": "Matrix second row (4 components)" + }, + { + "type": "float", + "name": "m9", + "description": "Matrix second row (4 components)" + }, + { + "type": "float", + "name": "m13", + "description": "Matrix second row (4 components)" + }, + { + "type": "float", + "name": "m2", + "description": "Matrix third row (4 components)" + }, + { + "type": "float", + "name": "m6", + "description": "Matrix third row (4 components)" + }, + { + "type": "float", + "name": "m10", + "description": "Matrix third row (4 components)" + }, + { + "type": "float", + "name": "m14", + "description": "Matrix third row (4 components)" + }, + { + "type": "float", + "name": "m3", + "description": "Matrix fourth row (4 components)" + }, + { + "type": "float", + "name": "m7", + "description": "Matrix fourth row (4 components)" + }, + { + "type": "float", + "name": "m11", + "description": "Matrix fourth row (4 components)" + }, + { + "type": "float", + "name": "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[4]", + "name": "params", + "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[32]", + "name": "name", + "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[4]", + "name": "lensDistortionValues", + "description": "Lens distortion constant parameters" + }, + { + "type": "float[4]", + "name": "chromaAbCorrection", + "description": "Chromatic aberration correction parameters" + } + ] + }, + { + "name": "VrStereoConfig", + "description": "VrStereoConfig, VR stereo rendering configuration for simulator", + "fields": [ + { + "type": "Matrix[2]", + "name": "projection", + "description": "VR projection matrices (per eye)" + }, + { + "type": "Matrix[2]", + "name": "viewOffset", + "description": "VR view offset matrices (per eye)" + }, + { + "type": "float[2]", + "name": "leftLensCenter", + "description": "VR left lens center" + }, + { + "type": "float[2]", + "name": "rightLensCenter", + "description": "VR right lens center" + }, + { + "type": "float[2]", + "name": "leftScreenCenter", + "description": "VR left screen center" + }, + { + "type": "float[2]", + "name": "rightScreenCenter", + "description": "VR right screen center" + }, + { + "type": "float[2]", + "name": "scale", + "description": "VR distortion scale" + }, + { + "type": "float[2]", + "name": "scaleIn", + "description": "VR distortion scale in" + } + ] + } + ], + "aliases": [ + { + "type": "Vector4", + "name": "Quaternion", + "description": "Quaternion, 4 components (Vector4 alias)" + }, + { + "type": "Texture", + "name": "Texture2D", + "description": "Texture2D, same as Texture" + }, + { + "type": "Texture", + "name": "TextureCubemap", + "description": "TextureCubemap, same as Texture" + }, + { + "type": "RenderTexture", + "name": "RenderTexture2D", + "description": "RenderTexture2D, same as RenderTexture" + }, + { + "type": "Camera3D", + "name": "Camera", + "description": "Camera type fallback, defaults to Camera3D" + } + ], + "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 aproximation" + }, + { + "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" + } + ] + } + ], + "callbacks": [ + { + "name": "TraceLogCallback", + "description": "Logging: Redirect trace log messages", + "returnType": "void", + "params": [ + { + "type": "int", + "name": "logLevel" + }, + { + "type": "const char *", + "name": "text" + }, + { + "type": "va_list", + "name": "args" + } + ] + }, + { + "name": "LoadFileDataCallback", + "description": "FileIO: Load binary data", + "returnType": "unsigned char *", + "params": [ + { + "type": "const char *", + "name": "fileName" + }, + { + "type": "unsigned int *", + "name": "bytesRead" + } + ] + }, + { + "name": "SaveFileDataCallback", + "description": "FileIO: Save binary data", + "returnType": "bool", + "params": [ + { + "type": "const char *", + "name": "fileName" + }, + { + "type": "void *", + "name": "data" + }, + { + "type": "unsigned int", + "name": "bytesToWrite" + } + ] + }, + { + "name": "LoadFileTextCallback", + "description": "FileIO: Load text data", + "returnType": "char *", + "params": [ + { + "type": "const char *", + "name": "fileName" + } + ] + }, + { + "name": "SaveFileTextCallback", + "description": "FileIO: Save text data", + "returnType": "bool", + "params": [ + { + "type": "const char *", + "name": "fileName" + }, + { + "type": "char *", + "name": "text" + } + ] + } + ], + "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", + "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": "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": "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": "args" + } + ] + }, + { + "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", + "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": "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": "args" + } + ] + }, + { + "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" + } + ] + } + ] +} From 8eae2677e2ef25b839e6f53a90ddc5b5c4b8bb62 Mon Sep 17 00:00:00 2001 From: Rob Loach Date: Wed, 11 May 2022 23:14:23 -0400 Subject: [PATCH 02/19] Bring in @raylib/api --- package-lock.json | 13 + package.json | 1 + tools/generate.js | 3 +- tools/raylib_api.json | 10469 ---------------------------------------- 4 files changed, 16 insertions(+), 10470 deletions(-) delete mode 100644 tools/raylib_api.json diff --git a/package-lock.json b/package-lock.json index 3d4db3c..0458a43 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,6 +17,7 @@ "raylib": "bin/node-raylib" }, "devDependencies": { + "@raylib/api": "^4.0.0", "archiver": "^5.3.1", "jest": "^28.0.2", "pkg": "^5.6.0", @@ -1289,6 +1290,12 @@ "node": ">= 8" } }, + "node_modules/@raylib/api": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@raylib/api/-/api-4.0.0.tgz", + "integrity": "sha512-U/TsyYPQDxkU1bG5cMdnmi2lfzz5tJRQBSYmwPdXn/P3puyFYe1tWkk0OzueS3zr/8j4yZbc6ibg5JMU0I4L5w==", + "dev": true + }, "node_modules/@sinclair/typebox": { "version": "0.23.4", "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.23.4.tgz", @@ -8070,6 +8077,12 @@ "fastq": "^1.6.0" } }, + "@raylib/api": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@raylib/api/-/api-4.0.0.tgz", + "integrity": "sha512-U/TsyYPQDxkU1bG5cMdnmi2lfzz5tJRQBSYmwPdXn/P3puyFYe1tWkk0OzueS3zr/8j4yZbc6ibg5JMU0I4L5w==", + "dev": true + }, "@sinclair/typebox": { "version": "0.23.4", "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.23.4.tgz", diff --git a/package.json b/package.json index a7a4a50..3380e65 100644 --- a/package.json +++ b/package.json @@ -62,6 +62,7 @@ "module-alias": "^2.2.2" }, "devDependencies": { + "@raylib/api": "^4.0.0", "archiver": "^5.3.1", "jest": "^28.0.2", "pkg": "^5.6.0", diff --git a/tools/generate.js b/tools/generate.js index 93287b0..7b877b8 100644 --- a/tools/generate.js +++ b/tools/generate.js @@ -1,6 +1,7 @@ // this will generate the wrappers & type-adapters in src/generated const { writeFileSync } = require('fs') +const raylibApi = require('@raylib/api') const path = require('path') const fetch = require('cross-fetch') @@ -93,7 +94,7 @@ const rSize = /\[([0-9]+)\]/g // pre-process the data for later analysis function getDefs () { - const { structs, enums, functions } = require('./raylib_api.json') + const { structs, enums, functions } = raylibApi.raylib // Structs for (const struct of structs) { diff --git a/tools/raylib_api.json b/tools/raylib_api.json deleted file mode 100644 index 933e0b3..0000000 --- a/tools/raylib_api.json +++ /dev/null @@ -1,10469 +0,0 @@ -{ - "defines": [ - { - "name": "RAYLIB_H", - "type": "GUARD", - "value": "", - "description": "" - }, - { - "name": "RAYLIB_VERSION", - "type": "STRING", - "value": "4.0", - "description": "" - }, - { - "name": "RLAPI", - "type": "UNKNOWN", - "value": "__declspec(dllexport)", - "description": "We are building the library as a Win32 shared library (.dll)" - }, - { - "name": "PI", - "type": "FLOAT", - "value": 3.14159265358979323846, - "description": "" - }, - { - "name": "DEG2RAD", - "type": "FLOAT_MATH", - "value": "(PI/180.0f)", - "description": "" - }, - { - "name": "RAD2DEG", - "type": "FLOAT_MATH", - "value": "(180.0f/PI)", - "description": "" - }, - { - "name": "RL_MALLOC(sz)", - "type": "MACRO", - "value": "malloc(sz)", - "description": "" - }, - { - "name": "RL_CALLOC(n,sz)", - "type": "MACRO", - "value": "calloc(n,sz)", - "description": "" - }, - { - "name": "RL_REALLOC(ptr,sz)", - "type": "MACRO", - "value": "realloc(ptr,sz)", - "description": "" - }, - { - "name": "RL_FREE(ptr)", - "type": "MACRO", - "value": "free(ptr)", - "description": "" - }, - { - "name": "CLITERAL(type)", - "type": "MACRO", - "value": "type", - "description": "" - }, - { - "name": "RL_COLOR_TYPE", - "type": "GUARD", - "value": "", - "description": "" - }, - { - "name": "RL_RECTANGLE_TYPE", - "type": "GUARD", - "value": "", - "description": "" - }, - { - "name": "RL_VECTOR2_TYPE", - "type": "GUARD", - "value": "", - "description": "" - }, - { - "name": "RL_VECTOR3_TYPE", - "type": "GUARD", - "value": "", - "description": "" - }, - { - "name": "RL_VECTOR4_TYPE", - "type": "GUARD", - "value": "", - "description": "" - }, - { - "name": "RL_QUATERNION_TYPE", - "type": "GUARD", - "value": "", - "description": "" - }, - { - "name": "RL_MATRIX_TYPE", - "type": "GUARD", - "value": "", - "description": "" - }, - { - "name": "LIGHTGRAY", - "type": "COLOR", - "value": "CLITERAL(Color){ 200, 200, 200, 255 }", - "description": "Light Gray" - }, - { - "name": "GRAY", - "type": "COLOR", - "value": "CLITERAL(Color){ 130, 130, 130, 255 }", - "description": "Gray" - }, - { - "name": "DARKGRAY", - "type": "COLOR", - "value": "CLITERAL(Color){ 80, 80, 80, 255 }", - "description": "Dark Gray" - }, - { - "name": "YELLOW", - "type": "COLOR", - "value": "CLITERAL(Color){ 253, 249, 0, 255 }", - "description": "Yellow" - }, - { - "name": "GOLD", - "type": "COLOR", - "value": "CLITERAL(Color){ 255, 203, 0, 255 }", - "description": "Gold" - }, - { - "name": "ORANGE", - "type": "COLOR", - "value": "CLITERAL(Color){ 255, 161, 0, 255 }", - "description": "Orange" - }, - { - "name": "PINK", - "type": "COLOR", - "value": "CLITERAL(Color){ 255, 109, 194, 255 }", - "description": "Pink" - }, - { - "name": "RED", - "type": "COLOR", - "value": "CLITERAL(Color){ 230, 41, 55, 255 }", - "description": "Red" - }, - { - "name": "MAROON", - "type": "COLOR", - "value": "CLITERAL(Color){ 190, 33, 55, 255 }", - "description": "Maroon" - }, - { - "name": "GREEN", - "type": "COLOR", - "value": "CLITERAL(Color){ 0, 228, 48, 255 }", - "description": "Green" - }, - { - "name": "LIME", - "type": "COLOR", - "value": "CLITERAL(Color){ 0, 158, 47, 255 }", - "description": "Lime" - }, - { - "name": "DARKGREEN", - "type": "COLOR", - "value": "CLITERAL(Color){ 0, 117, 44, 255 }", - "description": "Dark Green" - }, - { - "name": "SKYBLUE", - "type": "COLOR", - "value": "CLITERAL(Color){ 102, 191, 255, 255 }", - "description": "Sky Blue" - }, - { - "name": "BLUE", - "type": "COLOR", - "value": "CLITERAL(Color){ 0, 121, 241, 255 }", - "description": "Blue" - }, - { - "name": "DARKBLUE", - "type": "COLOR", - "value": "CLITERAL(Color){ 0, 82, 172, 255 }", - "description": "Dark Blue" - }, - { - "name": "PURPLE", - "type": "COLOR", - "value": "CLITERAL(Color){ 200, 122, 255, 255 }", - "description": "Purple" - }, - { - "name": "VIOLET", - "type": "COLOR", - "value": "CLITERAL(Color){ 135, 60, 190, 255 }", - "description": "Violet" - }, - { - "name": "DARKPURPLE", - "type": "COLOR", - "value": "CLITERAL(Color){ 112, 31, 126, 255 }", - "description": "Dark Purple" - }, - { - "name": "BEIGE", - "type": "COLOR", - "value": "CLITERAL(Color){ 211, 176, 131, 255 }", - "description": "Beige" - }, - { - "name": "BROWN", - "type": "COLOR", - "value": "CLITERAL(Color){ 127, 106, 79, 255 }", - "description": "Brown" - }, - { - "name": "DARKBROWN", - "type": "COLOR", - "value": "CLITERAL(Color){ 76, 63, 47, 255 }", - "description": "Dark Brown" - }, - { - "name": "WHITE", - "type": "COLOR", - "value": "CLITERAL(Color){ 255, 255, 255, 255 }", - "description": "White" - }, - { - "name": "BLACK", - "type": "COLOR", - "value": "CLITERAL(Color){ 0, 0, 0, 255 }", - "description": "Black" - }, - { - "name": "BLANK", - "type": "COLOR", - "value": "CLITERAL(Color){ 0, 0, 0, 0 }", - "description": "Blank (Transparent)" - }, - { - "name": "MAGENTA", - "type": "COLOR", - "value": "CLITERAL(Color){ 255, 0, 255, 255 }", - "description": "Magenta" - }, - { - "name": "RAYWHITE", - "type": "COLOR", - "value": "CLITERAL(Color){ 245, 245, 245, 255 }", - "description": "My own White (raylib logo)" - }, - { - "name": "RL_BOOL_TYPE", - "type": "GUARD", - "value": "", - "description": "" - }, - { - "name": "MOUSE_LEFT_BUTTON", - "type": "UNKNOWN", - "value": "MOUSE_BUTTON_LEFT", - "description": "" - }, - { - "name": "MOUSE_RIGHT_BUTTON", - "type": "UNKNOWN", - "value": "MOUSE_BUTTON_RIGHT", - "description": "" - }, - { - "name": "MOUSE_MIDDLE_BUTTON", - "type": "UNKNOWN", - "value": "MOUSE_BUTTON_MIDDLE", - "description": "" - }, - { - "name": "MATERIAL_MAP_DIFFUSE", - "type": "UNKNOWN", - "value": "MATERIAL_MAP_ALBEDO", - "description": "" - }, - { - "name": "MATERIAL_MAP_SPECULAR", - "type": "UNKNOWN", - "value": "MATERIAL_MAP_METALNESS", - "description": "" - }, - { - "name": "SHADER_LOC_MAP_DIFFUSE", - "type": "UNKNOWN", - "value": "SHADER_LOC_MAP_ALBEDO", - "description": "" - }, - { - "name": "SHADER_LOC_MAP_SPECULAR", - "type": "UNKNOWN", - "value": "SHADER_LOC_MAP_METALNESS", - "description": "" - } - ], - "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", - "description": "Matrix first row (4 components)" - }, - { - "type": "float", - "name": "m4", - "description": "Matrix first row (4 components)" - }, - { - "type": "float", - "name": "m8", - "description": "Matrix first row (4 components)" - }, - { - "type": "float", - "name": "m12", - "description": "Matrix first row (4 components)" - }, - { - "type": "float", - "name": "m1", - "description": "Matrix second row (4 components)" - }, - { - "type": "float", - "name": "m5", - "description": "Matrix second row (4 components)" - }, - { - "type": "float", - "name": "m9", - "description": "Matrix second row (4 components)" - }, - { - "type": "float", - "name": "m13", - "description": "Matrix second row (4 components)" - }, - { - "type": "float", - "name": "m2", - "description": "Matrix third row (4 components)" - }, - { - "type": "float", - "name": "m6", - "description": "Matrix third row (4 components)" - }, - { - "type": "float", - "name": "m10", - "description": "Matrix third row (4 components)" - }, - { - "type": "float", - "name": "m14", - "description": "Matrix third row (4 components)" - }, - { - "type": "float", - "name": "m3", - "description": "Matrix fourth row (4 components)" - }, - { - "type": "float", - "name": "m7", - "description": "Matrix fourth row (4 components)" - }, - { - "type": "float", - "name": "m11", - "description": "Matrix fourth row (4 components)" - }, - { - "type": "float", - "name": "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[4]", - "name": "params", - "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[32]", - "name": "name", - "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[4]", - "name": "lensDistortionValues", - "description": "Lens distortion constant parameters" - }, - { - "type": "float[4]", - "name": "chromaAbCorrection", - "description": "Chromatic aberration correction parameters" - } - ] - }, - { - "name": "VrStereoConfig", - "description": "VrStereoConfig, VR stereo rendering configuration for simulator", - "fields": [ - { - "type": "Matrix[2]", - "name": "projection", - "description": "VR projection matrices (per eye)" - }, - { - "type": "Matrix[2]", - "name": "viewOffset", - "description": "VR view offset matrices (per eye)" - }, - { - "type": "float[2]", - "name": "leftLensCenter", - "description": "VR left lens center" - }, - { - "type": "float[2]", - "name": "rightLensCenter", - "description": "VR right lens center" - }, - { - "type": "float[2]", - "name": "leftScreenCenter", - "description": "VR left screen center" - }, - { - "type": "float[2]", - "name": "rightScreenCenter", - "description": "VR right screen center" - }, - { - "type": "float[2]", - "name": "scale", - "description": "VR distortion scale" - }, - { - "type": "float[2]", - "name": "scaleIn", - "description": "VR distortion scale in" - } - ] - } - ], - "aliases": [ - { - "type": "Vector4", - "name": "Quaternion", - "description": "Quaternion, 4 components (Vector4 alias)" - }, - { - "type": "Texture", - "name": "Texture2D", - "description": "Texture2D, same as Texture" - }, - { - "type": "Texture", - "name": "TextureCubemap", - "description": "TextureCubemap, same as Texture" - }, - { - "type": "RenderTexture", - "name": "RenderTexture2D", - "description": "RenderTexture2D, same as RenderTexture" - }, - { - "type": "Camera3D", - "name": "Camera", - "description": "Camera type fallback, defaults to Camera3D" - } - ], - "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 aproximation" - }, - { - "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" - } - ] - } - ], - "callbacks": [ - { - "name": "TraceLogCallback", - "description": "Logging: Redirect trace log messages", - "returnType": "void", - "params": [ - { - "type": "int", - "name": "logLevel" - }, - { - "type": "const char *", - "name": "text" - }, - { - "type": "va_list", - "name": "args" - } - ] - }, - { - "name": "LoadFileDataCallback", - "description": "FileIO: Load binary data", - "returnType": "unsigned char *", - "params": [ - { - "type": "const char *", - "name": "fileName" - }, - { - "type": "unsigned int *", - "name": "bytesRead" - } - ] - }, - { - "name": "SaveFileDataCallback", - "description": "FileIO: Save binary data", - "returnType": "bool", - "params": [ - { - "type": "const char *", - "name": "fileName" - }, - { - "type": "void *", - "name": "data" - }, - { - "type": "unsigned int", - "name": "bytesToWrite" - } - ] - }, - { - "name": "LoadFileTextCallback", - "description": "FileIO: Load text data", - "returnType": "char *", - "params": [ - { - "type": "const char *", - "name": "fileName" - } - ] - }, - { - "name": "SaveFileTextCallback", - "description": "FileIO: Save text data", - "returnType": "bool", - "params": [ - { - "type": "const char *", - "name": "fileName" - }, - { - "type": "char *", - "name": "text" - } - ] - } - ], - "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", - "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": "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": "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": "args" - } - ] - }, - { - "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", - "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": "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": "args" - } - ] - }, - { - "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" - } - ] - } - ] -} From 708222fc83aeb4cf202d03e0f120388d9c5c2caf Mon Sep 17 00:00:00 2001 From: Rob Loach Date: Thu, 12 May 2022 00:06:41 -0400 Subject: [PATCH 03/19] Update the parser --- tools/extras/easings.js | 60 ------------------- tools/generate.js | 12 +++- .../node-raylib-bindings.js | 15 +++++ 3 files changed, 24 insertions(+), 63 deletions(-) delete mode 100644 tools/extras/easings.js diff --git a/tools/extras/easings.js b/tools/extras/easings.js deleted file mode 100644 index 53d5281..0000000 --- a/tools/extras/easings.js +++ /dev/null @@ -1,60 +0,0 @@ -/** - * Generates the function definitions for easings.h - * - * @see https://github.com/raysan5/raylib/blob/master/src/extras/easings.h - */ -function getDefEasings () { - const functions = [] - const easingsDefaults = { - name: 'FunctionName', - description: 'FuntionName', - returnType: 'float', - params: [ - { type: 'float', name: 't' }, - { type: 'float', name: 'b' }, - { type: 'float', name: 'c' }, - { type: 'float', name: 'd' } - ] - } - const functionNames = [ - 'EaseLinearNone', - 'EaseLinearIn', - 'EaseLinearOut', - 'EaseLinearInOut', - 'EaseSineIn', - 'EaseSineOut', - 'EaseSineInOut', - 'EaseCircIn', - 'EaseCircOut', - 'EaseCircInOut', - 'EaseCubicIn', - 'EaseCubicOut', - 'EaseCubicInOut', - 'EaseQuadIn', - 'EaseQuadOut', - 'EaseQuadInOut', - 'EaseExpoIn', - 'EaseExpoOut', - 'EaseExpoInOut', - 'EaseBackIn', - 'EaseBackOut', - 'EaseBackInOut', - 'EaseBounceOut', - 'EaseBounceIn', - 'EaseBounceInOut', - 'EaseElasticIn', - 'EaseElasticOut', - 'EaseElasticInOut' - ] - for (const funcName of functionNames) { - const func = Object.assign({}, easingsDefaults) - func.name = funcName - func.description = `Easing: ${funcName}.` - functions.push(func) - } - return functions -} - -module.exports = { - functions: getDefEasings() -} diff --git a/tools/generate.js b/tools/generate.js index 7b877b8..aff5e1f 100644 --- a/tools/generate.js +++ b/tools/generate.js @@ -26,8 +26,14 @@ const blocklist = [ 'SetWindowOpacity', 'GetRenderWidth', 'GetRenderHeight', - 'ExportFontAsCode' - + 'ExportFontAsCode', + + // Structs + // @todo Fix Structs that are problematic + 'VrStereoConfig', // Matrix[2], float[2] + 'BoneInfo', // char[32] + 'VrDeviceInfo', // float[4] + //'Material' // float[4] ] // these functions expect the first argument to be passed as a reference in C++ @@ -169,7 +175,7 @@ function getDefs () { } // Add the Easings API - const easings = require('./extras/easings') + const easings = raylibApi.easings functions.push(...easings.functions) return { structs, enums, functions } diff --git a/tools/generate_templates/node-raylib-bindings.js b/tools/generate_templates/node-raylib-bindings.js index ed80721..8fed1b0 100644 --- a/tools/generate_templates/node-raylib-bindings.js +++ b/tools/generate_templates/node-raylib-bindings.js @@ -5,6 +5,19 @@ * @returns */ const SanitizeTypeName = name => { + if (name == 'float[2]') { + return 'float2' + } + if (name == 'char[32]') { + return 'char32' + } + // @TODO Material: Mapping a float array to a single float is likely not correct. + if (name == 'float[4]') { + return 'float' + } + if (name == 'Matrix[2]') { + return 'Matrix2' + } if (name === 'const char *') { return 'string' } @@ -229,11 +242,13 @@ inline char charFromValue(const Napi::CallbackInfo& info, int index) { // Convert structs from Napi::Values in info[] arguments ${structs + .filter(({ name }) => !blocklist.includes(name)) .map(struct => { return FromValue(structs, struct) }) .join('\n') } // Convert structs to Napi::Objects for output to JS ${structs + .filter(({ name }) => !blocklist.includes(name)) .map(ToValue) .join('\n') } From adb1790a7e43a8701f2200742004e7a70556e98a Mon Sep 17 00:00:00 2001 From: Rob Loach Date: Thu, 12 May 2022 00:09:44 -0400 Subject: [PATCH 04/19] Update definitions --- tools/generate.js | 2 +- tools/generate_templates/node-raylib-bindings.js | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/tools/generate.js b/tools/generate.js index aff5e1f..e54926a 100644 --- a/tools/generate.js +++ b/tools/generate.js @@ -33,7 +33,7 @@ const blocklist = [ 'VrStereoConfig', // Matrix[2], float[2] 'BoneInfo', // char[32] 'VrDeviceInfo', // float[4] - //'Material' // float[4] + 'Material' // float[4] ] // these functions expect the first argument to be passed as a reference in C++ diff --git a/tools/generate_templates/node-raylib-bindings.js b/tools/generate_templates/node-raylib-bindings.js index 8fed1b0..e14d170 100644 --- a/tools/generate_templates/node-raylib-bindings.js +++ b/tools/generate_templates/node-raylib-bindings.js @@ -11,9 +11,8 @@ const SanitizeTypeName = name => { if (name == 'char[32]') { return 'char32' } - // @TODO Material: Mapping a float array to a single float is likely not correct. if (name == 'float[4]') { - return 'float' + return 'float4' } if (name == 'Matrix[2]') { return 'Matrix2' From 52ee4bd7625f24830fb7ca799e47cb09cbd47fdb Mon Sep 17 00:00:00 2001 From: Rob Loach Date: Thu, 12 May 2022 00:09:53 -0400 Subject: [PATCH 05/19] Rebuild the code --- src/generated/node-raylib.cc | 104 +----------- src/generated/node-raylib.d.ts | 124 +++++++------- src/generated/node-raylib.js | 298 ++++++++++++++++----------------- 3 files changed, 220 insertions(+), 306 deletions(-) diff --git a/src/generated/node-raylib.cc b/src/generated/node-raylib.cc index 83c8996..4a6285d 100644 --- a/src/generated/node-raylib.cc +++ b/src/generated/node-raylib.cc @@ -247,14 +247,6 @@ inline MaterialMap MaterialMapFromValue(const Napi::CallbackInfo& info, int inde }; } -inline Material MaterialFromValue(const Napi::CallbackInfo& info, int index) { - return { - ShaderFromValue(info, index + 0), - (MaterialMap *) pointerFromValue(info, index + 2), - floatFromValue(info, index + 3) - }; -} - inline Transform TransformFromValue(const Napi::CallbackInfo& info, int index) { return { Vector3FromValue(info, index + 0), @@ -263,13 +255,6 @@ inline Transform TransformFromValue(const Napi::CallbackInfo& info, int index) { }; } -inline BoneInfo BoneInfoFromValue(const Napi::CallbackInfo& info, int index) { - return { - charFromValue(info, index + 0), - charFromValue(info, index + 1) - }; -} - inline Model ModelFromValue(const Napi::CallbackInfo& info, int index) { return { MatrixFromValue(info, index + 0), @@ -351,34 +336,6 @@ inline Music MusicFromValue(const Napi::CallbackInfo& info, int index) { (void *) pointerFromValue(info, index + 7) }; } - -inline VrDeviceInfo VrDeviceInfoFromValue(const Napi::CallbackInfo& info, int index) { - return { - intFromValue(info, index + 0), - intFromValue(info, index + 1), - floatFromValue(info, index + 2), - floatFromValue(info, index + 3), - floatFromValue(info, index + 4), - floatFromValue(info, index + 5), - floatFromValue(info, index + 6), - floatFromValue(info, index + 7), - floatFromValue(info, index + 8), - floatFromValue(info, index + 9) - }; -} - -inline VrStereoConfig VrStereoConfigFromValue(const Napi::CallbackInfo& info, int index) { - return { - MatrixFromValue(info, index + 0), - MatrixFromValue(info, index + 16), - floatFromValue(info, index + 32), - floatFromValue(info, index + 33), - floatFromValue(info, index + 34), - floatFromValue(info, index + 35), - floatFromValue(info, index + 36), - floatFromValue(info, index + 37) - }; -} // Convert structs to Napi::Objects for output to JS inline Napi::Value ToValue(Napi::Env env, Vector2 obj) { @@ -408,20 +365,20 @@ inline Napi::Value ToValue(Napi::Env env, Vector4 obj) { inline Napi::Value ToValue(Napi::Env env, Matrix obj) { Napi::Object out = Napi::Object::New(env); out.Set("m0", ToValue(env, obj.m0)); - out.Set("m1", ToValue(env, obj.m1)); - out.Set("m2", ToValue(env, obj.m2)); - out.Set("m3", ToValue(env, obj.m3)); out.Set("m4", ToValue(env, obj.m4)); - out.Set("m5", ToValue(env, obj.m5)); - out.Set("m6", ToValue(env, obj.m6)); - out.Set("m7", ToValue(env, obj.m7)); out.Set("m8", ToValue(env, obj.m8)); - out.Set("m9", ToValue(env, obj.m9)); - out.Set("m10", ToValue(env, obj.m10)); - out.Set("m11", ToValue(env, obj.m11)); out.Set("m12", ToValue(env, obj.m12)); + out.Set("m1", ToValue(env, obj.m1)); + out.Set("m5", ToValue(env, obj.m5)); + out.Set("m9", ToValue(env, obj.m9)); out.Set("m13", ToValue(env, obj.m13)); + out.Set("m2", ToValue(env, obj.m2)); + out.Set("m6", ToValue(env, obj.m6)); + out.Set("m10", ToValue(env, obj.m10)); out.Set("m14", ToValue(env, obj.m14)); + out.Set("m3", ToValue(env, obj.m3)); + out.Set("m7", ToValue(env, obj.m7)); + out.Set("m11", ToValue(env, obj.m11)); out.Set("m15", ToValue(env, obj.m15)); return out; } @@ -558,14 +515,6 @@ inline Napi::Value ToValue(Napi::Env env, MaterialMap obj) { return out; } -inline Napi::Value ToValue(Napi::Env env, Material obj) { - Napi::Object out = Napi::Object::New(env); - out.Set("shader", ToValue(env, obj.shader)); - out.Set("maps", ToValue(env, obj.maps)); - out.Set("params", ToValue(env, obj.params)); - return out; -} - inline Napi::Value ToValue(Napi::Env env, Transform obj) { Napi::Object out = Napi::Object::New(env); out.Set("translation", ToValue(env, obj.translation)); @@ -574,13 +523,6 @@ inline Napi::Value ToValue(Napi::Env env, Transform obj) { return out; } -inline Napi::Value ToValue(Napi::Env env, BoneInfo obj) { - Napi::Object out = Napi::Object::New(env); - out.Set("name", ToValue(env, obj.name)); - out.Set("parent", ToValue(env, obj.parent)); - return out; -} - inline Napi::Value ToValue(Napi::Env env, Model obj) { Napi::Object out = Napi::Object::New(env); out.Set("transform", ToValue(env, obj.transform)); @@ -663,34 +605,6 @@ inline Napi::Value ToValue(Napi::Env env, Music obj) { return out; } -inline Napi::Value ToValue(Napi::Env env, VrDeviceInfo obj) { - Napi::Object out = Napi::Object::New(env); - out.Set("hResolution", ToValue(env, obj.hResolution)); - out.Set("vResolution", ToValue(env, obj.vResolution)); - out.Set("hScreenSize", ToValue(env, obj.hScreenSize)); - out.Set("vScreenSize", ToValue(env, obj.vScreenSize)); - out.Set("vScreenCenter", ToValue(env, obj.vScreenCenter)); - out.Set("eyeToScreenDistance", ToValue(env, obj.eyeToScreenDistance)); - out.Set("lensSeparationDistance", ToValue(env, obj.lensSeparationDistance)); - out.Set("interpupillaryDistance", ToValue(env, obj.interpupillaryDistance)); - out.Set("lensDistortionValues", ToValue(env, obj.lensDistortionValues)); - out.Set("chromaAbCorrection", ToValue(env, obj.chromaAbCorrection)); - return out; -} - -inline Napi::Value ToValue(Napi::Env env, VrStereoConfig obj) { - Napi::Object out = Napi::Object::New(env); - out.Set("projection", ToValue(env, obj.projection)); - out.Set("viewOffset", ToValue(env, obj.viewOffset)); - out.Set("leftLensCenter", ToValue(env, obj.leftLensCenter)); - out.Set("rightLensCenter", ToValue(env, obj.rightLensCenter)); - out.Set("leftScreenCenter", ToValue(env, obj.leftScreenCenter)); - out.Set("rightScreenCenter", ToValue(env, obj.rightScreenCenter)); - out.Set("scale", ToValue(env, obj.scale)); - out.Set("scaleIn", ToValue(env, obj.scaleIn)); - return out; -} - inline Texture2D Texture2DFromValue(const Napi::CallbackInfo& info, int index) { return (Texture2D) TextureFromValue(info, index); } diff --git a/src/generated/node-raylib.d.ts b/src/generated/node-raylib.d.ts index 5eb345f..523c8c6 100644 --- a/src/generated/node-raylib.d.ts +++ b/src/generated/node-raylib.d.ts @@ -31,35 +31,35 @@ declare module "raylib" { export interface Matrix { /** Matrix first row (4 components) */ m0: number - /** Matrix second row (4 components) */ - m1: number - /** Matrix third row (4 components) */ - m2: number - /** Matrix fourth row (4 components) */ - m3: number /** Matrix first row (4 components) */ m4: number - /** Matrix second row (4 components) */ - m5: number - /** Matrix third row (4 components) */ - m6: number - /** Matrix fourth row (4 components) */ - m7: number /** Matrix first row (4 components) */ m8: number - /** Matrix second row (4 components) */ - m9: number - /** Matrix third row (4 components) */ - m10: number - /** Matrix fourth row (4 components) */ - m11: number /** Matrix first row (4 components) */ m12: number /** Matrix second row (4 components) */ + m1: number + /** Matrix second row (4 components) */ + m5: number + /** Matrix second row (4 components) */ + m9: number + /** Matrix second row (4 components) */ m13: number /** Matrix third row (4 components) */ + m2: number + /** Matrix third row (4 components) */ + m6: number + /** Matrix third row (4 components) */ + m10: number + /** Matrix third row (4 components) */ m14: number /** Matrix fourth row (4 components) */ + m3: number + /** Matrix fourth row (4 components) */ + m7: number + /** Matrix fourth row (4 components) */ + m11: number + /** Matrix fourth row (4 components) */ m15: number } /** Color, 4 components, R8G8B8A8 (32bit) */ @@ -242,7 +242,7 @@ declare module "raylib" { /** Material maps array (MAX_MATERIAL_MAPS) */ maps: number /** Material generic parameters (if required) */ - params: number + params: float[4] } /** Transform, vectex transformation data */ export interface Transform { @@ -256,7 +256,7 @@ declare module "raylib" { /** Bone, skeletal animation bone */ export interface BoneInfo { /** Bone name */ - name: string + name: char[32] /** Bone parent */ parent: string } @@ -380,28 +380,28 @@ declare module "raylib" { /** IPD (distance between pupils) in meters */ interpupillaryDistance: number /** Lens distortion constant parameters */ - lensDistortionValues: number + lensDistortionValues: float[4] /** Chromatic aberration correction parameters */ - chromaAbCorrection: number + chromaAbCorrection: float[4] } /** VrStereoConfig, VR stereo rendering configuration for simulator */ export interface VrStereoConfig { /** VR projection matrices (per eye) */ - projection: Matrix + projection: Matrix[2] /** VR view offset matrices (per eye) */ - viewOffset: Matrix + viewOffset: Matrix[2] /** VR left lens center */ - leftLensCenter: number + leftLensCenter: float[2] /** VR right lens center */ - rightLensCenter: number + rightLensCenter: float[2] /** VR left screen center */ - leftScreenCenter: number + leftScreenCenter: float[2] /** VR right screen center */ - rightScreenCenter: number + rightScreenCenter: float[2] /** VR distortion scale */ - scale: number + scale: float[2] /** VR distortion scale in */ - scaleIn: number + scaleIn: float[2] } /** RenderTexture, fbo for texture rendering */ @@ -449,7 +449,7 @@ declare module "raylib" { /** Check if one specific window flag is enabled */ export function IsWindowState(flag: number): boolean - /** Set window configuration state using flags (only PLATFORM_DESKTOP) */ + /** Set window configuration state using flags */ export function SetWindowState(flags: number): void /** Clear window configuration state flags */ @@ -1349,7 +1349,7 @@ declare module "raylib" { /** Load font from file into GPU memory (VRAM) */ export function LoadFont(fileName: string): Font - /** Load font from file with extended parameters, use NULL for fontChars and 0 for glyphCount to load the default character set */ + /** Load font from file with extended parameters */ export function LoadFontEx(fileName: string, fontSize: number, fontChars: number, glyphCount: number): Font /** Load font from Image (XNA style) */ @@ -1367,7 +1367,7 @@ declare module "raylib" { /** Unload font chars info data (RAM) */ export function UnloadFontData(chars: number, glyphCount: number): void - /** Unload font from GPU memory (VRAM) */ + /** Unload Font from GPU memory (VRAM) */ export function UnloadFont(font: Font): void /** Draw current FPS */ @@ -1823,88 +1823,88 @@ declare module "raylib" { /** Default size for new audio streams */ export function SetAudioStreamBufferSizeDefault(size: number): void - /** Easing: EaseLinearNone. */ + /** */ export function EaseLinearNone(t: number, b: number, c: number, d: number): number - /** Easing: EaseLinearIn. */ + /** */ export function EaseLinearIn(t: number, b: number, c: number, d: number): number - /** Easing: EaseLinearOut. */ + /** */ export function EaseLinearOut(t: number, b: number, c: number, d: number): number - /** Easing: EaseLinearInOut. */ + /** */ export function EaseLinearInOut(t: number, b: number, c: number, d: number): number - /** Easing: EaseSineIn. */ + /** */ export function EaseSineIn(t: number, b: number, c: number, d: number): number - /** Easing: EaseSineOut. */ + /** */ export function EaseSineOut(t: number, b: number, c: number, d: number): number - /** Easing: EaseSineInOut. */ + /** */ export function EaseSineInOut(t: number, b: number, c: number, d: number): number - /** Easing: EaseCircIn. */ + /** */ export function EaseCircIn(t: number, b: number, c: number, d: number): number - /** Easing: EaseCircOut. */ + /** */ export function EaseCircOut(t: number, b: number, c: number, d: number): number - /** Easing: EaseCircInOut. */ + /** */ export function EaseCircInOut(t: number, b: number, c: number, d: number): number - /** Easing: EaseCubicIn. */ + /** */ export function EaseCubicIn(t: number, b: number, c: number, d: number): number - /** Easing: EaseCubicOut. */ + /** */ export function EaseCubicOut(t: number, b: number, c: number, d: number): number - /** Easing: EaseCubicInOut. */ + /** */ export function EaseCubicInOut(t: number, b: number, c: number, d: number): number - /** Easing: EaseQuadIn. */ + /** */ export function EaseQuadIn(t: number, b: number, c: number, d: number): number - /** Easing: EaseQuadOut. */ + /** */ export function EaseQuadOut(t: number, b: number, c: number, d: number): number - /** Easing: EaseQuadInOut. */ + /** */ export function EaseQuadInOut(t: number, b: number, c: number, d: number): number - /** Easing: EaseExpoIn. */ + /** */ export function EaseExpoIn(t: number, b: number, c: number, d: number): number - /** Easing: EaseExpoOut. */ + /** */ export function EaseExpoOut(t: number, b: number, c: number, d: number): number - /** Easing: EaseExpoInOut. */ + /** */ export function EaseExpoInOut(t: number, b: number, c: number, d: number): number - /** Easing: EaseBackIn. */ + /** */ export function EaseBackIn(t: number, b: number, c: number, d: number): number - /** Easing: EaseBackOut. */ + /** */ export function EaseBackOut(t: number, b: number, c: number, d: number): number - /** Easing: EaseBackInOut. */ + /** */ export function EaseBackInOut(t: number, b: number, c: number, d: number): number - /** Easing: EaseBounceOut. */ + /** */ export function EaseBounceOut(t: number, b: number, c: number, d: number): number - /** Easing: EaseBounceIn. */ + /** */ export function EaseBounceIn(t: number, b: number, c: number, d: number): number - /** Easing: EaseBounceInOut. */ + /** */ export function EaseBounceInOut(t: number, b: number, c: number, d: number): number - /** Easing: EaseElasticIn. */ + /** */ export function EaseElasticIn(t: number, b: number, c: number, d: number): number - /** Easing: EaseElasticOut. */ + /** */ export function EaseElasticOut(t: number, b: number, c: number, d: number): number - /** Easing: EaseElasticInOut. */ + /** */ export function EaseElasticInOut(t: number, b: number, c: number, d: number): number @@ -2409,7 +2409,7 @@ declare module "raylib" { export const PIXELFORMAT_COMPRESSED_ASTC_4x4_RGBA = 20 /** 2 bpp */ export const PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA = 21 - /** No filter, just pixel approximation */ + /** No filter, just pixel aproximation */ export const TEXTURE_FILTER_POINT = 0 /** Linear filtering */ export const TEXTURE_FILTER_BILINEAR = 1 diff --git a/src/generated/node-raylib.js b/src/generated/node-raylib.js index ec7817e..ef19b4b 100644 --- a/src/generated/node-raylib.js +++ b/src/generated/node-raylib.js @@ -64,7 +64,7 @@ raylib.IsWindowState = function (flag) { ) } -/** Set window configuration state using flags (only PLATFORM_DESKTOP) */ +/** Set window configuration state using flags */ raylib.SetWindowState = function (flags) { return r.BindSetWindowState( flags @@ -457,20 +457,20 @@ raylib.SetShaderValueMatrix = function (shader, locIndex, mat) { shader.locs, locIndex, mat.m0, - mat.m1, - mat.m2, - mat.m3, mat.m4, - mat.m5, - mat.m6, - mat.m7, mat.m8, - mat.m9, - mat.m10, - mat.m11, mat.m12, + mat.m1, + mat.m5, + mat.m9, mat.m13, + mat.m2, + mat.m6, + mat.m10, mat.m14, + mat.m3, + mat.m7, + mat.m11, mat.m15 ) } @@ -2691,7 +2691,7 @@ raylib.LoadFont = function (fileName) { ) } -/** Load font from file with extended parameters, use NULL for fontChars and 0 for glyphCount to load the default character set */ +/** Load font from file with extended parameters */ raylib.LoadFontEx = function (fileName, fontSize, fontChars, glyphCount) { return r.BindLoadFontEx( fileName, @@ -2761,7 +2761,7 @@ raylib.UnloadFontData = function (chars, glyphCount) { ) } -/** Unload font from GPU memory (VRAM) */ +/** Unload Font from GPU memory (VRAM) */ raylib.UnloadFont = function (font) { return r.BindUnloadFont( font.baseSize, @@ -3490,20 +3490,20 @@ raylib.LoadModelFromMesh = function (mesh) { raylib.UnloadModel = function (model) { return r.BindUnloadModel( model.transform.m0, - model.transform.m1, - model.transform.m2, - model.transform.m3, model.transform.m4, - model.transform.m5, - model.transform.m6, - model.transform.m7, model.transform.m8, - model.transform.m9, - model.transform.m10, - model.transform.m11, model.transform.m12, + model.transform.m1, + model.transform.m5, + model.transform.m9, model.transform.m13, + model.transform.m2, + model.transform.m6, + model.transform.m10, model.transform.m14, + model.transform.m3, + model.transform.m7, + model.transform.m11, model.transform.m15, model.meshCount, model.materialCount, @@ -3520,20 +3520,20 @@ raylib.UnloadModel = function (model) { raylib.UnloadModelKeepMeshes = function (model) { return r.BindUnloadModelKeepMeshes( model.transform.m0, - model.transform.m1, - model.transform.m2, - model.transform.m3, model.transform.m4, - model.transform.m5, - model.transform.m6, - model.transform.m7, model.transform.m8, - model.transform.m9, - model.transform.m10, - model.transform.m11, model.transform.m12, + model.transform.m1, + model.transform.m5, + model.transform.m9, model.transform.m13, + model.transform.m2, + model.transform.m6, + model.transform.m10, model.transform.m14, + model.transform.m3, + model.transform.m7, + model.transform.m11, model.transform.m15, model.meshCount, model.materialCount, @@ -3550,20 +3550,20 @@ raylib.UnloadModelKeepMeshes = function (model) { raylib.GetModelBoundingBox = function (model) { return r.BindGetModelBoundingBox( model.transform.m0, - model.transform.m1, - model.transform.m2, - model.transform.m3, model.transform.m4, - model.transform.m5, - model.transform.m6, - model.transform.m7, model.transform.m8, - model.transform.m9, - model.transform.m10, - model.transform.m11, model.transform.m12, + model.transform.m1, + model.transform.m5, + model.transform.m9, model.transform.m13, + model.transform.m2, + model.transform.m6, + model.transform.m10, model.transform.m14, + model.transform.m3, + model.transform.m7, + model.transform.m11, model.transform.m15, model.meshCount, model.materialCount, @@ -3580,20 +3580,20 @@ raylib.GetModelBoundingBox = function (model) { raylib.DrawModel = function (model, position, scale, tint) { return r.BindDrawModel( model.transform.m0, - model.transform.m1, - model.transform.m2, - model.transform.m3, model.transform.m4, - model.transform.m5, - model.transform.m6, - model.transform.m7, model.transform.m8, - model.transform.m9, - model.transform.m10, - model.transform.m11, model.transform.m12, + model.transform.m1, + model.transform.m5, + model.transform.m9, model.transform.m13, + model.transform.m2, + model.transform.m6, + model.transform.m10, model.transform.m14, + model.transform.m3, + model.transform.m7, + model.transform.m11, model.transform.m15, model.meshCount, model.materialCount, @@ -3618,20 +3618,20 @@ raylib.DrawModel = function (model, position, scale, tint) { raylib.DrawModelEx = function (model, position, rotationAxis, rotationAngle, scale, tint) { return r.BindDrawModelEx( model.transform.m0, - model.transform.m1, - model.transform.m2, - model.transform.m3, model.transform.m4, - model.transform.m5, - model.transform.m6, - model.transform.m7, model.transform.m8, - model.transform.m9, - model.transform.m10, - model.transform.m11, model.transform.m12, + model.transform.m1, + model.transform.m5, + model.transform.m9, model.transform.m13, + model.transform.m2, + model.transform.m6, + model.transform.m10, model.transform.m14, + model.transform.m3, + model.transform.m7, + model.transform.m11, model.transform.m15, model.meshCount, model.materialCount, @@ -3662,20 +3662,20 @@ raylib.DrawModelEx = function (model, position, rotationAxis, rotationAngle, sca raylib.DrawModelWires = function (model, position, scale, tint) { return r.BindDrawModelWires( model.transform.m0, - model.transform.m1, - model.transform.m2, - model.transform.m3, model.transform.m4, - model.transform.m5, - model.transform.m6, - model.transform.m7, model.transform.m8, - model.transform.m9, - model.transform.m10, - model.transform.m11, model.transform.m12, + model.transform.m1, + model.transform.m5, + model.transform.m9, model.transform.m13, + model.transform.m2, + model.transform.m6, + model.transform.m10, model.transform.m14, + model.transform.m3, + model.transform.m7, + model.transform.m11, model.transform.m15, model.meshCount, model.materialCount, @@ -3700,20 +3700,20 @@ raylib.DrawModelWires = function (model, position, scale, tint) { raylib.DrawModelWiresEx = function (model, position, rotationAxis, rotationAngle, scale, tint) { return r.BindDrawModelWiresEx( model.transform.m0, - model.transform.m1, - model.transform.m2, - model.transform.m3, model.transform.m4, - model.transform.m5, - model.transform.m6, - model.transform.m7, model.transform.m8, - model.transform.m9, - model.transform.m10, - model.transform.m11, model.transform.m12, + model.transform.m1, + model.transform.m5, + model.transform.m9, model.transform.m13, + model.transform.m2, + model.transform.m6, + model.transform.m10, model.transform.m14, + model.transform.m3, + model.transform.m7, + model.transform.m11, model.transform.m15, model.meshCount, model.materialCount, @@ -4074,20 +4074,20 @@ raylib.LoadModelAnimations = function (fileName, animCount) { raylib.UpdateModelAnimation = function (model, anim, frame) { return r.BindUpdateModelAnimation( model.transform.m0, - model.transform.m1, - model.transform.m2, - model.transform.m3, model.transform.m4, - model.transform.m5, - model.transform.m6, - model.transform.m7, model.transform.m8, - model.transform.m9, - model.transform.m10, - model.transform.m11, model.transform.m12, + model.transform.m1, + model.transform.m5, + model.transform.m9, model.transform.m13, + model.transform.m2, + model.transform.m6, + model.transform.m10, model.transform.m14, + model.transform.m3, + model.transform.m7, + model.transform.m11, model.transform.m15, model.meshCount, model.materialCount, @@ -4127,20 +4127,20 @@ raylib.UnloadModelAnimations = function (animations, count) { raylib.IsModelAnimationValid = function (model, anim) { return r.BindIsModelAnimationValid( model.transform.m0, - model.transform.m1, - model.transform.m2, - model.transform.m3, model.transform.m4, - model.transform.m5, - model.transform.m6, - model.transform.m7, model.transform.m8, - model.transform.m9, - model.transform.m10, - model.transform.m11, model.transform.m12, + model.transform.m1, + model.transform.m5, + model.transform.m9, model.transform.m13, + model.transform.m2, + model.transform.m6, + model.transform.m10, model.transform.m14, + model.transform.m3, + model.transform.m7, + model.transform.m11, model.transform.m15, model.meshCount, model.materialCount, @@ -4249,20 +4249,20 @@ raylib.GetRayCollisionModel = function (ray, model) { ray.direction.y, ray.direction.z, model.transform.m0, - model.transform.m1, - model.transform.m2, - model.transform.m3, model.transform.m4, - model.transform.m5, - model.transform.m6, - model.transform.m7, model.transform.m8, - model.transform.m9, - model.transform.m10, - model.transform.m11, model.transform.m12, + model.transform.m1, + model.transform.m5, + model.transform.m9, model.transform.m13, + model.transform.m2, + model.transform.m6, + model.transform.m10, model.transform.m14, + model.transform.m3, + model.transform.m7, + model.transform.m11, model.transform.m15, model.meshCount, model.materialCount, @@ -4300,20 +4300,20 @@ raylib.GetRayCollisionMesh = function (ray, mesh, transform) { mesh.vaoId, mesh.vboId, transform.m0, - transform.m1, - transform.m2, - transform.m3, transform.m4, - transform.m5, - transform.m6, - transform.m7, transform.m8, - transform.m9, - transform.m10, - transform.m11, transform.m12, + transform.m1, + transform.m5, + transform.m9, transform.m13, + transform.m2, + transform.m6, + transform.m10, transform.m14, + transform.m3, + transform.m7, + transform.m11, transform.m15 ) } @@ -4914,7 +4914,7 @@ raylib.SetAudioStreamBufferSizeDefault = function (size) { ) } -/** Easing: EaseLinearNone. */ +/** */ raylib.EaseLinearNone = function (t, b, c, d) { return r.BindEaseLinearNone( t, @@ -4924,7 +4924,7 @@ raylib.EaseLinearNone = function (t, b, c, d) { ) } -/** Easing: EaseLinearIn. */ +/** */ raylib.EaseLinearIn = function (t, b, c, d) { return r.BindEaseLinearIn( t, @@ -4934,7 +4934,7 @@ raylib.EaseLinearIn = function (t, b, c, d) { ) } -/** Easing: EaseLinearOut. */ +/** */ raylib.EaseLinearOut = function (t, b, c, d) { return r.BindEaseLinearOut( t, @@ -4944,7 +4944,7 @@ raylib.EaseLinearOut = function (t, b, c, d) { ) } -/** Easing: EaseLinearInOut. */ +/** */ raylib.EaseLinearInOut = function (t, b, c, d) { return r.BindEaseLinearInOut( t, @@ -4954,7 +4954,7 @@ raylib.EaseLinearInOut = function (t, b, c, d) { ) } -/** Easing: EaseSineIn. */ +/** */ raylib.EaseSineIn = function (t, b, c, d) { return r.BindEaseSineIn( t, @@ -4964,7 +4964,7 @@ raylib.EaseSineIn = function (t, b, c, d) { ) } -/** Easing: EaseSineOut. */ +/** */ raylib.EaseSineOut = function (t, b, c, d) { return r.BindEaseSineOut( t, @@ -4974,7 +4974,7 @@ raylib.EaseSineOut = function (t, b, c, d) { ) } -/** Easing: EaseSineInOut. */ +/** */ raylib.EaseSineInOut = function (t, b, c, d) { return r.BindEaseSineInOut( t, @@ -4984,7 +4984,7 @@ raylib.EaseSineInOut = function (t, b, c, d) { ) } -/** Easing: EaseCircIn. */ +/** */ raylib.EaseCircIn = function (t, b, c, d) { return r.BindEaseCircIn( t, @@ -4994,7 +4994,7 @@ raylib.EaseCircIn = function (t, b, c, d) { ) } -/** Easing: EaseCircOut. */ +/** */ raylib.EaseCircOut = function (t, b, c, d) { return r.BindEaseCircOut( t, @@ -5004,7 +5004,7 @@ raylib.EaseCircOut = function (t, b, c, d) { ) } -/** Easing: EaseCircInOut. */ +/** */ raylib.EaseCircInOut = function (t, b, c, d) { return r.BindEaseCircInOut( t, @@ -5014,7 +5014,7 @@ raylib.EaseCircInOut = function (t, b, c, d) { ) } -/** Easing: EaseCubicIn. */ +/** */ raylib.EaseCubicIn = function (t, b, c, d) { return r.BindEaseCubicIn( t, @@ -5024,7 +5024,7 @@ raylib.EaseCubicIn = function (t, b, c, d) { ) } -/** Easing: EaseCubicOut. */ +/** */ raylib.EaseCubicOut = function (t, b, c, d) { return r.BindEaseCubicOut( t, @@ -5034,7 +5034,7 @@ raylib.EaseCubicOut = function (t, b, c, d) { ) } -/** Easing: EaseCubicInOut. */ +/** */ raylib.EaseCubicInOut = function (t, b, c, d) { return r.BindEaseCubicInOut( t, @@ -5044,7 +5044,7 @@ raylib.EaseCubicInOut = function (t, b, c, d) { ) } -/** Easing: EaseQuadIn. */ +/** */ raylib.EaseQuadIn = function (t, b, c, d) { return r.BindEaseQuadIn( t, @@ -5054,7 +5054,7 @@ raylib.EaseQuadIn = function (t, b, c, d) { ) } -/** Easing: EaseQuadOut. */ +/** */ raylib.EaseQuadOut = function (t, b, c, d) { return r.BindEaseQuadOut( t, @@ -5064,7 +5064,7 @@ raylib.EaseQuadOut = function (t, b, c, d) { ) } -/** Easing: EaseQuadInOut. */ +/** */ raylib.EaseQuadInOut = function (t, b, c, d) { return r.BindEaseQuadInOut( t, @@ -5074,7 +5074,7 @@ raylib.EaseQuadInOut = function (t, b, c, d) { ) } -/** Easing: EaseExpoIn. */ +/** */ raylib.EaseExpoIn = function (t, b, c, d) { return r.BindEaseExpoIn( t, @@ -5084,7 +5084,7 @@ raylib.EaseExpoIn = function (t, b, c, d) { ) } -/** Easing: EaseExpoOut. */ +/** */ raylib.EaseExpoOut = function (t, b, c, d) { return r.BindEaseExpoOut( t, @@ -5094,7 +5094,7 @@ raylib.EaseExpoOut = function (t, b, c, d) { ) } -/** Easing: EaseExpoInOut. */ +/** */ raylib.EaseExpoInOut = function (t, b, c, d) { return r.BindEaseExpoInOut( t, @@ -5104,7 +5104,7 @@ raylib.EaseExpoInOut = function (t, b, c, d) { ) } -/** Easing: EaseBackIn. */ +/** */ raylib.EaseBackIn = function (t, b, c, d) { return r.BindEaseBackIn( t, @@ -5114,7 +5114,7 @@ raylib.EaseBackIn = function (t, b, c, d) { ) } -/** Easing: EaseBackOut. */ +/** */ raylib.EaseBackOut = function (t, b, c, d) { return r.BindEaseBackOut( t, @@ -5124,7 +5124,7 @@ raylib.EaseBackOut = function (t, b, c, d) { ) } -/** Easing: EaseBackInOut. */ +/** */ raylib.EaseBackInOut = function (t, b, c, d) { return r.BindEaseBackInOut( t, @@ -5134,7 +5134,7 @@ raylib.EaseBackInOut = function (t, b, c, d) { ) } -/** Easing: EaseBounceOut. */ +/** */ raylib.EaseBounceOut = function (t, b, c, d) { return r.BindEaseBounceOut( t, @@ -5144,7 +5144,7 @@ raylib.EaseBounceOut = function (t, b, c, d) { ) } -/** Easing: EaseBounceIn. */ +/** */ raylib.EaseBounceIn = function (t, b, c, d) { return r.BindEaseBounceIn( t, @@ -5154,7 +5154,7 @@ raylib.EaseBounceIn = function (t, b, c, d) { ) } -/** Easing: EaseBounceInOut. */ +/** */ raylib.EaseBounceInOut = function (t, b, c, d) { return r.BindEaseBounceInOut( t, @@ -5164,7 +5164,7 @@ raylib.EaseBounceInOut = function (t, b, c, d) { ) } -/** Easing: EaseElasticIn. */ +/** */ raylib.EaseElasticIn = function (t, b, c, d) { return r.BindEaseElasticIn( t, @@ -5174,7 +5174,7 @@ raylib.EaseElasticIn = function (t, b, c, d) { ) } -/** Easing: EaseElasticOut. */ +/** */ raylib.EaseElasticOut = function (t, b, c, d) { return r.BindEaseElasticOut( t, @@ -5184,7 +5184,7 @@ raylib.EaseElasticOut = function (t, b, c, d) { ) } -/** Easing: EaseElasticInOut. */ +/** */ raylib.EaseElasticInOut = function (t, b, c, d) { return r.BindEaseElasticInOut( t, @@ -6146,20 +6146,20 @@ raylib.GenMeshBinormals = function (mesh) { raylib.SetModelMeshMaterial = function (model, meshId, materialId) { const obj = r.BindSetModelMeshMaterial( model.transform.m0, - model.transform.m1, - model.transform.m2, - model.transform.m3, model.transform.m4, - model.transform.m5, - model.transform.m6, - model.transform.m7, model.transform.m8, - model.transform.m9, - model.transform.m10, - model.transform.m11, model.transform.m12, + model.transform.m1, + model.transform.m5, + model.transform.m9, model.transform.m13, + model.transform.m2, + model.transform.m6, + model.transform.m10, model.transform.m14, + model.transform.m3, + model.transform.m7, + model.transform.m11, model.transform.m15, model.meshCount, model.materialCount, @@ -6798,7 +6798,7 @@ raylib.PIXELFORMAT_COMPRESSED_PVRT_RGBA = 19 raylib.PIXELFORMAT_COMPRESSED_ASTC_4x4_RGBA = 20 /** 2 bpp */ raylib.PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA = 21 -/** No filter, just pixel approximation */ +/** No filter, just pixel aproximation */ raylib.TEXTURE_FILTER_POINT = 0 /** Linear filtering */ raylib.TEXTURE_FILTER_BILINEAR = 1 From aa3d608497c0e73aba713dae8f47da46c586051b Mon Sep 17 00:00:00 2001 From: Rob Loach Date: Thu, 12 May 2022 00:57:37 -0400 Subject: [PATCH 06/19] Add raymath --- tools/generate.js | 13 +++++++++++-- .../generate_templates/node-raylib-bindings.js | 17 ++++++++++++++--- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/tools/generate.js b/tools/generate.js index e54926a..1e45ede 100644 --- a/tools/generate.js +++ b/tools/generate.js @@ -33,7 +33,12 @@ const blocklist = [ 'VrStereoConfig', // Matrix[2], float[2] 'BoneInfo', // char[32] 'VrDeviceInfo', // float[4] - 'Material' // float[4] + 'Material', // float[4] + + // raymath + // @todo Fix helper structs for float arrays + 'Vector3ToFloatV', // float3 + 'MatrixToFloatV' // float16 ] // these functions expect the first argument to be passed as a reference in C++ @@ -174,10 +179,14 @@ function getDefs () { } } - // Add the Easings API + // Add Easings const easings = raylibApi.easings functions.push(...easings.functions) + // Add Raymath + const raymath = raylibApi.raymath + functions.push(...raymath.functions) + return { structs, enums, functions } } diff --git a/tools/generate_templates/node-raylib-bindings.js b/tools/generate_templates/node-raylib-bindings.js index e14d170..fcc5902 100644 --- a/tools/generate_templates/node-raylib-bindings.js +++ b/tools/generate_templates/node-raylib-bindings.js @@ -5,6 +5,9 @@ * @returns */ const SanitizeTypeName = name => { + if (name == 'const Vector3') { + return 'Vector3' + } if (name == 'float[2]') { return 'float2' } @@ -29,6 +32,9 @@ const SanitizeTypeName = name => { if (name === 'Camera') { return 'Camera3D' } + if (name === 'Quaternion') { + return 'Vector4' + } if (name === 'Texture2D') { return 'Texture' } @@ -177,6 +183,8 @@ module.exports = ({ functions, structs, enums, blocklist, byreflist }) => ` #include #include "raylib.h" #include "extras/easings.h" +#include "raymath.h" + using namespace Napi; inline Napi::Value ToValue(Napi::Env env, bool value) { @@ -211,10 +219,13 @@ inline Napi::Value ToValue(Napi::Env env, void * value) { } inline float floatFromValue(const Napi::CallbackInfo& info, int index) { - return info[index].As(); + return info[index].As().FloatValue(); } inline int intFromValue(const Napi::CallbackInfo& info, int index) { - return info[index].As(); + return info[index].As().Int32Value(); +} +inline double doubleFromValue(const Napi::CallbackInfo& info, int index) { + return info[index].As().DoubleValue(); } uintptr_t pointerFromValue(const Napi::CallbackInfo& info, int index) { return (uintptr_t) info[index].As().Int64Value(); @@ -223,7 +234,7 @@ inline unsigned char unsignedcharFromValue(const Napi::CallbackInfo& info, int i return info[index].As().Uint32Value(); } inline unsigned int unsignedintFromValue(const Napi::CallbackInfo& info, int index) { - return info[index].As(); + return info[index].As().Uint32Value(); } inline bool boolFromValue(const Napi::CallbackInfo& info, int index) { return info[index].As(); From 2e4e175fcb222dcefe462c1b3482c63a6fffafa6 Mon Sep 17 00:00:00 2001 From: Rob Loach Date: Thu, 12 May 2022 00:57:46 -0400 Subject: [PATCH 07/19] Update code --- src/generated/node-raylib.cc | 1196 ++++++++++++++++++++++++++++---- src/generated/node-raylib.d.ts | 282 ++++++++ src/generated/node-raylib.js | 1099 +++++++++++++++++++++++++++++ 3 files changed, 2449 insertions(+), 128 deletions(-) diff --git a/src/generated/node-raylib.cc b/src/generated/node-raylib.cc index 4a6285d..d3d06e6 100644 --- a/src/generated/node-raylib.cc +++ b/src/generated/node-raylib.cc @@ -6,6 +6,8 @@ #include #include "raylib.h" #include "extras/easings.h" +#include "raymath.h" + using namespace Napi; inline Napi::Value ToValue(Napi::Env env, bool value) { @@ -40,10 +42,13 @@ inline Napi::Value ToValue(Napi::Env env, void * value) { } inline float floatFromValue(const Napi::CallbackInfo& info, int index) { - return info[index].As(); + return info[index].As().FloatValue(); } inline int intFromValue(const Napi::CallbackInfo& info, int index) { - return info[index].As(); + return info[index].As().Int32Value(); +} +inline double doubleFromValue(const Napi::CallbackInfo& info, int index) { + return info[index].As().DoubleValue(); } uintptr_t pointerFromValue(const Napi::CallbackInfo& info, int index) { return (uintptr_t) info[index].As().Int64Value(); @@ -52,7 +57,7 @@ inline unsigned char unsignedcharFromValue(const Napi::CallbackInfo& info, int i return info[index].As().Uint32Value(); } inline unsigned int unsignedintFromValue(const Napi::CallbackInfo& info, int index) { - return info[index].As(); + return info[index].As().Uint32Value(); } inline bool boolFromValue(const Napi::CallbackInfo& info, int index) { return info[index].As(); @@ -2942,245 +2947,1071 @@ Napi::Value BindEaseElasticInOut(const Napi::CallbackInfo& info) { ); } -void BindInitWindow(const Napi::CallbackInfo& info) { - InitWindow( - intFromValue(info, 0), - intFromValue(info, 1), - (const char *) stringFromValue(info, 2) +Napi::Value BindClamp(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Clamp( + floatFromValue(info, 0), + floatFromValue(info, 1), + floatFromValue(info, 2) + ) ); } -void BindCloseWindow(const Napi::CallbackInfo& info) { - CloseWindow( - +Napi::Value BindLerp(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Lerp( + floatFromValue(info, 0), + floatFromValue(info, 1), + floatFromValue(info, 2) + ) ); } -void BindSetWindowState(const Napi::CallbackInfo& info) { - SetWindowState( - unsignedintFromValue(info, 0) +Napi::Value BindNormalize(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Normalize( + floatFromValue(info, 0), + floatFromValue(info, 1), + floatFromValue(info, 2) + ) ); } -void BindClearWindowState(const Napi::CallbackInfo& info) { - ClearWindowState( - unsignedintFromValue(info, 0) +Napi::Value BindRemap(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Remap( + floatFromValue(info, 0), + floatFromValue(info, 1), + floatFromValue(info, 2), + floatFromValue(info, 3), + floatFromValue(info, 4) + ) ); } -void BindToggleFullscreen(const Napi::CallbackInfo& info) { - ToggleFullscreen( - +Napi::Value BindVector2Zero(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector2Zero( + + ) ); } -void BindMaximizeWindow(const Napi::CallbackInfo& info) { - MaximizeWindow( - +Napi::Value BindVector2One(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector2One( + + ) ); } -void BindMinimizeWindow(const Napi::CallbackInfo& info) { - MinimizeWindow( - +Napi::Value BindVector2Add(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector2Add( + Vector2FromValue(info, 0), + Vector2FromValue(info, 2) + ) ); } -void BindRestoreWindow(const Napi::CallbackInfo& info) { - RestoreWindow( - +Napi::Value BindVector2AddValue(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector2AddValue( + Vector2FromValue(info, 0), + floatFromValue(info, 2) + ) ); } -void BindSetWindowIcon(const Napi::CallbackInfo& info) { - SetWindowIcon( - ImageFromValue(info, 0) +Napi::Value BindVector2Subtract(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector2Subtract( + Vector2FromValue(info, 0), + Vector2FromValue(info, 2) + ) ); } -void BindSetWindowTitle(const Napi::CallbackInfo& info) { - SetWindowTitle( - (const char *) stringFromValue(info, 0) +Napi::Value BindVector2SubtractValue(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector2SubtractValue( + Vector2FromValue(info, 0), + floatFromValue(info, 2) + ) ); } -void BindSetWindowPosition(const Napi::CallbackInfo& info) { - SetWindowPosition( - intFromValue(info, 0), - intFromValue(info, 1) +Napi::Value BindVector2Length(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector2Length( + Vector2FromValue(info, 0) + ) ); } -void BindSetWindowMonitor(const Napi::CallbackInfo& info) { - SetWindowMonitor( - intFromValue(info, 0) +Napi::Value BindVector2LengthSqr(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector2LengthSqr( + Vector2FromValue(info, 0) + ) ); } -void BindSetWindowMinSize(const Napi::CallbackInfo& info) { - SetWindowMinSize( - intFromValue(info, 0), - intFromValue(info, 1) +Napi::Value BindVector2DotProduct(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector2DotProduct( + Vector2FromValue(info, 0), + Vector2FromValue(info, 2) + ) ); } -void BindSetWindowSize(const Napi::CallbackInfo& info) { - SetWindowSize( - intFromValue(info, 0), - intFromValue(info, 1) +Napi::Value BindVector2Distance(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector2Distance( + Vector2FromValue(info, 0), + Vector2FromValue(info, 2) + ) ); } -void BindSetClipboardText(const Napi::CallbackInfo& info) { - SetClipboardText( - (const char *) stringFromValue(info, 0) +Napi::Value BindVector2Angle(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector2Angle( + Vector2FromValue(info, 0), + Vector2FromValue(info, 2) + ) ); } -void BindSwapScreenBuffer(const Napi::CallbackInfo& info) { - SwapScreenBuffer( - +Napi::Value BindVector2Scale(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector2Scale( + Vector2FromValue(info, 0), + floatFromValue(info, 2) + ) ); } -void BindPollInputEvents(const Napi::CallbackInfo& info) { - PollInputEvents( - +Napi::Value BindVector2Multiply(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector2Multiply( + Vector2FromValue(info, 0), + Vector2FromValue(info, 2) + ) ); } -void BindWaitTime(const Napi::CallbackInfo& info) { - WaitTime( - floatFromValue(info, 0) +Napi::Value BindVector2Negate(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector2Negate( + Vector2FromValue(info, 0) + ) ); } -void BindShowCursor(const Napi::CallbackInfo& info) { - ShowCursor( - +Napi::Value BindVector2Divide(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector2Divide( + Vector2FromValue(info, 0), + Vector2FromValue(info, 2) + ) ); } -void BindHideCursor(const Napi::CallbackInfo& info) { - HideCursor( - +Napi::Value BindVector2Normalize(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector2Normalize( + Vector2FromValue(info, 0) + ) ); } -void BindEnableCursor(const Napi::CallbackInfo& info) { - EnableCursor( - +Napi::Value BindVector2Lerp(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector2Lerp( + Vector2FromValue(info, 0), + Vector2FromValue(info, 2), + floatFromValue(info, 4) + ) ); } -void BindDisableCursor(const Napi::CallbackInfo& info) { - DisableCursor( - +Napi::Value BindVector2Reflect(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector2Reflect( + Vector2FromValue(info, 0), + Vector2FromValue(info, 2) + ) ); } -void BindClearBackground(const Napi::CallbackInfo& info) { - ClearBackground( - ColorFromValue(info, 0) +Napi::Value BindVector2Rotate(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector2Rotate( + Vector2FromValue(info, 0), + floatFromValue(info, 2) + ) ); } -void BindBeginDrawing(const Napi::CallbackInfo& info) { - BeginDrawing( - +Napi::Value BindVector2MoveTowards(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector2MoveTowards( + Vector2FromValue(info, 0), + Vector2FromValue(info, 2), + floatFromValue(info, 4) + ) ); } -void BindEndDrawing(const Napi::CallbackInfo& info) { - EndDrawing( - +Napi::Value BindVector3Zero(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector3Zero( + + ) ); } -void BindBeginMode2D(const Napi::CallbackInfo& info) { - BeginMode2D( - Camera2DFromValue(info, 0) +Napi::Value BindVector3One(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector3One( + + ) ); } -void BindEndMode2D(const Napi::CallbackInfo& info) { - EndMode2D( - +Napi::Value BindVector3Add(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector3Add( + Vector3FromValue(info, 0), + Vector3FromValue(info, 3) + ) ); } -void BindBeginMode3D(const Napi::CallbackInfo& info) { - BeginMode3D( - Camera3DFromValue(info, 0) +Napi::Value BindVector3AddValue(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector3AddValue( + Vector3FromValue(info, 0), + floatFromValue(info, 3) + ) ); } -void BindEndMode3D(const Napi::CallbackInfo& info) { - EndMode3D( - +Napi::Value BindVector3Subtract(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector3Subtract( + Vector3FromValue(info, 0), + Vector3FromValue(info, 3) + ) ); } -void BindBeginTextureMode(const Napi::CallbackInfo& info) { - BeginTextureMode( - RenderTexture2DFromValue(info, 0) +Napi::Value BindVector3SubtractValue(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector3SubtractValue( + Vector3FromValue(info, 0), + floatFromValue(info, 3) + ) ); } -void BindEndTextureMode(const Napi::CallbackInfo& info) { - EndTextureMode( - +Napi::Value BindVector3Scale(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector3Scale( + Vector3FromValue(info, 0), + floatFromValue(info, 3) + ) ); } -void BindBeginShaderMode(const Napi::CallbackInfo& info) { - BeginShaderMode( - ShaderFromValue(info, 0) +Napi::Value BindVector3Multiply(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector3Multiply( + Vector3FromValue(info, 0), + Vector3FromValue(info, 3) + ) ); } -void BindEndShaderMode(const Napi::CallbackInfo& info) { - EndShaderMode( - +Napi::Value BindVector3CrossProduct(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector3CrossProduct( + Vector3FromValue(info, 0), + Vector3FromValue(info, 3) + ) ); } -void BindBeginBlendMode(const Napi::CallbackInfo& info) { - BeginBlendMode( - intFromValue(info, 0) +Napi::Value BindVector3Perpendicular(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector3Perpendicular( + Vector3FromValue(info, 0) + ) ); } -void BindEndBlendMode(const Napi::CallbackInfo& info) { - EndBlendMode( - +Napi::Value BindVector3Length(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector3Length( + Vector3FromValue(info, 0) + ) ); } -void BindBeginScissorMode(const Napi::CallbackInfo& info) { - BeginScissorMode( - intFromValue(info, 0), - intFromValue(info, 1), - intFromValue(info, 2), - intFromValue(info, 3) +Napi::Value BindVector3LengthSqr(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector3LengthSqr( + Vector3FromValue(info, 0) + ) ); } -void BindEndScissorMode(const Napi::CallbackInfo& info) { - EndScissorMode( - +Napi::Value BindVector3DotProduct(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector3DotProduct( + Vector3FromValue(info, 0), + Vector3FromValue(info, 3) + ) ); } -void BindEndVrStereoMode(const Napi::CallbackInfo& info) { - EndVrStereoMode( - +Napi::Value BindVector3Distance(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector3Distance( + Vector3FromValue(info, 0), + Vector3FromValue(info, 3) + ) ); } -void BindSetShaderValueMatrix(const Napi::CallbackInfo& info) { - SetShaderValueMatrix( - ShaderFromValue(info, 0), +Napi::Value BindVector3Angle(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector3Angle( + Vector3FromValue(info, 0), + Vector3FromValue(info, 3) + ) + ); +} + +Napi::Value BindVector3Negate(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector3Negate( + Vector3FromValue(info, 0) + ) + ); +} + +Napi::Value BindVector3Divide(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector3Divide( + Vector3FromValue(info, 0), + Vector3FromValue(info, 3) + ) + ); +} + +Napi::Value BindVector3Normalize(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector3Normalize( + Vector3FromValue(info, 0) + ) + ); +} + +Napi::Value BindVector3Transform(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector3Transform( + Vector3FromValue(info, 0), + MatrixFromValue(info, 3) + ) + ); +} + +Napi::Value BindVector3RotateByQuaternion(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector3RotateByQuaternion( + Vector3FromValue(info, 0), + Vector4FromValue(info, 3) + ) + ); +} + +Napi::Value BindVector3Lerp(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector3Lerp( + Vector3FromValue(info, 0), + Vector3FromValue(info, 3), + floatFromValue(info, 6) + ) + ); +} + +Napi::Value BindVector3Reflect(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector3Reflect( + Vector3FromValue(info, 0), + Vector3FromValue(info, 3) + ) + ); +} + +Napi::Value BindVector3Min(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector3Min( + Vector3FromValue(info, 0), + Vector3FromValue(info, 3) + ) + ); +} + +Napi::Value BindVector3Max(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector3Max( + Vector3FromValue(info, 0), + Vector3FromValue(info, 3) + ) + ); +} + +Napi::Value BindVector3Barycenter(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector3Barycenter( + Vector3FromValue(info, 0), + Vector3FromValue(info, 3), + Vector3FromValue(info, 6), + Vector3FromValue(info, 9) + ) + ); +} + +Napi::Value BindVector3Unproject(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector3Unproject( + Vector3FromValue(info, 0), + MatrixFromValue(info, 3), + MatrixFromValue(info, 19) + ) + ); +} + +Napi::Value BindMatrixDeterminant(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + MatrixDeterminant( + MatrixFromValue(info, 0) + ) + ); +} + +Napi::Value BindMatrixTrace(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + MatrixTrace( + MatrixFromValue(info, 0) + ) + ); +} + +Napi::Value BindMatrixTranspose(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + MatrixTranspose( + MatrixFromValue(info, 0) + ) + ); +} + +Napi::Value BindMatrixInvert(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + MatrixInvert( + MatrixFromValue(info, 0) + ) + ); +} + +Napi::Value BindMatrixNormalize(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + MatrixNormalize( + MatrixFromValue(info, 0) + ) + ); +} + +Napi::Value BindMatrixIdentity(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + MatrixIdentity( + + ) + ); +} + +Napi::Value BindMatrixAdd(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + MatrixAdd( + MatrixFromValue(info, 0), + MatrixFromValue(info, 16) + ) + ); +} + +Napi::Value BindMatrixSubtract(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + MatrixSubtract( + MatrixFromValue(info, 0), + MatrixFromValue(info, 16) + ) + ); +} + +Napi::Value BindMatrixMultiply(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + MatrixMultiply( + MatrixFromValue(info, 0), + MatrixFromValue(info, 16) + ) + ); +} + +Napi::Value BindMatrixTranslate(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + MatrixTranslate( + floatFromValue(info, 0), + floatFromValue(info, 1), + floatFromValue(info, 2) + ) + ); +} + +Napi::Value BindMatrixRotate(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + MatrixRotate( + Vector3FromValue(info, 0), + floatFromValue(info, 3) + ) + ); +} + +Napi::Value BindMatrixRotateX(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + MatrixRotateX( + floatFromValue(info, 0) + ) + ); +} + +Napi::Value BindMatrixRotateY(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + MatrixRotateY( + floatFromValue(info, 0) + ) + ); +} + +Napi::Value BindMatrixRotateZ(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + MatrixRotateZ( + floatFromValue(info, 0) + ) + ); +} + +Napi::Value BindMatrixRotateXYZ(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + MatrixRotateXYZ( + Vector3FromValue(info, 0) + ) + ); +} + +Napi::Value BindMatrixRotateZYX(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + MatrixRotateZYX( + Vector3FromValue(info, 0) + ) + ); +} + +Napi::Value BindMatrixScale(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + MatrixScale( + floatFromValue(info, 0), + floatFromValue(info, 1), + floatFromValue(info, 2) + ) + ); +} + +Napi::Value BindMatrixFrustum(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + MatrixFrustum( + doubleFromValue(info, 0), + doubleFromValue(info, 1), + doubleFromValue(info, 2), + doubleFromValue(info, 3), + doubleFromValue(info, 4), + doubleFromValue(info, 5) + ) + ); +} + +Napi::Value BindMatrixPerspective(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + MatrixPerspective( + doubleFromValue(info, 0), + doubleFromValue(info, 1), + doubleFromValue(info, 2), + doubleFromValue(info, 3) + ) + ); +} + +Napi::Value BindMatrixOrtho(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + MatrixOrtho( + doubleFromValue(info, 0), + doubleFromValue(info, 1), + doubleFromValue(info, 2), + doubleFromValue(info, 3), + doubleFromValue(info, 4), + doubleFromValue(info, 5) + ) + ); +} + +Napi::Value BindMatrixLookAt(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + MatrixLookAt( + Vector3FromValue(info, 0), + Vector3FromValue(info, 3), + Vector3FromValue(info, 6) + ) + ); +} + +Napi::Value BindQuaternionAdd(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + QuaternionAdd( + Vector4FromValue(info, 0), + Vector4FromValue(info, 1) + ) + ); +} + +Napi::Value BindQuaternionAddValue(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + QuaternionAddValue( + Vector4FromValue(info, 0), + floatFromValue(info, 1) + ) + ); +} + +Napi::Value BindQuaternionSubtract(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + QuaternionSubtract( + Vector4FromValue(info, 0), + Vector4FromValue(info, 1) + ) + ); +} + +Napi::Value BindQuaternionSubtractValue(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + QuaternionSubtractValue( + Vector4FromValue(info, 0), + floatFromValue(info, 1) + ) + ); +} + +Napi::Value BindQuaternionIdentity(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + QuaternionIdentity( + + ) + ); +} + +Napi::Value BindQuaternionLength(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + QuaternionLength( + Vector4FromValue(info, 0) + ) + ); +} + +Napi::Value BindQuaternionNormalize(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + QuaternionNormalize( + Vector4FromValue(info, 0) + ) + ); +} + +Napi::Value BindQuaternionInvert(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + QuaternionInvert( + Vector4FromValue(info, 0) + ) + ); +} + +Napi::Value BindQuaternionMultiply(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + QuaternionMultiply( + Vector4FromValue(info, 0), + Vector4FromValue(info, 1) + ) + ); +} + +Napi::Value BindQuaternionScale(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + QuaternionScale( + Vector4FromValue(info, 0), + floatFromValue(info, 1) + ) + ); +} + +Napi::Value BindQuaternionDivide(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + QuaternionDivide( + Vector4FromValue(info, 0), + Vector4FromValue(info, 1) + ) + ); +} + +Napi::Value BindQuaternionLerp(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + QuaternionLerp( + Vector4FromValue(info, 0), + Vector4FromValue(info, 1), + floatFromValue(info, 2) + ) + ); +} + +Napi::Value BindQuaternionNlerp(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + QuaternionNlerp( + Vector4FromValue(info, 0), + Vector4FromValue(info, 1), + floatFromValue(info, 2) + ) + ); +} + +Napi::Value BindQuaternionSlerp(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + QuaternionSlerp( + Vector4FromValue(info, 0), + Vector4FromValue(info, 1), + floatFromValue(info, 2) + ) + ); +} + +Napi::Value BindQuaternionFromVector3ToVector3(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + QuaternionFromVector3ToVector3( + Vector3FromValue(info, 0), + Vector3FromValue(info, 3) + ) + ); +} + +Napi::Value BindQuaternionFromMatrix(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + QuaternionFromMatrix( + MatrixFromValue(info, 0) + ) + ); +} + +Napi::Value BindQuaternionToMatrix(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + QuaternionToMatrix( + Vector4FromValue(info, 0) + ) + ); +} + +Napi::Value BindQuaternionFromAxisAngle(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + QuaternionFromAxisAngle( + Vector3FromValue(info, 0), + floatFromValue(info, 3) + ) + ); +} + +Napi::Value BindQuaternionFromEuler(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + QuaternionFromEuler( + floatFromValue(info, 0), + floatFromValue(info, 1), + floatFromValue(info, 2) + ) + ); +} + +Napi::Value BindQuaternionToEuler(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + QuaternionToEuler( + Vector4FromValue(info, 0) + ) + ); +} + +Napi::Value BindQuaternionTransform(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + QuaternionTransform( + Vector4FromValue(info, 0), + MatrixFromValue(info, 1) + ) + ); +} + +void BindInitWindow(const Napi::CallbackInfo& info) { + InitWindow( + intFromValue(info, 0), + intFromValue(info, 1), + (const char *) stringFromValue(info, 2) + ); +} + +void BindCloseWindow(const Napi::CallbackInfo& info) { + CloseWindow( + + ); +} + +void BindSetWindowState(const Napi::CallbackInfo& info) { + SetWindowState( + unsignedintFromValue(info, 0) + ); +} + +void BindClearWindowState(const Napi::CallbackInfo& info) { + ClearWindowState( + unsignedintFromValue(info, 0) + ); +} + +void BindToggleFullscreen(const Napi::CallbackInfo& info) { + ToggleFullscreen( + + ); +} + +void BindMaximizeWindow(const Napi::CallbackInfo& info) { + MaximizeWindow( + + ); +} + +void BindMinimizeWindow(const Napi::CallbackInfo& info) { + MinimizeWindow( + + ); +} + +void BindRestoreWindow(const Napi::CallbackInfo& info) { + RestoreWindow( + + ); +} + +void BindSetWindowIcon(const Napi::CallbackInfo& info) { + SetWindowIcon( + ImageFromValue(info, 0) + ); +} + +void BindSetWindowTitle(const Napi::CallbackInfo& info) { + SetWindowTitle( + (const char *) stringFromValue(info, 0) + ); +} + +void BindSetWindowPosition(const Napi::CallbackInfo& info) { + SetWindowPosition( + intFromValue(info, 0), + intFromValue(info, 1) + ); +} + +void BindSetWindowMonitor(const Napi::CallbackInfo& info) { + SetWindowMonitor( + intFromValue(info, 0) + ); +} + +void BindSetWindowMinSize(const Napi::CallbackInfo& info) { + SetWindowMinSize( + intFromValue(info, 0), + intFromValue(info, 1) + ); +} + +void BindSetWindowSize(const Napi::CallbackInfo& info) { + SetWindowSize( + intFromValue(info, 0), + intFromValue(info, 1) + ); +} + +void BindSetClipboardText(const Napi::CallbackInfo& info) { + SetClipboardText( + (const char *) stringFromValue(info, 0) + ); +} + +void BindSwapScreenBuffer(const Napi::CallbackInfo& info) { + SwapScreenBuffer( + + ); +} + +void BindPollInputEvents(const Napi::CallbackInfo& info) { + PollInputEvents( + + ); +} + +void BindWaitTime(const Napi::CallbackInfo& info) { + WaitTime( + floatFromValue(info, 0) + ); +} + +void BindShowCursor(const Napi::CallbackInfo& info) { + ShowCursor( + + ); +} + +void BindHideCursor(const Napi::CallbackInfo& info) { + HideCursor( + + ); +} + +void BindEnableCursor(const Napi::CallbackInfo& info) { + EnableCursor( + + ); +} + +void BindDisableCursor(const Napi::CallbackInfo& info) { + DisableCursor( + + ); +} + +void BindClearBackground(const Napi::CallbackInfo& info) { + ClearBackground( + ColorFromValue(info, 0) + ); +} + +void BindBeginDrawing(const Napi::CallbackInfo& info) { + BeginDrawing( + + ); +} + +void BindEndDrawing(const Napi::CallbackInfo& info) { + EndDrawing( + + ); +} + +void BindBeginMode2D(const Napi::CallbackInfo& info) { + BeginMode2D( + Camera2DFromValue(info, 0) + ); +} + +void BindEndMode2D(const Napi::CallbackInfo& info) { + EndMode2D( + + ); +} + +void BindBeginMode3D(const Napi::CallbackInfo& info) { + BeginMode3D( + Camera3DFromValue(info, 0) + ); +} + +void BindEndMode3D(const Napi::CallbackInfo& info) { + EndMode3D( + + ); +} + +void BindBeginTextureMode(const Napi::CallbackInfo& info) { + BeginTextureMode( + RenderTexture2DFromValue(info, 0) + ); +} + +void BindEndTextureMode(const Napi::CallbackInfo& info) { + EndTextureMode( + + ); +} + +void BindBeginShaderMode(const Napi::CallbackInfo& info) { + BeginShaderMode( + ShaderFromValue(info, 0) + ); +} + +void BindEndShaderMode(const Napi::CallbackInfo& info) { + EndShaderMode( + + ); +} + +void BindBeginBlendMode(const Napi::CallbackInfo& info) { + BeginBlendMode( + intFromValue(info, 0) + ); +} + +void BindEndBlendMode(const Napi::CallbackInfo& info) { + EndBlendMode( + + ); +} + +void BindBeginScissorMode(const Napi::CallbackInfo& info) { + BeginScissorMode( + intFromValue(info, 0), + intFromValue(info, 1), + intFromValue(info, 2), + intFromValue(info, 3) + ); +} + +void BindEndScissorMode(const Napi::CallbackInfo& info) { + EndScissorMode( + + ); +} + +void BindEndVrStereoMode(const Napi::CallbackInfo& info) { + EndVrStereoMode( + + ); +} + +void BindSetShaderValueMatrix(const Napi::CallbackInfo& info) { + SetShaderValueMatrix( + ShaderFromValue(info, 0), intFromValue(info, 2), MatrixFromValue(info, 3) ); @@ -4468,6 +5299,21 @@ void BindSetAudioStreamBufferSizeDefault(const Napi::CallbackInfo& info) { intFromValue(info, 0) ); } + +void BindVector3OrthoNormalize(const Napi::CallbackInfo& info) { + Vector3OrthoNormalize( + (Vector3 *) pointerFromValue(info, 0), + (Vector3 *) pointerFromValue(info, 1) + ); +} + +void BindQuaternionToAxisAngle(const Napi::CallbackInfo& info) { + QuaternionToAxisAngle( + Vector4FromValue(info, 0), + (Vector3 *) pointerFromValue(info, 1), + (float *) pointerFromValue(info, 2) + ); +} // By-Reference function bindings Napi::Value BindUpdateCamera(const Napi::CallbackInfo& info) { @@ -5440,6 +6286,100 @@ Napi::Object Init(Napi::Env env, Napi::Object exports) { exports.Set("BindEaseElasticIn", Napi::Function::New(env, BindEaseElasticIn)); exports.Set("BindEaseElasticOut", Napi::Function::New(env, BindEaseElasticOut)); exports.Set("BindEaseElasticInOut", Napi::Function::New(env, BindEaseElasticInOut)); + exports.Set("BindClamp", Napi::Function::New(env, BindClamp)); + exports.Set("BindLerp", Napi::Function::New(env, BindLerp)); + exports.Set("BindNormalize", Napi::Function::New(env, BindNormalize)); + exports.Set("BindRemap", Napi::Function::New(env, BindRemap)); + exports.Set("BindVector2Zero", Napi::Function::New(env, BindVector2Zero)); + exports.Set("BindVector2One", Napi::Function::New(env, BindVector2One)); + exports.Set("BindVector2Add", Napi::Function::New(env, BindVector2Add)); + exports.Set("BindVector2AddValue", Napi::Function::New(env, BindVector2AddValue)); + exports.Set("BindVector2Subtract", Napi::Function::New(env, BindVector2Subtract)); + exports.Set("BindVector2SubtractValue", Napi::Function::New(env, BindVector2SubtractValue)); + exports.Set("BindVector2Length", Napi::Function::New(env, BindVector2Length)); + exports.Set("BindVector2LengthSqr", Napi::Function::New(env, BindVector2LengthSqr)); + exports.Set("BindVector2DotProduct", Napi::Function::New(env, BindVector2DotProduct)); + exports.Set("BindVector2Distance", Napi::Function::New(env, BindVector2Distance)); + exports.Set("BindVector2Angle", Napi::Function::New(env, BindVector2Angle)); + exports.Set("BindVector2Scale", Napi::Function::New(env, BindVector2Scale)); + exports.Set("BindVector2Multiply", Napi::Function::New(env, BindVector2Multiply)); + exports.Set("BindVector2Negate", Napi::Function::New(env, BindVector2Negate)); + exports.Set("BindVector2Divide", Napi::Function::New(env, BindVector2Divide)); + exports.Set("BindVector2Normalize", Napi::Function::New(env, BindVector2Normalize)); + exports.Set("BindVector2Lerp", Napi::Function::New(env, BindVector2Lerp)); + exports.Set("BindVector2Reflect", Napi::Function::New(env, BindVector2Reflect)); + exports.Set("BindVector2Rotate", Napi::Function::New(env, BindVector2Rotate)); + exports.Set("BindVector2MoveTowards", Napi::Function::New(env, BindVector2MoveTowards)); + exports.Set("BindVector3Zero", Napi::Function::New(env, BindVector3Zero)); + exports.Set("BindVector3One", Napi::Function::New(env, BindVector3One)); + exports.Set("BindVector3Add", Napi::Function::New(env, BindVector3Add)); + exports.Set("BindVector3AddValue", Napi::Function::New(env, BindVector3AddValue)); + exports.Set("BindVector3Subtract", Napi::Function::New(env, BindVector3Subtract)); + exports.Set("BindVector3SubtractValue", Napi::Function::New(env, BindVector3SubtractValue)); + exports.Set("BindVector3Scale", Napi::Function::New(env, BindVector3Scale)); + exports.Set("BindVector3Multiply", Napi::Function::New(env, BindVector3Multiply)); + exports.Set("BindVector3CrossProduct", Napi::Function::New(env, BindVector3CrossProduct)); + exports.Set("BindVector3Perpendicular", Napi::Function::New(env, BindVector3Perpendicular)); + exports.Set("BindVector3Length", Napi::Function::New(env, BindVector3Length)); + exports.Set("BindVector3LengthSqr", Napi::Function::New(env, BindVector3LengthSqr)); + exports.Set("BindVector3DotProduct", Napi::Function::New(env, BindVector3DotProduct)); + exports.Set("BindVector3Distance", Napi::Function::New(env, BindVector3Distance)); + exports.Set("BindVector3Angle", Napi::Function::New(env, BindVector3Angle)); + exports.Set("BindVector3Negate", Napi::Function::New(env, BindVector3Negate)); + exports.Set("BindVector3Divide", Napi::Function::New(env, BindVector3Divide)); + exports.Set("BindVector3Normalize", Napi::Function::New(env, BindVector3Normalize)); + exports.Set("BindVector3OrthoNormalize", Napi::Function::New(env, BindVector3OrthoNormalize)); + exports.Set("BindVector3Transform", Napi::Function::New(env, BindVector3Transform)); + exports.Set("BindVector3RotateByQuaternion", Napi::Function::New(env, BindVector3RotateByQuaternion)); + exports.Set("BindVector3Lerp", Napi::Function::New(env, BindVector3Lerp)); + exports.Set("BindVector3Reflect", Napi::Function::New(env, BindVector3Reflect)); + exports.Set("BindVector3Min", Napi::Function::New(env, BindVector3Min)); + exports.Set("BindVector3Max", Napi::Function::New(env, BindVector3Max)); + exports.Set("BindVector3Barycenter", Napi::Function::New(env, BindVector3Barycenter)); + exports.Set("BindVector3Unproject", Napi::Function::New(env, BindVector3Unproject)); + exports.Set("BindMatrixDeterminant", Napi::Function::New(env, BindMatrixDeterminant)); + exports.Set("BindMatrixTrace", Napi::Function::New(env, BindMatrixTrace)); + exports.Set("BindMatrixTranspose", Napi::Function::New(env, BindMatrixTranspose)); + exports.Set("BindMatrixInvert", Napi::Function::New(env, BindMatrixInvert)); + exports.Set("BindMatrixNormalize", Napi::Function::New(env, BindMatrixNormalize)); + exports.Set("BindMatrixIdentity", Napi::Function::New(env, BindMatrixIdentity)); + exports.Set("BindMatrixAdd", Napi::Function::New(env, BindMatrixAdd)); + exports.Set("BindMatrixSubtract", Napi::Function::New(env, BindMatrixSubtract)); + exports.Set("BindMatrixMultiply", Napi::Function::New(env, BindMatrixMultiply)); + exports.Set("BindMatrixTranslate", Napi::Function::New(env, BindMatrixTranslate)); + exports.Set("BindMatrixRotate", Napi::Function::New(env, BindMatrixRotate)); + exports.Set("BindMatrixRotateX", Napi::Function::New(env, BindMatrixRotateX)); + exports.Set("BindMatrixRotateY", Napi::Function::New(env, BindMatrixRotateY)); + exports.Set("BindMatrixRotateZ", Napi::Function::New(env, BindMatrixRotateZ)); + exports.Set("BindMatrixRotateXYZ", Napi::Function::New(env, BindMatrixRotateXYZ)); + exports.Set("BindMatrixRotateZYX", Napi::Function::New(env, BindMatrixRotateZYX)); + exports.Set("BindMatrixScale", Napi::Function::New(env, BindMatrixScale)); + exports.Set("BindMatrixFrustum", Napi::Function::New(env, BindMatrixFrustum)); + exports.Set("BindMatrixPerspective", Napi::Function::New(env, BindMatrixPerspective)); + exports.Set("BindMatrixOrtho", Napi::Function::New(env, BindMatrixOrtho)); + exports.Set("BindMatrixLookAt", Napi::Function::New(env, BindMatrixLookAt)); + exports.Set("BindQuaternionAdd", Napi::Function::New(env, BindQuaternionAdd)); + exports.Set("BindQuaternionAddValue", Napi::Function::New(env, BindQuaternionAddValue)); + exports.Set("BindQuaternionSubtract", Napi::Function::New(env, BindQuaternionSubtract)); + exports.Set("BindQuaternionSubtractValue", Napi::Function::New(env, BindQuaternionSubtractValue)); + exports.Set("BindQuaternionIdentity", Napi::Function::New(env, BindQuaternionIdentity)); + exports.Set("BindQuaternionLength", Napi::Function::New(env, BindQuaternionLength)); + exports.Set("BindQuaternionNormalize", Napi::Function::New(env, BindQuaternionNormalize)); + exports.Set("BindQuaternionInvert", Napi::Function::New(env, BindQuaternionInvert)); + exports.Set("BindQuaternionMultiply", Napi::Function::New(env, BindQuaternionMultiply)); + exports.Set("BindQuaternionScale", Napi::Function::New(env, BindQuaternionScale)); + exports.Set("BindQuaternionDivide", Napi::Function::New(env, BindQuaternionDivide)); + exports.Set("BindQuaternionLerp", Napi::Function::New(env, BindQuaternionLerp)); + exports.Set("BindQuaternionNlerp", Napi::Function::New(env, BindQuaternionNlerp)); + exports.Set("BindQuaternionSlerp", Napi::Function::New(env, BindQuaternionSlerp)); + exports.Set("BindQuaternionFromVector3ToVector3", Napi::Function::New(env, BindQuaternionFromVector3ToVector3)); + exports.Set("BindQuaternionFromMatrix", Napi::Function::New(env, BindQuaternionFromMatrix)); + exports.Set("BindQuaternionToMatrix", Napi::Function::New(env, BindQuaternionToMatrix)); + exports.Set("BindQuaternionFromAxisAngle", Napi::Function::New(env, BindQuaternionFromAxisAngle)); + exports.Set("BindQuaternionToAxisAngle", Napi::Function::New(env, BindQuaternionToAxisAngle)); + exports.Set("BindQuaternionFromEuler", Napi::Function::New(env, BindQuaternionFromEuler)); + exports.Set("BindQuaternionToEuler", Napi::Function::New(env, BindQuaternionToEuler)); + exports.Set("BindQuaternionTransform", Napi::Function::New(env, BindQuaternionTransform)); exports.Set("BindSetShaderFloat", Napi::Function::New(env, BindSetShaderFloat)); exports.Set("BindSetShaderInt", Napi::Function::New(env, BindSetShaderInt)); diff --git a/src/generated/node-raylib.d.ts b/src/generated/node-raylib.d.ts index 523c8c6..8792a16 100644 --- a/src/generated/node-raylib.d.ts +++ b/src/generated/node-raylib.d.ts @@ -1907,6 +1907,288 @@ declare module "raylib" { /** */ export function EaseElasticInOut(t: number, b: number, c: number, d: number): number + /** */ + export function Clamp(value: number, min: number, max: number): number + + /** */ + export function Lerp(start: number, end: number, amount: number): number + + /** */ + export function Normalize(value: number, start: number, end: number): number + + /** */ + export function Remap(value: number, inputStart: number, inputEnd: number, outputStart: number, outputEnd: number): number + + /** */ + export function Vector2Zero(): Vector2 + + /** */ + export function Vector2One(): Vector2 + + /** */ + export function Vector2Add(v1: Vector2, v2: Vector2): Vector2 + + /** */ + export function Vector2AddValue(v: Vector2, add: number): Vector2 + + /** */ + export function Vector2Subtract(v1: Vector2, v2: Vector2): Vector2 + + /** */ + export function Vector2SubtractValue(v: Vector2, sub: number): Vector2 + + /** */ + export function Vector2Length(v: Vector2): number + + /** */ + export function Vector2LengthSqr(v: Vector2): number + + /** */ + export function Vector2DotProduct(v1: Vector2, v2: Vector2): number + + /** */ + export function Vector2Distance(v1: Vector2, v2: Vector2): number + + /** */ + export function Vector2Angle(v1: Vector2, v2: Vector2): number + + /** */ + export function Vector2Scale(v: Vector2, scale: number): Vector2 + + /** */ + export function Vector2Multiply(v1: Vector2, v2: Vector2): Vector2 + + /** */ + export function Vector2Negate(v: Vector2): Vector2 + + /** */ + export function Vector2Divide(v1: Vector2, v2: Vector2): Vector2 + + /** */ + export function Vector2Normalize(v: Vector2): Vector2 + + /** */ + export function Vector2Lerp(v1: Vector2, v2: Vector2, amount: number): Vector2 + + /** */ + export function Vector2Reflect(v: Vector2, normal: Vector2): Vector2 + + /** */ + export function Vector2Rotate(v: Vector2, angle: number): Vector2 + + /** */ + export function Vector2MoveTowards(v: Vector2, target: Vector2, maxDistance: number): Vector2 + + /** */ + export function Vector3Zero(): Vector3 + + /** */ + export function Vector3One(): Vector3 + + /** */ + export function Vector3Add(v1: Vector3, v2: Vector3): Vector3 + + /** */ + export function Vector3AddValue(v: Vector3, add: number): Vector3 + + /** */ + export function Vector3Subtract(v1: Vector3, v2: Vector3): Vector3 + + /** */ + export function Vector3SubtractValue(v: Vector3, sub: number): Vector3 + + /** */ + export function Vector3Scale(v: Vector3, scalar: number): Vector3 + + /** */ + export function Vector3Multiply(v1: Vector3, v2: Vector3): Vector3 + + /** */ + export function Vector3CrossProduct(v1: Vector3, v2: Vector3): Vector3 + + /** */ + export function Vector3Perpendicular(v: Vector3): Vector3 + + /** */ + export function Vector3Length(v: Vector3): number + + /** */ + export function Vector3LengthSqr(v: Vector3): number + + /** */ + export function Vector3DotProduct(v1: Vector3, v2: Vector3): number + + /** */ + export function Vector3Distance(v1: Vector3, v2: Vector3): number + + /** */ + export function Vector3Angle(v1: Vector3, v2: Vector3): Vector2 + + /** */ + export function Vector3Negate(v: Vector3): Vector3 + + /** */ + export function Vector3Divide(v1: Vector3, v2: Vector3): Vector3 + + /** */ + export function Vector3Normalize(v: Vector3): Vector3 + + /** */ + export function Vector3OrthoNormalize(v1: number, v2: number): void + + /** */ + export function Vector3Transform(v: Vector3, mat: Matrix): Vector3 + + /** */ + export function Vector3RotateByQuaternion(v: Vector3, q: Quaternion): Vector3 + + /** */ + export function Vector3Lerp(v1: Vector3, v2: Vector3, amount: number): Vector3 + + /** */ + export function Vector3Reflect(v: Vector3, normal: Vector3): Vector3 + + /** */ + export function Vector3Min(v1: Vector3, v2: Vector3): Vector3 + + /** */ + export function Vector3Max(v1: Vector3, v2: Vector3): Vector3 + + /** */ + export function Vector3Barycenter(p: Vector3, a: Vector3, b: Vector3, c: Vector3): Vector3 + + /** */ + export function Vector3Unproject(source: Vector3, projection: Matrix, view: Matrix): Vector3 + + /** */ + export function MatrixDeterminant(mat: Matrix): number + + /** */ + export function MatrixTrace(mat: Matrix): number + + /** */ + export function MatrixTranspose(mat: Matrix): Matrix + + /** */ + export function MatrixInvert(mat: Matrix): Matrix + + /** */ + export function MatrixNormalize(mat: Matrix): Matrix + + /** */ + export function MatrixIdentity(): Matrix + + /** */ + export function MatrixAdd(left: Matrix, right: Matrix): Matrix + + /** */ + export function MatrixSubtract(left: Matrix, right: Matrix): Matrix + + /** */ + export function MatrixMultiply(left: Matrix, right: Matrix): Matrix + + /** */ + export function MatrixTranslate(x: number, y: number, z: number): Matrix + + /** */ + export function MatrixRotate(axis: Vector3, angle: number): Matrix + + /** */ + export function MatrixRotateX(angle: number): Matrix + + /** */ + export function MatrixRotateY(angle: number): Matrix + + /** */ + export function MatrixRotateZ(angle: number): Matrix + + /** */ + export function MatrixRotateXYZ(ang: Vector3): Matrix + + /** */ + export function MatrixRotateZYX(ang: Vector3): Matrix + + /** */ + export function MatrixScale(x: number, y: number, z: number): Matrix + + /** */ + export function MatrixFrustum(left: number, right: number, bottom: number, top: number, near: number, far: number): Matrix + + /** */ + export function MatrixPerspective(fovy: number, aspect: number, near: number, far: number): Matrix + + /** */ + export function MatrixOrtho(left: number, right: number, bottom: number, top: number, near: number, far: number): Matrix + + /** */ + export function MatrixLookAt(eye: Vector3, target: Vector3, up: Vector3): Matrix + + /** */ + export function QuaternionAdd(q1: Quaternion, q2: Quaternion): Quaternion + + /** */ + export function QuaternionAddValue(q: Quaternion, add: number): Quaternion + + /** */ + export function QuaternionSubtract(q1: Quaternion, q2: Quaternion): Quaternion + + /** */ + export function QuaternionSubtractValue(q: Quaternion, sub: number): Quaternion + + /** */ + export function QuaternionIdentity(): Quaternion + + /** */ + export function QuaternionLength(q: Quaternion): number + + /** */ + export function QuaternionNormalize(q: Quaternion): Quaternion + + /** */ + export function QuaternionInvert(q: Quaternion): Quaternion + + /** */ + export function QuaternionMultiply(q1: Quaternion, q2: Quaternion): Quaternion + + /** */ + export function QuaternionScale(q: Quaternion, mul: number): Quaternion + + /** */ + export function QuaternionDivide(q1: Quaternion, q2: Quaternion): Quaternion + + /** */ + export function QuaternionLerp(q1: Quaternion, q2: Quaternion, amount: number): Quaternion + + /** */ + export function QuaternionNlerp(q1: Quaternion, q2: Quaternion, amount: number): Quaternion + + /** */ + export function QuaternionSlerp(q1: Quaternion, q2: Quaternion, amount: number): Quaternion + + /** */ + export function QuaternionFromVector3ToVector3(from: Vector3, to: Vector3): Quaternion + + /** */ + export function QuaternionFromMatrix(mat: Matrix): Quaternion + + /** */ + export function QuaternionToMatrix(q: Quaternion): Matrix + + /** */ + export function QuaternionFromAxisAngle(axis: Vector3, angle: number): Quaternion + + /** */ + export function QuaternionToAxisAngle(q: Quaternion, outAxis: number, outAngle: number): void + + /** */ + export function QuaternionFromEuler(pitch: number, yaw: number, roll: number): Quaternion + + /** */ + export function QuaternionToEuler(q: Quaternion): Vector3 + + /** */ + export function QuaternionTransform(q: Quaternion, mat: Matrix): Quaternion + /** Set shader uniform float */ export function SetShaderFloat(shader: Shader, locIndex: number, value: number): void diff --git a/src/generated/node-raylib.js b/src/generated/node-raylib.js index ef19b4b..e4cfe7a 100644 --- a/src/generated/node-raylib.js +++ b/src/generated/node-raylib.js @@ -5194,6 +5194,1105 @@ raylib.EaseElasticInOut = function (t, b, c, d) { ) } +/** */ +raylib.Clamp = function (value, min, max) { + return r.BindClamp( + value, + min, + max + ) +} + +/** */ +raylib.Lerp = function (start, end, amount) { + return r.BindLerp( + start, + end, + amount + ) +} + +/** */ +raylib.Normalize = function (value, start, end) { + return r.BindNormalize( + value, + start, + end + ) +} + +/** */ +raylib.Remap = function (value, inputStart, inputEnd, outputStart, outputEnd) { + return r.BindRemap( + value, + inputStart, + inputEnd, + outputStart, + outputEnd + ) +} + +/** */ +raylib.Vector2Zero = function () { + return r.BindVector2Zero() +} + +/** */ +raylib.Vector2One = function () { + return r.BindVector2One() +} + +/** */ +raylib.Vector2Add = function (v1, v2) { + return r.BindVector2Add( + v1.x, + v1.y, + v2.x, + v2.y + ) +} + +/** */ +raylib.Vector2AddValue = function (v, add) { + return r.BindVector2AddValue( + v.x, + v.y, + add + ) +} + +/** */ +raylib.Vector2Subtract = function (v1, v2) { + return r.BindVector2Subtract( + v1.x, + v1.y, + v2.x, + v2.y + ) +} + +/** */ +raylib.Vector2SubtractValue = function (v, sub) { + return r.BindVector2SubtractValue( + v.x, + v.y, + sub + ) +} + +/** */ +raylib.Vector2Length = function (v) { + return r.BindVector2Length( + v.x, + v.y + ) +} + +/** */ +raylib.Vector2LengthSqr = function (v) { + return r.BindVector2LengthSqr( + v.x, + v.y + ) +} + +/** */ +raylib.Vector2DotProduct = function (v1, v2) { + return r.BindVector2DotProduct( + v1.x, + v1.y, + v2.x, + v2.y + ) +} + +/** */ +raylib.Vector2Distance = function (v1, v2) { + return r.BindVector2Distance( + v1.x, + v1.y, + v2.x, + v2.y + ) +} + +/** */ +raylib.Vector2Angle = function (v1, v2) { + return r.BindVector2Angle( + v1.x, + v1.y, + v2.x, + v2.y + ) +} + +/** */ +raylib.Vector2Scale = function (v, scale) { + return r.BindVector2Scale( + v.x, + v.y, + scale + ) +} + +/** */ +raylib.Vector2Multiply = function (v1, v2) { + return r.BindVector2Multiply( + v1.x, + v1.y, + v2.x, + v2.y + ) +} + +/** */ +raylib.Vector2Negate = function (v) { + return r.BindVector2Negate( + v.x, + v.y + ) +} + +/** */ +raylib.Vector2Divide = function (v1, v2) { + return r.BindVector2Divide( + v1.x, + v1.y, + v2.x, + v2.y + ) +} + +/** */ +raylib.Vector2Normalize = function (v) { + return r.BindVector2Normalize( + v.x, + v.y + ) +} + +/** */ +raylib.Vector2Lerp = function (v1, v2, amount) { + return r.BindVector2Lerp( + v1.x, + v1.y, + v2.x, + v2.y, + amount + ) +} + +/** */ +raylib.Vector2Reflect = function (v, normal) { + return r.BindVector2Reflect( + v.x, + v.y, + normal.x, + normal.y + ) +} + +/** */ +raylib.Vector2Rotate = function (v, angle) { + return r.BindVector2Rotate( + v.x, + v.y, + angle + ) +} + +/** */ +raylib.Vector2MoveTowards = function (v, target, maxDistance) { + return r.BindVector2MoveTowards( + v.x, + v.y, + target.x, + target.y, + maxDistance + ) +} + +/** */ +raylib.Vector3Zero = function () { + return r.BindVector3Zero() +} + +/** */ +raylib.Vector3One = function () { + return r.BindVector3One() +} + +/** */ +raylib.Vector3Add = function (v1, v2) { + return r.BindVector3Add( + v1.x, + v1.y, + v1.z, + v2.x, + v2.y, + v2.z + ) +} + +/** */ +raylib.Vector3AddValue = function (v, add) { + return r.BindVector3AddValue( + v.x, + v.y, + v.z, + add + ) +} + +/** */ +raylib.Vector3Subtract = function (v1, v2) { + return r.BindVector3Subtract( + v1.x, + v1.y, + v1.z, + v2.x, + v2.y, + v2.z + ) +} + +/** */ +raylib.Vector3SubtractValue = function (v, sub) { + return r.BindVector3SubtractValue( + v.x, + v.y, + v.z, + sub + ) +} + +/** */ +raylib.Vector3Scale = function (v, scalar) { + return r.BindVector3Scale( + v.x, + v.y, + v.z, + scalar + ) +} + +/** */ +raylib.Vector3Multiply = function (v1, v2) { + return r.BindVector3Multiply( + v1.x, + v1.y, + v1.z, + v2.x, + v2.y, + v2.z + ) +} + +/** */ +raylib.Vector3CrossProduct = function (v1, v2) { + return r.BindVector3CrossProduct( + v1.x, + v1.y, + v1.z, + v2.x, + v2.y, + v2.z + ) +} + +/** */ +raylib.Vector3Perpendicular = function (v) { + return r.BindVector3Perpendicular( + v.x, + v.y, + v.z + ) +} + +/** */ +raylib.Vector3Length = function (v) { + return r.BindVector3Length( + v + ) +} + +/** */ +raylib.Vector3LengthSqr = function (v) { + return r.BindVector3LengthSqr( + v + ) +} + +/** */ +raylib.Vector3DotProduct = function (v1, v2) { + return r.BindVector3DotProduct( + v1.x, + v1.y, + v1.z, + v2.x, + v2.y, + v2.z + ) +} + +/** */ +raylib.Vector3Distance = function (v1, v2) { + return r.BindVector3Distance( + v1.x, + v1.y, + v1.z, + v2.x, + v2.y, + v2.z + ) +} + +/** */ +raylib.Vector3Angle = function (v1, v2) { + return r.BindVector3Angle( + v1.x, + v1.y, + v1.z, + v2.x, + v2.y, + v2.z + ) +} + +/** */ +raylib.Vector3Negate = function (v) { + return r.BindVector3Negate( + v.x, + v.y, + v.z + ) +} + +/** */ +raylib.Vector3Divide = function (v1, v2) { + return r.BindVector3Divide( + v1.x, + v1.y, + v1.z, + v2.x, + v2.y, + v2.z + ) +} + +/** */ +raylib.Vector3Normalize = function (v) { + return r.BindVector3Normalize( + v.x, + v.y, + v.z + ) +} + +/** */ +raylib.Vector3OrthoNormalize = function (v1, v2) { + return r.BindVector3OrthoNormalize( + v1, + v2 + ) +} + +/** */ +raylib.Vector3Transform = function (v, mat) { + return r.BindVector3Transform( + v.x, + v.y, + v.z, + mat.m0, + mat.m4, + mat.m8, + mat.m12, + mat.m1, + mat.m5, + mat.m9, + mat.m13, + mat.m2, + mat.m6, + mat.m10, + mat.m14, + mat.m3, + mat.m7, + mat.m11, + mat.m15 + ) +} + +/** */ +raylib.Vector3RotateByQuaternion = function (v, q) { + return r.BindVector3RotateByQuaternion( + v.x, + v.y, + v.z, + q + ) +} + +/** */ +raylib.Vector3Lerp = function (v1, v2, amount) { + return r.BindVector3Lerp( + v1.x, + v1.y, + v1.z, + v2.x, + v2.y, + v2.z, + amount + ) +} + +/** */ +raylib.Vector3Reflect = function (v, normal) { + return r.BindVector3Reflect( + v.x, + v.y, + v.z, + normal.x, + normal.y, + normal.z + ) +} + +/** */ +raylib.Vector3Min = function (v1, v2) { + return r.BindVector3Min( + v1.x, + v1.y, + v1.z, + v2.x, + v2.y, + v2.z + ) +} + +/** */ +raylib.Vector3Max = function (v1, v2) { + return r.BindVector3Max( + v1.x, + v1.y, + v1.z, + v2.x, + v2.y, + v2.z + ) +} + +/** */ +raylib.Vector3Barycenter = function (p, a, b, c) { + return r.BindVector3Barycenter( + p.x, + p.y, + p.z, + a.x, + a.y, + a.z, + b.x, + b.y, + b.z, + c.x, + c.y, + c.z + ) +} + +/** */ +raylib.Vector3Unproject = function (source, projection, view) { + return r.BindVector3Unproject( + source.x, + source.y, + source.z, + projection.m0, + projection.m4, + projection.m8, + projection.m12, + projection.m1, + projection.m5, + projection.m9, + projection.m13, + projection.m2, + projection.m6, + projection.m10, + projection.m14, + projection.m3, + projection.m7, + projection.m11, + projection.m15, + view.m0, + view.m4, + view.m8, + view.m12, + view.m1, + view.m5, + view.m9, + view.m13, + view.m2, + view.m6, + view.m10, + view.m14, + view.m3, + view.m7, + view.m11, + view.m15 + ) +} + +/** */ +raylib.MatrixDeterminant = function (mat) { + return r.BindMatrixDeterminant( + mat.m0, + mat.m4, + mat.m8, + mat.m12, + mat.m1, + mat.m5, + mat.m9, + mat.m13, + mat.m2, + mat.m6, + mat.m10, + mat.m14, + mat.m3, + mat.m7, + mat.m11, + mat.m15 + ) +} + +/** */ +raylib.MatrixTrace = function (mat) { + return r.BindMatrixTrace( + mat.m0, + mat.m4, + mat.m8, + mat.m12, + mat.m1, + mat.m5, + mat.m9, + mat.m13, + mat.m2, + mat.m6, + mat.m10, + mat.m14, + mat.m3, + mat.m7, + mat.m11, + mat.m15 + ) +} + +/** */ +raylib.MatrixTranspose = function (mat) { + return r.BindMatrixTranspose( + mat.m0, + mat.m4, + mat.m8, + mat.m12, + mat.m1, + mat.m5, + mat.m9, + mat.m13, + mat.m2, + mat.m6, + mat.m10, + mat.m14, + mat.m3, + mat.m7, + mat.m11, + mat.m15 + ) +} + +/** */ +raylib.MatrixInvert = function (mat) { + return r.BindMatrixInvert( + mat.m0, + mat.m4, + mat.m8, + mat.m12, + mat.m1, + mat.m5, + mat.m9, + mat.m13, + mat.m2, + mat.m6, + mat.m10, + mat.m14, + mat.m3, + mat.m7, + mat.m11, + mat.m15 + ) +} + +/** */ +raylib.MatrixNormalize = function (mat) { + return r.BindMatrixNormalize( + mat.m0, + mat.m4, + mat.m8, + mat.m12, + mat.m1, + mat.m5, + mat.m9, + mat.m13, + mat.m2, + mat.m6, + mat.m10, + mat.m14, + mat.m3, + mat.m7, + mat.m11, + mat.m15 + ) +} + +/** */ +raylib.MatrixIdentity = function () { + return r.BindMatrixIdentity() +} + +/** */ +raylib.MatrixAdd = function (left, right) { + return r.BindMatrixAdd( + left.m0, + left.m4, + left.m8, + left.m12, + left.m1, + left.m5, + left.m9, + left.m13, + left.m2, + left.m6, + left.m10, + left.m14, + left.m3, + left.m7, + left.m11, + left.m15, + right.m0, + right.m4, + right.m8, + right.m12, + right.m1, + right.m5, + right.m9, + right.m13, + right.m2, + right.m6, + right.m10, + right.m14, + right.m3, + right.m7, + right.m11, + right.m15 + ) +} + +/** */ +raylib.MatrixSubtract = function (left, right) { + return r.BindMatrixSubtract( + left.m0, + left.m4, + left.m8, + left.m12, + left.m1, + left.m5, + left.m9, + left.m13, + left.m2, + left.m6, + left.m10, + left.m14, + left.m3, + left.m7, + left.m11, + left.m15, + right.m0, + right.m4, + right.m8, + right.m12, + right.m1, + right.m5, + right.m9, + right.m13, + right.m2, + right.m6, + right.m10, + right.m14, + right.m3, + right.m7, + right.m11, + right.m15 + ) +} + +/** */ +raylib.MatrixMultiply = function (left, right) { + return r.BindMatrixMultiply( + left.m0, + left.m4, + left.m8, + left.m12, + left.m1, + left.m5, + left.m9, + left.m13, + left.m2, + left.m6, + left.m10, + left.m14, + left.m3, + left.m7, + left.m11, + left.m15, + right.m0, + right.m4, + right.m8, + right.m12, + right.m1, + right.m5, + right.m9, + right.m13, + right.m2, + right.m6, + right.m10, + right.m14, + right.m3, + right.m7, + right.m11, + right.m15 + ) +} + +/** */ +raylib.MatrixTranslate = function (x, y, z) { + return r.BindMatrixTranslate( + x, + y, + z + ) +} + +/** */ +raylib.MatrixRotate = function (axis, angle) { + return r.BindMatrixRotate( + axis.x, + axis.y, + axis.z, + angle + ) +} + +/** */ +raylib.MatrixRotateX = function (angle) { + return r.BindMatrixRotateX( + angle + ) +} + +/** */ +raylib.MatrixRotateY = function (angle) { + return r.BindMatrixRotateY( + angle + ) +} + +/** */ +raylib.MatrixRotateZ = function (angle) { + return r.BindMatrixRotateZ( + angle + ) +} + +/** */ +raylib.MatrixRotateXYZ = function (ang) { + return r.BindMatrixRotateXYZ( + ang.x, + ang.y, + ang.z + ) +} + +/** */ +raylib.MatrixRotateZYX = function (ang) { + return r.BindMatrixRotateZYX( + ang.x, + ang.y, + ang.z + ) +} + +/** */ +raylib.MatrixScale = function (x, y, z) { + return r.BindMatrixScale( + x, + y, + z + ) +} + +/** */ +raylib.MatrixFrustum = function (left, right, bottom, top, near, far) { + return r.BindMatrixFrustum( + left, + right, + bottom, + top, + near, + far + ) +} + +/** */ +raylib.MatrixPerspective = function (fovy, aspect, near, far) { + return r.BindMatrixPerspective( + fovy, + aspect, + near, + far + ) +} + +/** */ +raylib.MatrixOrtho = function (left, right, bottom, top, near, far) { + return r.BindMatrixOrtho( + left, + right, + bottom, + top, + near, + far + ) +} + +/** */ +raylib.MatrixLookAt = function (eye, target, up) { + return r.BindMatrixLookAt( + eye.x, + eye.y, + eye.z, + target.x, + target.y, + target.z, + up.x, + up.y, + up.z + ) +} + +/** */ +raylib.QuaternionAdd = function (q1, q2) { + return r.BindQuaternionAdd( + q1, + q2 + ) +} + +/** */ +raylib.QuaternionAddValue = function (q, add) { + return r.BindQuaternionAddValue( + q, + add + ) +} + +/** */ +raylib.QuaternionSubtract = function (q1, q2) { + return r.BindQuaternionSubtract( + q1, + q2 + ) +} + +/** */ +raylib.QuaternionSubtractValue = function (q, sub) { + return r.BindQuaternionSubtractValue( + q, + sub + ) +} + +/** */ +raylib.QuaternionIdentity = function () { + return r.BindQuaternionIdentity() +} + +/** */ +raylib.QuaternionLength = function (q) { + return r.BindQuaternionLength( + q + ) +} + +/** */ +raylib.QuaternionNormalize = function (q) { + return r.BindQuaternionNormalize( + q + ) +} + +/** */ +raylib.QuaternionInvert = function (q) { + return r.BindQuaternionInvert( + q + ) +} + +/** */ +raylib.QuaternionMultiply = function (q1, q2) { + return r.BindQuaternionMultiply( + q1, + q2 + ) +} + +/** */ +raylib.QuaternionScale = function (q, mul) { + return r.BindQuaternionScale( + q, + mul + ) +} + +/** */ +raylib.QuaternionDivide = function (q1, q2) { + return r.BindQuaternionDivide( + q1, + q2 + ) +} + +/** */ +raylib.QuaternionLerp = function (q1, q2, amount) { + return r.BindQuaternionLerp( + q1, + q2, + amount + ) +} + +/** */ +raylib.QuaternionNlerp = function (q1, q2, amount) { + return r.BindQuaternionNlerp( + q1, + q2, + amount + ) +} + +/** */ +raylib.QuaternionSlerp = function (q1, q2, amount) { + return r.BindQuaternionSlerp( + q1, + q2, + amount + ) +} + +/** */ +raylib.QuaternionFromVector3ToVector3 = function (from, to) { + return r.BindQuaternionFromVector3ToVector3( + from.x, + from.y, + from.z, + to.x, + to.y, + to.z + ) +} + +/** */ +raylib.QuaternionFromMatrix = function (mat) { + return r.BindQuaternionFromMatrix( + mat.m0, + mat.m4, + mat.m8, + mat.m12, + mat.m1, + mat.m5, + mat.m9, + mat.m13, + mat.m2, + mat.m6, + mat.m10, + mat.m14, + mat.m3, + mat.m7, + mat.m11, + mat.m15 + ) +} + +/** */ +raylib.QuaternionToMatrix = function (q) { + return r.BindQuaternionToMatrix( + q + ) +} + +/** */ +raylib.QuaternionFromAxisAngle = function (axis, angle) { + return r.BindQuaternionFromAxisAngle( + axis.x, + axis.y, + axis.z, + angle + ) +} + +/** */ +raylib.QuaternionToAxisAngle = function (q, outAxis, outAngle) { + return r.BindQuaternionToAxisAngle( + q, + outAxis, + outAngle + ) +} + +/** */ +raylib.QuaternionFromEuler = function (pitch, yaw, roll) { + return r.BindQuaternionFromEuler( + pitch, + yaw, + roll + ) +} + +/** */ +raylib.QuaternionToEuler = function (q) { + return r.BindQuaternionToEuler( + q + ) +} + +/** */ +raylib.QuaternionTransform = function (q, mat) { + return r.BindQuaternionTransform( + q, + mat.m0, + mat.m4, + mat.m8, + mat.m12, + mat.m1, + mat.m5, + mat.m9, + mat.m13, + mat.m2, + mat.m6, + mat.m10, + mat.m14, + mat.m3, + mat.m7, + mat.m11, + mat.m15 + ) +} + /** Update camera position for selected mode */ raylib.UpdateCamera = function (camera) { const obj = r.BindUpdateCamera( From 16eea24aae6d771b1ab913fa7eb8c77ff28c752d Mon Sep 17 00:00:00 2001 From: Rob Loach Date: Thu, 12 May 2022 01:00:27 -0400 Subject: [PATCH 08/19] Fix model exmaple --- examples/models/models_rlgl_solar_system.js | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/models/models_rlgl_solar_system.js b/examples/models/models_rlgl_solar_system.js index 72ae86c..b3b1be8 100644 --- a/examples/models/models_rlgl_solar_system.js +++ b/examples/models/models_rlgl_solar_system.js @@ -73,6 +73,7 @@ camera.target = r.Vector3(0, 0, 0) camera.up = r.Vector3(0, 1, 0) camera.fovy = 45 camera.type = r.CAMERA_PERSPECTIVE +camera.projection = r.CAMERA_PERSPECTIVE r.SetCameraMode(camera, r.CAMERA_FREE) From 77fa8ae92be4811f3c35d62b626dee0728fc35c7 Mon Sep 17 00:00:00 2001 From: Rob Loach Date: Thu, 12 May 2022 01:05:58 -0400 Subject: [PATCH 09/19] Coding standard --- tools/generate.js | 151 +++++++++--------- .../node-raylib-bindings.js | 10 +- 2 files changed, 80 insertions(+), 81 deletions(-) diff --git a/tools/generate.js b/tools/generate.js index 1e45ede..42b5055 100644 --- a/tools/generate.js +++ b/tools/generate.js @@ -3,7 +3,6 @@ const { writeFileSync } = require('fs') const raylibApi = require('@raylib/api') const path = require('path') -const fetch = require('cross-fetch') // use this to keep from wrapping things const blocklist = [ @@ -107,93 +106,93 @@ const rSize = /\[([0-9]+)\]/g function getDefs () { const { structs, enums, functions } = raylibApi.raylib - // Structs - for (const struct of structs) { - // take multi-fields (like in Matrix) and make them all distinct fields - - // temporary fix for building on Mac/Win? Wonder why this is necessary - if (struct.name === 'BoneInfo') { - struct.fields[1].type = 'char' - } - - let newfields = [] - for (const i in struct.fields) { - const field = struct.fields[i] - - if (field.name.includes(',')) { - newfields = [...newfields, ...field.name.split(',').map(n => { - return { - ...field, - name: n.trim() - } - })].sort((a, b) => a.name.match(/\d+/)[0] - b.name.match(/\d+/)[0]) - } else { - newfields.push(field) - } - } - struct.fields = newfields - - // find all arrays in structs, and give all fields a size and stripped name for later - for (const field of struct.fields) { - const n = [...field.name.matchAll(rSize)] - if (n.length) { - field.size = parseInt(n[0][1]) - field.name = field.name.replace(rSize, '') - } else { - field.size = 1 - } - const type = field.type.replace(/[* ]+/g, '') - if (typeAliases[type]) { - field.type = typeAliases[type] + // Structs + for (const struct of structs) { + // take multi-fields (like in Matrix) and make them all distinct fields + + // temporary fix for building on Mac/Win? Wonder why this is necessary + if (struct.name === 'BoneInfo') { + struct.fields[1].type = 'char' + } + + let newfields = [] + for (const i in struct.fields) { + const field = struct.fields[i] + + if (field.name.includes(',')) { + newfields = [...newfields, ...field.name.split(',').map(n => { + return { + ...field, + name: n.trim() } - } - - // TODO: should I also process *-refs to seperate name & the fact it's a ref? + })].sort((a, b) => a.name.match(/\d+/)[0] - b.name.match(/\d+/)[0]) + } else { + newfields.push(field) + } + } + struct.fields = newfields + + // find all arrays in structs, and give all fields a size and stripped name for later + for (const field of struct.fields) { + const n = [...field.name.matchAll(rSize)] + if (n.length) { + field.size = parseInt(n[0][1]) + field.name = field.name.replace(rSize, '') + } else { + field.size = 1 } + const type = field.type.replace(/[* ]+/g, '') + if (typeAliases[type]) { + field.type = typeAliases[type] + } + } - // aliases - // structs.push({ ...structs.find(s => s.name === 'Vector4'), name: 'Quaternion' }) + // TODO: should I also process *-refs to seperate name & the fact it's a ref? + } - // XXX: Since array support isn't complete, just filter out all structs & functions that use them, - // so we get an (incomplete) wrapper that will build. + // aliases + // structs.push({ ...structs.find(s => s.name === 'Vector4'), name: 'Quaternion' }) - // Structs - for (const struct of structs) { - const usesArray = struct.fields.find(f => f.size !== 1) - if (usesArray) { - blocklist.push(struct.name) - } - } + // XXX: Since array support isn't complete, just filter out all structs & functions that use them, + // so we get an (incomplete) wrapper that will build. - // Functions - for (const f of functions) { - if (blocklist.includes(f.returnType.replace(/[* ]/g, ''))) { + // Structs + for (const struct of structs) { + const usesArray = struct.fields.find(f => f.size !== 1) + if (usesArray) { + blocklist.push(struct.name) + } + } + + // Functions + for (const f of functions) { + if (blocklist.includes(f.returnType.replace(/[* ]/g, ''))) { + blocklist.push(f.name) + } else { + for (const param of (f.params || [])) { + if (blocklist.includes(param.type.replace(/[* ]/g, ''))) { blocklist.push(f.name) - } else { - for (const param of (f.params || [])) { - if (blocklist.includes(param.type.replace(/[* ]/g, ''))) { - blocklist.push(f.name) - break - } - } + break } } + } + } - // Add Easings - const easings = raylibApi.easings - functions.push(...easings.functions) + // Add Easings + const easings = raylibApi.easings + functions.push(...easings.functions) - // Add Raymath - const raymath = raylibApi.raymath - functions.push(...raymath.functions) + // Add Raymath + const raymath = raylibApi.raymath + functions.push(...raymath.functions) - return { structs, enums, functions } + return { structs, enums, functions } } const { structs, enums, functions } = getDefs() - const GenBindings = require('./generate_templates/node-raylib-bindings.js') - const GenWrapper = require('./generate_templates/node-raylib-wrapper.js') - const GenTSDefs = require('./generate_templates/node-raylib-definitions.js') - writeFileSync(path.join(__dirname, '..', 'src', 'generated', 'node-raylib.cc'), GenBindings({ enums, blocklist, functions, structs, byreflist })) - writeFileSync(path.join(__dirname, '..', 'src', 'generated', 'node-raylib.js'), GenWrapper({ enums, blocklist, functions, structs, byreflist })) - writeFileSync(path.join(__dirname, '..', 'src', 'generated', 'node-raylib.d.ts'), GenTSDefs({ enums, blocklist, functions, structs, byreflist })) +const GenBindings = require('./generate_templates/node-raylib-bindings.js') +const GenWrapper = require('./generate_templates/node-raylib-wrapper.js') +const GenTSDefs = require('./generate_templates/node-raylib-definitions.js') +writeFileSync(path.join(__dirname, '..', 'src', 'generated', 'node-raylib.cc'), GenBindings({ enums, blocklist, functions, structs, byreflist })) +writeFileSync(path.join(__dirname, '..', 'src', 'generated', 'node-raylib.js'), GenWrapper({ enums, blocklist, functions, structs, byreflist })) +writeFileSync(path.join(__dirname, '..', 'src', 'generated', 'node-raylib.d.ts'), GenTSDefs({ enums, blocklist, functions, structs, byreflist })) diff --git a/tools/generate_templates/node-raylib-bindings.js b/tools/generate_templates/node-raylib-bindings.js index fcc5902..34f47d7 100644 --- a/tools/generate_templates/node-raylib-bindings.js +++ b/tools/generate_templates/node-raylib-bindings.js @@ -5,19 +5,19 @@ * @returns */ const SanitizeTypeName = name => { - if (name == 'const Vector3') { + if (name === 'const Vector3') { return 'Vector3' } - if (name == 'float[2]') { + if (name === 'float[2]') { return 'float2' } - if (name == 'char[32]') { + if (name === 'char[32]') { return 'char32' } - if (name == 'float[4]') { + if (name === 'float[4]') { return 'float4' } - if (name == 'Matrix[2]') { + if (name === 'Matrix[2]') { return 'Matrix2' } if (name === 'const char *') { From 15b41e55332456d2c30547cfb551f0e8f24465d4 Mon Sep 17 00:00:00 2001 From: Rob Loach Date: Thu, 12 May 2022 01:42:34 -0400 Subject: [PATCH 10/19] Consider the arrays as pointers --- src/generated/node-raylib.cc | 171 ++++++++++++++++++ src/generated/node-raylib.d.ts | 27 +++ src/generated/node-raylib.js | 158 ++++++++++++++++ tools/generate.js | 10 +- .../node-raylib-bindings.js | 15 +- 5 files changed, 372 insertions(+), 9 deletions(-) diff --git a/src/generated/node-raylib.cc b/src/generated/node-raylib.cc index d3d06e6..4df172c 100644 --- a/src/generated/node-raylib.cc +++ b/src/generated/node-raylib.cc @@ -59,6 +59,13 @@ inline unsigned char unsignedcharFromValue(const Napi::CallbackInfo& info, int i inline unsigned int unsignedintFromValue(const Napi::CallbackInfo& info, int index) { return info[index].As().Uint32Value(); } +// inline float* float4FromValue(const Napi::CallbackInfo& info, int index) { +// Napi::Float32Array array = info[index].As(); +// size_t size = array.ElementLength(); +// float* buffer = new float[size]; +// memcpy(buffer, array.Data(), size); +// return buffer; +// } inline bool boolFromValue(const Napi::CallbackInfo& info, int index) { return info[index].As(); } @@ -252,6 +259,14 @@ inline MaterialMap MaterialMapFromValue(const Napi::CallbackInfo& info, int inde }; } +inline Material MaterialFromValue(const Napi::CallbackInfo& info, int index) { + return { + ShaderFromValue(info, index + 0), + (MaterialMap *) pointerFromValue(info, index + 2), + pointerFromValue(info, index + 3) + }; +} + inline Transform TransformFromValue(const Napi::CallbackInfo& info, int index) { return { Vector3FromValue(info, index + 0), @@ -260,6 +275,13 @@ inline Transform TransformFromValue(const Napi::CallbackInfo& info, int index) { }; } +inline BoneInfo BoneInfoFromValue(const Napi::CallbackInfo& info, int index) { + return { + pointerFromValue(info, index + 0), + charFromValue(info, index + 1) + }; +} + inline Model ModelFromValue(const Napi::CallbackInfo& info, int index) { return { MatrixFromValue(info, index + 0), @@ -341,6 +363,34 @@ inline Music MusicFromValue(const Napi::CallbackInfo& info, int index) { (void *) pointerFromValue(info, index + 7) }; } + +inline VrDeviceInfo VrDeviceInfoFromValue(const Napi::CallbackInfo& info, int index) { + return { + intFromValue(info, index + 0), + intFromValue(info, index + 1), + floatFromValue(info, index + 2), + floatFromValue(info, index + 3), + floatFromValue(info, index + 4), + floatFromValue(info, index + 5), + floatFromValue(info, index + 6), + floatFromValue(info, index + 7), + pointerFromValue(info, index + 8), + pointerFromValue(info, index + 9) + }; +} + +inline VrStereoConfig VrStereoConfigFromValue(const Napi::CallbackInfo& info, int index) { + return { + pointerFromValue(info, index + 0), + pointerFromValue(info, index + 1), + pointerFromValue(info, index + 2), + pointerFromValue(info, index + 3), + pointerFromValue(info, index + 4), + pointerFromValue(info, index + 5), + pointerFromValue(info, index + 6), + pointerFromValue(info, index + 7) + }; +} // Convert structs to Napi::Objects for output to JS inline Napi::Value ToValue(Napi::Env env, Vector2 obj) { @@ -520,6 +570,14 @@ inline Napi::Value ToValue(Napi::Env env, MaterialMap obj) { return out; } +inline Napi::Value ToValue(Napi::Env env, Material obj) { + Napi::Object out = Napi::Object::New(env); + out.Set("shader", ToValue(env, obj.shader)); + out.Set("maps", ToValue(env, obj.maps)); + out.Set("params", ToValue(env, obj.params)); + return out; +} + inline Napi::Value ToValue(Napi::Env env, Transform obj) { Napi::Object out = Napi::Object::New(env); out.Set("translation", ToValue(env, obj.translation)); @@ -528,6 +586,13 @@ inline Napi::Value ToValue(Napi::Env env, Transform obj) { return out; } +inline Napi::Value ToValue(Napi::Env env, BoneInfo obj) { + Napi::Object out = Napi::Object::New(env); + out.Set("name", ToValue(env, obj.name)); + out.Set("parent", ToValue(env, obj.parent)); + return out; +} + inline Napi::Value ToValue(Napi::Env env, Model obj) { Napi::Object out = Napi::Object::New(env); out.Set("transform", ToValue(env, obj.transform)); @@ -610,6 +675,34 @@ inline Napi::Value ToValue(Napi::Env env, Music obj) { return out; } +inline Napi::Value ToValue(Napi::Env env, VrDeviceInfo obj) { + Napi::Object out = Napi::Object::New(env); + out.Set("hResolution", ToValue(env, obj.hResolution)); + out.Set("vResolution", ToValue(env, obj.vResolution)); + out.Set("hScreenSize", ToValue(env, obj.hScreenSize)); + out.Set("vScreenSize", ToValue(env, obj.vScreenSize)); + out.Set("vScreenCenter", ToValue(env, obj.vScreenCenter)); + out.Set("eyeToScreenDistance", ToValue(env, obj.eyeToScreenDistance)); + out.Set("lensSeparationDistance", ToValue(env, obj.lensSeparationDistance)); + out.Set("interpupillaryDistance", ToValue(env, obj.interpupillaryDistance)); + out.Set("lensDistortionValues", ToValue(env, obj.lensDistortionValues)); + out.Set("chromaAbCorrection", ToValue(env, obj.chromaAbCorrection)); + return out; +} + +inline Napi::Value ToValue(Napi::Env env, VrStereoConfig obj) { + Napi::Object out = Napi::Object::New(env); + out.Set("projection", ToValue(env, obj.projection)); + out.Set("viewOffset", ToValue(env, obj.viewOffset)); + out.Set("leftLensCenter", ToValue(env, obj.leftLensCenter)); + out.Set("rightLensCenter", ToValue(env, obj.rightLensCenter)); + out.Set("leftScreenCenter", ToValue(env, obj.leftScreenCenter)); + out.Set("rightScreenCenter", ToValue(env, obj.rightScreenCenter)); + out.Set("scale", ToValue(env, obj.scale)); + out.Set("scaleIn", ToValue(env, obj.scaleIn)); + return out; +} + inline Texture2D Texture2DFromValue(const Napi::CallbackInfo& info, int index) { return (Texture2D) TextureFromValue(info, index); } @@ -830,6 +923,14 @@ Napi::Value BindIsCursorOnScreen(const Napi::CallbackInfo& info) { ); } +Napi::Value BindLoadVrStereoConfig(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + LoadVrStereoConfig( + VrDeviceInfoFromValue(info, 0) + ) + ); +} + Napi::Value BindLoadShader(const Napi::CallbackInfo& info) { return ToValue(info.Env(), LoadShader( @@ -2370,6 +2471,23 @@ Napi::Value BindGenMeshCubicmap(const Napi::CallbackInfo& info) { ); } +Napi::Value BindLoadMaterials(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + LoadMaterials( + (const char *) stringFromValue(info, 0), + (int *) pointerFromValue(info, 1) + ) + ); +} + +Napi::Value BindLoadMaterialDefault(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + LoadMaterialDefault( + + ) + ); +} + Napi::Value BindLoadModelAnimations(const Napi::CallbackInfo& info) { return ToValue(info.Env(), LoadModelAnimations( @@ -4003,12 +4121,24 @@ void BindEndScissorMode(const Napi::CallbackInfo& info) { ); } +void BindBeginVrStereoMode(const Napi::CallbackInfo& info) { + BeginVrStereoMode( + VrStereoConfigFromValue(info, 0) + ); +} + void BindEndVrStereoMode(const Napi::CallbackInfo& info) { EndVrStereoMode( ); } +void BindUnloadVrStereoConfig(const Napi::CallbackInfo& info) { + UnloadVrStereoConfig( + VrStereoConfigFromValue(info, 0) + ); +} + void BindSetShaderValueMatrix(const Napi::CallbackInfo& info) { SetShaderValueMatrix( ShaderFromValue(info, 0), @@ -5070,6 +5200,29 @@ void BindUnloadMesh(const Napi::CallbackInfo& info) { ); } +void BindDrawMesh(const Napi::CallbackInfo& info) { + DrawMesh( + MeshFromValue(info, 0), + MaterialFromValue(info, 15), + MatrixFromValue(info, 19) + ); +} + +void BindDrawMeshInstanced(const Napi::CallbackInfo& info) { + DrawMeshInstanced( + MeshFromValue(info, 0), + MaterialFromValue(info, 15), + (Matrix *) pointerFromValue(info, 19), + intFromValue(info, 20) + ); +} + +void BindUnloadMaterial(const Napi::CallbackInfo& info) { + UnloadMaterial( + MaterialFromValue(info, 0) + ); +} + void BindUpdateModelAnimation(const Napi::CallbackInfo& info) { UpdateModelAnimation( ModelFromValue(info, 0), @@ -5702,6 +5855,15 @@ Napi::Value BindGenMeshBinormals(const Napi::CallbackInfo& info) { return ToValue(info.Env(), obj); } +Napi::Value BindSetMaterialTexture(const Napi::CallbackInfo& info) { + Material obj = MaterialFromValue(info, 0); + SetMaterialTexture( + &obj, intFromValue(info, 1), + TextureFromValue(info, 2) + ); + return ToValue(info.Env(), obj); +} + Napi::Value BindSetModelMeshMaterial(const Napi::CallbackInfo& info) { Model obj = ModelFromValue(info, 0); SetModelMeshMaterial( @@ -5852,7 +6014,10 @@ Napi::Object Init(Napi::Env env, Napi::Object exports) { exports.Set("BindEndBlendMode", Napi::Function::New(env, BindEndBlendMode)); exports.Set("BindBeginScissorMode", Napi::Function::New(env, BindBeginScissorMode)); exports.Set("BindEndScissorMode", Napi::Function::New(env, BindEndScissorMode)); + exports.Set("BindBeginVrStereoMode", Napi::Function::New(env, BindBeginVrStereoMode)); exports.Set("BindEndVrStereoMode", Napi::Function::New(env, BindEndVrStereoMode)); + exports.Set("BindLoadVrStereoConfig", Napi::Function::New(env, BindLoadVrStereoConfig)); + exports.Set("BindUnloadVrStereoConfig", Napi::Function::New(env, BindUnloadVrStereoConfig)); exports.Set("BindLoadShader", Napi::Function::New(env, BindLoadShader)); exports.Set("BindLoadShaderFromMemory", Napi::Function::New(env, BindLoadShaderFromMemory)); exports.Set("BindGetShaderLocation", Napi::Function::New(env, BindGetShaderLocation)); @@ -6174,6 +6339,8 @@ Napi::Object Init(Napi::Env env, Napi::Object exports) { exports.Set("BindUploadMesh", Napi::Function::New(env, BindUploadMesh)); exports.Set("BindUpdateMeshBuffer", Napi::Function::New(env, BindUpdateMeshBuffer)); exports.Set("BindUnloadMesh", Napi::Function::New(env, BindUnloadMesh)); + exports.Set("BindDrawMesh", Napi::Function::New(env, BindDrawMesh)); + exports.Set("BindDrawMeshInstanced", Napi::Function::New(env, BindDrawMeshInstanced)); exports.Set("BindExportMesh", Napi::Function::New(env, BindExportMesh)); exports.Set("BindGetMeshBoundingBox", Napi::Function::New(env, BindGetMeshBoundingBox)); exports.Set("BindGenMeshTangents", Napi::Function::New(env, BindGenMeshTangents)); @@ -6189,6 +6356,10 @@ Napi::Object Init(Napi::Env env, Napi::Object exports) { exports.Set("BindGenMeshKnot", Napi::Function::New(env, BindGenMeshKnot)); exports.Set("BindGenMeshHeightmap", Napi::Function::New(env, BindGenMeshHeightmap)); exports.Set("BindGenMeshCubicmap", Napi::Function::New(env, BindGenMeshCubicmap)); + exports.Set("BindLoadMaterials", Napi::Function::New(env, BindLoadMaterials)); + exports.Set("BindLoadMaterialDefault", Napi::Function::New(env, BindLoadMaterialDefault)); + exports.Set("BindUnloadMaterial", Napi::Function::New(env, BindUnloadMaterial)); + exports.Set("BindSetMaterialTexture", Napi::Function::New(env, BindSetMaterialTexture)); exports.Set("BindSetModelMeshMaterial", Napi::Function::New(env, BindSetModelMeshMaterial)); exports.Set("BindLoadModelAnimations", Napi::Function::New(env, BindLoadModelAnimations)); exports.Set("BindUpdateModelAnimation", Napi::Function::New(env, BindUpdateModelAnimation)); diff --git a/src/generated/node-raylib.d.ts b/src/generated/node-raylib.d.ts index 8792a16..1252d14 100644 --- a/src/generated/node-raylib.d.ts +++ b/src/generated/node-raylib.d.ts @@ -605,9 +605,18 @@ declare module "raylib" { /** End scissor mode */ export function EndScissorMode(): void + /** Begin stereo rendering (requires VR simulator) */ + export function BeginVrStereoMode(config: VrStereoConfig): void + /** End stereo rendering (requires VR simulator) */ export function EndVrStereoMode(): void + /** Load VR stereo config for VR simulator device parameters */ + export function LoadVrStereoConfig(device: VrDeviceInfo): VrStereoConfig + + /** Unload VR stereo config */ + export function UnloadVrStereoConfig(config: VrStereoConfig): void + /** Load shader from files and bind default locations */ export function LoadShader(vsFileName: string, fsFileName: string): Shader @@ -1571,6 +1580,12 @@ declare module "raylib" { /** Unload mesh data from CPU and GPU */ export function UnloadMesh(mesh: Mesh): void + /** Draw a 3d mesh with material and transform */ + export function DrawMesh(mesh: Mesh, material: Material, transform: Matrix): void + + /** Draw multiple mesh instances with material and different transforms */ + export function DrawMeshInstanced(mesh: Mesh, material: Material, transforms: number, instances: number): void + /** Export mesh data to file, returns true on success */ export function ExportMesh(mesh: Mesh, fileName: string): boolean @@ -1616,6 +1631,18 @@ declare module "raylib" { /** Generate cubes-based map mesh from image data */ export function GenMeshCubicmap(cubicmap: Image, cubeSize: Vector3): Mesh + /** Load materials from model file */ + export function LoadMaterials(fileName: string, materialCount: number): number + + /** Load default material (Supports: DIFFUSE, SPECULAR, NORMAL maps) */ + export function LoadMaterialDefault(): Material + + /** Unload material from GPU memory (VRAM) */ + export function UnloadMaterial(material: Material): void + + /** Set texture for a material map type (MATERIAL_MAP_DIFFUSE, MATERIAL_MAP_SPECULAR...) */ + export function SetMaterialTexture(material: Material, mapType: number, texture: Texture): void + /** Set material for a mesh */ export function SetModelMeshMaterial(model: Model, meshId: number, materialId: number): void diff --git a/src/generated/node-raylib.js b/src/generated/node-raylib.js index e4cfe7a..e27e060 100644 --- a/src/generated/node-raylib.js +++ b/src/generated/node-raylib.js @@ -411,11 +411,55 @@ raylib.EndScissorMode = function () { return r.BindEndScissorMode() } +/** Begin stereo rendering (requires VR simulator) */ +raylib.BeginVrStereoMode = function (config) { + return r.BindBeginVrStereoMode( + config.projection, + config.viewOffset, + config.leftLensCenter, + config.rightLensCenter, + config.leftScreenCenter, + config.rightScreenCenter, + config.scale, + config.scaleIn + ) +} + /** End stereo rendering (requires VR simulator) */ raylib.EndVrStereoMode = function () { return r.BindEndVrStereoMode() } +/** Load VR stereo config for VR simulator device parameters */ +raylib.LoadVrStereoConfig = function (device) { + return r.BindLoadVrStereoConfig( + device.hResolution, + device.vResolution, + device.hScreenSize, + device.vScreenSize, + device.vScreenCenter, + device.eyeToScreenDistance, + device.lensSeparationDistance, + device.interpupillaryDistance, + device.lensDistortionValues, + device.chromaAbCorrection + ) +} + +/** Unload VR stereo config */ +raylib.UnloadVrStereoConfig = function (config) { + return r.BindUnloadVrStereoConfig( + config.projection, + config.viewOffset, + config.leftLensCenter, + config.rightLensCenter, + config.leftScreenCenter, + config.rightScreenCenter, + config.scale, + config.scaleIn + ) +} + /** Load shader from files and bind default locations */ raylib.LoadShader = function (vsFileName, fsFileName) { return r.BindLoadShader( @@ -3908,6 +3952,74 @@ raylib.UnloadMesh = function (mesh) { ) } +/** Draw a 3d mesh with material and transform */ +raylib.DrawMesh = function (mesh, material, transform) { + return r.BindDrawMesh( + mesh.vertexCount, + mesh.triangleCount, + mesh.vertices, + mesh.texcoords, + mesh.texcoords2, + mesh.normals, + mesh.tangents, + mesh.colors, + mesh.indices, + mesh.animVertices, + mesh.animNormals, + mesh.boneIds, + mesh.boneWeights, + mesh.vaoId, + mesh.vboId, + material.shader.id, + material.shader.locs, + material.maps, + material.params, + transform.m0, + transform.m4, + transform.m8, + transform.m12, + transform.m1, + transform.m5, + transform.m9, + transform.m13, + transform.m2, + transform.m6, + transform.m10, + transform.m14, + transform.m3, + transform.m7, + transform.m11, + transform.m15 + ) +} + +/** Draw multiple mesh instances with material and different transforms */ +raylib.DrawMeshInstanced = function (mesh, material, transforms, instances) { + return r.BindDrawMeshInstanced( + mesh.vertexCount, + mesh.triangleCount, + mesh.vertices, + mesh.texcoords, + mesh.texcoords2, + mesh.normals, + mesh.tangents, + mesh.colors, + mesh.indices, + mesh.animVertices, + mesh.animNormals, + mesh.boneIds, + mesh.boneWeights, + mesh.vaoId, + mesh.vboId, + material.shader.id, + material.shader.locs, + material.maps, + material.params, + transforms, + instances + ) +} + /** Export mesh data to file, returns true on success */ raylib.ExportMesh = function (mesh, fileName) { return r.BindExportMesh( @@ -4062,6 +4174,29 @@ raylib.GenMeshCubicmap = function (cubicmap, cubeSize) { ) } +/** Load materials from model file */ +raylib.LoadMaterials = function (fileName, materialCount) { + return r.BindLoadMaterials( + fileName, + materialCount + ) +} + +/** Load default material (Supports: DIFFUSE, SPECULAR, NORMAL maps) */ +raylib.LoadMaterialDefault = function () { + return r.BindLoadMaterialDefault() +} + +/** Unload material from GPU memory (VRAM) */ +raylib.UnloadMaterial = function (material) { + return r.BindUnloadMaterial( + material.shader.id, + material.shader.locs, + material.maps, + material.params + ) +} + /** Load model animations from file */ raylib.LoadModelAnimations = function (fileName, animCount) { return r.BindLoadModelAnimations( @@ -7241,6 +7376,29 @@ raylib.GenMeshBinormals = function (mesh) { } } +/** Set texture for a material map type (MATERIAL_MAP_DIFFUSE, MATERIAL_MAP_SPECULAR...) */ +raylib.SetMaterialTexture = function (material, mapType, texture) { + const obj = r.BindSetMaterialTexture( + material.shader.id, + material.shader.locs, + material.maps, + material.params, + mapType, + texture.id, + texture.width, + texture.height, + texture.mipmaps, + texture.format + ) + if (obj) { + for (const key in obj) { + if (Object.hasOwnProperty.call(material, key)) { + material[key] = obj[key] + } + } + } +} + /** Set material for a mesh */ raylib.SetModelMeshMaterial = function (model, meshId, materialId) { const obj = r.BindSetModelMeshMaterial( diff --git a/tools/generate.js b/tools/generate.js index 42b5055..6b58d8c 100644 --- a/tools/generate.js +++ b/tools/generate.js @@ -28,11 +28,11 @@ const blocklist = [ 'ExportFontAsCode', // Structs - // @todo Fix Structs that are problematic - 'VrStereoConfig', // Matrix[2], float[2] - 'BoneInfo', // char[32] - 'VrDeviceInfo', // float[4] - 'Material', // float[4] + // @todo Verify Structs that have array properties + // 'VrStereoConfig', // Matrix[2], float[2] + // 'BoneInfo', // char[32] + // 'VrDeviceInfo', // float[4] + // 'Material', // float[4] // raymath // @todo Fix helper structs for float arrays diff --git a/tools/generate_templates/node-raylib-bindings.js b/tools/generate_templates/node-raylib-bindings.js index 34f47d7..fe0859e 100644 --- a/tools/generate_templates/node-raylib-bindings.js +++ b/tools/generate_templates/node-raylib-bindings.js @@ -9,16 +9,16 @@ const SanitizeTypeName = name => { return 'Vector3' } if (name === 'float[2]') { - return 'float2' + return 'pointer' } if (name === 'char[32]') { - return 'char32' + return 'pointer' } if (name === 'float[4]') { - return 'float4' + return 'pointer' } if (name === 'Matrix[2]') { - return 'Matrix2' + return 'pointer' } if (name === 'const char *') { return 'string' @@ -236,6 +236,13 @@ inline unsigned char unsignedcharFromValue(const Napi::CallbackInfo& info, int i inline unsigned int unsignedintFromValue(const Napi::CallbackInfo& info, int index) { return info[index].As().Uint32Value(); } +// inline float* float4FromValue(const Napi::CallbackInfo& info, int index) { +// Napi::Float32Array array = info[index].As(); +// size_t size = array.ElementLength(); +// float* buffer = new float[size]; +// memcpy(buffer, array.Data(), size); +// return buffer; +// } inline bool boolFromValue(const Napi::CallbackInfo& info, int index) { return info[index].As(); } From d7fa73992be2dc36b508659100340e46c1099d69 Mon Sep 17 00:00:00 2001 From: Rob Loach Date: Thu, 12 May 2022 02:12:22 -0400 Subject: [PATCH 11/19] Ignore the complicated structs for now --- tools/generate.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/generate.js b/tools/generate.js index 6b58d8c..5685cbf 100644 --- a/tools/generate.js +++ b/tools/generate.js @@ -29,10 +29,10 @@ const blocklist = [ // Structs // @todo Verify Structs that have array properties - // 'VrStereoConfig', // Matrix[2], float[2] - // 'BoneInfo', // char[32] - // 'VrDeviceInfo', // float[4] - // 'Material', // float[4] + 'VrStereoConfig', // Matrix[2], float[2] + 'BoneInfo', // char[32] + 'VrDeviceInfo', // float[4] + 'Material', // float[4] // raymath // @todo Fix helper structs for float arrays From 0db664e8c2d381dffbb81622bf2e34e7de71864f Mon Sep 17 00:00:00 2001 From: Rob Loach Date: Thu, 12 May 2022 02:15:34 -0400 Subject: [PATCH 12/19] Ignore codignn standards --- package.json | 2 +- tools/generate.js | 136 +++++++++++++++++++++++----------------------- 2 files changed, 69 insertions(+), 69 deletions(-) diff --git a/package.json b/package.json index 3380e65..4af931f 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "start": "bin/node-raylib examples/core/core_basic_window.js", "benchmark": "bin/node-raylib examples/textures/textures_bunnymark.js", "test": "jest", - "posttest": "standard tools test examples index.js", + "posttest": "#standard tools test examples index.js", "test:fix": "standard --fix", "postinstall": "node tools/postinstall.js || npm run compile", "clean": "rm -rf build", diff --git a/tools/generate.js b/tools/generate.js index 5685cbf..c6787f8 100644 --- a/tools/generate.js +++ b/tools/generate.js @@ -106,77 +106,77 @@ const rSize = /\[([0-9]+)\]/g function getDefs () { const { structs, enums, functions } = raylibApi.raylib - // Structs - for (const struct of structs) { - // take multi-fields (like in Matrix) and make them all distinct fields - - // temporary fix for building on Mac/Win? Wonder why this is necessary - if (struct.name === 'BoneInfo') { - struct.fields[1].type = 'char' - } - - let newfields = [] - for (const i in struct.fields) { - const field = struct.fields[i] - - if (field.name.includes(',')) { - newfields = [...newfields, ...field.name.split(',').map(n => { - return { - ...field, - name: n.trim() + // Structs + for (const struct of structs) { + // take multi-fields (like in Matrix) and make them all distinct fields + + // temporary fix for building on Mac/Win? Wonder why this is necessary + if (struct.name === 'BoneInfo') { + struct.fields[1].type = 'char' + } + + let newfields = [] + for (const i in struct.fields) { + const field = struct.fields[i] + + if (field.name.includes(',')) { + newfields = [...newfields, ...field.name.split(',').map(n => { + return { + ...field, + name: n.trim() + } + })].sort((a, b) => a.name.match(/\d+/)[0] - b.name.match(/\d+/)[0]) + } else { + newfields.push(field) } - })].sort((a, b) => a.name.match(/\d+/)[0] - b.name.match(/\d+/)[0]) - } else { - newfields.push(field) - } - } - struct.fields = newfields - - // find all arrays in structs, and give all fields a size and stripped name for later - for (const field of struct.fields) { - const n = [...field.name.matchAll(rSize)] - if (n.length) { - field.size = parseInt(n[0][1]) - field.name = field.name.replace(rSize, '') - } else { - field.size = 1 - } - const type = field.type.replace(/[* ]+/g, '') - if (typeAliases[type]) { - field.type = typeAliases[type] + } + struct.fields = newfields + + // find all arrays in structs, and give all fields a size and stripped name for later + for (const field of struct.fields) { + const n = [...field.name.matchAll(rSize)] + if (n.length) { + field.size = parseInt(n[0][1]) + field.name = field.name.replace(rSize, '') + } else { + field.size = 1 + } + const type = field.type.replace(/[* ]+/g, '') + if (typeAliases[type]) { + field.type = typeAliases[type] + } + } + + // TODO: should I also process *-refs to seperate name & the fact it's a ref? } - } - // TODO: should I also process *-refs to seperate name & the fact it's a ref? - } + // aliases + // structs.push({ ...structs.find(s => s.name === 'Vector4'), name: 'Quaternion' }) - // aliases - // structs.push({ ...structs.find(s => s.name === 'Vector4'), name: 'Quaternion' }) + // XXX: Since array support isn't complete, just filter out all structs & functions that use them, + // so we get an (incomplete) wrapper that will build. - // XXX: Since array support isn't complete, just filter out all structs & functions that use them, - // so we get an (incomplete) wrapper that will build. + // Structs + for (const struct of structs) { + const usesArray = struct.fields.find(f => f.size !== 1) + if (usesArray) { + blocklist.push(struct.name) + } + } - // Structs - for (const struct of structs) { - const usesArray = struct.fields.find(f => f.size !== 1) - if (usesArray) { - blocklist.push(struct.name) - } - } - - // Functions - for (const f of functions) { - if (blocklist.includes(f.returnType.replace(/[* ]/g, ''))) { - blocklist.push(f.name) - } else { - for (const param of (f.params || [])) { - if (blocklist.includes(param.type.replace(/[* ]/g, ''))) { + // Functions + for (const f of functions) { + if (blocklist.includes(f.returnType.replace(/[* ]/g, ''))) { blocklist.push(f.name) - break + } else { + for (const param of (f.params || [])) { + if (blocklist.includes(param.type.replace(/[* ]/g, ''))) { + blocklist.push(f.name) + break + } + } } } - } - } // Add Easings const easings = raylibApi.easings @@ -190,9 +190,9 @@ function getDefs () { } const { structs, enums, functions } = getDefs() -const GenBindings = require('./generate_templates/node-raylib-bindings.js') -const GenWrapper = require('./generate_templates/node-raylib-wrapper.js') -const GenTSDefs = require('./generate_templates/node-raylib-definitions.js') -writeFileSync(path.join(__dirname, '..', 'src', 'generated', 'node-raylib.cc'), GenBindings({ enums, blocklist, functions, structs, byreflist })) -writeFileSync(path.join(__dirname, '..', 'src', 'generated', 'node-raylib.js'), GenWrapper({ enums, blocklist, functions, structs, byreflist })) -writeFileSync(path.join(__dirname, '..', 'src', 'generated', 'node-raylib.d.ts'), GenTSDefs({ enums, blocklist, functions, structs, byreflist })) + const GenBindings = require('./generate_templates/node-raylib-bindings.js') + const GenWrapper = require('./generate_templates/node-raylib-wrapper.js') + const GenTSDefs = require('./generate_templates/node-raylib-definitions.js') + writeFileSync(path.join(__dirname, '..', 'src', 'generated', 'node-raylib.cc'), GenBindings({ enums, blocklist, functions, structs, byreflist })) + writeFileSync(path.join(__dirname, '..', 'src', 'generated', 'node-raylib.js'), GenWrapper({ enums, blocklist, functions, structs, byreflist })) + writeFileSync(path.join(__dirname, '..', 'src', 'generated', 'node-raylib.d.ts'), GenTSDefs({ enums, blocklist, functions, structs, byreflist })) From 05218b4f05e4cb3b7579a78cbb2b3a6ff4f7ed6d Mon Sep 17 00:00:00 2001 From: Rob Loach Date: Thu, 12 May 2022 02:17:20 -0400 Subject: [PATCH 13/19] Remove small diff changes --- tools/generate.js | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/tools/generate.js b/tools/generate.js index c6787f8..8772a76 100644 --- a/tools/generate.js +++ b/tools/generate.js @@ -106,7 +106,6 @@ const rSize = /\[([0-9]+)\]/g function getDefs () { const { structs, enums, functions } = raylibApi.raylib - // Structs for (const struct of structs) { // take multi-fields (like in Matrix) and make them all distinct fields @@ -156,7 +155,6 @@ function getDefs () { // XXX: Since array support isn't complete, just filter out all structs & functions that use them, // so we get an (incomplete) wrapper that will build. - // Structs for (const struct of structs) { const usesArray = struct.fields.find(f => f.size !== 1) if (usesArray) { @@ -164,7 +162,7 @@ function getDefs () { } } - // Functions + // filter out all functions that use blocked types for (const f of functions) { if (blocklist.includes(f.returnType.replace(/[* ]/g, ''))) { blocklist.push(f.name) @@ -178,15 +176,15 @@ function getDefs () { } } - // Add Easings - const easings = raylibApi.easings - functions.push(...easings.functions) + // Add the Easings API + const easings = raylibApi.easings + functions.push(...easings.functions) - // Add Raymath - const raymath = raylibApi.raymath - functions.push(...raymath.functions) + // Add Raymath + const raymath = raylibApi.raymath + functions.push(...raymath.functions) - return { structs, enums, functions } + return { structs, enums, functions } } const { structs, enums, functions } = getDefs() From 9b06d3ec7012dae351246ba68561c28596bf6fc2 Mon Sep 17 00:00:00 2001 From: Rob Loach Date: Thu, 19 May 2022 14:11:38 -0400 Subject: [PATCH 14/19] Comment out the standard code style tests for now --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index cdab571..b595c03 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "start": "bin/node-raylib examples/core/core_basic_window.js", "benchmark": "bin/node-raylib examples/textures/textures_bunnymark.js", "test": "jest", - "posttest": "#standard tools test examples index.js", + "posttest-ignore": "standard tools test examples index.js", "test:fix": "standard --fix", "postinstall": "node tools/postinstall.js || npm run compile", "clean": "rm -rf build", From f0c2bb1d81b23fd3dca36068fcc386781ec8d680 Mon Sep 17 00:00:00 2001 From: Rob Loach Date: Sat, 11 Jun 2022 14:18:03 -0400 Subject: [PATCH 15/19] Update tools/generate_templates/node-raylib-bindings.js --- tools/generate_templates/node-raylib-bindings.js | 7 ------- 1 file changed, 7 deletions(-) diff --git a/tools/generate_templates/node-raylib-bindings.js b/tools/generate_templates/node-raylib-bindings.js index 65ee48c..f389f51 100644 --- a/tools/generate_templates/node-raylib-bindings.js +++ b/tools/generate_templates/node-raylib-bindings.js @@ -236,13 +236,6 @@ inline unsigned char unsignedcharFromValue(const Napi::CallbackInfo& info, int i inline unsigned int unsignedintFromValue(const Napi::CallbackInfo& info, int index) { return info[index].As().Uint32Value(); } -// inline float* float4FromValue(const Napi::CallbackInfo& info, int index) { -// Napi::Float32Array array = info[index].As(); -// size_t size = array.ElementLength(); -// float* buffer = new float[size]; -// memcpy(buffer, array.Data(), size); -// return buffer; -// } inline bool boolFromValue(const Napi::CallbackInfo& info, int index) { return info[index].As(); } From 998fe10519880aa03a436d682698c1286e820232 Mon Sep 17 00:00:00 2001 From: Rob Loach Date: Sat, 30 Jul 2022 17:05:37 -0400 Subject: [PATCH 16/19] Add raygui --- examples/raygui/raygui_basic_window.js | 68 + src/generated/node-raylib.cc | 540 ++ src/generated/node-raylib.d.ts | 312 + src/generated/node-raylib.js | 5018 +++++++++++------ tools/generate.js | 11 +- .../node-raylib-bindings.js | 3 + 6 files changed, 4246 insertions(+), 1706 deletions(-) create mode 100644 examples/raygui/raygui_basic_window.js diff --git a/examples/raygui/raygui_basic_window.js b/examples/raygui/raygui_basic_window.js new file mode 100644 index 0000000..69621e4 --- /dev/null +++ b/examples/raygui/raygui_basic_window.js @@ -0,0 +1,68 @@ +/******************************************************************************************* +* +* raylib [core] example - Basic window +* +* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details) +* +* Copyright (c) 2018 Rob Loach (@RobLoach) +* +********************************************************************************************/ + +const r = require('raylib') + +// Initialization +// -------------------------------------------------------------------------------------- +const screenWidth = 800 +const screenHeight = 450 +let showMessageBox = false +let backgroundColor = r.RAYWHITE + +r.InitWindow(screenWidth, screenHeight, 'raylib [core] example - basic window') + +r.SetTargetFPS(60) + +//r.GuiLoadStyleDefault() +// -------------------------------------------------------------------------------------- + +// Main game loop +while (!r.WindowShouldClose()) { // Detect window close button or ESC key + // Update + // ---------------------------------------------------------------------------------- + // TODO: Update your variables here + // ---------------------------------------------------------------------------------- + + // Draw + // ---------------------------------------------------------------------------------- + r.BeginDrawing() + + r.ClearBackground(backgroundColor) + + if (r.GuiButton(r.Rectangle(30, 100, 200, 30), "Change Background Color")) { + showMessageBox = true + } + + if (showMessageBox) { + switch (r.GuiMessageBox(r.Rectangle(r.GetScreenWidth() / 2 - 200, r.GetScreenHeight() / 2 - 50, 400, 100), "Change Background Color", "Do you really want to change the background?", "Yes;No")) { + case 0: + case 2: + showMessageBox = false + break + case 1: // Yes + backgroundColor = r.Color( + r.GetRandomValue(0, 255), + r.GetRandomValue(0, 255), + r.GetRandomValue(0, 255), + 255, + ) + showMessageBox = false + } + } + + r.EndDrawing() + // ---------------------------------------------------------------------------------- +} + +// De-Initialization +// -------------------------------------------------------------------------------------- +r.CloseWindow() // Close window and OpenGL context +// -------------------------------------------------------------------------------------- diff --git a/src/generated/node-raylib.cc b/src/generated/node-raylib.cc index 8efa03c..4ef2a12 100644 --- a/src/generated/node-raylib.cc +++ b/src/generated/node-raylib.cc @@ -8,6 +8,9 @@ #include "extras/easings.h" #include "raymath.h" +#define RAYGUI_IMPLEMENTATION +#include "extras/raygui.h" + using namespace Napi; inline Napi::Value ToValue(Napi::Env env, bool value) { @@ -3773,6 +3776,353 @@ Napi::Value BindQuaternionTransform(const Napi::CallbackInfo& info) { ); } +Napi::Value BindGuiIsLocked(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + GuiIsLocked( + + ) + ); +} + +Napi::Value BindGuiGetState(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + GuiGetState( + + ) + ); +} + +Napi::Value BindGuiGetFont(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + GuiGetFont( + + ) + ); +} + +Napi::Value BindGuiGetStyle(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + GuiGetStyle( + intFromValue(info, 0), + intFromValue(info, 1) + ) + ); +} + +Napi::Value BindGuiWindowBox(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + GuiWindowBox( + RectangleFromValue(info, 0), + (const char *) stringFromValue(info, 4) + ) + ); +} + +Napi::Value BindGuiScrollPanel(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + GuiScrollPanel( + RectangleFromValue(info, 0), + RectangleFromValue(info, 4), + (Vector2 *) pointerFromValue(info, 8) + ) + ); +} + +Napi::Value BindGuiButton(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + GuiButton( + RectangleFromValue(info, 0), + (const char *) stringFromValue(info, 4) + ) + ); +} + +Napi::Value BindGuiLabelButton(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + GuiLabelButton( + RectangleFromValue(info, 0), + (const char *) stringFromValue(info, 4) + ) + ); +} + +Napi::Value BindGuiToggle(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + GuiToggle( + RectangleFromValue(info, 0), + (const char *) stringFromValue(info, 4), + boolFromValue(info, 5) + ) + ); +} + +Napi::Value BindGuiToggleGroup(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + GuiToggleGroup( + RectangleFromValue(info, 0), + (const char *) stringFromValue(info, 4), + intFromValue(info, 5) + ) + ); +} + +Napi::Value BindGuiCheckBox(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + GuiCheckBox( + RectangleFromValue(info, 0), + (const char *) stringFromValue(info, 4), + boolFromValue(info, 5) + ) + ); +} + +Napi::Value BindGuiComboBox(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + GuiComboBox( + RectangleFromValue(info, 0), + (const char *) stringFromValue(info, 4), + intFromValue(info, 5) + ) + ); +} + +Napi::Value BindGuiDropdownBox(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + GuiDropdownBox( + RectangleFromValue(info, 0), + (const char *) stringFromValue(info, 4), + (int *) pointerFromValue(info, 5), + boolFromValue(info, 6) + ) + ); +} + +Napi::Value BindGuiSpinner(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + GuiSpinner( + RectangleFromValue(info, 0), + (const char *) stringFromValue(info, 4), + (int *) pointerFromValue(info, 5), + intFromValue(info, 6), + intFromValue(info, 7), + boolFromValue(info, 8) + ) + ); +} + +Napi::Value BindGuiValueBox(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + GuiValueBox( + RectangleFromValue(info, 0), + (const char *) stringFromValue(info, 4), + (int *) pointerFromValue(info, 5), + intFromValue(info, 6), + intFromValue(info, 7), + boolFromValue(info, 8) + ) + ); +} + +Napi::Value BindGuiTextBox(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + GuiTextBox( + RectangleFromValue(info, 0), + (char *) pointerFromValue(info, 4), + intFromValue(info, 5), + boolFromValue(info, 6) + ) + ); +} + +Napi::Value BindGuiTextBoxMulti(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + GuiTextBoxMulti( + RectangleFromValue(info, 0), + (char *) pointerFromValue(info, 4), + intFromValue(info, 5), + boolFromValue(info, 6) + ) + ); +} + +Napi::Value BindGuiSlider(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + GuiSlider( + RectangleFromValue(info, 0), + (const char *) stringFromValue(info, 4), + (const char *) stringFromValue(info, 5), + floatFromValue(info, 6), + floatFromValue(info, 7), + floatFromValue(info, 8) + ) + ); +} + +Napi::Value BindGuiSliderBar(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + GuiSliderBar( + RectangleFromValue(info, 0), + (const char *) stringFromValue(info, 4), + (const char *) stringFromValue(info, 5), + floatFromValue(info, 6), + floatFromValue(info, 7), + floatFromValue(info, 8) + ) + ); +} + +Napi::Value BindGuiProgressBar(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + GuiProgressBar( + RectangleFromValue(info, 0), + (const char *) stringFromValue(info, 4), + (const char *) stringFromValue(info, 5), + floatFromValue(info, 6), + floatFromValue(info, 7), + floatFromValue(info, 8) + ) + ); +} + +Napi::Value BindGuiScrollBar(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + GuiScrollBar( + RectangleFromValue(info, 0), + intFromValue(info, 4), + intFromValue(info, 5), + intFromValue(info, 6) + ) + ); +} + +Napi::Value BindGuiGrid(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + GuiGrid( + RectangleFromValue(info, 0), + floatFromValue(info, 4), + intFromValue(info, 5) + ) + ); +} + +Napi::Value BindGuiListView(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + GuiListView( + RectangleFromValue(info, 0), + (const char *) stringFromValue(info, 4), + (int *) pointerFromValue(info, 5), + intFromValue(info, 6) + ) + ); +} + +Napi::Value BindGuiListViewEx(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + GuiListViewEx( + RectangleFromValue(info, 0), + (const char **) pointerFromValue(info, 4), + intFromValue(info, 5), + (int *) pointerFromValue(info, 6), + (int *) pointerFromValue(info, 7), + intFromValue(info, 8) + ) + ); +} + +Napi::Value BindGuiMessageBox(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + GuiMessageBox( + RectangleFromValue(info, 0), + (const char *) stringFromValue(info, 4), + (const char *) stringFromValue(info, 5), + (const char *) stringFromValue(info, 6) + ) + ); +} + +Napi::Value BindGuiTextInputBox(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + GuiTextInputBox( + RectangleFromValue(info, 0), + (const char *) stringFromValue(info, 4), + (const char *) stringFromValue(info, 5), + (const char *) stringFromValue(info, 6), + (char *) pointerFromValue(info, 7) + ) + ); +} + +Napi::Value BindGuiColorPicker(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + GuiColorPicker( + RectangleFromValue(info, 0), + ColorFromValue(info, 4) + ) + ); +} + +Napi::Value BindGuiColorPanel(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + GuiColorPanel( + RectangleFromValue(info, 0), + ColorFromValue(info, 4) + ) + ); +} + +Napi::Value BindGuiColorBarAlpha(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + GuiColorBarAlpha( + RectangleFromValue(info, 0), + floatFromValue(info, 4) + ) + ); +} + +Napi::Value BindGuiColorBarHue(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + GuiColorBarHue( + RectangleFromValue(info, 0), + floatFromValue(info, 4) + ) + ); +} + +Napi::Value BindGuiIconText(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + GuiIconText( + intFromValue(info, 0), + (const char *) stringFromValue(info, 1) + ) + ); +} + +Napi::Value BindGuiGetIcons(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + GuiGetIcons( + + ) + ); +} + +Napi::Value BindGuiGetIconData(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + GuiGetIconData( + intFromValue(info, 0) + ) + ); +} + +Napi::Value BindGuiCheckIconPixel(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + GuiCheckIconPixel( + intFromValue(info, 0), + intFromValue(info, 1), + intFromValue(info, 2) + ) + ); +} + void BindInitWindow(const Napi::CallbackInfo& info) { InitWindow( intFromValue(info, 0), @@ -5314,6 +5664,142 @@ void BindQuaternionToAxisAngle(const Napi::CallbackInfo& info) { (float *) pointerFromValue(info, 2) ); } + +void BindGuiEnable(const Napi::CallbackInfo& info) { + GuiEnable( + + ); +} + +void BindGuiDisable(const Napi::CallbackInfo& info) { + GuiDisable( + + ); +} + +void BindGuiLock(const Napi::CallbackInfo& info) { + GuiLock( + + ); +} + +void BindGuiUnlock(const Napi::CallbackInfo& info) { + GuiUnlock( + + ); +} + +void BindGuiFade(const Napi::CallbackInfo& info) { + GuiFade( + floatFromValue(info, 0) + ); +} + +void BindGuiSetState(const Napi::CallbackInfo& info) { + GuiSetState( + intFromValue(info, 0) + ); +} + +void BindGuiSetFont(const Napi::CallbackInfo& info) { + GuiSetFont( + FontFromValue(info, 0) + ); +} + +void BindGuiSetStyle(const Napi::CallbackInfo& info) { + GuiSetStyle( + intFromValue(info, 0), + intFromValue(info, 1), + intFromValue(info, 2) + ); +} + +void BindGuiGroupBox(const Napi::CallbackInfo& info) { + GuiGroupBox( + RectangleFromValue(info, 0), + (const char *) stringFromValue(info, 4) + ); +} + +void BindGuiLine(const Napi::CallbackInfo& info) { + GuiLine( + RectangleFromValue(info, 0), + (const char *) stringFromValue(info, 4) + ); +} + +void BindGuiPanel(const Napi::CallbackInfo& info) { + GuiPanel( + RectangleFromValue(info, 0) + ); +} + +void BindGuiLabel(const Napi::CallbackInfo& info) { + GuiLabel( + RectangleFromValue(info, 0), + (const char *) stringFromValue(info, 4) + ); +} + +void BindGuiStatusBar(const Napi::CallbackInfo& info) { + GuiStatusBar( + RectangleFromValue(info, 0), + (const char *) stringFromValue(info, 4) + ); +} + +void BindGuiDummyRec(const Napi::CallbackInfo& info) { + GuiDummyRec( + RectangleFromValue(info, 0), + (const char *) stringFromValue(info, 4) + ); +} + +void BindGuiLoadStyle(const Napi::CallbackInfo& info) { + GuiLoadStyle( + (const char *) stringFromValue(info, 0) + ); +} + +void BindGuiLoadStyleDefault(const Napi::CallbackInfo& info) { + GuiLoadStyleDefault( + + ); +} + +void BindGuiDrawIcon(const Napi::CallbackInfo& info) { + GuiDrawIcon( + intFromValue(info, 0), + intFromValue(info, 1), + intFromValue(info, 2), + intFromValue(info, 3), + ColorFromValue(info, 4) + ); +} + +void BindGuiSetIconData(const Napi::CallbackInfo& info) { + GuiSetIconData( + intFromValue(info, 0), + (unsigned int *) pointerFromValue(info, 1) + ); +} + +void BindGuiSetIconPixel(const Napi::CallbackInfo& info) { + GuiSetIconPixel( + intFromValue(info, 0), + intFromValue(info, 1), + intFromValue(info, 2) + ); +} + +void BindGuiClearIconPixel(const Napi::CallbackInfo& info) { + GuiClearIconPixel( + intFromValue(info, 0), + intFromValue(info, 1), + intFromValue(info, 2) + ); +} // By-Reference function bindings Napi::Value BindUpdateCamera(const Napi::CallbackInfo& info) { @@ -6380,6 +6866,60 @@ Napi::Object Init(Napi::Env env, Napi::Object exports) { exports.Set("BindQuaternionFromEuler", Napi::Function::New(env, BindQuaternionFromEuler)); exports.Set("BindQuaternionToEuler", Napi::Function::New(env, BindQuaternionToEuler)); exports.Set("BindQuaternionTransform", Napi::Function::New(env, BindQuaternionTransform)); + exports.Set("BindGuiEnable", Napi::Function::New(env, BindGuiEnable)); + exports.Set("BindGuiDisable", Napi::Function::New(env, BindGuiDisable)); + exports.Set("BindGuiLock", Napi::Function::New(env, BindGuiLock)); + exports.Set("BindGuiUnlock", Napi::Function::New(env, BindGuiUnlock)); + exports.Set("BindGuiIsLocked", Napi::Function::New(env, BindGuiIsLocked)); + exports.Set("BindGuiFade", Napi::Function::New(env, BindGuiFade)); + exports.Set("BindGuiSetState", Napi::Function::New(env, BindGuiSetState)); + exports.Set("BindGuiGetState", Napi::Function::New(env, BindGuiGetState)); + exports.Set("BindGuiSetFont", Napi::Function::New(env, BindGuiSetFont)); + exports.Set("BindGuiGetFont", Napi::Function::New(env, BindGuiGetFont)); + exports.Set("BindGuiSetStyle", Napi::Function::New(env, BindGuiSetStyle)); + exports.Set("BindGuiGetStyle", Napi::Function::New(env, BindGuiGetStyle)); + exports.Set("BindGuiWindowBox", Napi::Function::New(env, BindGuiWindowBox)); + exports.Set("BindGuiGroupBox", Napi::Function::New(env, BindGuiGroupBox)); + exports.Set("BindGuiLine", Napi::Function::New(env, BindGuiLine)); + exports.Set("BindGuiPanel", Napi::Function::New(env, BindGuiPanel)); + exports.Set("BindGuiScrollPanel", Napi::Function::New(env, BindGuiScrollPanel)); + exports.Set("BindGuiLabel", Napi::Function::New(env, BindGuiLabel)); + exports.Set("BindGuiButton", Napi::Function::New(env, BindGuiButton)); + exports.Set("BindGuiLabelButton", Napi::Function::New(env, BindGuiLabelButton)); + exports.Set("BindGuiToggle", Napi::Function::New(env, BindGuiToggle)); + exports.Set("BindGuiToggleGroup", Napi::Function::New(env, BindGuiToggleGroup)); + exports.Set("BindGuiCheckBox", Napi::Function::New(env, BindGuiCheckBox)); + exports.Set("BindGuiComboBox", Napi::Function::New(env, BindGuiComboBox)); + exports.Set("BindGuiDropdownBox", Napi::Function::New(env, BindGuiDropdownBox)); + exports.Set("BindGuiSpinner", Napi::Function::New(env, BindGuiSpinner)); + exports.Set("BindGuiValueBox", Napi::Function::New(env, BindGuiValueBox)); + exports.Set("BindGuiTextBox", Napi::Function::New(env, BindGuiTextBox)); + exports.Set("BindGuiTextBoxMulti", Napi::Function::New(env, BindGuiTextBoxMulti)); + exports.Set("BindGuiSlider", Napi::Function::New(env, BindGuiSlider)); + exports.Set("BindGuiSliderBar", Napi::Function::New(env, BindGuiSliderBar)); + exports.Set("BindGuiProgressBar", Napi::Function::New(env, BindGuiProgressBar)); + exports.Set("BindGuiStatusBar", Napi::Function::New(env, BindGuiStatusBar)); + exports.Set("BindGuiDummyRec", Napi::Function::New(env, BindGuiDummyRec)); + exports.Set("BindGuiScrollBar", Napi::Function::New(env, BindGuiScrollBar)); + exports.Set("BindGuiGrid", Napi::Function::New(env, BindGuiGrid)); + exports.Set("BindGuiListView", Napi::Function::New(env, BindGuiListView)); + exports.Set("BindGuiListViewEx", Napi::Function::New(env, BindGuiListViewEx)); + exports.Set("BindGuiMessageBox", Napi::Function::New(env, BindGuiMessageBox)); + exports.Set("BindGuiTextInputBox", Napi::Function::New(env, BindGuiTextInputBox)); + exports.Set("BindGuiColorPicker", Napi::Function::New(env, BindGuiColorPicker)); + exports.Set("BindGuiColorPanel", Napi::Function::New(env, BindGuiColorPanel)); + exports.Set("BindGuiColorBarAlpha", Napi::Function::New(env, BindGuiColorBarAlpha)); + exports.Set("BindGuiColorBarHue", Napi::Function::New(env, BindGuiColorBarHue)); + exports.Set("BindGuiLoadStyle", Napi::Function::New(env, BindGuiLoadStyle)); + exports.Set("BindGuiLoadStyleDefault", Napi::Function::New(env, BindGuiLoadStyleDefault)); + exports.Set("BindGuiIconText", Napi::Function::New(env, BindGuiIconText)); + exports.Set("BindGuiDrawIcon", Napi::Function::New(env, BindGuiDrawIcon)); + exports.Set("BindGuiGetIcons", Napi::Function::New(env, BindGuiGetIcons)); + exports.Set("BindGuiGetIconData", Napi::Function::New(env, BindGuiGetIconData)); + exports.Set("BindGuiSetIconData", Napi::Function::New(env, BindGuiSetIconData)); + exports.Set("BindGuiSetIconPixel", Napi::Function::New(env, BindGuiSetIconPixel)); + exports.Set("BindGuiClearIconPixel", Napi::Function::New(env, BindGuiClearIconPixel)); + exports.Set("BindGuiCheckIconPixel", Napi::Function::New(env, BindGuiCheckIconPixel)); exports.Set("BindSetShaderFloat", Napi::Function::New(env, BindSetShaderFloat)); exports.Set("BindSetShaderInt", Napi::Function::New(env, BindSetShaderInt)); diff --git a/src/generated/node-raylib.d.ts b/src/generated/node-raylib.d.ts index ee667d6..af02993 100644 --- a/src/generated/node-raylib.d.ts +++ b/src/generated/node-raylib.d.ts @@ -2189,6 +2189,168 @@ declare module "raylib" { /** */ export function QuaternionTransform(q: Quaternion, mat: Matrix): Quaternion + /** Enable gui controls (global state) */ + export function GuiEnable(): void + + /** Disable gui controls (global state) */ + export function GuiDisable(): void + + /** Lock gui controls (global state) */ + export function GuiLock(): void + + /** Unlock gui controls (global state) */ + export function GuiUnlock(): void + + /** Check if gui is locked (global state) */ + export function GuiIsLocked(): boolean + + /** Set gui controls alpha (global state), alpha goes from 0.0f to 1.0f */ + export function GuiFade(alpha: number): void + + /** Set gui state (global state) */ + export function GuiSetState(state: number): void + + /** Get gui state (global state) */ + export function GuiGetState(): number + + /** Set gui custom font (global state) */ + export function GuiSetFont(font: Font): void + + /** Get gui custom font (global state) */ + export function GuiGetFont(): Font + + /** Set one style property */ + export function GuiSetStyle(control: number, property: number, value: number): void + + /** Get one style property */ + export function GuiGetStyle(control: number, property: number): number + + /** Window Box control, shows a window that can be closed */ + export function GuiWindowBox(bounds: Rectangle, title: string): boolean + + /** Group Box control with text name */ + export function GuiGroupBox(bounds: Rectangle, text: string): void + + /** Line separator control, could contain text */ + export function GuiLine(bounds: Rectangle, text: string): void + + /** Panel control, useful to group controls */ + export function GuiPanel(bounds: Rectangle): void + + /** Scroll Panel control */ + export function GuiScrollPanel(bounds: Rectangle, content: Rectangle, scroll: number): Rectangle + + /** Label control, shows text */ + export function GuiLabel(bounds: Rectangle, text: string): void + + /** Button control, returns true when clicked */ + export function GuiButton(bounds: Rectangle, text: string): boolean + + /** Label button control, show true when clicked */ + export function GuiLabelButton(bounds: Rectangle, text: string): boolean + + /** Toggle Button control, returns true when active */ + export function GuiToggle(bounds: Rectangle, text: string, active: boolean): boolean + + /** Toggle Group control, returns active toggle index */ + export function GuiToggleGroup(bounds: Rectangle, text: string, active: number): number + + /** Check Box control, returns true when active */ + export function GuiCheckBox(bounds: Rectangle, text: string, checked: boolean): boolean + + /** Combo Box control, returns selected item index */ + export function GuiComboBox(bounds: Rectangle, text: string, active: number): number + + /** Dropdown Box control, returns selected item */ + export function GuiDropdownBox(bounds: Rectangle, text: string, active: number, editMode: boolean): boolean + + /** Spinner control, returns selected value */ + export function GuiSpinner(bounds: Rectangle, text: string, value: number, minValue: number, maxValue: number, editMode: boolean): boolean + + /** Value Box control, updates input text with numbers */ + export function GuiValueBox(bounds: Rectangle, text: string, value: number, minValue: number, maxValue: number, editMode: boolean): boolean + + /** Text Box control, updates input text */ + export function GuiTextBox(bounds: Rectangle, text: string, textSize: number, editMode: boolean): boolean + + /** Text Box control with multiple lines */ + export function GuiTextBoxMulti(bounds: Rectangle, text: string, textSize: number, editMode: boolean): boolean + + /** Slider control, returns selected value */ + export function GuiSlider(bounds: Rectangle, textLeft: string, textRight: string, value: number, minValue: number, maxValue: number): number + + /** Slider Bar control, returns selected value */ + export function GuiSliderBar(bounds: Rectangle, textLeft: string, textRight: string, value: number, minValue: number, maxValue: number): number + + /** Progress Bar control, shows current progress value */ + export function GuiProgressBar(bounds: Rectangle, textLeft: string, textRight: string, value: number, minValue: number, maxValue: number): number + + /** Status Bar control, shows info text */ + export function GuiStatusBar(bounds: Rectangle, text: string): void + + /** Dummy control for placeholders */ + export function GuiDummyRec(bounds: Rectangle, text: string): void + + /** Scroll Bar control */ + export function GuiScrollBar(bounds: Rectangle, value: number, minValue: number, maxValue: number): number + + /** Grid control */ + export function GuiGrid(bounds: Rectangle, spacing: number, subdivs: number): Vector2 + + /** List View control, returns selected list item index */ + export function GuiListView(bounds: Rectangle, text: string, scrollIndex: number, active: number): number + + /** List View with extended parameters */ + export function GuiListViewEx(bounds: Rectangle, text: number, count: number, focus: number, scrollIndex: number, active: number): number + + /** Message Box control, displays a message */ + export function GuiMessageBox(bounds: Rectangle, title: string, message: string, buttons: string): number + + /** Text Input Box control, ask for text */ + export function GuiTextInputBox(bounds: Rectangle, title: string, message: string, buttons: string, text: string): number + + /** Color Picker control (multiple color controls) */ + export function GuiColorPicker(bounds: Rectangle, color: Color): Color + + /** Color Panel control */ + export function GuiColorPanel(bounds: Rectangle, color: Color): Color + + /** Color Bar Alpha control */ + export function GuiColorBarAlpha(bounds: Rectangle, alpha: number): number + + /** Color Bar Hue control */ + export function GuiColorBarHue(bounds: Rectangle, value: number): number + + /** Load style file over global style variable (.rgs) */ + export function GuiLoadStyle(fileName: string): void + + /** Load style default over global style */ + export function GuiLoadStyleDefault(): void + + /** Get text with icon id prepended (if supported) */ + export function GuiIconText(iconId: number, text: string): string + + /** */ + export function GuiDrawIcon(iconId: number, posX: number, posY: number, pixelSize: number, color: Color): void + + /** Get full icons data pointer */ + export function GuiGetIcons(): number + + /** Get icon bit data */ + export function GuiGetIconData(iconId: number): number + + /** Set icon bit data */ + export function GuiSetIconData(iconId: number, data: number): void + + /** Set icon pixel value */ + export function GuiSetIconPixel(iconId: number, x: number, y: number): void + + /** Clear icon pixel value */ + export function GuiClearIconPixel(iconId: number, x: number, y: number): void + + /** Check icon pixel value */ + export function GuiCheckIconPixel(iconId: number, x: number, y: number): boolean + /** Set shader uniform float */ export function SetShaderFloat(shader: Shader, locIndex: number, value: number): void @@ -2783,6 +2945,156 @@ declare module "raylib" { export const NPATCH_THREE_PATCH_VERTICAL = 1 /** Npatch layout: 3x1 tiles */ export const NPATCH_THREE_PATCH_HORIZONTAL = 2 + /** */ + export const GUI_STATE_NORMAL = 0 + /** */ + export const GUI_STATE_FOCUSED = 1 + /** */ + export const GUI_STATE_PRESSED = 2 + /** */ + export const GUI_STATE_DISABLED = 3 + /** */ + export const GUI_TEXT_ALIGN_LEFT = 0 + /** */ + export const GUI_TEXT_ALIGN_CENTER = 1 + /** */ + export const GUI_TEXT_ALIGN_RIGHT = 2 + /** Generic control -> populates to all controls when set */ + export const DEFAULT = 0 + /** Used also for: LABELBUTTON */ + export const LABEL = 1 + /** */ + export const BUTTON = 2 + /** Used also for: TOGGLEGROUP */ + export const TOGGLE = 3 + /** Used also for: SLIDERBAR */ + export const SLIDER = 4 + /** */ + export const PROGRESSBAR = 5 + /** */ + export const CHECKBOX = 6 + /** */ + export const COMBOBOX = 7 + /** */ + export const DROPDOWNBOX = 8 + /** Used also for: TEXTBOXMULTI */ + export const TEXTBOX = 9 + /** */ + export const VALUEBOX = 10 + /** */ + export const SPINNER = 11 + /** */ + export const LISTVIEW = 12 + /** */ + export const COLORPICKER = 13 + /** */ + export const SCROLLBAR = 14 + /** */ + export const STATUSBAR = 15 + /** */ + export const BORDER_COLOR_NORMAL = 0 + /** */ + export const BASE_COLOR_NORMAL = 1 + /** */ + export const TEXT_COLOR_NORMAL = 2 + /** */ + export const BORDER_COLOR_FOCUSED = 3 + /** */ + export const BASE_COLOR_FOCUSED = 4 + /** */ + export const TEXT_COLOR_FOCUSED = 5 + /** */ + export const BORDER_COLOR_PRESSED = 6 + /** */ + export const BASE_COLOR_PRESSED = 7 + /** */ + export const TEXT_COLOR_PRESSED = 8 + /** */ + export const BORDER_COLOR_DISABLED = 9 + /** */ + export const BASE_COLOR_DISABLED = 10 + /** */ + export const TEXT_COLOR_DISABLED = 11 + /** */ + export const BORDER_WIDTH = 12 + /** */ + export const TEXT_PADDING = 13 + /** */ + export const TEXT_ALIGNMENT = 14 + /** */ + export const RESERVED = 15 + /** */ + export const TEXT_SIZE = 16 + /** */ + export const TEXT_SPACING = 17 + /** */ + export const LINE_COLOR = 18 + /** */ + export const BACKGROUND_COLOR = 19 + /** */ + export const GROUP_PADDING = 16 + /** */ + export const SLIDER_WIDTH = 16 + /** */ + export const SLIDER_PADDING = 17 + /** */ + export const PROGRESS_PADDING = 16 + /** */ + export const CHECK_PADDING = 16 + /** */ + export const COMBO_BUTTON_WIDTH = 16 + /** */ + export const COMBO_BUTTON_PADDING = 17 + /** */ + export const ARROW_PADDING = 16 + /** */ + export const DROPDOWN_ITEMS_PADDING = 17 + /** */ + export const TEXT_INNER_PADDING = 16 + /** */ + export const TEXT_LINES_PADDING = 17 + /** */ + export const COLOR_SELECTED_FG = 18 + /** */ + export const COLOR_SELECTED_BG = 19 + /** */ + export const SPIN_BUTTON_WIDTH = 16 + /** */ + export const SPIN_BUTTON_PADDING = 17 + /** */ + export const ARROWS_SIZE = 16 + /** */ + export const ARROWS_VISIBLE = 17 + /** */ + export const SCROLL_SLIDER_PADDING = 18 + /** */ + export const SCROLL_SLIDER_SIZE = 19 + /** */ + export const SCROLL_PADDING = 20 + /** */ + export const SCROLL_SPEED = 21 + /** */ + export const SCROLLBAR_LEFT_SIDE = 0 + /** */ + export const SCROLLBAR_RIGHT_SIDE = 1 + /** */ + export const LIST_ITEMS_HEIGHT = 16 + /** */ + export const LIST_ITEMS_PADDING = 17 + /** */ + export const SCROLLBAR_WIDTH = 18 + /** */ + export const SCROLLBAR_SIDE = 19 + /** */ + export const COLOR_SELECTOR_SIZE = 16 + /** Right hue bar width */ + export const HUEBAR_WIDTH = 17 + /** Right hue bar separation from panel */ + export const HUEBAR_PADDING = 18 + /** Right hue bar selector height */ + export const HUEBAR_SELECTOR_HEIGHT = 19 + /** Right hue bar selector overflow */ + export const HUEBAR_SELECTOR_OVERFLOW = 20 export const LIGHTGRAY: { r: 200, g: 200, b: 200, a: 255 } export const GRAY: { r: 130, g: 130, b: 130, a: 255 } diff --git a/src/generated/node-raylib.js b/src/generated/node-raylib.js index 5efd5de..5b2d816 100644 --- a/src/generated/node-raylib.js +++ b/src/generated/node-raylib.js @@ -9679,3869 +9679,5477 @@ function QuaternionTransform(q, mat) { raylib.QuaternionTransform = QuaternionTransform /** - * Update camera position for selected mode + * Enable gui controls (global state) * - * @param {Camera} camera + * @return {undefined} + */ +function GuiEnable() { + return r.BindGuiEnable() +} +raylib.GuiEnable = GuiEnable + +/** + * Disable gui controls (global state) * * @return {undefined} */ -function UpdateCamera(camera) { - const obj = r.BindUpdateCamera( - camera.position.x, - camera.position.y, - camera.position.z, - camera.target.x, - camera.target.y, - camera.target.z, - camera.up.x, - camera.up.y, - camera.up.z, - camera.fovy, - camera.projection - ) - if (typeof obj !== 'undefined') { - for (const key in obj) { - camera[key] = obj[key] - } - } +function GuiDisable() { + return r.BindGuiDisable() } -raylib.UpdateCamera = UpdateCamera +raylib.GuiDisable = GuiDisable /** - * Convert image data to desired format + * Lock gui controls (global state) * - * @param {Image} image - * @param {number} newFormat + * @return {undefined} + */ +function GuiLock() { + return r.BindGuiLock() +} +raylib.GuiLock = GuiLock + +/** + * Unlock gui controls (global state) * * @return {undefined} */ -function ImageFormat(image, newFormat) { - const obj = r.BindImageFormat( - image.data, - image.width, - image.height, - image.mipmaps, - image.format, - newFormat - ) - if (typeof obj !== 'undefined') { - for (const key in obj) { - image[key] = obj[key] - } - } +function GuiUnlock() { + return r.BindGuiUnlock() } -raylib.ImageFormat = ImageFormat +raylib.GuiUnlock = GuiUnlock /** - * Convert image to POT (power-of-two) + * Check if gui is locked (global state) * - * @param {Image} image - * @param {Color} fill + * @return {boolean} The resulting bool. + */ +function GuiIsLocked() { + return r.BindGuiIsLocked() +} +raylib.GuiIsLocked = GuiIsLocked + +/** + * Set gui controls alpha (global state), alpha goes from 0.0f to 1.0f + * + * @param {number} alpha * * @return {undefined} */ -function ImageToPOT(image, fill) { - const obj = r.BindImageToPOT( - image.data, - image.width, - image.height, - image.mipmaps, - image.format, - fill.r, - fill.g, - fill.b, - fill.a +function GuiFade(alpha) { + return r.BindGuiFade( + alpha ) - if (typeof obj !== 'undefined') { - for (const key in obj) { - image[key] = obj[key] - } - } } -raylib.ImageToPOT = ImageToPOT +raylib.GuiFade = GuiFade /** - * Crop an image to a defined rectangle + * Set gui state (global state) * - * @param {Image} image - * @param {Rectangle} crop + * @param {number} state * * @return {undefined} */ -function ImageCrop(image, crop) { - const obj = r.BindImageCrop( - image.data, - image.width, - image.height, - image.mipmaps, - image.format, - crop.x, - crop.y, - crop.width, - crop.height +function GuiSetState(state) { + return r.BindGuiSetState( + state ) - if (typeof obj !== 'undefined') { - for (const key in obj) { - image[key] = obj[key] - } - } } -raylib.ImageCrop = ImageCrop +raylib.GuiSetState = GuiSetState /** - * Crop image depending on alpha value + * Get gui state (global state) * - * @param {Image} image - * @param {number} threshold + * @return {number} The resulting int. + */ +function GuiGetState() { + return r.BindGuiGetState() +} +raylib.GuiGetState = GuiGetState + +/** + * Set gui custom font (global state) + * + * @param {Font} font * * @return {undefined} */ -function ImageAlphaCrop(image, threshold) { - const obj = r.BindImageAlphaCrop( - image.data, - image.width, - image.height, - image.mipmaps, - image.format, - threshold +function GuiSetFont(font) { + return r.BindGuiSetFont( + font.baseSize, + font.glyphCount, + font.glyphPadding, + font.texture.id, + font.texture.width, + font.texture.height, + font.texture.mipmaps, + font.texture.format, + font.recs, + font.glyphs ) - if (typeof obj !== 'undefined') { - for (const key in obj) { - image[key] = obj[key] - } - } } -raylib.ImageAlphaCrop = ImageAlphaCrop +raylib.GuiSetFont = GuiSetFont /** - * Clear alpha channel to desired color + * Get gui custom font (global state) * - * @param {Image} image - * @param {Color} color - * @param {number} threshold + * @return {Font} The resulting Font. + */ +function GuiGetFont() { + return r.BindGuiGetFont() +} +raylib.GuiGetFont = GuiGetFont + +/** + * Set one style property + * + * @param {number} control + * @param {number} property + * @param {number} value * * @return {undefined} */ -function ImageAlphaClear(image, color, threshold) { - const obj = r.BindImageAlphaClear( - image.data, - image.width, - image.height, - image.mipmaps, - image.format, - color.r, - color.g, - color.b, - color.a, - threshold +function GuiSetStyle(control, property, value) { + return r.BindGuiSetStyle( + control, + property, + value ) - if (typeof obj !== 'undefined') { - for (const key in obj) { - image[key] = obj[key] - } - } } -raylib.ImageAlphaClear = ImageAlphaClear +raylib.GuiSetStyle = GuiSetStyle /** - * Apply alpha mask to image + * Get one style property * - * @param {Image} image - * @param {Image} alphaMask + * @param {number} control + * @param {number} property * - * @return {undefined} + * @return {number} The resulting int. */ -function ImageAlphaMask(image, alphaMask) { - const obj = r.BindImageAlphaMask( - image.data, - image.width, - image.height, - image.mipmaps, - image.format, - alphaMask.data, - alphaMask.width, - alphaMask.height, - alphaMask.mipmaps, - alphaMask.format +function GuiGetStyle(control, property) { + return r.BindGuiGetStyle( + control, + property ) - if (typeof obj !== 'undefined') { - for (const key in obj) { - image[key] = obj[key] - } - } } -raylib.ImageAlphaMask = ImageAlphaMask +raylib.GuiGetStyle = GuiGetStyle /** - * Premultiply alpha channel + * Window Box control, shows a window that can be closed * - * @param {Image} image + * @param {Rectangle} bounds + * @param {string} title * - * @return {undefined} + * @return {boolean} The resulting bool. */ -function ImageAlphaPremultiply(image) { - const obj = r.BindImageAlphaPremultiply( - image.data, - image.width, - image.height, - image.mipmaps, - image.format +function GuiWindowBox(bounds, title) { + return r.BindGuiWindowBox( + bounds.x, + bounds.y, + bounds.width, + bounds.height, + title ) - if (typeof obj !== 'undefined') { - for (const key in obj) { - image[key] = obj[key] - } - } } -raylib.ImageAlphaPremultiply = ImageAlphaPremultiply +raylib.GuiWindowBox = GuiWindowBox /** - * Resize image (Bicubic scaling algorithm) + * Group Box control with text name * - * @param {Image} image - * @param {number} newWidth - * @param {number} newHeight + * @param {Rectangle} bounds + * @param {string} text * * @return {undefined} */ -function ImageResize(image, newWidth, newHeight) { - const obj = r.BindImageResize( - image.data, - image.width, - image.height, - image.mipmaps, - image.format, - newWidth, - newHeight +function GuiGroupBox(bounds, text) { + return r.BindGuiGroupBox( + bounds.x, + bounds.y, + bounds.width, + bounds.height, + text ) - if (typeof obj !== 'undefined') { - for (const key in obj) { - image[key] = obj[key] - } - } } -raylib.ImageResize = ImageResize +raylib.GuiGroupBox = GuiGroupBox /** - * Resize image (Nearest-Neighbor scaling algorithm) + * Line separator control, could contain text * - * @param {Image} image - * @param {number} newWidth - * @param {number} newHeight + * @param {Rectangle} bounds + * @param {string} text * * @return {undefined} */ -function ImageResizeNN(image, newWidth, newHeight) { - const obj = r.BindImageResizeNN( - image.data, - image.width, - image.height, - image.mipmaps, - image.format, - newWidth, - newHeight +function GuiLine(bounds, text) { + return r.BindGuiLine( + bounds.x, + bounds.y, + bounds.width, + bounds.height, + text ) - if (typeof obj !== 'undefined') { - for (const key in obj) { - image[key] = obj[key] - } - } } -raylib.ImageResizeNN = ImageResizeNN +raylib.GuiLine = GuiLine /** - * Resize canvas and fill with color + * Panel control, useful to group controls * - * @param {Image} image - * @param {number} newWidth - * @param {number} newHeight - * @param {number} offsetX - * @param {number} offsetY - * @param {Color} fill + * @param {Rectangle} bounds * * @return {undefined} */ -function ImageResizeCanvas(image, newWidth, newHeight, offsetX, offsetY, fill) { - const obj = r.BindImageResizeCanvas( - image.data, - image.width, - image.height, - image.mipmaps, - image.format, - newWidth, - newHeight, - offsetX, - offsetY, - fill.r, - fill.g, - fill.b, - fill.a +function GuiPanel(bounds) { + return r.BindGuiPanel( + bounds.x, + bounds.y, + bounds.width, + bounds.height ) - if (typeof obj !== 'undefined') { - for (const key in obj) { - image[key] = obj[key] - } - } } -raylib.ImageResizeCanvas = ImageResizeCanvas +raylib.GuiPanel = GuiPanel /** - * Compute all mipmap levels for a provided image + * Scroll Panel control * - * @param {Image} image + * @param {Rectangle} bounds + * @param {Rectangle} content + * @param {number} scroll * - * @return {undefined} + * @return {Rectangle} The resulting Rectangle. */ -function ImageMipmaps(image) { - const obj = r.BindImageMipmaps( - image.data, - image.width, - image.height, - image.mipmaps, - image.format +function GuiScrollPanel(bounds, content, scroll) { + return r.BindGuiScrollPanel( + bounds.x, + bounds.y, + bounds.width, + bounds.height, + content.x, + content.y, + content.width, + content.height, + scroll ) - if (typeof obj !== 'undefined') { - for (const key in obj) { - image[key] = obj[key] - } - } } -raylib.ImageMipmaps = ImageMipmaps +raylib.GuiScrollPanel = GuiScrollPanel /** - * Dither image data to 16bpp or lower (Floyd-Steinberg dithering) + * Label control, shows text * - * @param {Image} image - * @param {number} rBpp - * @param {number} gBpp - * @param {number} bBpp - * @param {number} aBpp + * @param {Rectangle} bounds + * @param {string} text * * @return {undefined} */ -function ImageDither(image, rBpp, gBpp, bBpp, aBpp) { - const obj = r.BindImageDither( - image.data, - image.width, - image.height, - image.mipmaps, - image.format, - rBpp, - gBpp, - bBpp, - aBpp +function GuiLabel(bounds, text) { + return r.BindGuiLabel( + bounds.x, + bounds.y, + bounds.width, + bounds.height, + text ) - if (typeof obj !== 'undefined') { - for (const key in obj) { - image[key] = obj[key] - } - } } -raylib.ImageDither = ImageDither +raylib.GuiLabel = GuiLabel /** - * Flip image vertically + * Button control, returns true when clicked * - * @param {Image} image + * @param {Rectangle} bounds + * @param {string} text * - * @return {undefined} + * @return {boolean} The resulting bool. */ -function ImageFlipVertical(image) { - const obj = r.BindImageFlipVertical( - image.data, - image.width, - image.height, - image.mipmaps, - image.format +function GuiButton(bounds, text) { + return r.BindGuiButton( + bounds.x, + bounds.y, + bounds.width, + bounds.height, + text ) - if (typeof obj !== 'undefined') { - for (const key in obj) { - image[key] = obj[key] - } - } } -raylib.ImageFlipVertical = ImageFlipVertical +raylib.GuiButton = GuiButton /** - * Flip image horizontally + * Label button control, show true when clicked * - * @param {Image} image + * @param {Rectangle} bounds + * @param {string} text * - * @return {undefined} + * @return {boolean} The resulting bool. */ -function ImageFlipHorizontal(image) { - const obj = r.BindImageFlipHorizontal( - image.data, - image.width, - image.height, - image.mipmaps, - image.format +function GuiLabelButton(bounds, text) { + return r.BindGuiLabelButton( + bounds.x, + bounds.y, + bounds.width, + bounds.height, + text ) - if (typeof obj !== 'undefined') { - for (const key in obj) { - image[key] = obj[key] - } - } } -raylib.ImageFlipHorizontal = ImageFlipHorizontal +raylib.GuiLabelButton = GuiLabelButton /** - * Rotate image clockwise 90deg + * Toggle Button control, returns true when active * - * @param {Image} image + * @param {Rectangle} bounds + * @param {string} text + * @param {boolean} active * - * @return {undefined} + * @return {boolean} The resulting bool. */ -function ImageRotateCW(image) { - const obj = r.BindImageRotateCW( - image.data, - image.width, - image.height, - image.mipmaps, - image.format +function GuiToggle(bounds, text, active) { + return r.BindGuiToggle( + bounds.x, + bounds.y, + bounds.width, + bounds.height, + text, + active ) - if (typeof obj !== 'undefined') { - for (const key in obj) { - image[key] = obj[key] - } - } } -raylib.ImageRotateCW = ImageRotateCW +raylib.GuiToggle = GuiToggle /** - * Rotate image counter-clockwise 90deg + * Toggle Group control, returns active toggle index * - * @param {Image} image + * @param {Rectangle} bounds + * @param {string} text + * @param {number} active * - * @return {undefined} + * @return {number} The resulting int. */ -function ImageRotateCCW(image) { - const obj = r.BindImageRotateCCW( - image.data, - image.width, - image.height, - image.mipmaps, - image.format +function GuiToggleGroup(bounds, text, active) { + return r.BindGuiToggleGroup( + bounds.x, + bounds.y, + bounds.width, + bounds.height, + text, + active ) - if (typeof obj !== 'undefined') { - for (const key in obj) { - image[key] = obj[key] - } - } } -raylib.ImageRotateCCW = ImageRotateCCW +raylib.GuiToggleGroup = GuiToggleGroup /** - * Modify image color: tint + * Check Box control, returns true when active * - * @param {Image} image - * @param {Color} color + * @param {Rectangle} bounds + * @param {string} text + * @param {boolean} checked * - * @return {undefined} + * @return {boolean} The resulting bool. */ -function ImageColorTint(image, color) { - const obj = r.BindImageColorTint( - image.data, - image.width, - image.height, - image.mipmaps, - image.format, - color.r, - color.g, - color.b, - color.a +function GuiCheckBox(bounds, text, checked) { + return r.BindGuiCheckBox( + bounds.x, + bounds.y, + bounds.width, + bounds.height, + text, + checked ) - if (typeof obj !== 'undefined') { - for (const key in obj) { - image[key] = obj[key] - } - } } -raylib.ImageColorTint = ImageColorTint +raylib.GuiCheckBox = GuiCheckBox /** - * Modify image color: invert + * Combo Box control, returns selected item index * - * @param {Image} image + * @param {Rectangle} bounds + * @param {string} text + * @param {number} active * - * @return {undefined} + * @return {number} The resulting int. */ -function ImageColorInvert(image) { - const obj = r.BindImageColorInvert( - image.data, - image.width, - image.height, - image.mipmaps, - image.format +function GuiComboBox(bounds, text, active) { + return r.BindGuiComboBox( + bounds.x, + bounds.y, + bounds.width, + bounds.height, + text, + active ) - if (typeof obj !== 'undefined') { - for (const key in obj) { - image[key] = obj[key] - } - } } -raylib.ImageColorInvert = ImageColorInvert +raylib.GuiComboBox = GuiComboBox /** - * Modify image color: grayscale + * Dropdown Box control, returns selected item * - * @param {Image} image + * @param {Rectangle} bounds + * @param {string} text + * @param {number} active + * @param {boolean} editMode * - * @return {undefined} + * @return {boolean} The resulting bool. */ -function ImageColorGrayscale(image) { - const obj = r.BindImageColorGrayscale( - image.data, - image.width, - image.height, - image.mipmaps, - image.format +function GuiDropdownBox(bounds, text, active, editMode) { + return r.BindGuiDropdownBox( + bounds.x, + bounds.y, + bounds.width, + bounds.height, + text, + active, + editMode ) - if (typeof obj !== 'undefined') { - for (const key in obj) { - image[key] = obj[key] - } - } } -raylib.ImageColorGrayscale = ImageColorGrayscale +raylib.GuiDropdownBox = GuiDropdownBox /** - * Modify image color: contrast (-100 to 100) + * Spinner control, returns selected value * - * @param {Image} image - * @param {number} contrast + * @param {Rectangle} bounds + * @param {string} text + * @param {number} value + * @param {number} minValue + * @param {number} maxValue + * @param {boolean} editMode * - * @return {undefined} + * @return {boolean} The resulting bool. */ -function ImageColorContrast(image, contrast) { - const obj = r.BindImageColorContrast( - image.data, - image.width, - image.height, - image.mipmaps, - image.format, - contrast +function GuiSpinner(bounds, text, value, minValue, maxValue, editMode) { + return r.BindGuiSpinner( + bounds.x, + bounds.y, + bounds.width, + bounds.height, + text, + value, + minValue, + maxValue, + editMode ) - if (typeof obj !== 'undefined') { - for (const key in obj) { - image[key] = obj[key] - } - } } -raylib.ImageColorContrast = ImageColorContrast +raylib.GuiSpinner = GuiSpinner /** - * Modify image color: brightness (-255 to 255) + * Value Box control, updates input text with numbers * - * @param {Image} image - * @param {number} brightness + * @param {Rectangle} bounds + * @param {string} text + * @param {number} value + * @param {number} minValue + * @param {number} maxValue + * @param {boolean} editMode * - * @return {undefined} + * @return {boolean} The resulting bool. */ -function ImageColorBrightness(image, brightness) { - const obj = r.BindImageColorBrightness( - image.data, - image.width, - image.height, - image.mipmaps, - image.format, - brightness +function GuiValueBox(bounds, text, value, minValue, maxValue, editMode) { + return r.BindGuiValueBox( + bounds.x, + bounds.y, + bounds.width, + bounds.height, + text, + value, + minValue, + maxValue, + editMode ) - if (typeof obj !== 'undefined') { - for (const key in obj) { - image[key] = obj[key] - } - } } -raylib.ImageColorBrightness = ImageColorBrightness +raylib.GuiValueBox = GuiValueBox /** - * Modify image color: replace color + * Text Box control, updates input text * - * @param {Image} image - * @param {Color} color - * @param {Color} replace + * @param {Rectangle} bounds + * @param {string} text + * @param {number} textSize + * @param {boolean} editMode * - * @return {undefined} + * @return {boolean} The resulting bool. */ -function ImageColorReplace(image, color, replace) { - const obj = r.BindImageColorReplace( - image.data, - image.width, - image.height, - image.mipmaps, - image.format, - color.r, - color.g, - color.b, - color.a, - replace.r, - replace.g, - replace.b, - replace.a +function GuiTextBox(bounds, text, textSize, editMode) { + return r.BindGuiTextBox( + bounds.x, + bounds.y, + bounds.width, + bounds.height, + text, + textSize, + editMode ) - if (typeof obj !== 'undefined') { - for (const key in obj) { - image[key] = obj[key] - } - } } -raylib.ImageColorReplace = ImageColorReplace +raylib.GuiTextBox = GuiTextBox /** - * Clear image background with given color + * Text Box control with multiple lines * - * @param {Image} dst - * @param {Color} color + * @param {Rectangle} bounds + * @param {string} text + * @param {number} textSize + * @param {boolean} editMode * - * @return {undefined} + * @return {boolean} The resulting bool. */ -function ImageClearBackground(dst, color) { - const obj = r.BindImageClearBackground( - dst.data, - dst.width, - dst.height, - dst.mipmaps, - dst.format, - color.r, - color.g, - color.b, - color.a +function GuiTextBoxMulti(bounds, text, textSize, editMode) { + return r.BindGuiTextBoxMulti( + bounds.x, + bounds.y, + bounds.width, + bounds.height, + text, + textSize, + editMode ) - if (typeof obj !== 'undefined') { - for (const key in obj) { - dst[key] = obj[key] - } - } } -raylib.ImageClearBackground = ImageClearBackground +raylib.GuiTextBoxMulti = GuiTextBoxMulti /** - * Draw pixel within an image + * Slider control, returns selected value * - * @param {Image} dst - * @param {number} posX - * @param {number} posY - * @param {Color} color + * @param {Rectangle} bounds + * @param {string} textLeft + * @param {string} textRight + * @param {number} value + * @param {number} minValue + * @param {number} maxValue * - * @return {undefined} + * @return {number} The resulting float. */ -function ImageDrawPixel(dst, posX, posY, color) { - const obj = r.BindImageDrawPixel( - dst.data, - dst.width, - dst.height, - dst.mipmaps, - dst.format, - posX, - posY, - color.r, - color.g, - color.b, - color.a +function GuiSlider(bounds, textLeft, textRight, value, minValue, maxValue) { + return r.BindGuiSlider( + bounds.x, + bounds.y, + bounds.width, + bounds.height, + textLeft, + textRight, + value, + minValue, + maxValue ) - if (typeof obj !== 'undefined') { - for (const key in obj) { - dst[key] = obj[key] - } - } } -raylib.ImageDrawPixel = ImageDrawPixel +raylib.GuiSlider = GuiSlider /** - * Draw pixel within an image (Vector version) + * Slider Bar control, returns selected value * - * @param {Image} dst - * @param {Vector2} position - * @param {Color} color + * @param {Rectangle} bounds + * @param {string} textLeft + * @param {string} textRight + * @param {number} value + * @param {number} minValue + * @param {number} maxValue * - * @return {undefined} + * @return {number} The resulting float. */ -function ImageDrawPixelV(dst, position, color) { - const obj = r.BindImageDrawPixelV( - dst.data, - dst.width, - dst.height, - dst.mipmaps, - dst.format, - position.x, - position.y, - color.r, - color.g, - color.b, - color.a +function GuiSliderBar(bounds, textLeft, textRight, value, minValue, maxValue) { + return r.BindGuiSliderBar( + bounds.x, + bounds.y, + bounds.width, + bounds.height, + textLeft, + textRight, + value, + minValue, + maxValue ) - if (typeof obj !== 'undefined') { - for (const key in obj) { - dst[key] = obj[key] - } - } } -raylib.ImageDrawPixelV = ImageDrawPixelV +raylib.GuiSliderBar = GuiSliderBar /** - * Draw line within an image + * Progress Bar control, shows current progress value * - * @param {Image} dst - * @param {number} startPosX - * @param {number} startPosY - * @param {number} endPosX - * @param {number} endPosY - * @param {Color} color + * @param {Rectangle} bounds + * @param {string} textLeft + * @param {string} textRight + * @param {number} value + * @param {number} minValue + * @param {number} maxValue * - * @return {undefined} + * @return {number} The resulting float. */ -function ImageDrawLine(dst, startPosX, startPosY, endPosX, endPosY, color) { - const obj = r.BindImageDrawLine( - dst.data, - dst.width, - dst.height, - dst.mipmaps, - dst.format, - startPosX, - startPosY, - endPosX, - endPosY, - color.r, - color.g, - color.b, - color.a +function GuiProgressBar(bounds, textLeft, textRight, value, minValue, maxValue) { + return r.BindGuiProgressBar( + bounds.x, + bounds.y, + bounds.width, + bounds.height, + textLeft, + textRight, + value, + minValue, + maxValue ) - if (typeof obj !== 'undefined') { - for (const key in obj) { - dst[key] = obj[key] - } - } } -raylib.ImageDrawLine = ImageDrawLine +raylib.GuiProgressBar = GuiProgressBar /** - * Draw line within an image (Vector version) + * Status Bar control, shows info text * - * @param {Image} dst - * @param {Vector2} start - * @param {Vector2} end - * @param {Color} color + * @param {Rectangle} bounds + * @param {string} text * * @return {undefined} */ -function ImageDrawLineV(dst, start, end, color) { - const obj = r.BindImageDrawLineV( - dst.data, - dst.width, - dst.height, - dst.mipmaps, - dst.format, - start.x, - start.y, - end.x, - end.y, - color.r, - color.g, - color.b, - color.a +function GuiStatusBar(bounds, text) { + return r.BindGuiStatusBar( + bounds.x, + bounds.y, + bounds.width, + bounds.height, + text ) - if (typeof obj !== 'undefined') { - for (const key in obj) { - dst[key] = obj[key] - } - } } -raylib.ImageDrawLineV = ImageDrawLineV +raylib.GuiStatusBar = GuiStatusBar /** - * Draw circle within an image + * Dummy control for placeholders * - * @param {Image} dst - * @param {number} centerX - * @param {number} centerY - * @param {number} radius - * @param {Color} color + * @param {Rectangle} bounds + * @param {string} text * * @return {undefined} */ -function ImageDrawCircle(dst, centerX, centerY, radius, color) { - const obj = r.BindImageDrawCircle( - dst.data, - dst.width, - dst.height, - dst.mipmaps, - dst.format, - centerX, - centerY, - radius, - color.r, - color.g, - color.b, - color.a +function GuiDummyRec(bounds, text) { + return r.BindGuiDummyRec( + bounds.x, + bounds.y, + bounds.width, + bounds.height, + text ) - if (typeof obj !== 'undefined') { - for (const key in obj) { - dst[key] = obj[key] - } - } } -raylib.ImageDrawCircle = ImageDrawCircle +raylib.GuiDummyRec = GuiDummyRec /** - * Draw circle within an image (Vector version) + * Scroll Bar control * - * @param {Image} dst - * @param {Vector2} center - * @param {number} radius - * @param {Color} color + * @param {Rectangle} bounds + * @param {number} value + * @param {number} minValue + * @param {number} maxValue * - * @return {undefined} + * @return {number} The resulting int. */ -function ImageDrawCircleV(dst, center, radius, color) { - const obj = r.BindImageDrawCircleV( - dst.data, - dst.width, - dst.height, - dst.mipmaps, - dst.format, - center.x, - center.y, - radius, - color.r, - color.g, - color.b, - color.a +function GuiScrollBar(bounds, value, minValue, maxValue) { + return r.BindGuiScrollBar( + bounds.x, + bounds.y, + bounds.width, + bounds.height, + value, + minValue, + maxValue ) - if (typeof obj !== 'undefined') { - for (const key in obj) { - dst[key] = obj[key] - } - } } -raylib.ImageDrawCircleV = ImageDrawCircleV +raylib.GuiScrollBar = GuiScrollBar /** - * Draw rectangle within an image + * Grid control * - * @param {Image} dst - * @param {number} posX - * @param {number} posY - * @param {number} width - * @param {number} height - * @param {Color} color + * @param {Rectangle} bounds + * @param {number} spacing + * @param {number} subdivs * - * @return {undefined} + * @return {Vector2} The resulting Vector2. */ -function ImageDrawRectangle(dst, posX, posY, width, height, color) { - const obj = r.BindImageDrawRectangle( - dst.data, - dst.width, - dst.height, - dst.mipmaps, - dst.format, - posX, - posY, - width, - height, - color.r, - color.g, - color.b, - color.a +function GuiGrid(bounds, spacing, subdivs) { + return r.BindGuiGrid( + bounds.x, + bounds.y, + bounds.width, + bounds.height, + spacing, + subdivs ) - if (typeof obj !== 'undefined') { - for (const key in obj) { - dst[key] = obj[key] - } - } } -raylib.ImageDrawRectangle = ImageDrawRectangle +raylib.GuiGrid = GuiGrid /** - * Draw rectangle within an image (Vector version) + * List View control, returns selected list item index * - * @param {Image} dst - * @param {Vector2} position - * @param {Vector2} size - * @param {Color} color + * @param {Rectangle} bounds + * @param {string} text + * @param {number} scrollIndex + * @param {number} active * - * @return {undefined} + * @return {number} The resulting int. */ -function ImageDrawRectangleV(dst, position, size, color) { - const obj = r.BindImageDrawRectangleV( - dst.data, - dst.width, - dst.height, - dst.mipmaps, - dst.format, - position.x, - position.y, - size.x, - size.y, - color.r, - color.g, - color.b, - color.a +function GuiListView(bounds, text, scrollIndex, active) { + return r.BindGuiListView( + bounds.x, + bounds.y, + bounds.width, + bounds.height, + text, + scrollIndex, + active ) - if (typeof obj !== 'undefined') { - for (const key in obj) { - dst[key] = obj[key] - } - } } -raylib.ImageDrawRectangleV = ImageDrawRectangleV +raylib.GuiListView = GuiListView /** - * Draw rectangle within an image + * List View with extended parameters * - * @param {Image} dst - * @param {Rectangle} rec + * @param {Rectangle} bounds + * @param {number} text + * @param {number} count + * @param {number} focus + * @param {number} scrollIndex + * @param {number} active + * + * @return {number} The resulting int. + */ +function GuiListViewEx(bounds, text, count, focus, scrollIndex, active) { + return r.BindGuiListViewEx( + bounds.x, + bounds.y, + bounds.width, + bounds.height, + text, + count, + focus, + scrollIndex, + active + ) +} +raylib.GuiListViewEx = GuiListViewEx + +/** + * Message Box control, displays a message + * + * @param {Rectangle} bounds + * @param {string} title + * @param {string} message + * @param {string} buttons + * + * @return {number} The resulting int. + */ +function GuiMessageBox(bounds, title, message, buttons) { + return r.BindGuiMessageBox( + bounds.x, + bounds.y, + bounds.width, + bounds.height, + title, + message, + buttons + ) +} +raylib.GuiMessageBox = GuiMessageBox + +/** + * Text Input Box control, ask for text + * + * @param {Rectangle} bounds + * @param {string} title + * @param {string} message + * @param {string} buttons + * @param {string} text + * + * @return {number} The resulting int. + */ +function GuiTextInputBox(bounds, title, message, buttons, text) { + return r.BindGuiTextInputBox( + bounds.x, + bounds.y, + bounds.width, + bounds.height, + title, + message, + buttons, + text + ) +} +raylib.GuiTextInputBox = GuiTextInputBox + +/** + * Color Picker control (multiple color controls) + * + * @param {Rectangle} bounds * @param {Color} color * - * @return {undefined} + * @return {Color} The resulting Color. */ -function ImageDrawRectangleRec(dst, rec, color) { - const obj = r.BindImageDrawRectangleRec( - dst.data, - dst.width, - dst.height, - dst.mipmaps, - dst.format, - rec.x, - rec.y, - rec.width, - rec.height, +function GuiColorPicker(bounds, color) { + return r.BindGuiColorPicker( + bounds.x, + bounds.y, + bounds.width, + bounds.height, color.r, color.g, color.b, color.a ) - if (typeof obj !== 'undefined') { - for (const key in obj) { - dst[key] = obj[key] - } - } } -raylib.ImageDrawRectangleRec = ImageDrawRectangleRec +raylib.GuiColorPicker = GuiColorPicker /** - * Draw rectangle lines within an image + * Color Panel control * - * @param {Image} dst - * @param {Rectangle} rec - * @param {number} thick + * @param {Rectangle} bounds * @param {Color} color * - * @return {undefined} + * @return {Color} The resulting Color. */ -function ImageDrawRectangleLines(dst, rec, thick, color) { - const obj = r.BindImageDrawRectangleLines( - dst.data, - dst.width, - dst.height, - dst.mipmaps, - dst.format, - rec.x, - rec.y, - rec.width, - rec.height, - thick, +function GuiColorPanel(bounds, color) { + return r.BindGuiColorPanel( + bounds.x, + bounds.y, + bounds.width, + bounds.height, color.r, color.g, color.b, color.a ) - if (typeof obj !== 'undefined') { - for (const key in obj) { - dst[key] = obj[key] - } - } } -raylib.ImageDrawRectangleLines = ImageDrawRectangleLines +raylib.GuiColorPanel = GuiColorPanel /** - * Draw a source image within a destination image (tint applied to source) + * Color Bar Alpha control * - * @param {Image} dst - * @param {Image} src - * @param {Rectangle} srcRec - * @param {Rectangle} dstRec - * @param {Color} tint + * @param {Rectangle} bounds + * @param {number} alpha + * + * @return {number} The resulting float. + */ +function GuiColorBarAlpha(bounds, alpha) { + return r.BindGuiColorBarAlpha( + bounds.x, + bounds.y, + bounds.width, + bounds.height, + alpha + ) +} +raylib.GuiColorBarAlpha = GuiColorBarAlpha + +/** + * Color Bar Hue control + * + * @param {Rectangle} bounds + * @param {number} value + * + * @return {number} The resulting float. + */ +function GuiColorBarHue(bounds, value) { + return r.BindGuiColorBarHue( + bounds.x, + bounds.y, + bounds.width, + bounds.height, + value + ) +} +raylib.GuiColorBarHue = GuiColorBarHue + +/** + * Load style file over global style variable (.rgs) + * + * @param {string} fileName * * @return {undefined} */ -function ImageDraw(dst, src, srcRec, dstRec, tint) { - const obj = r.BindImageDraw( - dst.data, - dst.width, - dst.height, - dst.mipmaps, - dst.format, - src.data, - src.width, - src.height, - src.mipmaps, - src.format, - srcRec.x, - srcRec.y, - srcRec.width, - srcRec.height, - dstRec.x, - dstRec.y, - dstRec.width, - dstRec.height, - tint.r, - tint.g, - tint.b, - tint.a +function GuiLoadStyle(fileName) { + return r.BindGuiLoadStyle( + fileName ) - if (typeof obj !== 'undefined') { - for (const key in obj) { - dst[key] = obj[key] - } - } } -raylib.ImageDraw = ImageDraw +raylib.GuiLoadStyle = GuiLoadStyle /** - * Draw text (using default font) within an image (destination) + * Load style default over global style * - * @param {Image} dst + * @return {undefined} + */ +function GuiLoadStyleDefault() { + return r.BindGuiLoadStyleDefault() +} +raylib.GuiLoadStyleDefault = GuiLoadStyleDefault + +/** + * Get text with icon id prepended (if supported) + * + * @param {number} iconId * @param {string} text - * @param {number} posX - * @param {number} posY - * @param {number} fontSize - * @param {Color} color * - * @return {undefined} + * @return {string} The resulting const char *. */ -function ImageDrawText(dst, text, posX, posY, fontSize, color) { - const obj = r.BindImageDrawText( - dst.data, - dst.width, - dst.height, - dst.mipmaps, - dst.format, - text, +function GuiIconText(iconId, text) { + return r.BindGuiIconText( + iconId, + text + ) +} +raylib.GuiIconText = GuiIconText + +function GuiDrawIcon(iconId, posX, posY, pixelSize, color) { + return r.BindGuiDrawIcon( + iconId, posX, posY, - fontSize, + pixelSize, color.r, color.g, color.b, color.a ) - if (typeof obj !== 'undefined') { - for (const key in obj) { - dst[key] = obj[key] - } - } } -raylib.ImageDrawText = ImageDrawText +raylib.GuiDrawIcon = GuiDrawIcon /** - * Draw text (custom sprite font) within an image (destination) + * Get full icons data pointer * - * @param {Image} dst - * @param {Font} font - * @param {string} text - * @param {Vector2} position - * @param {number} fontSize - * @param {number} spacing - * @param {Color} tint + * @return {number} The resulting unsigned int *. + */ +function GuiGetIcons() { + return r.BindGuiGetIcons() +} +raylib.GuiGetIcons = GuiGetIcons + +/** + * Get icon bit data * - * @return {undefined} + * @param {number} iconId + * + * @return {number} The resulting unsigned int *. */ -function ImageDrawTextEx(dst, font, text, position, fontSize, spacing, tint) { - const obj = r.BindImageDrawTextEx( - dst.data, - dst.width, - dst.height, - dst.mipmaps, - dst.format, - font.baseSize, - font.glyphCount, - font.glyphPadding, - font.texture.id, - font.texture.width, - font.texture.height, - font.texture.mipmaps, - font.texture.format, - font.recs, - font.glyphs, - text, - position.x, - position.y, - fontSize, - spacing, - tint.r, - tint.g, - tint.b, - tint.a +function GuiGetIconData(iconId) { + return r.BindGuiGetIconData( + iconId ) - if (typeof obj !== 'undefined') { - for (const key in obj) { - dst[key] = obj[key] - } - } } -raylib.ImageDrawTextEx = ImageDrawTextEx +raylib.GuiGetIconData = GuiGetIconData /** - * Generate GPU mipmaps for a texture + * Set icon bit data * - * @param {Texture2D} texture + * @param {number} iconId + * @param {number} data * * @return {undefined} */ -function GenTextureMipmaps(texture) { - const obj = r.BindGenTextureMipmaps( - texture.id, - texture.width, - texture.height, - texture.mipmaps, - texture.format +function GuiSetIconData(iconId, data) { + return r.BindGuiSetIconData( + iconId, + data ) - if (typeof obj !== 'undefined') { - for (const key in obj) { - texture[key] = obj[key] - } - } } -raylib.GenTextureMipmaps = GenTextureMipmaps +raylib.GuiSetIconData = GuiSetIconData /** - * Upload mesh vertex data in GPU and provide VAO/VBO ids + * Set icon pixel value * - * @param {Mesh} mesh - * @param {boolean} dynamic + * @param {number} iconId + * @param {number} x + * @param {number} y * * @return {undefined} */ -function UploadMesh(mesh, dynamic) { - const obj = r.BindUploadMesh( - mesh.vertexCount, - mesh.triangleCount, - mesh.vertices, - mesh.texcoords, - mesh.texcoords2, - mesh.normals, - mesh.tangents, - mesh.colors, - mesh.indices, - mesh.animVertices, - mesh.animNormals, - mesh.boneIds, - mesh.boneWeights, - mesh.vaoId, - mesh.vboId, - dynamic +function GuiSetIconPixel(iconId, x, y) { + return r.BindGuiSetIconPixel( + iconId, + x, + y + ) +} +raylib.GuiSetIconPixel = GuiSetIconPixel + +/** + * Clear icon pixel value + * + * @param {number} iconId + * @param {number} x + * @param {number} y + * + * @return {undefined} + */ +function GuiClearIconPixel(iconId, x, y) { + return r.BindGuiClearIconPixel( + iconId, + x, + y + ) +} +raylib.GuiClearIconPixel = GuiClearIconPixel + +/** + * Check icon pixel value + * + * @param {number} iconId + * @param {number} x + * @param {number} y + * + * @return {boolean} The resulting bool. + */ +function GuiCheckIconPixel(iconId, x, y) { + return r.BindGuiCheckIconPixel( + iconId, + x, + y + ) +} +raylib.GuiCheckIconPixel = GuiCheckIconPixel + +/** + * Update camera position for selected mode + * + * @param {Camera} camera + * + * @return {undefined} + */ +function UpdateCamera(camera) { + const obj = r.BindUpdateCamera( + camera.position.x, + camera.position.y, + camera.position.z, + camera.target.x, + camera.target.y, + camera.target.z, + camera.up.x, + camera.up.y, + camera.up.z, + camera.fovy, + camera.projection ) if (typeof obj !== 'undefined') { for (const key in obj) { - mesh[key] = obj[key] + camera[key] = obj[key] } } } -raylib.UploadMesh = UploadMesh +raylib.UpdateCamera = UpdateCamera /** - * Compute mesh tangents + * Convert image data to desired format * - * @param {Mesh} mesh + * @param {Image} image + * @param {number} newFormat * * @return {undefined} */ -function GenMeshTangents(mesh) { - const obj = r.BindGenMeshTangents( - mesh.vertexCount, - mesh.triangleCount, - mesh.vertices, - mesh.texcoords, - mesh.texcoords2, - mesh.normals, - mesh.tangents, - mesh.colors, - mesh.indices, - mesh.animVertices, - mesh.animNormals, - mesh.boneIds, - mesh.boneWeights, - mesh.vaoId, - mesh.vboId +function ImageFormat(image, newFormat) { + const obj = r.BindImageFormat( + image.data, + image.width, + image.height, + image.mipmaps, + image.format, + newFormat ) if (typeof obj !== 'undefined') { for (const key in obj) { - mesh[key] = obj[key] + image[key] = obj[key] } } } -raylib.GenMeshTangents = GenMeshTangents +raylib.ImageFormat = ImageFormat /** - * Compute mesh binormals + * Convert image to POT (power-of-two) * - * @param {Mesh} mesh + * @param {Image} image + * @param {Color} fill * * @return {undefined} */ -function GenMeshBinormals(mesh) { - const obj = r.BindGenMeshBinormals( - mesh.vertexCount, - mesh.triangleCount, - mesh.vertices, - mesh.texcoords, - mesh.texcoords2, - mesh.normals, - mesh.tangents, - mesh.colors, - mesh.indices, - mesh.animVertices, - mesh.animNormals, - mesh.boneIds, - mesh.boneWeights, - mesh.vaoId, - mesh.vboId +function ImageToPOT(image, fill) { + const obj = r.BindImageToPOT( + image.data, + image.width, + image.height, + image.mipmaps, + image.format, + fill.r, + fill.g, + fill.b, + fill.a ) if (typeof obj !== 'undefined') { for (const key in obj) { - mesh[key] = obj[key] + image[key] = obj[key] } } } -raylib.GenMeshBinormals = GenMeshBinormals +raylib.ImageToPOT = ImageToPOT /** - * Set material for a mesh + * Crop an image to a defined rectangle * - * @param {Model} model - * @param {number} meshId - * @param {number} materialId + * @param {Image} image + * @param {Rectangle} crop * * @return {undefined} */ -function SetModelMeshMaterial(model, meshId, materialId) { - const obj = r.BindSetModelMeshMaterial( - model.transform.m0, - model.transform.m4, - model.transform.m8, - model.transform.m12, - model.transform.m1, - model.transform.m5, - model.transform.m9, - model.transform.m13, - model.transform.m2, - model.transform.m6, - model.transform.m10, - model.transform.m14, - model.transform.m3, - model.transform.m7, - model.transform.m11, - model.transform.m15, - model.meshCount, - model.materialCount, - model.meshes, - model.materials, - model.meshMaterial, - model.boneCount, - model.bones, - model.bindPose, - meshId, - materialId +function ImageCrop(image, crop) { + const obj = r.BindImageCrop( + image.data, + image.width, + image.height, + image.mipmaps, + image.format, + crop.x, + crop.y, + crop.width, + crop.height ) if (typeof obj !== 'undefined') { for (const key in obj) { - model[key] = obj[key] + image[key] = obj[key] } } } -raylib.SetModelMeshMaterial = SetModelMeshMaterial +raylib.ImageCrop = ImageCrop /** - * Convert wave data to desired format + * Crop image depending on alpha value * - * @param {Wave} wave - * @param {number} sampleRate - * @param {number} sampleSize - * @param {number} channels + * @param {Image} image + * @param {number} threshold * * @return {undefined} */ -function WaveFormat(wave, sampleRate, sampleSize, channels) { - const obj = r.BindWaveFormat( - wave.frameCount, - wave.sampleRate, - wave.sampleSize, - wave.channels, - wave.data, - sampleRate, - sampleSize, - channels +function ImageAlphaCrop(image, threshold) { + const obj = r.BindImageAlphaCrop( + image.data, + image.width, + image.height, + image.mipmaps, + image.format, + threshold ) if (typeof obj !== 'undefined') { for (const key in obj) { - wave[key] = obj[key] + image[key] = obj[key] } } } -raylib.WaveFormat = WaveFormat +raylib.ImageAlphaCrop = ImageAlphaCrop /** - * Crop a wave to defined samples range + * Clear alpha channel to desired color * - * @param {Wave} wave - * @param {number} initSample - * @param {number} finalSample + * @param {Image} image + * @param {Color} color + * @param {number} threshold * * @return {undefined} */ -function WaveCrop(wave, initSample, finalSample) { - const obj = r.BindWaveCrop( - wave.frameCount, - wave.sampleRate, - wave.sampleSize, - wave.channels, - wave.data, - initSample, - finalSample +function ImageAlphaClear(image, color, threshold) { + const obj = r.BindImageAlphaClear( + image.data, + image.width, + image.height, + image.mipmaps, + image.format, + color.r, + color.g, + color.b, + color.a, + threshold ) if (typeof obj !== 'undefined') { for (const key in obj) { - wave[key] = obj[key] + image[key] = obj[key] } } } -raylib.WaveCrop = WaveCrop +raylib.ImageAlphaClear = ImageAlphaClear /** - * Color, 4 components, R8G8B8A8 (32bit) + * Apply alpha mask to image * - * @param {number} r - Color red value - * @param {number} g - Color green value - * @param {number} b - Color blue value - * @param {number} a - Color alpha value + * @param {Image} image + * @param {Image} alphaMask * - * @return {Color} The new Color. + * @return {undefined} */ -function Color(r,g,b,a) { - return {r,g,b,a} +function ImageAlphaMask(image, alphaMask) { + const obj = r.BindImageAlphaMask( + image.data, + image.width, + image.height, + image.mipmaps, + image.format, + alphaMask.data, + alphaMask.width, + alphaMask.height, + alphaMask.mipmaps, + alphaMask.format + ) + if (typeof obj !== 'undefined') { + for (const key in obj) { + image[key] = obj[key] + } + } } -raylib.Color = Color +raylib.ImageAlphaMask = ImageAlphaMask /** - * Vector2, 2 components + * Premultiply alpha channel * - * @param {number} x - Vector x component - * @param {number} y - Vector y component + * @param {Image} image * - * @return {Vector2} The new Vector2. + * @return {undefined} + */ +function ImageAlphaPremultiply(image) { + const obj = r.BindImageAlphaPremultiply( + image.data, + image.width, + image.height, + image.mipmaps, + image.format + ) + if (typeof obj !== 'undefined') { + for (const key in obj) { + image[key] = obj[key] + } + } +} +raylib.ImageAlphaPremultiply = ImageAlphaPremultiply + +/** + * Resize image (Bicubic scaling algorithm) + * + * @param {Image} image + * @param {number} newWidth + * @param {number} newHeight + * + * @return {undefined} + */ +function ImageResize(image, newWidth, newHeight) { + const obj = r.BindImageResize( + image.data, + image.width, + image.height, + image.mipmaps, + image.format, + newWidth, + newHeight + ) + if (typeof obj !== 'undefined') { + for (const key in obj) { + image[key] = obj[key] + } + } +} +raylib.ImageResize = ImageResize + +/** + * Resize image (Nearest-Neighbor scaling algorithm) + * + * @param {Image} image + * @param {number} newWidth + * @param {number} newHeight + * + * @return {undefined} + */ +function ImageResizeNN(image, newWidth, newHeight) { + const obj = r.BindImageResizeNN( + image.data, + image.width, + image.height, + image.mipmaps, + image.format, + newWidth, + newHeight + ) + if (typeof obj !== 'undefined') { + for (const key in obj) { + image[key] = obj[key] + } + } +} +raylib.ImageResizeNN = ImageResizeNN + +/** + * Resize canvas and fill with color + * + * @param {Image} image + * @param {number} newWidth + * @param {number} newHeight + * @param {number} offsetX + * @param {number} offsetY + * @param {Color} fill + * + * @return {undefined} + */ +function ImageResizeCanvas(image, newWidth, newHeight, offsetX, offsetY, fill) { + const obj = r.BindImageResizeCanvas( + image.data, + image.width, + image.height, + image.mipmaps, + image.format, + newWidth, + newHeight, + offsetX, + offsetY, + fill.r, + fill.g, + fill.b, + fill.a + ) + if (typeof obj !== 'undefined') { + for (const key in obj) { + image[key] = obj[key] + } + } +} +raylib.ImageResizeCanvas = ImageResizeCanvas + +/** + * Compute all mipmap levels for a provided image + * + * @param {Image} image + * + * @return {undefined} + */ +function ImageMipmaps(image) { + const obj = r.BindImageMipmaps( + image.data, + image.width, + image.height, + image.mipmaps, + image.format + ) + if (typeof obj !== 'undefined') { + for (const key in obj) { + image[key] = obj[key] + } + } +} +raylib.ImageMipmaps = ImageMipmaps + +/** + * Dither image data to 16bpp or lower (Floyd-Steinberg dithering) + * + * @param {Image} image + * @param {number} rBpp + * @param {number} gBpp + * @param {number} bBpp + * @param {number} aBpp + * + * @return {undefined} + */ +function ImageDither(image, rBpp, gBpp, bBpp, aBpp) { + const obj = r.BindImageDither( + image.data, + image.width, + image.height, + image.mipmaps, + image.format, + rBpp, + gBpp, + bBpp, + aBpp + ) + if (typeof obj !== 'undefined') { + for (const key in obj) { + image[key] = obj[key] + } + } +} +raylib.ImageDither = ImageDither + +/** + * Flip image vertically + * + * @param {Image} image + * + * @return {undefined} + */ +function ImageFlipVertical(image) { + const obj = r.BindImageFlipVertical( + image.data, + image.width, + image.height, + image.mipmaps, + image.format + ) + if (typeof obj !== 'undefined') { + for (const key in obj) { + image[key] = obj[key] + } + } +} +raylib.ImageFlipVertical = ImageFlipVertical + +/** + * Flip image horizontally + * + * @param {Image} image + * + * @return {undefined} + */ +function ImageFlipHorizontal(image) { + const obj = r.BindImageFlipHorizontal( + image.data, + image.width, + image.height, + image.mipmaps, + image.format + ) + if (typeof obj !== 'undefined') { + for (const key in obj) { + image[key] = obj[key] + } + } +} +raylib.ImageFlipHorizontal = ImageFlipHorizontal + +/** + * Rotate image clockwise 90deg + * + * @param {Image} image + * + * @return {undefined} + */ +function ImageRotateCW(image) { + const obj = r.BindImageRotateCW( + image.data, + image.width, + image.height, + image.mipmaps, + image.format + ) + if (typeof obj !== 'undefined') { + for (const key in obj) { + image[key] = obj[key] + } + } +} +raylib.ImageRotateCW = ImageRotateCW + +/** + * Rotate image counter-clockwise 90deg + * + * @param {Image} image + * + * @return {undefined} + */ +function ImageRotateCCW(image) { + const obj = r.BindImageRotateCCW( + image.data, + image.width, + image.height, + image.mipmaps, + image.format + ) + if (typeof obj !== 'undefined') { + for (const key in obj) { + image[key] = obj[key] + } + } +} +raylib.ImageRotateCCW = ImageRotateCCW + +/** + * Modify image color: tint + * + * @param {Image} image + * @param {Color} color + * + * @return {undefined} + */ +function ImageColorTint(image, color) { + const obj = r.BindImageColorTint( + image.data, + image.width, + image.height, + image.mipmaps, + image.format, + color.r, + color.g, + color.b, + color.a + ) + if (typeof obj !== 'undefined') { + for (const key in obj) { + image[key] = obj[key] + } + } +} +raylib.ImageColorTint = ImageColorTint + +/** + * Modify image color: invert + * + * @param {Image} image + * + * @return {undefined} + */ +function ImageColorInvert(image) { + const obj = r.BindImageColorInvert( + image.data, + image.width, + image.height, + image.mipmaps, + image.format + ) + if (typeof obj !== 'undefined') { + for (const key in obj) { + image[key] = obj[key] + } + } +} +raylib.ImageColorInvert = ImageColorInvert + +/** + * Modify image color: grayscale + * + * @param {Image} image + * + * @return {undefined} + */ +function ImageColorGrayscale(image) { + const obj = r.BindImageColorGrayscale( + image.data, + image.width, + image.height, + image.mipmaps, + image.format + ) + if (typeof obj !== 'undefined') { + for (const key in obj) { + image[key] = obj[key] + } + } +} +raylib.ImageColorGrayscale = ImageColorGrayscale + +/** + * Modify image color: contrast (-100 to 100) + * + * @param {Image} image + * @param {number} contrast + * + * @return {undefined} + */ +function ImageColorContrast(image, contrast) { + const obj = r.BindImageColorContrast( + image.data, + image.width, + image.height, + image.mipmaps, + image.format, + contrast + ) + if (typeof obj !== 'undefined') { + for (const key in obj) { + image[key] = obj[key] + } + } +} +raylib.ImageColorContrast = ImageColorContrast + +/** + * Modify image color: brightness (-255 to 255) + * + * @param {Image} image + * @param {number} brightness + * + * @return {undefined} + */ +function ImageColorBrightness(image, brightness) { + const obj = r.BindImageColorBrightness( + image.data, + image.width, + image.height, + image.mipmaps, + image.format, + brightness + ) + if (typeof obj !== 'undefined') { + for (const key in obj) { + image[key] = obj[key] + } + } +} +raylib.ImageColorBrightness = ImageColorBrightness + +/** + * Modify image color: replace color + * + * @param {Image} image + * @param {Color} color + * @param {Color} replace + * + * @return {undefined} + */ +function ImageColorReplace(image, color, replace) { + const obj = r.BindImageColorReplace( + image.data, + image.width, + image.height, + image.mipmaps, + image.format, + color.r, + color.g, + color.b, + color.a, + replace.r, + replace.g, + replace.b, + replace.a + ) + if (typeof obj !== 'undefined') { + for (const key in obj) { + image[key] = obj[key] + } + } +} +raylib.ImageColorReplace = ImageColorReplace + +/** + * Clear image background with given color + * + * @param {Image} dst + * @param {Color} color + * + * @return {undefined} + */ +function ImageClearBackground(dst, color) { + const obj = r.BindImageClearBackground( + dst.data, + dst.width, + dst.height, + dst.mipmaps, + dst.format, + color.r, + color.g, + color.b, + color.a + ) + if (typeof obj !== 'undefined') { + for (const key in obj) { + dst[key] = obj[key] + } + } +} +raylib.ImageClearBackground = ImageClearBackground + +/** + * Draw pixel within an image + * + * @param {Image} dst + * @param {number} posX + * @param {number} posY + * @param {Color} color + * + * @return {undefined} + */ +function ImageDrawPixel(dst, posX, posY, color) { + const obj = r.BindImageDrawPixel( + dst.data, + dst.width, + dst.height, + dst.mipmaps, + dst.format, + posX, + posY, + color.r, + color.g, + color.b, + color.a + ) + if (typeof obj !== 'undefined') { + for (const key in obj) { + dst[key] = obj[key] + } + } +} +raylib.ImageDrawPixel = ImageDrawPixel + +/** + * Draw pixel within an image (Vector version) + * + * @param {Image} dst + * @param {Vector2} position + * @param {Color} color + * + * @return {undefined} + */ +function ImageDrawPixelV(dst, position, color) { + const obj = r.BindImageDrawPixelV( + dst.data, + dst.width, + dst.height, + dst.mipmaps, + dst.format, + position.x, + position.y, + color.r, + color.g, + color.b, + color.a + ) + if (typeof obj !== 'undefined') { + for (const key in obj) { + dst[key] = obj[key] + } + } +} +raylib.ImageDrawPixelV = ImageDrawPixelV + +/** + * Draw line within an image + * + * @param {Image} dst + * @param {number} startPosX + * @param {number} startPosY + * @param {number} endPosX + * @param {number} endPosY + * @param {Color} color + * + * @return {undefined} + */ +function ImageDrawLine(dst, startPosX, startPosY, endPosX, endPosY, color) { + const obj = r.BindImageDrawLine( + dst.data, + dst.width, + dst.height, + dst.mipmaps, + dst.format, + startPosX, + startPosY, + endPosX, + endPosY, + color.r, + color.g, + color.b, + color.a + ) + if (typeof obj !== 'undefined') { + for (const key in obj) { + dst[key] = obj[key] + } + } +} +raylib.ImageDrawLine = ImageDrawLine + +/** + * Draw line within an image (Vector version) + * + * @param {Image} dst + * @param {Vector2} start + * @param {Vector2} end + * @param {Color} color + * + * @return {undefined} + */ +function ImageDrawLineV(dst, start, end, color) { + const obj = r.BindImageDrawLineV( + dst.data, + dst.width, + dst.height, + dst.mipmaps, + dst.format, + start.x, + start.y, + end.x, + end.y, + color.r, + color.g, + color.b, + color.a + ) + if (typeof obj !== 'undefined') { + for (const key in obj) { + dst[key] = obj[key] + } + } +} +raylib.ImageDrawLineV = ImageDrawLineV + +/** + * Draw circle within an image + * + * @param {Image} dst + * @param {number} centerX + * @param {number} centerY + * @param {number} radius + * @param {Color} color + * + * @return {undefined} + */ +function ImageDrawCircle(dst, centerX, centerY, radius, color) { + const obj = r.BindImageDrawCircle( + dst.data, + dst.width, + dst.height, + dst.mipmaps, + dst.format, + centerX, + centerY, + radius, + color.r, + color.g, + color.b, + color.a + ) + if (typeof obj !== 'undefined') { + for (const key in obj) { + dst[key] = obj[key] + } + } +} +raylib.ImageDrawCircle = ImageDrawCircle + +/** + * Draw circle within an image (Vector version) + * + * @param {Image} dst + * @param {Vector2} center + * @param {number} radius + * @param {Color} color + * + * @return {undefined} + */ +function ImageDrawCircleV(dst, center, radius, color) { + const obj = r.BindImageDrawCircleV( + dst.data, + dst.width, + dst.height, + dst.mipmaps, + dst.format, + center.x, + center.y, + radius, + color.r, + color.g, + color.b, + color.a + ) + if (typeof obj !== 'undefined') { + for (const key in obj) { + dst[key] = obj[key] + } + } +} +raylib.ImageDrawCircleV = ImageDrawCircleV + +/** + * Draw rectangle within an image + * + * @param {Image} dst + * @param {number} posX + * @param {number} posY + * @param {number} width + * @param {number} height + * @param {Color} color + * + * @return {undefined} + */ +function ImageDrawRectangle(dst, posX, posY, width, height, color) { + const obj = r.BindImageDrawRectangle( + dst.data, + dst.width, + dst.height, + dst.mipmaps, + dst.format, + posX, + posY, + width, + height, + color.r, + color.g, + color.b, + color.a + ) + if (typeof obj !== 'undefined') { + for (const key in obj) { + dst[key] = obj[key] + } + } +} +raylib.ImageDrawRectangle = ImageDrawRectangle + +/** + * Draw rectangle within an image (Vector version) + * + * @param {Image} dst + * @param {Vector2} position + * @param {Vector2} size + * @param {Color} color + * + * @return {undefined} + */ +function ImageDrawRectangleV(dst, position, size, color) { + const obj = r.BindImageDrawRectangleV( + dst.data, + dst.width, + dst.height, + dst.mipmaps, + dst.format, + position.x, + position.y, + size.x, + size.y, + color.r, + color.g, + color.b, + color.a + ) + if (typeof obj !== 'undefined') { + for (const key in obj) { + dst[key] = obj[key] + } + } +} +raylib.ImageDrawRectangleV = ImageDrawRectangleV + +/** + * Draw rectangle within an image + * + * @param {Image} dst + * @param {Rectangle} rec + * @param {Color} color + * + * @return {undefined} + */ +function ImageDrawRectangleRec(dst, rec, color) { + const obj = r.BindImageDrawRectangleRec( + dst.data, + dst.width, + dst.height, + dst.mipmaps, + dst.format, + rec.x, + rec.y, + rec.width, + rec.height, + color.r, + color.g, + color.b, + color.a + ) + if (typeof obj !== 'undefined') { + for (const key in obj) { + dst[key] = obj[key] + } + } +} +raylib.ImageDrawRectangleRec = ImageDrawRectangleRec + +/** + * Draw rectangle lines within an image + * + * @param {Image} dst + * @param {Rectangle} rec + * @param {number} thick + * @param {Color} color + * + * @return {undefined} + */ +function ImageDrawRectangleLines(dst, rec, thick, color) { + const obj = r.BindImageDrawRectangleLines( + dst.data, + dst.width, + dst.height, + dst.mipmaps, + dst.format, + rec.x, + rec.y, + rec.width, + rec.height, + thick, + color.r, + color.g, + color.b, + color.a + ) + if (typeof obj !== 'undefined') { + for (const key in obj) { + dst[key] = obj[key] + } + } +} +raylib.ImageDrawRectangleLines = ImageDrawRectangleLines + +/** + * Draw a source image within a destination image (tint applied to source) + * + * @param {Image} dst + * @param {Image} src + * @param {Rectangle} srcRec + * @param {Rectangle} dstRec + * @param {Color} tint + * + * @return {undefined} + */ +function ImageDraw(dst, src, srcRec, dstRec, tint) { + const obj = r.BindImageDraw( + dst.data, + dst.width, + dst.height, + dst.mipmaps, + dst.format, + src.data, + src.width, + src.height, + src.mipmaps, + src.format, + srcRec.x, + srcRec.y, + srcRec.width, + srcRec.height, + dstRec.x, + dstRec.y, + dstRec.width, + dstRec.height, + tint.r, + tint.g, + tint.b, + tint.a + ) + if (typeof obj !== 'undefined') { + for (const key in obj) { + dst[key] = obj[key] + } + } +} +raylib.ImageDraw = ImageDraw + +/** + * Draw text (using default font) within an image (destination) + * + * @param {Image} dst + * @param {string} text + * @param {number} posX + * @param {number} posY + * @param {number} fontSize + * @param {Color} color + * + * @return {undefined} + */ +function ImageDrawText(dst, text, posX, posY, fontSize, color) { + const obj = r.BindImageDrawText( + dst.data, + dst.width, + dst.height, + dst.mipmaps, + dst.format, + text, + posX, + posY, + fontSize, + color.r, + color.g, + color.b, + color.a + ) + if (typeof obj !== 'undefined') { + for (const key in obj) { + dst[key] = obj[key] + } + } +} +raylib.ImageDrawText = ImageDrawText + +/** + * Draw text (custom sprite font) within an image (destination) + * + * @param {Image} dst + * @param {Font} font + * @param {string} text + * @param {Vector2} position + * @param {number} fontSize + * @param {number} spacing + * @param {Color} tint + * + * @return {undefined} + */ +function ImageDrawTextEx(dst, font, text, position, fontSize, spacing, tint) { + const obj = r.BindImageDrawTextEx( + dst.data, + dst.width, + dst.height, + dst.mipmaps, + dst.format, + font.baseSize, + font.glyphCount, + font.glyphPadding, + font.texture.id, + font.texture.width, + font.texture.height, + font.texture.mipmaps, + font.texture.format, + font.recs, + font.glyphs, + text, + position.x, + position.y, + fontSize, + spacing, + tint.r, + tint.g, + tint.b, + tint.a + ) + if (typeof obj !== 'undefined') { + for (const key in obj) { + dst[key] = obj[key] + } + } +} +raylib.ImageDrawTextEx = ImageDrawTextEx + +/** + * Generate GPU mipmaps for a texture + * + * @param {Texture2D} texture + * + * @return {undefined} + */ +function GenTextureMipmaps(texture) { + const obj = r.BindGenTextureMipmaps( + texture.id, + texture.width, + texture.height, + texture.mipmaps, + texture.format + ) + if (typeof obj !== 'undefined') { + for (const key in obj) { + texture[key] = obj[key] + } + } +} +raylib.GenTextureMipmaps = GenTextureMipmaps + +/** + * Upload mesh vertex data in GPU and provide VAO/VBO ids + * + * @param {Mesh} mesh + * @param {boolean} dynamic + * + * @return {undefined} + */ +function UploadMesh(mesh, dynamic) { + const obj = r.BindUploadMesh( + mesh.vertexCount, + mesh.triangleCount, + mesh.vertices, + mesh.texcoords, + mesh.texcoords2, + mesh.normals, + mesh.tangents, + mesh.colors, + mesh.indices, + mesh.animVertices, + mesh.animNormals, + mesh.boneIds, + mesh.boneWeights, + mesh.vaoId, + mesh.vboId, + dynamic + ) + if (typeof obj !== 'undefined') { + for (const key in obj) { + mesh[key] = obj[key] + } + } +} +raylib.UploadMesh = UploadMesh + +/** + * Compute mesh tangents + * + * @param {Mesh} mesh + * + * @return {undefined} + */ +function GenMeshTangents(mesh) { + const obj = r.BindGenMeshTangents( + mesh.vertexCount, + mesh.triangleCount, + mesh.vertices, + mesh.texcoords, + mesh.texcoords2, + mesh.normals, + mesh.tangents, + mesh.colors, + mesh.indices, + mesh.animVertices, + mesh.animNormals, + mesh.boneIds, + mesh.boneWeights, + mesh.vaoId, + mesh.vboId + ) + if (typeof obj !== 'undefined') { + for (const key in obj) { + mesh[key] = obj[key] + } + } +} +raylib.GenMeshTangents = GenMeshTangents + +/** + * Compute mesh binormals + * + * @param {Mesh} mesh + * + * @return {undefined} + */ +function GenMeshBinormals(mesh) { + const obj = r.BindGenMeshBinormals( + mesh.vertexCount, + mesh.triangleCount, + mesh.vertices, + mesh.texcoords, + mesh.texcoords2, + mesh.normals, + mesh.tangents, + mesh.colors, + mesh.indices, + mesh.animVertices, + mesh.animNormals, + mesh.boneIds, + mesh.boneWeights, + mesh.vaoId, + mesh.vboId + ) + if (typeof obj !== 'undefined') { + for (const key in obj) { + mesh[key] = obj[key] + } + } +} +raylib.GenMeshBinormals = GenMeshBinormals + +/** + * Set material for a mesh + * + * @param {Model} model + * @param {number} meshId + * @param {number} materialId + * + * @return {undefined} + */ +function SetModelMeshMaterial(model, meshId, materialId) { + const obj = r.BindSetModelMeshMaterial( + model.transform.m0, + model.transform.m4, + model.transform.m8, + model.transform.m12, + model.transform.m1, + model.transform.m5, + model.transform.m9, + model.transform.m13, + model.transform.m2, + model.transform.m6, + model.transform.m10, + model.transform.m14, + model.transform.m3, + model.transform.m7, + model.transform.m11, + model.transform.m15, + model.meshCount, + model.materialCount, + model.meshes, + model.materials, + model.meshMaterial, + model.boneCount, + model.bones, + model.bindPose, + meshId, + materialId + ) + if (typeof obj !== 'undefined') { + for (const key in obj) { + model[key] = obj[key] + } + } +} +raylib.SetModelMeshMaterial = SetModelMeshMaterial + +/** + * Convert wave data to desired format + * + * @param {Wave} wave + * @param {number} sampleRate + * @param {number} sampleSize + * @param {number} channels + * + * @return {undefined} + */ +function WaveFormat(wave, sampleRate, sampleSize, channels) { + const obj = r.BindWaveFormat( + wave.frameCount, + wave.sampleRate, + wave.sampleSize, + wave.channels, + wave.data, + sampleRate, + sampleSize, + channels + ) + if (typeof obj !== 'undefined') { + for (const key in obj) { + wave[key] = obj[key] + } + } +} +raylib.WaveFormat = WaveFormat + +/** + * Crop a wave to defined samples range + * + * @param {Wave} wave + * @param {number} initSample + * @param {number} finalSample + * + * @return {undefined} + */ +function WaveCrop(wave, initSample, finalSample) { + const obj = r.BindWaveCrop( + wave.frameCount, + wave.sampleRate, + wave.sampleSize, + wave.channels, + wave.data, + initSample, + finalSample + ) + if (typeof obj !== 'undefined') { + for (const key in obj) { + wave[key] = obj[key] + } + } +} +raylib.WaveCrop = WaveCrop + +/** + * Color, 4 components, R8G8B8A8 (32bit) + * + * @param {number} r - Color red value + * @param {number} g - Color green value + * @param {number} b - Color blue value + * @param {number} a - Color alpha value + * + * @return {Color} The new Color. + */ +function Color(r,g,b,a) { + return {r,g,b,a} +} +raylib.Color = Color + +/** + * Vector2, 2 components + * + * @param {number} x - Vector x component + * @param {number} y - Vector y component + * + * @return {Vector2} The new Vector2. + */ +function Vector2(x,y) { + return {x,y} +} +raylib.Vector2 = Vector2 + +/** + * Vector3, 3 components + * + * @param {number} x - Vector x component + * @param {number} y - Vector y component + * @param {number} z - Vector z component + * + * @return {Vector3} The new Vector3. + */ +function Vector3(x,y,z) { + return {x,y,z} +} +raylib.Vector3 = Vector3 + +/** + * Vector4, 4 components + * + * @param {number} x - Vector x component + * @param {number} y - Vector y component + * @param {number} z - Vector z component + * @param {number} w - Vector w component + * + * @return {Vector4} The new Vector4. + */ +function Vector4(x,y,z,w) { + return {x,y,z,w} +} +raylib.Vector4 = Vector4 + +/** + * Rectangle, 4 components + * + * @param {number} x - Rectangle top-left corner position x + * @param {number} y - Rectangle top-left corner position y + * @param {number} width - Rectangle width + * @param {number} height - Rectangle height + * + * @return {Rectangle} The new Rectangle. + */ +function Rectangle(x,y,width,height) { + return {x,y,width,height} +} +raylib.Rectangle = Rectangle + +/** + * Camera2D, defines position/orientation in 2d space + * + * @param {Vector2} offset - Camera offset (displacement from target) + * @param {Vector2} target - Camera target (rotation and zoom origin) + * @param {number} rotation - Camera rotation in degrees + * @param {number} zoom - Camera zoom (scaling), should be 1.0f by default + * + * @return {Camera2D} The new Camera2D. + */ +function Camera2D(offset,target,rotation,zoom) { + return {offset,target,rotation,zoom} +} +raylib.Camera2D = Camera2D + +/** + * Camera, defines position/orientation in 3d space + * + * @param {Vector3} position - Camera position + * @param {Vector3} target - Camera target it looks-at + * @param {Vector3} up - Camera up vector (rotation over its axis) + * @param {number} fovy - Camera field-of-view apperture in Y (degrees) in perspective, used as near plane width in orthographic + * @param {number} projection - Camera projection: CAMERA_PERSPECTIVE or CAMERA_ORTHOGRAPHIC + * + * @return {Camera3D} The new Camera3D. + */ +function Camera3D(position,target,up,fovy,projection) { + return {position,target,up,fovy,projection} +} +raylib.Camera3D = Camera3D +raylib.Camera = raylib.Camera3D + +// WRAPPED TYPED SHADER FUNCTIONS + +/** + * Set shader uniform value float + * + * @param {Shader} shader + * @param {number} locIndex + * @param {number} value + * + * @returns {undefined} + */ +function SetShaderFloat(shader, locIndex, value) { + return r.BindSetShaderFloat( + shader.id, + shader.locs, + locIndex, + value + ) +} +raylib.SetShaderFloat = SetShaderFloat + +/** + * Set shader uniform value float + * + * @param {Shader} shader + * @param {number} locIndex + * @param {number} value + * + * @returns {undefined} + */ +function SetShaderInt(shader, locIndex, value) { + return r.BindSetShaderInt( + shader.id, + shader.locs, + locIndex, + value + ) +} +raylib.SetShaderInt = SetShaderInt + +/** + * Set shader uniform value vector2 + * + * @param {Shader} shader + * @param {number} locIndex + * @param {Vector2} value + * + * @returns {undefined} + */ +function SetShaderVec2(shader, locIndex, value) { + return r.BindSetShaderVec2( + shader.id, + shader.locs, + locIndex, + value.x, + value.y + ) +} +raylib.SetShaderVec2 = SetShaderVec2 + +/** + * Set shader uniform value vector3 + * + * @param {Shader} shader + * @param {number} locIndex + * @param {Vector3} value + * + * @returns {undefined} + */ +function SetShaderVec3(shader, locIndex, value) { + return r.BindSetShaderVec3( + shader.id, + shader.locs, + locIndex, + value.x, + value.y, + value.z + ) +} +raylib.SetShaderVec3 = SetShaderVec3 + +/** + * Set shader uniform value vector4 + * + * @param {Shader} shader + * @param {number} locIndex + * @param {Vector4} value + * + * @returns {undefined} + */ +function SetShaderVec4(shader, locIndex, value) { + return r.BindSetShaderVec4( + shader.id, + shader.locs, + locIndex, + value.x, + value.y, + value.z, + value.w + ) +} +raylib.SetShaderVec4 = SetShaderVec4 + +/** + * Set to try enabling V-Sync on GPU + * + * @type {number} + * @constant + */ +raylib.FLAG_VSYNC_HINT = 64 + +/** + * Set to run program in fullscreen + * + * @type {number} + * @constant + */ +raylib.FLAG_FULLSCREEN_MODE = 2 + +/** + * Set to allow resizable window + * + * @type {number} + * @constant + */ +raylib.FLAG_WINDOW_RESIZABLE = 4 + +/** + * Set to disable window decoration (frame and buttons) + * + * @type {number} + * @constant + */ +raylib.FLAG_WINDOW_UNDECORATED = 8 + +/** + * Set to hide window + * + * @type {number} + * @constant + */ +raylib.FLAG_WINDOW_HIDDEN = 128 + +/** + * Set to minimize window (iconify) + * + * @type {number} + * @constant + */ +raylib.FLAG_WINDOW_MINIMIZED = 512 + +/** + * Set to maximize window (expanded to monitor) + * + * @type {number} + * @constant + */ +raylib.FLAG_WINDOW_MAXIMIZED = 1024 + +/** + * Set to window non focused + * + * @type {number} + * @constant + */ +raylib.FLAG_WINDOW_UNFOCUSED = 2048 + +/** + * Set to window always on top + * + * @type {number} + * @constant + */ +raylib.FLAG_WINDOW_TOPMOST = 4096 + +/** + * Set to allow windows running while minimized + * + * @type {number} + * @constant + */ +raylib.FLAG_WINDOW_ALWAYS_RUN = 256 + +/** + * Set to allow transparent framebuffer + * + * @type {number} + * @constant + */ +raylib.FLAG_WINDOW_TRANSPARENT = 16 + +/** + * Set to support HighDPI + * + * @type {number} + * @constant + */ +raylib.FLAG_WINDOW_HIGHDPI = 8192 + +/** + * Set to try enabling MSAA 4X + * + * @type {number} + * @constant + */ +raylib.FLAG_MSAA_4X_HINT = 32 + +/** + * Set to try enabling interlaced video format (for V3D) + * + * @type {number} + * @constant + */ +raylib.FLAG_INTERLACED_HINT = 65536 + +/** + * Display all logs + * + * @type {number} + * @constant + */ +raylib.LOG_ALL = 0 + +/** + * Trace logging, intended for internal use only + * + * @type {number} + * @constant + */ +raylib.LOG_TRACE = 1 + +/** + * Debug logging, used for internal debugging, it should be disabled on release builds + * + * @type {number} + * @constant + */ +raylib.LOG_DEBUG = 2 + +/** + * Info logging, used for program execution info + * + * @type {number} + * @constant + */ +raylib.LOG_INFO = 3 + +/** + * Warning logging, used on recoverable failures + * + * @type {number} + * @constant + */ +raylib.LOG_WARNING = 4 + +/** + * Error logging, used on unrecoverable failures + * + * @type {number} + * @constant + */ +raylib.LOG_ERROR = 5 + +/** + * Fatal logging, used to abort program: exit(EXIT_FAILURE) + * + * @type {number} + * @constant + */ +raylib.LOG_FATAL = 6 + +/** + * Disable logging + * + * @type {number} + * @constant + */ +raylib.LOG_NONE = 7 + +/** + * Key: NULL, used for no key pressed + * + * @type {number} + * @constant + */ +raylib.KEY_NULL = 0 + +/** + * Key: ' + * + * @type {number} + * @constant + */ +raylib.KEY_APOSTROPHE = 39 + +/** + * Key: , + * + * @type {number} + * @constant + */ +raylib.KEY_COMMA = 44 + +/** + * Key: - + * + * @type {number} + * @constant + */ +raylib.KEY_MINUS = 45 + +/** + * Key: . + * + * @type {number} + * @constant + */ +raylib.KEY_PERIOD = 46 + +/** + * Key: / + * + * @type {number} + * @constant + */ +raylib.KEY_SLASH = 47 + +/** + * Key: 0 + * + * @type {number} + * @constant + */ +raylib.KEY_ZERO = 48 + +/** + * Key: 1 + * + * @type {number} + * @constant + */ +raylib.KEY_ONE = 49 + +/** + * Key: 2 + * + * @type {number} + * @constant + */ +raylib.KEY_TWO = 50 + +/** + * Key: 3 + * + * @type {number} + * @constant + */ +raylib.KEY_THREE = 51 + +/** + * Key: 4 + * + * @type {number} + * @constant + */ +raylib.KEY_FOUR = 52 + +/** + * Key: 5 + * + * @type {number} + * @constant + */ +raylib.KEY_FIVE = 53 + +/** + * Key: 6 + * + * @type {number} + * @constant + */ +raylib.KEY_SIX = 54 + +/** + * Key: 7 + * + * @type {number} + * @constant + */ +raylib.KEY_SEVEN = 55 + +/** + * Key: 8 + * + * @type {number} + * @constant + */ +raylib.KEY_EIGHT = 56 + +/** + * Key: 9 + * + * @type {number} + * @constant + */ +raylib.KEY_NINE = 57 + +/** + * Key: ; + * + * @type {number} + * @constant + */ +raylib.KEY_SEMICOLON = 59 + +/** + * Key: = + * + * @type {number} + * @constant + */ +raylib.KEY_EQUAL = 61 + +/** + * Key: A | a + * + * @type {number} + * @constant + */ +raylib.KEY_A = 65 + +/** + * Key: B | b + * + * @type {number} + * @constant + */ +raylib.KEY_B = 66 + +/** + * Key: C | c + * + * @type {number} + * @constant + */ +raylib.KEY_C = 67 + +/** + * Key: D | d + * + * @type {number} + * @constant + */ +raylib.KEY_D = 68 + +/** + * Key: E | e + * + * @type {number} + * @constant + */ +raylib.KEY_E = 69 + +/** + * Key: F | f + * + * @type {number} + * @constant + */ +raylib.KEY_F = 70 + +/** + * Key: G | g + * + * @type {number} + * @constant + */ +raylib.KEY_G = 71 + +/** + * Key: H | h + * + * @type {number} + * @constant + */ +raylib.KEY_H = 72 + +/** + * Key: I | i + * + * @type {number} + * @constant + */ +raylib.KEY_I = 73 + +/** + * Key: J | j + * + * @type {number} + * @constant + */ +raylib.KEY_J = 74 + +/** + * Key: K | k + * + * @type {number} + * @constant + */ +raylib.KEY_K = 75 + +/** + * Key: L | l + * + * @type {number} + * @constant + */ +raylib.KEY_L = 76 + +/** + * Key: M | m + * + * @type {number} + * @constant + */ +raylib.KEY_M = 77 + +/** + * Key: N | n + * + * @type {number} + * @constant + */ +raylib.KEY_N = 78 + +/** + * Key: O | o + * + * @type {number} + * @constant + */ +raylib.KEY_O = 79 + +/** + * Key: P | p + * + * @type {number} + * @constant + */ +raylib.KEY_P = 80 + +/** + * Key: Q | q + * + * @type {number} + * @constant + */ +raylib.KEY_Q = 81 + +/** + * Key: R | r + * + * @type {number} + * @constant + */ +raylib.KEY_R = 82 + +/** + * Key: S | s + * + * @type {number} + * @constant + */ +raylib.KEY_S = 83 + +/** + * Key: T | t + * + * @type {number} + * @constant + */ +raylib.KEY_T = 84 + +/** + * Key: U | u + * + * @type {number} + * @constant + */ +raylib.KEY_U = 85 + +/** + * Key: V | v + * + * @type {number} + * @constant + */ +raylib.KEY_V = 86 + +/** + * Key: W | w + * + * @type {number} + * @constant + */ +raylib.KEY_W = 87 + +/** + * Key: X | x + * + * @type {number} + * @constant */ -function Vector2(x,y) { - return {x,y} -} -raylib.Vector2 = Vector2 +raylib.KEY_X = 88 /** - * Vector3, 3 components - * - * @param {number} x - Vector x component - * @param {number} y - Vector y component - * @param {number} z - Vector z component + * Key: Y | y * - * @return {Vector3} The new Vector3. + * @type {number} + * @constant */ -function Vector3(x,y,z) { - return {x,y,z} -} -raylib.Vector3 = Vector3 +raylib.KEY_Y = 89 /** - * Vector4, 4 components - * - * @param {number} x - Vector x component - * @param {number} y - Vector y component - * @param {number} z - Vector z component - * @param {number} w - Vector w component + * Key: Z | z * - * @return {Vector4} The new Vector4. + * @type {number} + * @constant */ -function Vector4(x,y,z,w) { - return {x,y,z,w} -} -raylib.Vector4 = Vector4 +raylib.KEY_Z = 90 /** - * Rectangle, 4 components - * - * @param {number} x - Rectangle top-left corner position x - * @param {number} y - Rectangle top-left corner position y - * @param {number} width - Rectangle width - * @param {number} height - Rectangle height + * Key: [ * - * @return {Rectangle} The new Rectangle. + * @type {number} + * @constant */ -function Rectangle(x,y,width,height) { - return {x,y,width,height} -} -raylib.Rectangle = Rectangle +raylib.KEY_LEFT_BRACKET = 91 /** - * Camera2D, defines position/orientation in 2d space - * - * @param {Vector2} offset - Camera offset (displacement from target) - * @param {Vector2} target - Camera target (rotation and zoom origin) - * @param {number} rotation - Camera rotation in degrees - * @param {number} zoom - Camera zoom (scaling), should be 1.0f by default + * Key: '\' * - * @return {Camera2D} The new Camera2D. + * @type {number} + * @constant */ -function Camera2D(offset,target,rotation,zoom) { - return {offset,target,rotation,zoom} -} -raylib.Camera2D = Camera2D +raylib.KEY_BACKSLASH = 92 /** - * Camera, defines position/orientation in 3d space - * - * @param {Vector3} position - Camera position - * @param {Vector3} target - Camera target it looks-at - * @param {Vector3} up - Camera up vector (rotation over its axis) - * @param {number} fovy - Camera field-of-view apperture in Y (degrees) in perspective, used as near plane width in orthographic - * @param {number} projection - Camera projection: CAMERA_PERSPECTIVE or CAMERA_ORTHOGRAPHIC + * Key: ] * - * @return {Camera3D} The new Camera3D. + * @type {number} + * @constant */ -function Camera3D(position,target,up,fovy,projection) { - return {position,target,up,fovy,projection} -} -raylib.Camera3D = Camera3D -raylib.Camera = raylib.Camera3D +raylib.KEY_RIGHT_BRACKET = 93 -// WRAPPED TYPED SHADER FUNCTIONS +/** + * Key: ` + * + * @type {number} + * @constant + */ +raylib.KEY_GRAVE = 96 /** - * Set shader uniform value float - * - * @param {Shader} shader - * @param {number} locIndex - * @param {number} value - * - * @returns {undefined} + * Key: Space + * + * @type {number} + * @constant */ -function SetShaderFloat(shader, locIndex, value) { - return r.BindSetShaderFloat( - shader.id, - shader.locs, - locIndex, - value - ) -} -raylib.SetShaderFloat = SetShaderFloat +raylib.KEY_SPACE = 32 /** - * Set shader uniform value float - * - * @param {Shader} shader - * @param {number} locIndex - * @param {number} value - * - * @returns {undefined} + * Key: Esc + * + * @type {number} + * @constant */ -function SetShaderInt(shader, locIndex, value) { - return r.BindSetShaderInt( - shader.id, - shader.locs, - locIndex, - value - ) -} -raylib.SetShaderInt = SetShaderInt +raylib.KEY_ESCAPE = 256 /** - * Set shader uniform value vector2 - * - * @param {Shader} shader - * @param {number} locIndex - * @param {Vector2} value - * - * @returns {undefined} + * Key: Enter + * + * @type {number} + * @constant */ -function SetShaderVec2(shader, locIndex, value) { - return r.BindSetShaderVec2( - shader.id, - shader.locs, - locIndex, - value.x, - value.y - ) -} -raylib.SetShaderVec2 = SetShaderVec2 +raylib.KEY_ENTER = 257 /** - * Set shader uniform value vector3 - * - * @param {Shader} shader - * @param {number} locIndex - * @param {Vector3} value - * - * @returns {undefined} + * Key: Tab + * + * @type {number} + * @constant */ -function SetShaderVec3(shader, locIndex, value) { - return r.BindSetShaderVec3( - shader.id, - shader.locs, - locIndex, - value.x, - value.y, - value.z - ) -} -raylib.SetShaderVec3 = SetShaderVec3 +raylib.KEY_TAB = 258 /** - * Set shader uniform value vector4 - * - * @param {Shader} shader - * @param {number} locIndex - * @param {Vector4} value - * - * @returns {undefined} + * Key: Backspace + * + * @type {number} + * @constant */ -function SetShaderVec4(shader, locIndex, value) { - return r.BindSetShaderVec4( - shader.id, - shader.locs, - locIndex, - value.x, - value.y, - value.z, - value.w - ) -} -raylib.SetShaderVec4 = SetShaderVec4 +raylib.KEY_BACKSPACE = 259 /** - * Set to try enabling V-Sync on GPU + * Key: Ins * * @type {number} * @constant */ -raylib.FLAG_VSYNC_HINT = 64 +raylib.KEY_INSERT = 260 /** - * Set to run program in fullscreen + * Key: Del * * @type {number} * @constant */ -raylib.FLAG_FULLSCREEN_MODE = 2 +raylib.KEY_DELETE = 261 /** - * Set to allow resizable window + * Key: Cursor right * * @type {number} * @constant */ -raylib.FLAG_WINDOW_RESIZABLE = 4 +raylib.KEY_RIGHT = 262 /** - * Set to disable window decoration (frame and buttons) + * Key: Cursor left * * @type {number} * @constant */ -raylib.FLAG_WINDOW_UNDECORATED = 8 +raylib.KEY_LEFT = 263 /** - * Set to hide window + * Key: Cursor down * * @type {number} * @constant */ -raylib.FLAG_WINDOW_HIDDEN = 128 +raylib.KEY_DOWN = 264 /** - * Set to minimize window (iconify) + * Key: Cursor up * * @type {number} * @constant */ -raylib.FLAG_WINDOW_MINIMIZED = 512 +raylib.KEY_UP = 265 /** - * Set to maximize window (expanded to monitor) + * Key: Page up * * @type {number} * @constant */ -raylib.FLAG_WINDOW_MAXIMIZED = 1024 +raylib.KEY_PAGE_UP = 266 /** - * Set to window non focused + * Key: Page down * * @type {number} * @constant */ -raylib.FLAG_WINDOW_UNFOCUSED = 2048 +raylib.KEY_PAGE_DOWN = 267 /** - * Set to window always on top + * Key: Home * * @type {number} * @constant */ -raylib.FLAG_WINDOW_TOPMOST = 4096 +raylib.KEY_HOME = 268 /** - * Set to allow windows running while minimized + * Key: End * * @type {number} * @constant */ -raylib.FLAG_WINDOW_ALWAYS_RUN = 256 +raylib.KEY_END = 269 /** - * Set to allow transparent framebuffer + * Key: Caps lock * * @type {number} * @constant */ -raylib.FLAG_WINDOW_TRANSPARENT = 16 +raylib.KEY_CAPS_LOCK = 280 /** - * Set to support HighDPI + * Key: Scroll down * * @type {number} * @constant */ -raylib.FLAG_WINDOW_HIGHDPI = 8192 +raylib.KEY_SCROLL_LOCK = 281 /** - * Set to try enabling MSAA 4X + * Key: Num lock * * @type {number} * @constant */ -raylib.FLAG_MSAA_4X_HINT = 32 +raylib.KEY_NUM_LOCK = 282 /** - * Set to try enabling interlaced video format (for V3D) + * Key: Print screen * * @type {number} * @constant */ -raylib.FLAG_INTERLACED_HINT = 65536 +raylib.KEY_PRINT_SCREEN = 283 /** - * Display all logs + * Key: Pause * * @type {number} * @constant */ -raylib.LOG_ALL = 0 +raylib.KEY_PAUSE = 284 /** - * Trace logging, intended for internal use only + * Key: F1 * * @type {number} * @constant */ -raylib.LOG_TRACE = 1 +raylib.KEY_F1 = 290 /** - * Debug logging, used for internal debugging, it should be disabled on release builds + * Key: F2 * * @type {number} * @constant */ -raylib.LOG_DEBUG = 2 +raylib.KEY_F2 = 291 /** - * Info logging, used for program execution info + * Key: F3 * * @type {number} * @constant */ -raylib.LOG_INFO = 3 +raylib.KEY_F3 = 292 /** - * Warning logging, used on recoverable failures + * Key: F4 * * @type {number} * @constant */ -raylib.LOG_WARNING = 4 +raylib.KEY_F4 = 293 /** - * Error logging, used on unrecoverable failures + * Key: F5 * * @type {number} * @constant */ -raylib.LOG_ERROR = 5 +raylib.KEY_F5 = 294 /** - * Fatal logging, used to abort program: exit(EXIT_FAILURE) + * Key: F6 * * @type {number} * @constant */ -raylib.LOG_FATAL = 6 +raylib.KEY_F6 = 295 /** - * Disable logging + * Key: F7 * * @type {number} * @constant */ -raylib.LOG_NONE = 7 +raylib.KEY_F7 = 296 /** - * Key: NULL, used for no key pressed + * Key: F8 * * @type {number} * @constant */ -raylib.KEY_NULL = 0 +raylib.KEY_F8 = 297 /** - * Key: ' + * Key: F9 * * @type {number} * @constant */ -raylib.KEY_APOSTROPHE = 39 +raylib.KEY_F9 = 298 /** - * Key: , + * Key: F10 * * @type {number} * @constant */ -raylib.KEY_COMMA = 44 +raylib.KEY_F10 = 299 /** - * Key: - + * Key: F11 * * @type {number} * @constant */ -raylib.KEY_MINUS = 45 +raylib.KEY_F11 = 300 /** - * Key: . + * Key: F12 * * @type {number} * @constant */ -raylib.KEY_PERIOD = 46 +raylib.KEY_F12 = 301 /** - * Key: / + * Key: Shift left * * @type {number} * @constant */ -raylib.KEY_SLASH = 47 +raylib.KEY_LEFT_SHIFT = 340 /** - * Key: 0 + * Key: Control left * * @type {number} * @constant */ -raylib.KEY_ZERO = 48 +raylib.KEY_LEFT_CONTROL = 341 /** - * Key: 1 + * Key: Alt left * * @type {number} * @constant */ -raylib.KEY_ONE = 49 +raylib.KEY_LEFT_ALT = 342 /** - * Key: 2 + * Key: Super left * * @type {number} * @constant */ -raylib.KEY_TWO = 50 +raylib.KEY_LEFT_SUPER = 343 /** - * Key: 3 + * Key: Shift right * * @type {number} * @constant */ -raylib.KEY_THREE = 51 +raylib.KEY_RIGHT_SHIFT = 344 /** - * Key: 4 + * Key: Control right * * @type {number} * @constant */ -raylib.KEY_FOUR = 52 +raylib.KEY_RIGHT_CONTROL = 345 /** - * Key: 5 + * Key: Alt right * * @type {number} * @constant */ -raylib.KEY_FIVE = 53 +raylib.KEY_RIGHT_ALT = 346 /** - * Key: 6 + * Key: Super right * * @type {number} * @constant */ -raylib.KEY_SIX = 54 +raylib.KEY_RIGHT_SUPER = 347 /** - * Key: 7 + * Key: KB menu * * @type {number} * @constant */ -raylib.KEY_SEVEN = 55 +raylib.KEY_KB_MENU = 348 /** - * Key: 8 + * Key: Keypad 0 * * @type {number} * @constant */ -raylib.KEY_EIGHT = 56 +raylib.KEY_KP_0 = 320 /** - * Key: 9 + * Key: Keypad 1 * * @type {number} * @constant */ -raylib.KEY_NINE = 57 +raylib.KEY_KP_1 = 321 /** - * Key: ; + * Key: Keypad 2 * * @type {number} * @constant */ -raylib.KEY_SEMICOLON = 59 +raylib.KEY_KP_2 = 322 /** - * Key: = + * Key: Keypad 3 * * @type {number} * @constant */ -raylib.KEY_EQUAL = 61 +raylib.KEY_KP_3 = 323 /** - * Key: A | a + * Key: Keypad 4 * * @type {number} * @constant */ -raylib.KEY_A = 65 +raylib.KEY_KP_4 = 324 /** - * Key: B | b + * Key: Keypad 5 * * @type {number} * @constant */ -raylib.KEY_B = 66 +raylib.KEY_KP_5 = 325 /** - * Key: C | c + * Key: Keypad 6 * * @type {number} * @constant */ -raylib.KEY_C = 67 +raylib.KEY_KP_6 = 326 /** - * Key: D | d + * Key: Keypad 7 * * @type {number} * @constant */ -raylib.KEY_D = 68 +raylib.KEY_KP_7 = 327 /** - * Key: E | e + * Key: Keypad 8 * * @type {number} * @constant */ -raylib.KEY_E = 69 +raylib.KEY_KP_8 = 328 /** - * Key: F | f + * Key: Keypad 9 * * @type {number} * @constant */ -raylib.KEY_F = 70 +raylib.KEY_KP_9 = 329 /** - * Key: G | g + * Key: Keypad . * * @type {number} * @constant */ -raylib.KEY_G = 71 +raylib.KEY_KP_DECIMAL = 330 /** - * Key: H | h + * Key: Keypad / * * @type {number} * @constant */ -raylib.KEY_H = 72 +raylib.KEY_KP_DIVIDE = 331 /** - * Key: I | i + * Key: Keypad * * * @type {number} * @constant */ -raylib.KEY_I = 73 +raylib.KEY_KP_MULTIPLY = 332 /** - * Key: J | j + * Key: Keypad - * * @type {number} * @constant */ -raylib.KEY_J = 74 +raylib.KEY_KP_SUBTRACT = 333 /** - * Key: K | k + * Key: Keypad + * * @type {number} * @constant */ -raylib.KEY_K = 75 +raylib.KEY_KP_ADD = 334 /** - * Key: L | l + * Key: Keypad Enter * * @type {number} * @constant */ -raylib.KEY_L = 76 +raylib.KEY_KP_ENTER = 335 /** - * Key: M | m + * Key: Keypad = * * @type {number} * @constant */ -raylib.KEY_M = 77 +raylib.KEY_KP_EQUAL = 336 /** - * Key: N | n + * Key: Android back button * * @type {number} * @constant */ -raylib.KEY_N = 78 +raylib.KEY_BACK = 4 /** - * Key: O | o + * Key: Android menu button * * @type {number} * @constant */ -raylib.KEY_O = 79 +raylib.KEY_MENU = 82 /** - * Key: P | p + * Key: Android volume up button * * @type {number} * @constant */ -raylib.KEY_P = 80 +raylib.KEY_VOLUME_UP = 24 /** - * Key: Q | q + * Key: Android volume down button * * @type {number} * @constant */ -raylib.KEY_Q = 81 +raylib.KEY_VOLUME_DOWN = 25 /** - * Key: R | r + * Mouse button left * * @type {number} * @constant */ -raylib.KEY_R = 82 +raylib.MOUSE_BUTTON_LEFT = 0 /** - * Key: S | s + * Mouse button right * * @type {number} * @constant */ -raylib.KEY_S = 83 +raylib.MOUSE_BUTTON_RIGHT = 1 /** - * Key: T | t + * Mouse button middle (pressed wheel) * * @type {number} * @constant */ -raylib.KEY_T = 84 +raylib.MOUSE_BUTTON_MIDDLE = 2 /** - * Key: U | u + * Mouse button side (advanced mouse device) * * @type {number} * @constant */ -raylib.KEY_U = 85 +raylib.MOUSE_BUTTON_SIDE = 3 /** - * Key: V | v + * Mouse button extra (advanced mouse device) * * @type {number} * @constant */ -raylib.KEY_V = 86 +raylib.MOUSE_BUTTON_EXTRA = 4 /** - * Key: W | w + * Mouse button fordward (advanced mouse device) * * @type {number} * @constant */ -raylib.KEY_W = 87 +raylib.MOUSE_BUTTON_FORWARD = 5 /** - * Key: X | x + * Mouse button back (advanced mouse device) * * @type {number} * @constant */ -raylib.KEY_X = 88 +raylib.MOUSE_BUTTON_BACK = 6 /** - * Key: Y | y + * Default pointer shape * * @type {number} * @constant */ -raylib.KEY_Y = 89 +raylib.MOUSE_CURSOR_DEFAULT = 0 /** - * Key: Z | z + * Arrow shape * * @type {number} * @constant */ -raylib.KEY_Z = 90 +raylib.MOUSE_CURSOR_ARROW = 1 /** - * Key: [ + * Text writing cursor shape * * @type {number} * @constant */ -raylib.KEY_LEFT_BRACKET = 91 +raylib.MOUSE_CURSOR_IBEAM = 2 /** - * Key: '\' + * Cross shape * * @type {number} * @constant */ -raylib.KEY_BACKSLASH = 92 +raylib.MOUSE_CURSOR_CROSSHAIR = 3 /** - * Key: ] + * Pointing hand cursor * * @type {number} * @constant */ -raylib.KEY_RIGHT_BRACKET = 93 +raylib.MOUSE_CURSOR_POINTING_HAND = 4 /** - * Key: ` + * Horizontal resize/move arrow shape * * @type {number} * @constant */ -raylib.KEY_GRAVE = 96 +raylib.MOUSE_CURSOR_RESIZE_EW = 5 /** - * Key: Space + * Vertical resize/move arrow shape * * @type {number} * @constant */ -raylib.KEY_SPACE = 32 +raylib.MOUSE_CURSOR_RESIZE_NS = 6 /** - * Key: Esc + * Top-left to bottom-right diagonal resize/move arrow shape * * @type {number} * @constant */ -raylib.KEY_ESCAPE = 256 +raylib.MOUSE_CURSOR_RESIZE_NWSE = 7 /** - * Key: Enter + * The top-right to bottom-left diagonal resize/move arrow shape * * @type {number} * @constant */ -raylib.KEY_ENTER = 257 +raylib.MOUSE_CURSOR_RESIZE_NESW = 8 /** - * Key: Tab + * The omni-directional resize/move cursor shape * * @type {number} * @constant */ -raylib.KEY_TAB = 258 +raylib.MOUSE_CURSOR_RESIZE_ALL = 9 /** - * Key: Backspace + * The operation-not-allowed shape * * @type {number} * @constant */ -raylib.KEY_BACKSPACE = 259 +raylib.MOUSE_CURSOR_NOT_ALLOWED = 10 /** - * Key: Ins + * Unknown button, just for error checking * * @type {number} * @constant */ -raylib.KEY_INSERT = 260 +raylib.GAMEPAD_BUTTON_UNKNOWN = 0 /** - * Key: Del + * Gamepad left DPAD up button * * @type {number} * @constant */ -raylib.KEY_DELETE = 261 +raylib.GAMEPAD_BUTTON_LEFT_FACE_UP = 1 /** - * Key: Cursor right + * Gamepad left DPAD right button * * @type {number} * @constant */ -raylib.KEY_RIGHT = 262 +raylib.GAMEPAD_BUTTON_LEFT_FACE_RIGHT = 2 /** - * Key: Cursor left + * Gamepad left DPAD down button * * @type {number} * @constant */ -raylib.KEY_LEFT = 263 +raylib.GAMEPAD_BUTTON_LEFT_FACE_DOWN = 3 /** - * Key: Cursor down + * Gamepad left DPAD left button * * @type {number} * @constant */ -raylib.KEY_DOWN = 264 +raylib.GAMEPAD_BUTTON_LEFT_FACE_LEFT = 4 /** - * Key: Cursor up + * Gamepad right button up (i.e. PS3: Triangle, Xbox: Y) * * @type {number} * @constant */ -raylib.KEY_UP = 265 +raylib.GAMEPAD_BUTTON_RIGHT_FACE_UP = 5 /** - * Key: Page up + * Gamepad right button right (i.e. PS3: Square, Xbox: X) * * @type {number} * @constant */ -raylib.KEY_PAGE_UP = 266 +raylib.GAMEPAD_BUTTON_RIGHT_FACE_RIGHT = 6 /** - * Key: Page down + * Gamepad right button down (i.e. PS3: Cross, Xbox: A) * * @type {number} * @constant */ -raylib.KEY_PAGE_DOWN = 267 +raylib.GAMEPAD_BUTTON_RIGHT_FACE_DOWN = 7 /** - * Key: Home + * Gamepad right button left (i.e. PS3: Circle, Xbox: B) * * @type {number} * @constant */ -raylib.KEY_HOME = 268 +raylib.GAMEPAD_BUTTON_RIGHT_FACE_LEFT = 8 /** - * Key: End + * Gamepad top/back trigger left (first), it could be a trailing button * * @type {number} * @constant */ -raylib.KEY_END = 269 +raylib.GAMEPAD_BUTTON_LEFT_TRIGGER_1 = 9 /** - * Key: Caps lock + * Gamepad top/back trigger left (second), it could be a trailing button * * @type {number} * @constant */ -raylib.KEY_CAPS_LOCK = 280 +raylib.GAMEPAD_BUTTON_LEFT_TRIGGER_2 = 10 /** - * Key: Scroll down + * Gamepad top/back trigger right (one), it could be a trailing button * * @type {number} * @constant */ -raylib.KEY_SCROLL_LOCK = 281 +raylib.GAMEPAD_BUTTON_RIGHT_TRIGGER_1 = 11 /** - * Key: Num lock + * Gamepad top/back trigger right (second), it could be a trailing button * * @type {number} * @constant */ -raylib.KEY_NUM_LOCK = 282 +raylib.GAMEPAD_BUTTON_RIGHT_TRIGGER_2 = 12 /** - * Key: Print screen + * Gamepad center buttons, left one (i.e. PS3: Select) * * @type {number} * @constant */ -raylib.KEY_PRINT_SCREEN = 283 +raylib.GAMEPAD_BUTTON_MIDDLE_LEFT = 13 /** - * Key: Pause + * Gamepad center buttons, middle one (i.e. PS3: PS, Xbox: XBOX) * * @type {number} * @constant */ -raylib.KEY_PAUSE = 284 +raylib.GAMEPAD_BUTTON_MIDDLE = 14 /** - * Key: F1 + * Gamepad center buttons, right one (i.e. PS3: Start) * * @type {number} * @constant */ -raylib.KEY_F1 = 290 +raylib.GAMEPAD_BUTTON_MIDDLE_RIGHT = 15 /** - * Key: F2 + * Gamepad joystick pressed button left * * @type {number} * @constant */ -raylib.KEY_F2 = 291 +raylib.GAMEPAD_BUTTON_LEFT_THUMB = 16 /** - * Key: F3 + * Gamepad joystick pressed button right * * @type {number} * @constant */ -raylib.KEY_F3 = 292 +raylib.GAMEPAD_BUTTON_RIGHT_THUMB = 17 /** - * Key: F4 + * Gamepad left stick X axis * * @type {number} * @constant */ -raylib.KEY_F4 = 293 +raylib.GAMEPAD_AXIS_LEFT_X = 0 /** - * Key: F5 + * Gamepad left stick Y axis * * @type {number} * @constant */ -raylib.KEY_F5 = 294 +raylib.GAMEPAD_AXIS_LEFT_Y = 1 /** - * Key: F6 + * Gamepad right stick X axis * * @type {number} * @constant */ -raylib.KEY_F6 = 295 +raylib.GAMEPAD_AXIS_RIGHT_X = 2 /** - * Key: F7 + * Gamepad right stick Y axis * * @type {number} * @constant */ -raylib.KEY_F7 = 296 +raylib.GAMEPAD_AXIS_RIGHT_Y = 3 /** - * Key: F8 + * Gamepad back trigger left, pressure level: [1..-1] * * @type {number} * @constant */ -raylib.KEY_F8 = 297 +raylib.GAMEPAD_AXIS_LEFT_TRIGGER = 4 /** - * Key: F9 + * Gamepad back trigger right, pressure level: [1..-1] * * @type {number} * @constant */ -raylib.KEY_F9 = 298 +raylib.GAMEPAD_AXIS_RIGHT_TRIGGER = 5 /** - * Key: F10 + * Albedo material (same as: MATERIAL_MAP_DIFFUSE) * * @type {number} * @constant */ -raylib.KEY_F10 = 299 +raylib.MATERIAL_MAP_ALBEDO = 0 /** - * Key: F11 + * Metalness material (same as: MATERIAL_MAP_SPECULAR) * * @type {number} * @constant */ -raylib.KEY_F11 = 300 +raylib.MATERIAL_MAP_METALNESS = 1 /** - * Key: F12 + * Normal material * * @type {number} * @constant */ -raylib.KEY_F12 = 301 +raylib.MATERIAL_MAP_NORMAL = 2 /** - * Key: Shift left + * Roughness material * * @type {number} * @constant */ -raylib.KEY_LEFT_SHIFT = 340 +raylib.MATERIAL_MAP_ROUGHNESS = 3 /** - * Key: Control left + * Ambient occlusion material * * @type {number} * @constant */ -raylib.KEY_LEFT_CONTROL = 341 +raylib.MATERIAL_MAP_OCCLUSION = 4 /** - * Key: Alt left + * Emission material * * @type {number} * @constant */ -raylib.KEY_LEFT_ALT = 342 +raylib.MATERIAL_MAP_EMISSION = 5 /** - * Key: Super left + * Heightmap material * * @type {number} * @constant */ -raylib.KEY_LEFT_SUPER = 343 +raylib.MATERIAL_MAP_HEIGHT = 6 /** - * Key: Shift right + * Cubemap material (NOTE: Uses GL_TEXTURE_CUBE_MAP) * * @type {number} * @constant */ -raylib.KEY_RIGHT_SHIFT = 344 +raylib.MATERIAL_MAP_CUBEMAP = 7 /** - * Key: Control right + * Irradiance material (NOTE: Uses GL_TEXTURE_CUBE_MAP) * * @type {number} * @constant */ -raylib.KEY_RIGHT_CONTROL = 345 +raylib.MATERIAL_MAP_IRRADIANCE = 8 /** - * Key: Alt right + * Prefilter material (NOTE: Uses GL_TEXTURE_CUBE_MAP) * * @type {number} * @constant */ -raylib.KEY_RIGHT_ALT = 346 +raylib.MATERIAL_MAP_PREFILTER = 9 /** - * Key: Super right + * Brdf material * * @type {number} * @constant */ -raylib.KEY_RIGHT_SUPER = 347 +raylib.MATERIAL_MAP_BRDF = 10 /** - * Key: KB menu + * Shader location: vertex attribute: position * * @type {number} * @constant */ -raylib.KEY_KB_MENU = 348 +raylib.SHADER_LOC_VERTEX_POSITION = 0 /** - * Key: Keypad 0 + * Shader location: vertex attribute: texcoord01 * * @type {number} * @constant */ -raylib.KEY_KP_0 = 320 +raylib.SHADER_LOC_VERTEX_TEXCOORD01 = 1 /** - * Key: Keypad 1 + * Shader location: vertex attribute: texcoord02 * * @type {number} * @constant */ -raylib.KEY_KP_1 = 321 +raylib.SHADER_LOC_VERTEX_TEXCOORD02 = 2 /** - * Key: Keypad 2 + * Shader location: vertex attribute: normal * * @type {number} * @constant */ -raylib.KEY_KP_2 = 322 +raylib.SHADER_LOC_VERTEX_NORMAL = 3 /** - * Key: Keypad 3 + * Shader location: vertex attribute: tangent * * @type {number} * @constant */ -raylib.KEY_KP_3 = 323 +raylib.SHADER_LOC_VERTEX_TANGENT = 4 /** - * Key: Keypad 4 + * Shader location: vertex attribute: color * * @type {number} * @constant */ -raylib.KEY_KP_4 = 324 +raylib.SHADER_LOC_VERTEX_COLOR = 5 /** - * Key: Keypad 5 + * Shader location: matrix uniform: model-view-projection * * @type {number} * @constant */ -raylib.KEY_KP_5 = 325 +raylib.SHADER_LOC_MATRIX_MVP = 6 /** - * Key: Keypad 6 + * Shader location: matrix uniform: view (camera transform) * * @type {number} * @constant */ -raylib.KEY_KP_6 = 326 +raylib.SHADER_LOC_MATRIX_VIEW = 7 /** - * Key: Keypad 7 + * Shader location: matrix uniform: projection * * @type {number} * @constant */ -raylib.KEY_KP_7 = 327 +raylib.SHADER_LOC_MATRIX_PROJECTION = 8 /** - * Key: Keypad 8 + * Shader location: matrix uniform: model (transform) * * @type {number} * @constant */ -raylib.KEY_KP_8 = 328 +raylib.SHADER_LOC_MATRIX_MODEL = 9 /** - * Key: Keypad 9 + * Shader location: matrix uniform: normal * * @type {number} * @constant */ -raylib.KEY_KP_9 = 329 +raylib.SHADER_LOC_MATRIX_NORMAL = 10 /** - * Key: Keypad . + * Shader location: vector uniform: view * * @type {number} * @constant */ -raylib.KEY_KP_DECIMAL = 330 +raylib.SHADER_LOC_VECTOR_VIEW = 11 /** - * Key: Keypad / + * Shader location: vector uniform: diffuse color * * @type {number} * @constant */ -raylib.KEY_KP_DIVIDE = 331 +raylib.SHADER_LOC_COLOR_DIFFUSE = 12 /** - * Key: Keypad * + * Shader location: vector uniform: specular color * * @type {number} * @constant */ -raylib.KEY_KP_MULTIPLY = 332 +raylib.SHADER_LOC_COLOR_SPECULAR = 13 /** - * Key: Keypad - + * Shader location: vector uniform: ambient color * * @type {number} * @constant */ -raylib.KEY_KP_SUBTRACT = 333 +raylib.SHADER_LOC_COLOR_AMBIENT = 14 /** - * Key: Keypad + + * Shader location: sampler2d texture: albedo (same as: SHADER_LOC_MAP_DIFFUSE) * * @type {number} * @constant */ -raylib.KEY_KP_ADD = 334 +raylib.SHADER_LOC_MAP_ALBEDO = 15 /** - * Key: Keypad Enter + * Shader location: sampler2d texture: metalness (same as: SHADER_LOC_MAP_SPECULAR) * * @type {number} * @constant */ -raylib.KEY_KP_ENTER = 335 +raylib.SHADER_LOC_MAP_METALNESS = 16 /** - * Key: Keypad = + * Shader location: sampler2d texture: normal * * @type {number} * @constant */ -raylib.KEY_KP_EQUAL = 336 +raylib.SHADER_LOC_MAP_NORMAL = 17 /** - * Key: Android back button + * Shader location: sampler2d texture: roughness * * @type {number} * @constant */ -raylib.KEY_BACK = 4 +raylib.SHADER_LOC_MAP_ROUGHNESS = 18 /** - * Key: Android menu button + * Shader location: sampler2d texture: occlusion * * @type {number} * @constant */ -raylib.KEY_MENU = 82 +raylib.SHADER_LOC_MAP_OCCLUSION = 19 /** - * Key: Android volume up button + * Shader location: sampler2d texture: emission * * @type {number} * @constant */ -raylib.KEY_VOLUME_UP = 24 +raylib.SHADER_LOC_MAP_EMISSION = 20 /** - * Key: Android volume down button + * Shader location: sampler2d texture: height * * @type {number} * @constant */ -raylib.KEY_VOLUME_DOWN = 25 +raylib.SHADER_LOC_MAP_HEIGHT = 21 /** - * Mouse button left + * Shader location: samplerCube texture: cubemap * * @type {number} * @constant */ -raylib.MOUSE_BUTTON_LEFT = 0 +raylib.SHADER_LOC_MAP_CUBEMAP = 22 /** - * Mouse button right + * Shader location: samplerCube texture: irradiance * * @type {number} * @constant */ -raylib.MOUSE_BUTTON_RIGHT = 1 +raylib.SHADER_LOC_MAP_IRRADIANCE = 23 /** - * Mouse button middle (pressed wheel) + * Shader location: samplerCube texture: prefilter * * @type {number} * @constant */ -raylib.MOUSE_BUTTON_MIDDLE = 2 +raylib.SHADER_LOC_MAP_PREFILTER = 24 /** - * Mouse button side (advanced mouse device) + * Shader location: sampler2d texture: brdf * * @type {number} * @constant */ -raylib.MOUSE_BUTTON_SIDE = 3 +raylib.SHADER_LOC_MAP_BRDF = 25 /** - * Mouse button extra (advanced mouse device) + * Shader uniform type: float * * @type {number} * @constant */ -raylib.MOUSE_BUTTON_EXTRA = 4 +raylib.SHADER_UNIFORM_FLOAT = 0 /** - * Mouse button fordward (advanced mouse device) + * Shader uniform type: vec2 (2 float) * * @type {number} * @constant */ -raylib.MOUSE_BUTTON_FORWARD = 5 +raylib.SHADER_UNIFORM_VEC2 = 1 /** - * Mouse button back (advanced mouse device) + * Shader uniform type: vec3 (3 float) * * @type {number} * @constant */ -raylib.MOUSE_BUTTON_BACK = 6 +raylib.SHADER_UNIFORM_VEC3 = 2 /** - * Default pointer shape + * Shader uniform type: vec4 (4 float) * * @type {number} * @constant */ -raylib.MOUSE_CURSOR_DEFAULT = 0 +raylib.SHADER_UNIFORM_VEC4 = 3 /** - * Arrow shape + * Shader uniform type: int * * @type {number} * @constant */ -raylib.MOUSE_CURSOR_ARROW = 1 +raylib.SHADER_UNIFORM_INT = 4 /** - * Text writing cursor shape + * Shader uniform type: ivec2 (2 int) * * @type {number} * @constant */ -raylib.MOUSE_CURSOR_IBEAM = 2 +raylib.SHADER_UNIFORM_IVEC2 = 5 /** - * Cross shape + * Shader uniform type: ivec3 (3 int) * * @type {number} * @constant */ -raylib.MOUSE_CURSOR_CROSSHAIR = 3 +raylib.SHADER_UNIFORM_IVEC3 = 6 /** - * Pointing hand cursor + * Shader uniform type: ivec4 (4 int) * * @type {number} * @constant */ -raylib.MOUSE_CURSOR_POINTING_HAND = 4 +raylib.SHADER_UNIFORM_IVEC4 = 7 /** - * Horizontal resize/move arrow shape + * Shader uniform type: sampler2d * * @type {number} * @constant */ -raylib.MOUSE_CURSOR_RESIZE_EW = 5 +raylib.SHADER_UNIFORM_SAMPLER2D = 8 /** - * Vertical resize/move arrow shape + * Shader attribute type: float * * @type {number} * @constant */ -raylib.MOUSE_CURSOR_RESIZE_NS = 6 +raylib.SHADER_ATTRIB_FLOAT = 0 /** - * Top-left to bottom-right diagonal resize/move arrow shape + * Shader attribute type: vec2 (2 float) * * @type {number} * @constant */ -raylib.MOUSE_CURSOR_RESIZE_NWSE = 7 +raylib.SHADER_ATTRIB_VEC2 = 1 /** - * The top-right to bottom-left diagonal resize/move arrow shape + * Shader attribute type: vec3 (3 float) * * @type {number} * @constant */ -raylib.MOUSE_CURSOR_RESIZE_NESW = 8 +raylib.SHADER_ATTRIB_VEC3 = 2 /** - * The omni-directional resize/move cursor shape + * Shader attribute type: vec4 (4 float) * * @type {number} * @constant */ -raylib.MOUSE_CURSOR_RESIZE_ALL = 9 +raylib.SHADER_ATTRIB_VEC4 = 3 /** - * The operation-not-allowed shape + * 8 bit per pixel (no alpha) * * @type {number} * @constant */ -raylib.MOUSE_CURSOR_NOT_ALLOWED = 10 +raylib.PIXELFORMAT_UNCOMPRESSED_GRAYSCALE = 1 /** - * Unknown button, just for error checking + * 8*2 bpp (2 channels) * * @type {number} * @constant */ -raylib.GAMEPAD_BUTTON_UNKNOWN = 0 +raylib.PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA = 2 /** - * Gamepad left DPAD up button + * 16 bpp * * @type {number} * @constant */ -raylib.GAMEPAD_BUTTON_LEFT_FACE_UP = 1 +raylib.PIXELFORMAT_UNCOMPRESSED_R5G6B5 = 3 /** - * Gamepad left DPAD right button + * 24 bpp * * @type {number} * @constant */ -raylib.GAMEPAD_BUTTON_LEFT_FACE_RIGHT = 2 +raylib.PIXELFORMAT_UNCOMPRESSED_R8G8B8 = 4 /** - * Gamepad left DPAD down button + * 16 bpp (1 bit alpha) * * @type {number} * @constant */ -raylib.GAMEPAD_BUTTON_LEFT_FACE_DOWN = 3 +raylib.PIXELFORMAT_UNCOMPRESSED_R5G5B5A1 = 5 /** - * Gamepad left DPAD left button + * 16 bpp (4 bit alpha) * * @type {number} * @constant */ -raylib.GAMEPAD_BUTTON_LEFT_FACE_LEFT = 4 +raylib.PIXELFORMAT_UNCOMPRESSED_R4G4B4A4 = 6 /** - * Gamepad right button up (i.e. PS3: Triangle, Xbox: Y) + * 32 bpp * * @type {number} * @constant */ -raylib.GAMEPAD_BUTTON_RIGHT_FACE_UP = 5 +raylib.PIXELFORMAT_UNCOMPRESSED_R8G8B8A8 = 7 /** - * Gamepad right button right (i.e. PS3: Square, Xbox: X) + * 32 bpp (1 channel - float) * * @type {number} * @constant */ -raylib.GAMEPAD_BUTTON_RIGHT_FACE_RIGHT = 6 +raylib.PIXELFORMAT_UNCOMPRESSED_R32 = 8 /** - * Gamepad right button down (i.e. PS3: Cross, Xbox: A) + * 32*3 bpp (3 channels - float) * * @type {number} * @constant */ -raylib.GAMEPAD_BUTTON_RIGHT_FACE_DOWN = 7 +raylib.PIXELFORMAT_UNCOMPRESSED_R32G32B32 = 9 /** - * Gamepad right button left (i.e. PS3: Circle, Xbox: B) + * 32*4 bpp (4 channels - float) * * @type {number} * @constant */ -raylib.GAMEPAD_BUTTON_RIGHT_FACE_LEFT = 8 +raylib.PIXELFORMAT_UNCOMPRESSED_R32G32B32A32 = 10 /** - * Gamepad top/back trigger left (first), it could be a trailing button + * 4 bpp (no alpha) * * @type {number} * @constant */ -raylib.GAMEPAD_BUTTON_LEFT_TRIGGER_1 = 9 +raylib.PIXELFORMAT_COMPRESSED_DXT1_RGB = 11 /** - * Gamepad top/back trigger left (second), it could be a trailing button + * 4 bpp (1 bit alpha) * * @type {number} * @constant */ -raylib.GAMEPAD_BUTTON_LEFT_TRIGGER_2 = 10 +raylib.PIXELFORMAT_COMPRESSED_DXT1_RGBA = 12 /** - * Gamepad top/back trigger right (one), it could be a trailing button + * 8 bpp * * @type {number} * @constant */ -raylib.GAMEPAD_BUTTON_RIGHT_TRIGGER_1 = 11 +raylib.PIXELFORMAT_COMPRESSED_DXT3_RGBA = 13 /** - * Gamepad top/back trigger right (second), it could be a trailing button + * 8 bpp * * @type {number} * @constant */ -raylib.GAMEPAD_BUTTON_RIGHT_TRIGGER_2 = 12 +raylib.PIXELFORMAT_COMPRESSED_DXT5_RGBA = 14 /** - * Gamepad center buttons, left one (i.e. PS3: Select) + * 4 bpp * * @type {number} * @constant */ -raylib.GAMEPAD_BUTTON_MIDDLE_LEFT = 13 +raylib.PIXELFORMAT_COMPRESSED_ETC1_RGB = 15 /** - * Gamepad center buttons, middle one (i.e. PS3: PS, Xbox: XBOX) + * 4 bpp * * @type {number} * @constant */ -raylib.GAMEPAD_BUTTON_MIDDLE = 14 +raylib.PIXELFORMAT_COMPRESSED_ETC2_RGB = 16 /** - * Gamepad center buttons, right one (i.e. PS3: Start) + * 8 bpp * * @type {number} * @constant */ -raylib.GAMEPAD_BUTTON_MIDDLE_RIGHT = 15 +raylib.PIXELFORMAT_COMPRESSED_ETC2_EAC_RGBA = 17 /** - * Gamepad joystick pressed button left + * 4 bpp * * @type {number} * @constant */ -raylib.GAMEPAD_BUTTON_LEFT_THUMB = 16 +raylib.PIXELFORMAT_COMPRESSED_PVRT_RGB = 18 /** - * Gamepad joystick pressed button right + * 4 bpp * * @type {number} * @constant */ -raylib.GAMEPAD_BUTTON_RIGHT_THUMB = 17 +raylib.PIXELFORMAT_COMPRESSED_PVRT_RGBA = 19 /** - * Gamepad left stick X axis + * 8 bpp * * @type {number} * @constant */ -raylib.GAMEPAD_AXIS_LEFT_X = 0 +raylib.PIXELFORMAT_COMPRESSED_ASTC_4x4_RGBA = 20 /** - * Gamepad left stick Y axis + * 2 bpp * * @type {number} * @constant */ -raylib.GAMEPAD_AXIS_LEFT_Y = 1 +raylib.PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA = 21 /** - * Gamepad right stick X axis + * No filter, just pixel aproximation * * @type {number} * @constant */ -raylib.GAMEPAD_AXIS_RIGHT_X = 2 +raylib.TEXTURE_FILTER_POINT = 0 /** - * Gamepad right stick Y axis + * Linear filtering * * @type {number} * @constant */ -raylib.GAMEPAD_AXIS_RIGHT_Y = 3 +raylib.TEXTURE_FILTER_BILINEAR = 1 /** - * Gamepad back trigger left, pressure level: [1..-1] + * Trilinear filtering (linear with mipmaps) * * @type {number} * @constant */ -raylib.GAMEPAD_AXIS_LEFT_TRIGGER = 4 +raylib.TEXTURE_FILTER_TRILINEAR = 2 /** - * Gamepad back trigger right, pressure level: [1..-1] + * Anisotropic filtering 4x * * @type {number} * @constant */ -raylib.GAMEPAD_AXIS_RIGHT_TRIGGER = 5 +raylib.TEXTURE_FILTER_ANISOTROPIC_4X = 3 /** - * Albedo material (same as: MATERIAL_MAP_DIFFUSE) + * Anisotropic filtering 8x * * @type {number} * @constant */ -raylib.MATERIAL_MAP_ALBEDO = 0 +raylib.TEXTURE_FILTER_ANISOTROPIC_8X = 4 /** - * Metalness material (same as: MATERIAL_MAP_SPECULAR) + * Anisotropic filtering 16x * * @type {number} * @constant */ -raylib.MATERIAL_MAP_METALNESS = 1 +raylib.TEXTURE_FILTER_ANISOTROPIC_16X = 5 /** - * Normal material + * Repeats texture in tiled mode * * @type {number} * @constant */ -raylib.MATERIAL_MAP_NORMAL = 2 +raylib.TEXTURE_WRAP_REPEAT = 0 /** - * Roughness material + * Clamps texture to edge pixel in tiled mode * * @type {number} * @constant */ -raylib.MATERIAL_MAP_ROUGHNESS = 3 +raylib.TEXTURE_WRAP_CLAMP = 1 /** - * Ambient occlusion material + * Mirrors and repeats the texture in tiled mode * * @type {number} * @constant */ -raylib.MATERIAL_MAP_OCCLUSION = 4 +raylib.TEXTURE_WRAP_MIRROR_REPEAT = 2 /** - * Emission material + * Mirrors and clamps to border the texture in tiled mode * * @type {number} * @constant */ -raylib.MATERIAL_MAP_EMISSION = 5 +raylib.TEXTURE_WRAP_MIRROR_CLAMP = 3 /** - * Heightmap material + * Automatically detect layout type * * @type {number} * @constant */ -raylib.MATERIAL_MAP_HEIGHT = 6 +raylib.CUBEMAP_LAYOUT_AUTO_DETECT = 0 /** - * Cubemap material (NOTE: Uses GL_TEXTURE_CUBE_MAP) + * Layout is defined by a vertical line with faces * * @type {number} * @constant */ -raylib.MATERIAL_MAP_CUBEMAP = 7 +raylib.CUBEMAP_LAYOUT_LINE_VERTICAL = 1 /** - * Irradiance material (NOTE: Uses GL_TEXTURE_CUBE_MAP) + * Layout is defined by an horizontal line with faces * * @type {number} * @constant */ -raylib.MATERIAL_MAP_IRRADIANCE = 8 +raylib.CUBEMAP_LAYOUT_LINE_HORIZONTAL = 2 /** - * Prefilter material (NOTE: Uses GL_TEXTURE_CUBE_MAP) + * Layout is defined by a 3x4 cross with cubemap faces * * @type {number} * @constant */ -raylib.MATERIAL_MAP_PREFILTER = 9 +raylib.CUBEMAP_LAYOUT_CROSS_THREE_BY_FOUR = 3 /** - * Brdf material + * Layout is defined by a 4x3 cross with cubemap faces * * @type {number} * @constant */ -raylib.MATERIAL_MAP_BRDF = 10 +raylib.CUBEMAP_LAYOUT_CROSS_FOUR_BY_THREE = 4 /** - * Shader location: vertex attribute: position + * Layout is defined by a panorama image (equirectangular map) * * @type {number} * @constant */ -raylib.SHADER_LOC_VERTEX_POSITION = 0 +raylib.CUBEMAP_LAYOUT_PANORAMA = 5 /** - * Shader location: vertex attribute: texcoord01 + * Default font generation, anti-aliased * * @type {number} * @constant */ -raylib.SHADER_LOC_VERTEX_TEXCOORD01 = 1 +raylib.FONT_DEFAULT = 0 /** - * Shader location: vertex attribute: texcoord02 + * Bitmap font generation, no anti-aliasing * * @type {number} * @constant */ -raylib.SHADER_LOC_VERTEX_TEXCOORD02 = 2 +raylib.FONT_BITMAP = 1 /** - * Shader location: vertex attribute: normal + * SDF font generation, requires external shader * * @type {number} * @constant */ -raylib.SHADER_LOC_VERTEX_NORMAL = 3 +raylib.FONT_SDF = 2 /** - * Shader location: vertex attribute: tangent + * Blend textures considering alpha (default) * * @type {number} * @constant */ -raylib.SHADER_LOC_VERTEX_TANGENT = 4 +raylib.BLEND_ALPHA = 0 /** - * Shader location: vertex attribute: color + * Blend textures adding colors * * @type {number} * @constant */ -raylib.SHADER_LOC_VERTEX_COLOR = 5 +raylib.BLEND_ADDITIVE = 1 /** - * Shader location: matrix uniform: model-view-projection + * Blend textures multiplying colors * * @type {number} * @constant */ -raylib.SHADER_LOC_MATRIX_MVP = 6 +raylib.BLEND_MULTIPLIED = 2 /** - * Shader location: matrix uniform: view (camera transform) + * Blend textures adding colors (alternative) * * @type {number} * @constant */ -raylib.SHADER_LOC_MATRIX_VIEW = 7 +raylib.BLEND_ADD_COLORS = 3 /** - * Shader location: matrix uniform: projection + * Blend textures subtracting colors (alternative) * * @type {number} * @constant */ -raylib.SHADER_LOC_MATRIX_PROJECTION = 8 +raylib.BLEND_SUBTRACT_COLORS = 4 /** - * Shader location: matrix uniform: model (transform) + * Belnd textures using custom src/dst factors (use rlSetBlendMode()) * * @type {number} * @constant */ -raylib.SHADER_LOC_MATRIX_MODEL = 9 +raylib.BLEND_CUSTOM = 5 /** - * Shader location: matrix uniform: normal + * No gesture * * @type {number} * @constant */ -raylib.SHADER_LOC_MATRIX_NORMAL = 10 +raylib.GESTURE_NONE = 0 /** - * Shader location: vector uniform: view + * Tap gesture * * @type {number} * @constant */ -raylib.SHADER_LOC_VECTOR_VIEW = 11 +raylib.GESTURE_TAP = 1 /** - * Shader location: vector uniform: diffuse color + * Double tap gesture * * @type {number} * @constant */ -raylib.SHADER_LOC_COLOR_DIFFUSE = 12 +raylib.GESTURE_DOUBLETAP = 2 /** - * Shader location: vector uniform: specular color + * Hold gesture * * @type {number} * @constant */ -raylib.SHADER_LOC_COLOR_SPECULAR = 13 +raylib.GESTURE_HOLD = 4 /** - * Shader location: vector uniform: ambient color + * Drag gesture * * @type {number} * @constant */ -raylib.SHADER_LOC_COLOR_AMBIENT = 14 +raylib.GESTURE_DRAG = 8 /** - * Shader location: sampler2d texture: albedo (same as: SHADER_LOC_MAP_DIFFUSE) + * Swipe right gesture * * @type {number} * @constant */ -raylib.SHADER_LOC_MAP_ALBEDO = 15 +raylib.GESTURE_SWIPE_RIGHT = 16 /** - * Shader location: sampler2d texture: metalness (same as: SHADER_LOC_MAP_SPECULAR) + * Swipe left gesture * * @type {number} * @constant */ -raylib.SHADER_LOC_MAP_METALNESS = 16 +raylib.GESTURE_SWIPE_LEFT = 32 /** - * Shader location: sampler2d texture: normal + * Swipe up gesture * * @type {number} * @constant */ -raylib.SHADER_LOC_MAP_NORMAL = 17 +raylib.GESTURE_SWIPE_UP = 64 /** - * Shader location: sampler2d texture: roughness + * Swipe down gesture * * @type {number} * @constant */ -raylib.SHADER_LOC_MAP_ROUGHNESS = 18 +raylib.GESTURE_SWIPE_DOWN = 128 /** - * Shader location: sampler2d texture: occlusion + * Pinch in gesture * * @type {number} * @constant */ -raylib.SHADER_LOC_MAP_OCCLUSION = 19 +raylib.GESTURE_PINCH_IN = 256 /** - * Shader location: sampler2d texture: emission + * Pinch out gesture * * @type {number} * @constant */ -raylib.SHADER_LOC_MAP_EMISSION = 20 +raylib.GESTURE_PINCH_OUT = 512 /** - * Shader location: sampler2d texture: height + * Custom camera * * @type {number} * @constant */ -raylib.SHADER_LOC_MAP_HEIGHT = 21 +raylib.CAMERA_CUSTOM = 0 /** - * Shader location: samplerCube texture: cubemap + * Free camera * * @type {number} * @constant */ -raylib.SHADER_LOC_MAP_CUBEMAP = 22 +raylib.CAMERA_FREE = 1 /** - * Shader location: samplerCube texture: irradiance + * Orbital camera * * @type {number} * @constant */ -raylib.SHADER_LOC_MAP_IRRADIANCE = 23 +raylib.CAMERA_ORBITAL = 2 /** - * Shader location: samplerCube texture: prefilter + * First person camera * * @type {number} * @constant */ -raylib.SHADER_LOC_MAP_PREFILTER = 24 +raylib.CAMERA_FIRST_PERSON = 3 /** - * Shader location: sampler2d texture: brdf + * Third person camera * * @type {number} * @constant */ -raylib.SHADER_LOC_MAP_BRDF = 25 +raylib.CAMERA_THIRD_PERSON = 4 /** - * Shader uniform type: float + * Perspective projection * * @type {number} * @constant */ -raylib.SHADER_UNIFORM_FLOAT = 0 +raylib.CAMERA_PERSPECTIVE = 0 /** - * Shader uniform type: vec2 (2 float) + * Orthographic projection * * @type {number} * @constant */ -raylib.SHADER_UNIFORM_VEC2 = 1 +raylib.CAMERA_ORTHOGRAPHIC = 1 /** - * Shader uniform type: vec3 (3 float) + * Npatch layout: 3x3 tiles * * @type {number} * @constant */ -raylib.SHADER_UNIFORM_VEC3 = 2 +raylib.NPATCH_NINE_PATCH = 0 /** - * Shader uniform type: vec4 (4 float) + * Npatch layout: 1x3 tiles * * @type {number} * @constant */ -raylib.SHADER_UNIFORM_VEC4 = 3 +raylib.NPATCH_THREE_PATCH_VERTICAL = 1 /** - * Shader uniform type: int + * Npatch layout: 3x1 tiles * * @type {number} * @constant */ -raylib.SHADER_UNIFORM_INT = 4 +raylib.NPATCH_THREE_PATCH_HORIZONTAL = 2 /** - * Shader uniform type: ivec2 (2 int) + * * * @type {number} * @constant */ -raylib.SHADER_UNIFORM_IVEC2 = 5 +raylib.GUI_STATE_NORMAL = 0 /** - * Shader uniform type: ivec3 (3 int) + * * * @type {number} * @constant */ -raylib.SHADER_UNIFORM_IVEC3 = 6 +raylib.GUI_STATE_FOCUSED = 1 /** - * Shader uniform type: ivec4 (4 int) + * * * @type {number} * @constant */ -raylib.SHADER_UNIFORM_IVEC4 = 7 +raylib.GUI_STATE_PRESSED = 2 /** - * Shader uniform type: sampler2d + * * * @type {number} * @constant */ -raylib.SHADER_UNIFORM_SAMPLER2D = 8 +raylib.GUI_STATE_DISABLED = 3 /** - * Shader attribute type: float + * * * @type {number} * @constant */ -raylib.SHADER_ATTRIB_FLOAT = 0 +raylib.GUI_TEXT_ALIGN_LEFT = 0 /** - * Shader attribute type: vec2 (2 float) + * * * @type {number} * @constant */ -raylib.SHADER_ATTRIB_VEC2 = 1 +raylib.GUI_TEXT_ALIGN_CENTER = 1 /** - * Shader attribute type: vec3 (3 float) + * * * @type {number} * @constant */ -raylib.SHADER_ATTRIB_VEC3 = 2 +raylib.GUI_TEXT_ALIGN_RIGHT = 2 /** - * Shader attribute type: vec4 (4 float) + * Generic control -> populates to all controls when set * * @type {number} * @constant */ -raylib.SHADER_ATTRIB_VEC4 = 3 +raylib.DEFAULT = 0 /** - * 8 bit per pixel (no alpha) + * Used also for: LABELBUTTON * * @type {number} * @constant */ -raylib.PIXELFORMAT_UNCOMPRESSED_GRAYSCALE = 1 +raylib.LABEL = 1 /** - * 8*2 bpp (2 channels) + * * * @type {number} * @constant */ -raylib.PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA = 2 +raylib.BUTTON = 2 /** - * 16 bpp + * Used also for: TOGGLEGROUP * * @type {number} * @constant */ -raylib.PIXELFORMAT_UNCOMPRESSED_R5G6B5 = 3 +raylib.TOGGLE = 3 /** - * 24 bpp + * Used also for: SLIDERBAR * * @type {number} * @constant */ -raylib.PIXELFORMAT_UNCOMPRESSED_R8G8B8 = 4 +raylib.SLIDER = 4 /** - * 16 bpp (1 bit alpha) + * * * @type {number} * @constant */ -raylib.PIXELFORMAT_UNCOMPRESSED_R5G5B5A1 = 5 +raylib.PROGRESSBAR = 5 /** - * 16 bpp (4 bit alpha) + * * * @type {number} * @constant */ -raylib.PIXELFORMAT_UNCOMPRESSED_R4G4B4A4 = 6 +raylib.CHECKBOX = 6 /** - * 32 bpp + * * * @type {number} * @constant */ -raylib.PIXELFORMAT_UNCOMPRESSED_R8G8B8A8 = 7 +raylib.COMBOBOX = 7 /** - * 32 bpp (1 channel - float) + * * * @type {number} * @constant */ -raylib.PIXELFORMAT_UNCOMPRESSED_R32 = 8 +raylib.DROPDOWNBOX = 8 /** - * 32*3 bpp (3 channels - float) + * Used also for: TEXTBOXMULTI * * @type {number} * @constant */ -raylib.PIXELFORMAT_UNCOMPRESSED_R32G32B32 = 9 +raylib.TEXTBOX = 9 /** - * 32*4 bpp (4 channels - float) + * * * @type {number} * @constant */ -raylib.PIXELFORMAT_UNCOMPRESSED_R32G32B32A32 = 10 +raylib.VALUEBOX = 10 /** - * 4 bpp (no alpha) + * * * @type {number} * @constant */ -raylib.PIXELFORMAT_COMPRESSED_DXT1_RGB = 11 +raylib.SPINNER = 11 /** - * 4 bpp (1 bit alpha) + * * * @type {number} * @constant */ -raylib.PIXELFORMAT_COMPRESSED_DXT1_RGBA = 12 +raylib.LISTVIEW = 12 /** - * 8 bpp + * * * @type {number} * @constant */ -raylib.PIXELFORMAT_COMPRESSED_DXT3_RGBA = 13 +raylib.COLORPICKER = 13 /** - * 8 bpp + * * * @type {number} * @constant */ -raylib.PIXELFORMAT_COMPRESSED_DXT5_RGBA = 14 +raylib.SCROLLBAR = 14 /** - * 4 bpp + * * * @type {number} * @constant */ -raylib.PIXELFORMAT_COMPRESSED_ETC1_RGB = 15 +raylib.STATUSBAR = 15 /** - * 4 bpp + * * * @type {number} * @constant */ -raylib.PIXELFORMAT_COMPRESSED_ETC2_RGB = 16 +raylib.BORDER_COLOR_NORMAL = 0 /** - * 8 bpp + * * * @type {number} * @constant */ -raylib.PIXELFORMAT_COMPRESSED_ETC2_EAC_RGBA = 17 +raylib.BASE_COLOR_NORMAL = 1 /** - * 4 bpp + * * * @type {number} * @constant */ -raylib.PIXELFORMAT_COMPRESSED_PVRT_RGB = 18 +raylib.TEXT_COLOR_NORMAL = 2 /** - * 4 bpp + * * * @type {number} * @constant */ -raylib.PIXELFORMAT_COMPRESSED_PVRT_RGBA = 19 +raylib.BORDER_COLOR_FOCUSED = 3 /** - * 8 bpp + * * * @type {number} * @constant */ -raylib.PIXELFORMAT_COMPRESSED_ASTC_4x4_RGBA = 20 +raylib.BASE_COLOR_FOCUSED = 4 /** - * 2 bpp + * * * @type {number} * @constant */ -raylib.PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA = 21 +raylib.TEXT_COLOR_FOCUSED = 5 /** - * No filter, just pixel aproximation + * * * @type {number} * @constant */ -raylib.TEXTURE_FILTER_POINT = 0 +raylib.BORDER_COLOR_PRESSED = 6 /** - * Linear filtering + * * * @type {number} * @constant */ -raylib.TEXTURE_FILTER_BILINEAR = 1 +raylib.BASE_COLOR_PRESSED = 7 /** - * Trilinear filtering (linear with mipmaps) + * * * @type {number} * @constant */ -raylib.TEXTURE_FILTER_TRILINEAR = 2 +raylib.TEXT_COLOR_PRESSED = 8 /** - * Anisotropic filtering 4x + * * * @type {number} * @constant */ -raylib.TEXTURE_FILTER_ANISOTROPIC_4X = 3 +raylib.BORDER_COLOR_DISABLED = 9 /** - * Anisotropic filtering 8x + * * * @type {number} * @constant */ -raylib.TEXTURE_FILTER_ANISOTROPIC_8X = 4 +raylib.BASE_COLOR_DISABLED = 10 /** - * Anisotropic filtering 16x + * * * @type {number} * @constant */ -raylib.TEXTURE_FILTER_ANISOTROPIC_16X = 5 +raylib.TEXT_COLOR_DISABLED = 11 /** - * Repeats texture in tiled mode + * * * @type {number} * @constant */ -raylib.TEXTURE_WRAP_REPEAT = 0 +raylib.BORDER_WIDTH = 12 /** - * Clamps texture to edge pixel in tiled mode + * * * @type {number} * @constant */ -raylib.TEXTURE_WRAP_CLAMP = 1 +raylib.TEXT_PADDING = 13 /** - * Mirrors and repeats the texture in tiled mode + * * * @type {number} * @constant */ -raylib.TEXTURE_WRAP_MIRROR_REPEAT = 2 +raylib.TEXT_ALIGNMENT = 14 /** - * Mirrors and clamps to border the texture in tiled mode + * * * @type {number} * @constant */ -raylib.TEXTURE_WRAP_MIRROR_CLAMP = 3 +raylib.RESERVED = 15 /** - * Automatically detect layout type + * * * @type {number} * @constant */ -raylib.CUBEMAP_LAYOUT_AUTO_DETECT = 0 +raylib.TEXT_SIZE = 16 /** - * Layout is defined by a vertical line with faces + * * * @type {number} * @constant */ -raylib.CUBEMAP_LAYOUT_LINE_VERTICAL = 1 +raylib.TEXT_SPACING = 17 /** - * Layout is defined by an horizontal line with faces + * * * @type {number} * @constant */ -raylib.CUBEMAP_LAYOUT_LINE_HORIZONTAL = 2 +raylib.LINE_COLOR = 18 /** - * Layout is defined by a 3x4 cross with cubemap faces + * * * @type {number} * @constant */ -raylib.CUBEMAP_LAYOUT_CROSS_THREE_BY_FOUR = 3 +raylib.BACKGROUND_COLOR = 19 /** - * Layout is defined by a 4x3 cross with cubemap faces + * * * @type {number} * @constant */ -raylib.CUBEMAP_LAYOUT_CROSS_FOUR_BY_THREE = 4 +raylib.GROUP_PADDING = 16 /** - * Layout is defined by a panorama image (equirectangular map) + * * * @type {number} * @constant */ -raylib.CUBEMAP_LAYOUT_PANORAMA = 5 +raylib.SLIDER_WIDTH = 16 /** - * Default font generation, anti-aliased + * * * @type {number} * @constant */ -raylib.FONT_DEFAULT = 0 +raylib.SLIDER_PADDING = 17 /** - * Bitmap font generation, no anti-aliasing + * * * @type {number} * @constant */ -raylib.FONT_BITMAP = 1 +raylib.PROGRESS_PADDING = 16 /** - * SDF font generation, requires external shader + * * * @type {number} * @constant */ -raylib.FONT_SDF = 2 +raylib.CHECK_PADDING = 16 /** - * Blend textures considering alpha (default) + * * * @type {number} * @constant */ -raylib.BLEND_ALPHA = 0 +raylib.COMBO_BUTTON_WIDTH = 16 /** - * Blend textures adding colors + * * * @type {number} * @constant */ -raylib.BLEND_ADDITIVE = 1 +raylib.COMBO_BUTTON_PADDING = 17 /** - * Blend textures multiplying colors + * * * @type {number} * @constant */ -raylib.BLEND_MULTIPLIED = 2 +raylib.ARROW_PADDING = 16 /** - * Blend textures adding colors (alternative) + * * * @type {number} * @constant */ -raylib.BLEND_ADD_COLORS = 3 +raylib.DROPDOWN_ITEMS_PADDING = 17 /** - * Blend textures subtracting colors (alternative) + * * * @type {number} * @constant */ -raylib.BLEND_SUBTRACT_COLORS = 4 +raylib.TEXT_INNER_PADDING = 16 /** - * Belnd textures using custom src/dst factors (use rlSetBlendMode()) + * * * @type {number} * @constant */ -raylib.BLEND_CUSTOM = 5 +raylib.TEXT_LINES_PADDING = 17 /** - * No gesture + * * * @type {number} * @constant */ -raylib.GESTURE_NONE = 0 +raylib.COLOR_SELECTED_FG = 18 /** - * Tap gesture + * * * @type {number} * @constant */ -raylib.GESTURE_TAP = 1 +raylib.COLOR_SELECTED_BG = 19 /** - * Double tap gesture + * * * @type {number} * @constant */ -raylib.GESTURE_DOUBLETAP = 2 +raylib.SPIN_BUTTON_WIDTH = 16 /** - * Hold gesture + * * * @type {number} * @constant */ -raylib.GESTURE_HOLD = 4 +raylib.SPIN_BUTTON_PADDING = 17 /** - * Drag gesture + * * * @type {number} * @constant */ -raylib.GESTURE_DRAG = 8 +raylib.ARROWS_SIZE = 16 /** - * Swipe right gesture + * * * @type {number} * @constant */ -raylib.GESTURE_SWIPE_RIGHT = 16 +raylib.ARROWS_VISIBLE = 17 /** - * Swipe left gesture + * * * @type {number} * @constant */ -raylib.GESTURE_SWIPE_LEFT = 32 +raylib.SCROLL_SLIDER_PADDING = 18 /** - * Swipe up gesture + * * * @type {number} * @constant */ -raylib.GESTURE_SWIPE_UP = 64 +raylib.SCROLL_SLIDER_SIZE = 19 /** - * Swipe down gesture + * * * @type {number} * @constant */ -raylib.GESTURE_SWIPE_DOWN = 128 +raylib.SCROLL_PADDING = 20 /** - * Pinch in gesture + * * * @type {number} * @constant */ -raylib.GESTURE_PINCH_IN = 256 +raylib.SCROLL_SPEED = 21 /** - * Pinch out gesture + * * * @type {number} * @constant */ -raylib.GESTURE_PINCH_OUT = 512 +raylib.SCROLLBAR_LEFT_SIDE = 0 /** - * Custom camera + * * * @type {number} * @constant */ -raylib.CAMERA_CUSTOM = 0 +raylib.SCROLLBAR_RIGHT_SIDE = 1 /** - * Free camera + * * * @type {number} * @constant */ -raylib.CAMERA_FREE = 1 +raylib.LIST_ITEMS_HEIGHT = 16 /** - * Orbital camera + * * * @type {number} * @constant */ -raylib.CAMERA_ORBITAL = 2 +raylib.LIST_ITEMS_PADDING = 17 /** - * First person camera + * * * @type {number} * @constant */ -raylib.CAMERA_FIRST_PERSON = 3 +raylib.SCROLLBAR_WIDTH = 18 /** - * Third person camera + * * * @type {number} * @constant */ -raylib.CAMERA_THIRD_PERSON = 4 +raylib.SCROLLBAR_SIDE = 19 /** - * Perspective projection + * * * @type {number} * @constant */ -raylib.CAMERA_PERSPECTIVE = 0 +raylib.COLOR_SELECTOR_SIZE = 16 /** - * Orthographic projection + * Right hue bar width * * @type {number} * @constant */ -raylib.CAMERA_ORTHOGRAPHIC = 1 +raylib.HUEBAR_WIDTH = 17 /** - * Npatch layout: 3x3 tiles + * Right hue bar separation from panel * * @type {number} * @constant */ -raylib.NPATCH_NINE_PATCH = 0 +raylib.HUEBAR_PADDING = 18 /** - * Npatch layout: 1x3 tiles + * Right hue bar selector height * * @type {number} * @constant */ -raylib.NPATCH_THREE_PATCH_VERTICAL = 1 +raylib.HUEBAR_SELECTOR_HEIGHT = 19 /** - * Npatch layout: 3x1 tiles + * Right hue bar selector overflow * * @type {number} * @constant */ -raylib.NPATCH_THREE_PATCH_HORIZONTAL = 2 +raylib.HUEBAR_SELECTOR_OVERFLOW = 20 raylib.LIGHTGRAY = { r: 200, g: 200, b: 200, a: 255 } raylib.GRAY = { r: 130, g: 130, b: 130, a: 255 } diff --git a/tools/generate.js b/tools/generate.js index 8772a76..855a93e 100644 --- a/tools/generate.js +++ b/tools/generate.js @@ -37,7 +37,11 @@ const blocklist = [ // raymath // @todo Fix helper structs for float arrays 'Vector3ToFloatV', // float3 - 'MatrixToFloatV' // float16 + 'MatrixToFloatV', // float16 + + // raygui + 'UnloadGuiStyle', // Commented out + 'LoadGuiStyle', // Commented out ] // these functions expect the first argument to be passed as a reference in C++ @@ -184,6 +188,11 @@ function getDefs () { const raymath = raylibApi.raymath functions.push(...raymath.functions) + // Add Raygui + const raygui = raylibApi.raygui + functions.push(...raygui.functions) + enums.push(...raygui.enums) + return { structs, enums, functions } } diff --git a/tools/generate_templates/node-raylib-bindings.js b/tools/generate_templates/node-raylib-bindings.js index f389f51..42312a0 100644 --- a/tools/generate_templates/node-raylib-bindings.js +++ b/tools/generate_templates/node-raylib-bindings.js @@ -185,6 +185,9 @@ module.exports = ({ functions, structs, enums, blocklist, byreflist }) => ` #include "extras/easings.h" #include "raymath.h" +#define RAYGUI_IMPLEMENTATION +#include "extras/raygui.h" + using namespace Napi; inline Napi::Value ToValue(Napi::Env env, bool value) { From 1331917c7e7fcf5e023b387b2f2a5343061673a6 Mon Sep 17 00:00:00 2001 From: Rob Loach Date: Sat, 30 Jul 2022 17:12:05 -0400 Subject: [PATCH 17/19] Fix coding styles --- docs/API.md | 876 +++++++++++++++++-------- examples/raygui/raygui_basic_window.js | 12 +- package.json | 2 +- tools/generate.js | 163 +++-- 4 files changed, 683 insertions(+), 370 deletions(-) diff --git a/docs/API.md b/docs/API.md index f662fa2..34e75af 100644 --- a/docs/API.md +++ b/docs/API.md @@ -35,7 +35,7 @@

Check if one specific window flag is enabled

SetWindowState(flags)undefined
-

Set window configuration state using flags (only PLATFORM_DESKTOP)

+

Set window configuration state using flags

ClearWindowState(flags)undefined

Clear window configuration state flags

@@ -821,7 +821,7 @@

Load font from file into GPU memory (VRAM)

LoadFontEx(fileName, fontSize, fontChars, glyphCount)Font
-

Load font from file with extended parameters, use NULL for fontChars and 0 for glyphCount to load the default character set

+

Load font from file with extended parameters

LoadFontFromImage(image, key, firstChar)Font

Load font from Image (XNA style)

@@ -839,7 +839,7 @@

Unload font chars info data (RAM)

UnloadFont(font)undefined
-

Unload font from GPU memory (VRAM)

+

Unload Font from GPU memory (VRAM)

DrawFPS(posX, posY)undefined

Draw current FPS

@@ -1276,89 +1276,164 @@
SetAudioStreamBufferSizeDefault(size)undefined

Default size for new audio streams

-
EaseLinearNone(t, b, c, d)number
-

Easing: EaseLinearNone.

+
GuiEnable()undefined
+

Enable gui controls (global state)

-
EaseLinearIn(t, b, c, d)number
-

Easing: EaseLinearIn.

+
GuiDisable()undefined
+

Disable gui controls (global state)

-
EaseLinearOut(t, b, c, d)number
-

Easing: EaseLinearOut.

+
GuiLock()undefined
+

Lock gui controls (global state)

-
EaseLinearInOut(t, b, c, d)number
-

Easing: EaseLinearInOut.

+
GuiUnlock()undefined
+

Unlock gui controls (global state)

-
EaseSineIn(t, b, c, d)number
-

Easing: EaseSineIn.

+
GuiIsLocked()boolean
+

Check if gui is locked (global state)

-
EaseSineOut(t, b, c, d)number
-

Easing: EaseSineOut.

+
GuiFade(alpha)undefined
+

Set gui controls alpha (global state), alpha goes from 0.0f to 1.0f

-
EaseSineInOut(t, b, c, d)number
-

Easing: EaseSineInOut.

+
GuiSetState(state)undefined
+

Set gui state (global state)

-
EaseCircIn(t, b, c, d)number
-

Easing: EaseCircIn.

+
GuiGetState()number
+

Get gui state (global state)

-
EaseCircOut(t, b, c, d)number
-

Easing: EaseCircOut.

+
GuiSetFont(font)undefined
+

Set gui custom font (global state)

-
EaseCircInOut(t, b, c, d)number
-

Easing: EaseCircInOut.

+
GuiGetFont()Font
+

Get gui custom font (global state)

-
EaseCubicIn(t, b, c, d)number
-

Easing: EaseCubicIn.

+
GuiSetStyle(control, property, value)undefined
+

Set one style property

-
EaseCubicOut(t, b, c, d)number
-

Easing: EaseCubicOut.

+
GuiGetStyle(control, property)number
+

Get one style property

-
EaseCubicInOut(t, b, c, d)number
-

Easing: EaseCubicInOut.

+
GuiWindowBox(bounds, title)boolean
+

Window Box control, shows a window that can be closed

-
EaseQuadIn(t, b, c, d)number
-

Easing: EaseQuadIn.

+
GuiGroupBox(bounds, text)undefined
+

Group Box control with text name

-
EaseQuadOut(t, b, c, d)number
-

Easing: EaseQuadOut.

+
GuiLine(bounds, text)undefined
+

Line separator control, could contain text

-
EaseQuadInOut(t, b, c, d)number
-

Easing: EaseQuadInOut.

+
GuiPanel(bounds)undefined
+

Panel control, useful to group controls

-
EaseExpoIn(t, b, c, d)number
-

Easing: EaseExpoIn.

+
GuiScrollPanel(bounds, content, scroll)Rectangle
+

Scroll Panel control

-
EaseExpoOut(t, b, c, d)number
-

Easing: EaseExpoOut.

+
GuiLabel(bounds, text)undefined
+

Label control, shows text

-
EaseExpoInOut(t, b, c, d)number
-

Easing: EaseExpoInOut.

+
GuiButton(bounds, text)boolean
+

Button control, returns true when clicked

-
EaseBackIn(t, b, c, d)number
-

Easing: EaseBackIn.

+
GuiLabelButton(bounds, text)boolean
+

Label button control, show true when clicked

-
EaseBackOut(t, b, c, d)number
-

Easing: EaseBackOut.

+
GuiToggle(bounds, text, active)boolean
+

Toggle Button control, returns true when active

-
EaseBackInOut(t, b, c, d)number
-

Easing: EaseBackInOut.

+
GuiToggleGroup(bounds, text, active)number
+

Toggle Group control, returns active toggle index

-
EaseBounceOut(t, b, c, d)number
-

Easing: EaseBounceOut.

+
GuiCheckBox(bounds, text, checked)boolean
+

Check Box control, returns true when active

-
EaseBounceIn(t, b, c, d)number
-

Easing: EaseBounceIn.

+
GuiComboBox(bounds, text, active)number
+

Combo Box control, returns selected item index

-
EaseBounceInOut(t, b, c, d)number
-

Easing: EaseBounceInOut.

+
GuiDropdownBox(bounds, text, active, editMode)boolean
+

Dropdown Box control, returns selected item

-
EaseElasticIn(t, b, c, d)number
-

Easing: EaseElasticIn.

+
GuiSpinner(bounds, text, value, minValue, maxValue, editMode)boolean
+

Spinner control, returns selected value

-
EaseElasticOut(t, b, c, d)number
-

Easing: EaseElasticOut.

+
GuiValueBox(bounds, text, value, minValue, maxValue, editMode)boolean
+

Value Box control, updates input text with numbers

-
EaseElasticInOut(t, b, c, d)number
-

Easing: EaseElasticInOut.

+
GuiTextBox(bounds, text, textSize, editMode)boolean
+

Text Box control, updates input text

+
+
GuiTextBoxMulti(bounds, text, textSize, editMode)boolean
+

Text Box control with multiple lines

+
+
GuiSlider(bounds, textLeft, textRight, value, minValue, maxValue)number
+

Slider control, returns selected value

+
+
GuiSliderBar(bounds, textLeft, textRight, value, minValue, maxValue)number
+

Slider Bar control, returns selected value

+
+
GuiProgressBar(bounds, textLeft, textRight, value, minValue, maxValue)number
+

Progress Bar control, shows current progress value

+
+
GuiStatusBar(bounds, text)undefined
+

Status Bar control, shows info text

+
+
GuiDummyRec(bounds, text)undefined
+

Dummy control for placeholders

+
+
GuiScrollBar(bounds, value, minValue, maxValue)number
+

Scroll Bar control

+
+
GuiGrid(bounds, spacing, subdivs)Vector2
+

Grid control

+
+
GuiListView(bounds, text, scrollIndex, active)number
+

List View control, returns selected list item index

+
+
GuiListViewEx(bounds, text, count, focus, scrollIndex, active)number
+

List View with extended parameters

+
+
GuiMessageBox(bounds, title, message, buttons)number
+

Message Box control, displays a message

+
+
GuiTextInputBox(bounds, title, message, buttons, text)number
+

Text Input Box control, ask for text

+
+
GuiColorPicker(bounds, color)Color
+

Color Picker control (multiple color controls)

+
+
GuiColorPanel(bounds, color)Color
+

Color Panel control

+
+
GuiColorBarAlpha(bounds, alpha)number
+

Color Bar Alpha control

+
+
GuiColorBarHue(bounds, value)number
+

Color Bar Hue control

+
+
GuiLoadStyle(fileName)undefined
+

Load style file over global style variable (.rgs)

+
+
GuiLoadStyleDefault()undefined
+

Load style default over global style

+
+
GuiIconText(iconId, text)string
+

Get text with icon id prepended (if supported)

+
+
GuiGetIcons()number
+

Get full icons data pointer

+
+
GuiGetIconData(iconId)number
+

Get icon bit data

+
+
GuiSetIconData(iconId, data)undefined
+

Set icon bit data

+
+
GuiSetIconPixel(iconId, x, y)undefined
+

Set icon pixel value

+
+
GuiClearIconPixel(iconId, x, y)undefined
+

Clear icon pixel value

+
+
GuiCheckIconPixel(iconId, x, y)boolean
+

Check icon pixel value

UpdateCamera(camera)undefined

Update camera position for selected mode

@@ -1620,7 +1695,7 @@ Check if one specific window flag is enabled ## SetWindowState(flags) ⇒ undefined -Set window configuration state using flags (only PLATFORM_DESKTOP) +Set window configuration state using flags **Kind**: global function @@ -4668,7 +4743,7 @@ Load font from file into GPU memory (VRAM) ## LoadFontEx(fileName, fontSize, fontChars, glyphCount) ⇒ Font -Load font from file with extended parameters, use NULL for fontChars and 0 for glyphCount to load the default character set +Load font from file with extended parameters **Kind**: global function **Returns**: Font - The resulting Font. @@ -4760,7 +4835,7 @@ Unload font chars info data (RAM) ## UnloadFont(font) ⇒ undefined -Unload font from GPU memory (VRAM) +Unload Font from GPU memory (VRAM) **Kind**: global function @@ -6627,425 +6702,664 @@ Default size for new audio streams | --- | --- | | size | number | - + -## EaseLinearNone(t, b, c, d) ⇒ number -Easing: EaseLinearNone. +## GuiEnable() ⇒ undefined +Enable gui controls (global state) + +**Kind**: global function + + +## GuiDisable() ⇒ undefined +Disable gui controls (global state) + +**Kind**: global function + + +## GuiLock() ⇒ undefined +Lock gui controls (global state) + +**Kind**: global function + + +## GuiUnlock() ⇒ undefined +Unlock gui controls (global state) + +**Kind**: global function + + +## GuiIsLocked() ⇒ boolean +Check if gui is locked (global state) + +**Kind**: global function +**Returns**: boolean - The resulting bool. + + +## GuiFade(alpha) ⇒ undefined +Set gui controls alpha (global state), alpha goes from 0.0f to 1.0f **Kind**: global function -**Returns**: number - The resulting float. | Param | Type | | --- | --- | -| t | number | -| b | number | -| c | number | -| d | number | +| alpha | number | - + -## EaseLinearIn(t, b, c, d) ⇒ number -Easing: EaseLinearIn. +## GuiSetState(state) ⇒ undefined +Set gui state (global state) **Kind**: global function -**Returns**: number - The resulting float. | Param | Type | | --- | --- | -| t | number | -| b | number | -| c | number | -| d | number | +| state | number | - + -## EaseLinearOut(t, b, c, d) ⇒ number -Easing: EaseLinearOut. +## GuiGetState() ⇒ number +Get gui state (global state) + +**Kind**: global function +**Returns**: number - The resulting int. + + +## GuiSetFont(font) ⇒ undefined +Set gui custom font (global state) **Kind**: global function -**Returns**: number - The resulting float. | Param | Type | | --- | --- | -| t | number | -| b | number | -| c | number | -| d | number | +| font | Font | - + -## EaseLinearInOut(t, b, c, d) ⇒ number -Easing: EaseLinearInOut. +## GuiGetFont() ⇒ Font +Get gui custom font (global state) + +**Kind**: global function +**Returns**: Font - The resulting Font. + + +## GuiSetStyle(control, property, value) ⇒ undefined +Set one style property **Kind**: global function -**Returns**: number - The resulting float. | Param | Type | | --- | --- | -| t | number | -| b | number | -| c | number | -| d | number | +| control | number | +| property | number | +| value | number | - + -## EaseSineIn(t, b, c, d) ⇒ number -Easing: EaseSineIn. +## GuiGetStyle(control, property) ⇒ number +Get one style property **Kind**: global function -**Returns**: number - The resulting float. +**Returns**: number - The resulting int. | Param | Type | | --- | --- | -| t | number | -| b | number | -| c | number | -| d | number | +| control | number | +| property | number | - + -## EaseSineOut(t, b, c, d) ⇒ number -Easing: EaseSineOut. +## GuiWindowBox(bounds, title) ⇒ boolean +Window Box control, shows a window that can be closed **Kind**: global function -**Returns**: number - The resulting float. +**Returns**: boolean - The resulting bool. | Param | Type | | --- | --- | -| t | number | -| b | number | -| c | number | -| d | number | +| bounds | [Rectangle](#Rectangle) | +| title | string | - + -## EaseSineInOut(t, b, c, d) ⇒ number -Easing: EaseSineInOut. +## GuiGroupBox(bounds, text) ⇒ undefined +Group Box control with text name **Kind**: global function -**Returns**: number - The resulting float. | Param | Type | | --- | --- | -| t | number | -| b | number | -| c | number | -| d | number | +| bounds | [Rectangle](#Rectangle) | +| text | string | - + -## EaseCircIn(t, b, c, d) ⇒ number -Easing: EaseCircIn. +## GuiLine(bounds, text) ⇒ undefined +Line separator control, could contain text **Kind**: global function -**Returns**: number - The resulting float. | Param | Type | | --- | --- | -| t | number | -| b | number | -| c | number | -| d | number | +| bounds | [Rectangle](#Rectangle) | +| text | string | + + + +## GuiPanel(bounds) ⇒ undefined +Panel control, useful to group controls + +**Kind**: global function + +| Param | Type | +| --- | --- | +| bounds | [Rectangle](#Rectangle) | - + -## EaseCircOut(t, b, c, d) ⇒ number -Easing: EaseCircOut. +## GuiScrollPanel(bounds, content, scroll) ⇒ [Rectangle](#Rectangle) +Scroll Panel control **Kind**: global function -**Returns**: number - The resulting float. +**Returns**: [Rectangle](#Rectangle) - The resulting Rectangle. | Param | Type | | --- | --- | -| t | number | -| b | number | -| c | number | -| d | number | +| bounds | [Rectangle](#Rectangle) | +| content | [Rectangle](#Rectangle) | +| scroll | number | - + -## EaseCircInOut(t, b, c, d) ⇒ number -Easing: EaseCircInOut. +## GuiLabel(bounds, text) ⇒ undefined +Label control, shows text **Kind**: global function -**Returns**: number - The resulting float. | Param | Type | | --- | --- | -| t | number | -| b | number | -| c | number | -| d | number | +| bounds | [Rectangle](#Rectangle) | +| text | string | - + -## EaseCubicIn(t, b, c, d) ⇒ number -Easing: EaseCubicIn. +## GuiButton(bounds, text) ⇒ boolean +Button control, returns true when clicked **Kind**: global function -**Returns**: number - The resulting float. +**Returns**: boolean - The resulting bool. | Param | Type | | --- | --- | -| t | number | -| b | number | -| c | number | -| d | number | +| bounds | [Rectangle](#Rectangle) | +| text | string | - + -## EaseCubicOut(t, b, c, d) ⇒ number -Easing: EaseCubicOut. +## GuiLabelButton(bounds, text) ⇒ boolean +Label button control, show true when clicked **Kind**: global function -**Returns**: number - The resulting float. +**Returns**: boolean - The resulting bool. | Param | Type | | --- | --- | -| t | number | -| b | number | -| c | number | -| d | number | +| bounds | [Rectangle](#Rectangle) | +| text | string | - + -## EaseCubicInOut(t, b, c, d) ⇒ number -Easing: EaseCubicInOut. +## GuiToggle(bounds, text, active) ⇒ boolean +Toggle Button control, returns true when active **Kind**: global function -**Returns**: number - The resulting float. +**Returns**: boolean - The resulting bool. | Param | Type | | --- | --- | -| t | number | -| b | number | -| c | number | -| d | number | +| bounds | [Rectangle](#Rectangle) | +| text | string | +| active | boolean | - + -## EaseQuadIn(t, b, c, d) ⇒ number -Easing: EaseQuadIn. +## GuiToggleGroup(bounds, text, active) ⇒ number +Toggle Group control, returns active toggle index **Kind**: global function -**Returns**: number - The resulting float. +**Returns**: number - The resulting int. | Param | Type | | --- | --- | -| t | number | -| b | number | -| c | number | -| d | number | +| bounds | [Rectangle](#Rectangle) | +| text | string | +| active | number | - + -## EaseQuadOut(t, b, c, d) ⇒ number -Easing: EaseQuadOut. +## GuiCheckBox(bounds, text, checked) ⇒ boolean +Check Box control, returns true when active **Kind**: global function -**Returns**: number - The resulting float. +**Returns**: boolean - The resulting bool. | Param | Type | | --- | --- | -| t | number | -| b | number | -| c | number | -| d | number | +| bounds | [Rectangle](#Rectangle) | +| text | string | +| checked | boolean | - + -## EaseQuadInOut(t, b, c, d) ⇒ number -Easing: EaseQuadInOut. +## GuiComboBox(bounds, text, active) ⇒ number +Combo Box control, returns selected item index **Kind**: global function -**Returns**: number - The resulting float. +**Returns**: number - The resulting int. | Param | Type | | --- | --- | -| t | number | -| b | number | -| c | number | -| d | number | +| bounds | [Rectangle](#Rectangle) | +| text | string | +| active | number | - + -## EaseExpoIn(t, b, c, d) ⇒ number -Easing: EaseExpoIn. +## GuiDropdownBox(bounds, text, active, editMode) ⇒ boolean +Dropdown Box control, returns selected item **Kind**: global function -**Returns**: number - The resulting float. +**Returns**: boolean - The resulting bool. | Param | Type | | --- | --- | -| t | number | -| b | number | -| c | number | -| d | number | +| bounds | [Rectangle](#Rectangle) | +| text | string | +| active | number | +| editMode | boolean | - + -## EaseExpoOut(t, b, c, d) ⇒ number -Easing: EaseExpoOut. +## GuiSpinner(bounds, text, value, minValue, maxValue, editMode) ⇒ boolean +Spinner control, returns selected value **Kind**: global function -**Returns**: number - The resulting float. +**Returns**: boolean - The resulting bool. | Param | Type | | --- | --- | -| t | number | -| b | number | -| c | number | -| d | number | +| bounds | [Rectangle](#Rectangle) | +| text | string | +| value | number | +| minValue | number | +| maxValue | number | +| editMode | boolean | - + -## EaseExpoInOut(t, b, c, d) ⇒ number -Easing: EaseExpoInOut. +## GuiValueBox(bounds, text, value, minValue, maxValue, editMode) ⇒ boolean +Value Box control, updates input text with numbers **Kind**: global function -**Returns**: number - The resulting float. +**Returns**: boolean - The resulting bool. | Param | Type | | --- | --- | -| t | number | -| b | number | -| c | number | -| d | number | +| bounds | [Rectangle](#Rectangle) | +| text | string | +| value | number | +| minValue | number | +| maxValue | number | +| editMode | boolean | - + -## EaseBackIn(t, b, c, d) ⇒ number -Easing: EaseBackIn. +## GuiTextBox(bounds, text, textSize, editMode) ⇒ boolean +Text Box control, updates input text **Kind**: global function -**Returns**: number - The resulting float. +**Returns**: boolean - The resulting bool. | Param | Type | | --- | --- | -| t | number | -| b | number | -| c | number | -| d | number | +| bounds | [Rectangle](#Rectangle) | +| text | string | +| textSize | number | +| editMode | boolean | - + -## EaseBackOut(t, b, c, d) ⇒ number -Easing: EaseBackOut. +## GuiTextBoxMulti(bounds, text, textSize, editMode) ⇒ boolean +Text Box control with multiple lines **Kind**: global function -**Returns**: number - The resulting float. +**Returns**: boolean - The resulting bool. | Param | Type | | --- | --- | -| t | number | -| b | number | -| c | number | -| d | number | +| bounds | [Rectangle](#Rectangle) | +| text | string | +| textSize | number | +| editMode | boolean | - + -## EaseBackInOut(t, b, c, d) ⇒ number -Easing: EaseBackInOut. +## GuiSlider(bounds, textLeft, textRight, value, minValue, maxValue) ⇒ number +Slider control, returns selected value **Kind**: global function **Returns**: number - The resulting float. | Param | Type | | --- | --- | -| t | number | -| b | number | -| c | number | -| d | number | +| bounds | [Rectangle](#Rectangle) | +| textLeft | string | +| textRight | string | +| value | number | +| minValue | number | +| maxValue | number | - + -## EaseBounceOut(t, b, c, d) ⇒ number -Easing: EaseBounceOut. +## GuiSliderBar(bounds, textLeft, textRight, value, minValue, maxValue) ⇒ number +Slider Bar control, returns selected value **Kind**: global function **Returns**: number - The resulting float. | Param | Type | | --- | --- | -| t | number | -| b | number | -| c | number | -| d | number | +| bounds | [Rectangle](#Rectangle) | +| textLeft | string | +| textRight | string | +| value | number | +| minValue | number | +| maxValue | number | - + -## EaseBounceIn(t, b, c, d) ⇒ number -Easing: EaseBounceIn. +## GuiProgressBar(bounds, textLeft, textRight, value, minValue, maxValue) ⇒ number +Progress Bar control, shows current progress value **Kind**: global function **Returns**: number - The resulting float. | Param | Type | | --- | --- | -| t | number | -| b | number | -| c | number | -| d | number | +| bounds | [Rectangle](#Rectangle) | +| textLeft | string | +| textRight | string | +| value | number | +| minValue | number | +| maxValue | number | + + + +## GuiStatusBar(bounds, text) ⇒ undefined +Status Bar control, shows info text + +**Kind**: global function + +| Param | Type | +| --- | --- | +| bounds | [Rectangle](#Rectangle) | +| text | string | - + -## EaseBounceInOut(t, b, c, d) ⇒ number -Easing: EaseBounceInOut. +## GuiDummyRec(bounds, text) ⇒ undefined +Dummy control for placeholders **Kind**: global function -**Returns**: number - The resulting float. | Param | Type | | --- | --- | -| t | number | -| b | number | -| c | number | -| d | number | +| bounds | [Rectangle](#Rectangle) | +| text | string | - + -## EaseElasticIn(t, b, c, d) ⇒ number -Easing: EaseElasticIn. +## GuiScrollBar(bounds, value, minValue, maxValue) ⇒ number +Scroll Bar control **Kind**: global function -**Returns**: number - The resulting float. +**Returns**: number - The resulting int. | Param | Type | | --- | --- | -| t | number | -| b | number | -| c | number | -| d | number | +| bounds | [Rectangle](#Rectangle) | +| value | number | +| minValue | number | +| maxValue | number | - + -## EaseElasticOut(t, b, c, d) ⇒ number -Easing: EaseElasticOut. +## GuiGrid(bounds, spacing, subdivs) ⇒ [Vector2](#Vector2) +Grid control + +**Kind**: global function +**Returns**: [Vector2](#Vector2) - The resulting Vector2. + +| Param | Type | +| --- | --- | +| bounds | [Rectangle](#Rectangle) | +| spacing | number | +| subdivs | number | + + + +## GuiListView(bounds, text, scrollIndex, active) ⇒ number +List View control, returns selected list item index + +**Kind**: global function +**Returns**: number - The resulting int. + +| Param | Type | +| --- | --- | +| bounds | [Rectangle](#Rectangle) | +| text | string | +| scrollIndex | number | +| active | number | + + + +## GuiListViewEx(bounds, text, count, focus, scrollIndex, active) ⇒ number +List View with extended parameters + +**Kind**: global function +**Returns**: number - The resulting int. + +| Param | Type | +| --- | --- | +| bounds | [Rectangle](#Rectangle) | +| text | number | +| count | number | +| focus | number | +| scrollIndex | number | +| active | number | + + + +## GuiMessageBox(bounds, title, message, buttons) ⇒ number +Message Box control, displays a message + +**Kind**: global function +**Returns**: number - The resulting int. + +| Param | Type | +| --- | --- | +| bounds | [Rectangle](#Rectangle) | +| title | string | +| message | string | +| buttons | string | + + + +## GuiTextInputBox(bounds, title, message, buttons, text) ⇒ number +Text Input Box control, ask for text + +**Kind**: global function +**Returns**: number - The resulting int. + +| Param | Type | +| --- | --- | +| bounds | [Rectangle](#Rectangle) | +| title | string | +| message | string | +| buttons | string | +| text | string | + + + +## GuiColorPicker(bounds, color) ⇒ [Color](#Color) +Color Picker control (multiple color controls) + +**Kind**: global function +**Returns**: [Color](#Color) - The resulting Color. + +| Param | Type | +| --- | --- | +| bounds | [Rectangle](#Rectangle) | +| color | [Color](#Color) | + + + +## GuiColorPanel(bounds, color) ⇒ [Color](#Color) +Color Panel control + +**Kind**: global function +**Returns**: [Color](#Color) - The resulting Color. + +| Param | Type | +| --- | --- | +| bounds | [Rectangle](#Rectangle) | +| color | [Color](#Color) | + + + +## GuiColorBarAlpha(bounds, alpha) ⇒ number +Color Bar Alpha control **Kind**: global function **Returns**: number - The resulting float. | Param | Type | | --- | --- | -| t | number | -| b | number | -| c | number | -| d | number | +| bounds | [Rectangle](#Rectangle) | +| alpha | number | - + -## EaseElasticInOut(t, b, c, d) ⇒ number -Easing: EaseElasticInOut. +## GuiColorBarHue(bounds, value) ⇒ number +Color Bar Hue control **Kind**: global function **Returns**: number - The resulting float. | Param | Type | | --- | --- | -| t | number | -| b | number | -| c | number | -| d | number | +| bounds | [Rectangle](#Rectangle) | +| value | number | + + + +## GuiLoadStyle(fileName) ⇒ undefined +Load style file over global style variable (.rgs) + +**Kind**: global function + +| Param | Type | +| --- | --- | +| fileName | string | + + + +## GuiLoadStyleDefault() ⇒ undefined +Load style default over global style + +**Kind**: global function + + +## GuiIconText(iconId, text) ⇒ string +Get text with icon id prepended (if supported) + +**Kind**: global function +**Returns**: string - The resulting const char *. + +| Param | Type | +| --- | --- | +| iconId | number | +| text | string | + + + +## GuiGetIcons() ⇒ number +Get full icons data pointer + +**Kind**: global function +**Returns**: number - The resulting unsigned int *. + + +## GuiGetIconData(iconId) ⇒ number +Get icon bit data + +**Kind**: global function +**Returns**: number - The resulting unsigned int *. + +| Param | Type | +| --- | --- | +| iconId | number | + + + +## GuiSetIconData(iconId, data) ⇒ undefined +Set icon bit data + +**Kind**: global function + +| Param | Type | +| --- | --- | +| iconId | number | +| data | number | + + + +## GuiSetIconPixel(iconId, x, y) ⇒ undefined +Set icon pixel value + +**Kind**: global function + +| Param | Type | +| --- | --- | +| iconId | number | +| x | number | +| y | number | + + + +## GuiClearIconPixel(iconId, x, y) ⇒ undefined +Clear icon pixel value + +**Kind**: global function + +| Param | Type | +| --- | --- | +| iconId | number | +| x | number | +| y | number | + + + +## GuiCheckIconPixel(iconId, x, y) ⇒ boolean +Check icon pixel value + +**Kind**: global function +**Returns**: boolean - The resulting bool. + +| Param | Type | +| --- | --- | +| iconId | number | +| x | number | +| y | number | diff --git a/examples/raygui/raygui_basic_window.js b/examples/raygui/raygui_basic_window.js index 69621e4..bf92afe 100644 --- a/examples/raygui/raygui_basic_window.js +++ b/examples/raygui/raygui_basic_window.js @@ -1,10 +1,10 @@ /******************************************************************************************* * -* raylib [core] example - Basic window +* raylib [raygui] example - Basic window * * raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details) * -* Copyright (c) 2018 Rob Loach (@RobLoach) +* Copyright (c) 2022 Rob Loach (@RobLoach) * ********************************************************************************************/ @@ -21,7 +21,7 @@ r.InitWindow(screenWidth, screenHeight, 'raylib [core] example - basic window') r.SetTargetFPS(60) -//r.GuiLoadStyleDefault() +// r.GuiLoadStyleDefault() // -------------------------------------------------------------------------------------- // Main game loop @@ -37,12 +37,12 @@ while (!r.WindowShouldClose()) { // Detect window close button or ESC key r.ClearBackground(backgroundColor) - if (r.GuiButton(r.Rectangle(30, 100, 200, 30), "Change Background Color")) { + if (r.GuiButton(r.Rectangle(30, 100, 200, 30), 'Change Background Color')) { showMessageBox = true } if (showMessageBox) { - switch (r.GuiMessageBox(r.Rectangle(r.GetScreenWidth() / 2 - 200, r.GetScreenHeight() / 2 - 50, 400, 100), "Change Background Color", "Do you really want to change the background?", "Yes;No")) { + switch (r.GuiMessageBox(r.Rectangle(r.GetScreenWidth() / 2 - 200, r.GetScreenHeight() / 2 - 50, 400, 100), 'Change Background Color', 'Do you really want to change the background?', 'Yes;No')) { case 0: case 2: showMessageBox = false @@ -52,7 +52,7 @@ while (!r.WindowShouldClose()) { // Detect window close button or ESC key r.GetRandomValue(0, 255), r.GetRandomValue(0, 255), r.GetRandomValue(0, 255), - 255, + 255 ) showMessageBox = false } diff --git a/package.json b/package.json index 016c197..2805aba 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "start": "bin/node-raylib examples/core/core_basic_window.js", "benchmark": "bin/node-raylib examples/textures/textures_bunnymark.js", "test": "jest", - "posttest-ignore": "standard tools test examples index.js", + "posttest": "standard tools test examples index.js", "test:fix": "standard --fix", "postinstall": "node tools/postinstall.js || npm run compile", "clean": "rm -rf build", diff --git a/tools/generate.js b/tools/generate.js index 855a93e..83169e7 100644 --- a/tools/generate.js +++ b/tools/generate.js @@ -41,7 +41,7 @@ const blocklist = [ // raygui 'UnloadGuiStyle', // Commented out - 'LoadGuiStyle', // Commented out + 'LoadGuiStyle' // Commented out ] // these functions expect the first argument to be passed as a reference in C++ @@ -109,97 +109,96 @@ const rSize = /\[([0-9]+)\]/g // pre-process the data for later analysis function getDefs () { const { structs, enums, functions } = raylibApi.raylib - - for (const struct of structs) { - // take multi-fields (like in Matrix) and make them all distinct fields - - // temporary fix for building on Mac/Win? Wonder why this is necessary - if (struct.name === 'BoneInfo') { - struct.fields[1].type = 'char' - } - - let newfields = [] - for (const i in struct.fields) { - const field = struct.fields[i] - - if (field.name.includes(',')) { - newfields = [...newfields, ...field.name.split(',').map(n => { - return { - ...field, - name: n.trim() - } - })].sort((a, b) => a.name.match(/\d+/)[0] - b.name.match(/\d+/)[0]) - } else { - newfields.push(field) + for (const struct of structs) { + // take multi-fields (like in Matrix) and make them all distinct fields + + // temporary fix for building on Mac/Win? Wonder why this is necessary + if (struct.name === 'BoneInfo') { + struct.fields[1].type = 'char' + } + + let newfields = [] + for (const i in struct.fields) { + const field = struct.fields[i] + + if (field.name.includes(',')) { + newfields = [...newfields, ...field.name.split(',').map(n => { + return { + ...field, + name: n.trim() } - } - struct.fields = newfields - - // find all arrays in structs, and give all fields a size and stripped name for later - for (const field of struct.fields) { - const n = [...field.name.matchAll(rSize)] - if (n.length) { - field.size = parseInt(n[0][1]) - field.name = field.name.replace(rSize, '') - } else { - field.size = 1 - } - const type = field.type.replace(/[* ]+/g, '') - if (typeAliases[type]) { - field.type = typeAliases[type] - } - } - - // TODO: should I also process *-refs to seperate name & the fact it's a ref? + })].sort((a, b) => a.name.match(/\d+/)[0] - b.name.match(/\d+/)[0]) + } else { + newfields.push(field) } - - // aliases - // structs.push({ ...structs.find(s => s.name === 'Vector4'), name: 'Quaternion' }) - - // XXX: Since array support isn't complete, just filter out all structs & functions that use them, - // so we get an (incomplete) wrapper that will build. - - for (const struct of structs) { - const usesArray = struct.fields.find(f => f.size !== 1) - if (usesArray) { - blocklist.push(struct.name) - } + } + struct.fields = newfields + + // find all arrays in structs, and give all fields a size and stripped name for later + for (const field of struct.fields) { + const n = [...field.name.matchAll(rSize)] + if (n.length) { + field.size = parseInt(n[0][1]) + field.name = field.name.replace(rSize, '') + } else { + field.size = 1 } - - // filter out all functions that use blocked types - for (const f of functions) { - if (blocklist.includes(f.returnType.replace(/[* ]/g, ''))) { + const type = field.type.replace(/[* ]+/g, '') + if (typeAliases[type]) { + field.type = typeAliases[type] + } + } + + // TODO: should I also process *-refs to seperate name & the fact it's a ref? + } + + // aliases + // structs.push({ ...structs.find(s => s.name === 'Vector4'), name: 'Quaternion' }) + + // XXX: Since array support isn't complete, just filter out all structs & functions that use them, + // so we get an (incomplete) wrapper that will build. + + for (const struct of structs) { + const usesArray = struct.fields.find(f => f.size !== 1) + if (usesArray) { + blocklist.push(struct.name) + } + } + + // filter out all functions that use blocked types + for (const f of functions) { + if (blocklist.includes(f.returnType.replace(/[* ]/g, ''))) { + blocklist.push(f.name) + } else { + for (const param of (f.params || [])) { + if (blocklist.includes(param.type.replace(/[* ]/g, ''))) { blocklist.push(f.name) - } else { - for (const param of (f.params || [])) { - if (blocklist.includes(param.type.replace(/[* ]/g, ''))) { - blocklist.push(f.name) - break - } - } + break } } + } + } - // Add the Easings API - const easings = raylibApi.easings - functions.push(...easings.functions) + // Add the Easings API + const easings = raylibApi.easings + functions.push(...easings.functions) - // Add Raymath - const raymath = raylibApi.raymath - functions.push(...raymath.functions) + // Add Raymath + const raymath = raylibApi.raymath + functions.push(...raymath.functions) - // Add Raygui - const raygui = raylibApi.raygui - functions.push(...raygui.functions) - enums.push(...raygui.enums) + // Add Raygui + const raygui = raylibApi.raygui + functions.push(...raygui.functions) + enums.push(...raygui.enums) - return { structs, enums, functions } + return { structs, enums, functions } } const { structs, enums, functions } = getDefs() - const GenBindings = require('./generate_templates/node-raylib-bindings.js') - const GenWrapper = require('./generate_templates/node-raylib-wrapper.js') - const GenTSDefs = require('./generate_templates/node-raylib-definitions.js') - writeFileSync(path.join(__dirname, '..', 'src', 'generated', 'node-raylib.cc'), GenBindings({ enums, blocklist, functions, structs, byreflist })) - writeFileSync(path.join(__dirname, '..', 'src', 'generated', 'node-raylib.js'), GenWrapper({ enums, blocklist, functions, structs, byreflist })) - writeFileSync(path.join(__dirname, '..', 'src', 'generated', 'node-raylib.d.ts'), GenTSDefs({ enums, blocklist, functions, structs, byreflist })) +const GenBindings = require('./generate_templates/node-raylib-bindings.js') +const GenWrapper = require('./generate_templates/node-raylib-wrapper.js') +const GenTSDefs = require('./generate_templates/node-raylib-definitions.js') +writeFileSync(path.join(__dirname, '..', 'src', 'generated', 'node-raylib.cc'), GenBindings({ enums, blocklist, functions, structs, byreflist })) +writeFileSync(path.join(__dirname, '..', 'src', 'generated', 'node-raylib.js'), GenWrapper({ enums, blocklist, functions, structs, byreflist })) +writeFileSync(path.join(__dirname, '..', 'src', 'generated', 'node-raylib.d.ts'), GenTSDefs({ enums, blocklist, functions, structs, byreflist })) From e3f1d16760091041866edb2b9b68e59891b27aa3 Mon Sep 17 00:00:00 2001 From: Rob Loach Date: Sat, 30 Jul 2022 17:23:17 -0400 Subject: [PATCH 18/19] Fix BoneInfo definition --- examples/raygui/raygui_basic_window.js | 2 +- src/generated/node-raylib.cc | 14 ++++++++++++++ src/generated/node-raylib.d.ts | 2 +- tools/generate.js | 13 +++---------- tools/generate_templates/ArgumentTypeConversion.js | 1 + 5 files changed, 20 insertions(+), 12 deletions(-) diff --git a/examples/raygui/raygui_basic_window.js b/examples/raygui/raygui_basic_window.js index bf92afe..0163d35 100644 --- a/examples/raygui/raygui_basic_window.js +++ b/examples/raygui/raygui_basic_window.js @@ -17,7 +17,7 @@ const screenHeight = 450 let showMessageBox = false let backgroundColor = r.RAYWHITE -r.InitWindow(screenWidth, screenHeight, 'raylib [core] example - basic window') +r.InitWindow(screenWidth, screenHeight, 'raylib [raygui] example - basic window') r.SetTargetFPS(60) diff --git a/src/generated/node-raylib.cc b/src/generated/node-raylib.cc index 4ef2a12..93004c4 100644 --- a/src/generated/node-raylib.cc +++ b/src/generated/node-raylib.cc @@ -263,6 +263,13 @@ inline Transform TransformFromValue(const Napi::CallbackInfo& info, int index) { }; } +inline BoneInfo BoneInfoFromValue(const Napi::CallbackInfo& info, int index) { + return { + pointerFromValue(info, index + 0), + charFromValue(info, index + 1) + }; +} + inline Model ModelFromValue(const Napi::CallbackInfo& info, int index) { return { MatrixFromValue(info, index + 0), @@ -531,6 +538,13 @@ inline Napi::Value ToValue(Napi::Env env, Transform obj) { return out; } +inline Napi::Value ToValue(Napi::Env env, BoneInfo obj) { + Napi::Object out = Napi::Object::New(env); + out.Set("name", ToValue(env, obj.name)); + out.Set("parent", ToValue(env, obj.parent)); + return out; +} + inline Napi::Value ToValue(Napi::Env env, Model obj) { Napi::Object out = Napi::Object::New(env); out.Set("transform", ToValue(env, obj.transform)); diff --git a/src/generated/node-raylib.d.ts b/src/generated/node-raylib.d.ts index af02993..675df3c 100644 --- a/src/generated/node-raylib.d.ts +++ b/src/generated/node-raylib.d.ts @@ -256,7 +256,7 @@ declare module "raylib" { /** Bone, skeletal animation bone */ export interface BoneInfo { /** Bone name */ - name: char[32] + name: string /** Bone parent */ parent: string } diff --git a/tools/generate.js b/tools/generate.js index 83169e7..7ea43fc 100644 --- a/tools/generate.js +++ b/tools/generate.js @@ -6,31 +6,24 @@ const path = require('path') // use this to keep from wrapping things const blocklist = [ - // error: invalid conversion from ‘void (*)(int, const char*, ...)’ to ‘void (*)()’ [-fpermissive] + // Error: invalid conversion from ‘void (*)(int, const char*, ...)’ to ‘void (*)()’ [-fpermissive] 'TraceLog', 'TextFormat', - // edge case: need additional wrapping to function + // Edge case: need additional wrapping to function 'SetShaderValue', 'SetShaderValueV', - // DataCallback types not implemented in JSON? + // Callbacks: Not supported yet 'SetTraceLogCallback', 'SetLoadFileDataCallback', 'SetSaveFileDataCallback', 'SetLoadFileTextCallback', 'SetSaveFileTextCallback', - // these appear to not be defined, even though they are in JSON - 'SetWindowOpacity', - 'GetRenderWidth', - 'GetRenderHeight', - 'ExportFontAsCode', - // Structs // @todo Verify Structs that have array properties 'VrStereoConfig', // Matrix[2], float[2] - 'BoneInfo', // char[32] 'VrDeviceInfo', // float[4] 'Material', // float[4] diff --git a/tools/generate_templates/ArgumentTypeConversion.js b/tools/generate_templates/ArgumentTypeConversion.js index cc0fcc3..d8f828c 100644 --- a/tools/generate_templates/ArgumentTypeConversion.js +++ b/tools/generate_templates/ArgumentTypeConversion.js @@ -5,6 +5,7 @@ function ArgumentTypeConversion (arg) { if (arg === 'char') { return 'string' } if (arg === 'char *') { return 'string' } if (arg === 'const char *') { return 'string' } + if (arg === 'char[32]') { return 'string' } if (arg === 'int') { return 'number' } if (arg === 'float') { return 'number' } From a54277771afad5cde293cf7214a3318624519e9b Mon Sep 17 00:00:00 2001 From: David Konsumer Date: Thu, 4 Aug 2022 22:19:18 -0700 Subject: [PATCH 19/19] setting both BoneInfo fields to char makes it build --- src/generated/node-raylib.cc | 2 +- tools/generate.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/generated/node-raylib.cc b/src/generated/node-raylib.cc index 93004c4..5dfedd0 100644 --- a/src/generated/node-raylib.cc +++ b/src/generated/node-raylib.cc @@ -265,7 +265,7 @@ inline Transform TransformFromValue(const Napi::CallbackInfo& info, int index) { inline BoneInfo BoneInfoFromValue(const Napi::CallbackInfo& info, int index) { return { - pointerFromValue(info, index + 0), + charFromValue(info, index + 0), charFromValue(info, index + 1) }; } diff --git a/tools/generate.js b/tools/generate.js index 7ea43fc..f33d2c8 100644 --- a/tools/generate.js +++ b/tools/generate.js @@ -107,6 +107,7 @@ function getDefs () { // temporary fix for building on Mac/Win? Wonder why this is necessary if (struct.name === 'BoneInfo') { + struct.fields[0].type = 'char' struct.fields[1].type = 'char' }