diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..7fca474 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,8 @@ +.git +.cache +**/.cache +dist +node_modules +*.tgz +libraylib.dylib +libraylib.so diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..57e5ac3 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,135 @@ +name: CI + +on: + push: + branches: + - main + pull_request: + +permissions: + contents: read + +jobs: + validate: + strategy: + fail-fast: false + matrix: + os: + - ubuntu-24.04 + - macos-15 + runs-on: ${{ matrix.os }} + timeout-minutes: 30 + + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: 24 + cache: npm + + - name: Install raylib build dependencies + if: runner.os == 'Linux' + run: | + sudo apt-get update + sudo apt-get install -y \ + cmake \ + libasound2-dev \ + libgl1-mesa-dev \ + libglu1-mesa-dev \ + libx11-dev \ + libxcursor-dev \ + libxi-dev \ + libxinerama-dev \ + libxrandr-dev \ + ninja-build \ + patch \ + unzip \ + xauth \ + xvfb + + - name: Build pinned raylib dynamic library + shell: bash + run: | + git clone --filter=blob:none https://github.com/raysan5/raylib.git "$RUNNER_TEMP/raylib" + git -C "$RUNNER_TEMP/raylib" checkout dbc56a87da87d973a9c5baa4e7438a9d20121d28 + cmake \ + -S "$RUNNER_TEMP/raylib" \ + -B "$RUNNER_TEMP/raylib-build" \ + -G Ninja \ + -DBUILD_EXAMPLES=OFF \ + -DBUILD_SHARED_LIBS=ON \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX="$RUNNER_TEMP/raylib-install" + cmake --build "$RUNNER_TEMP/raylib-build" + cmake --install "$RUNNER_TEMP/raylib-build" + echo "RAYLIB_INCLUDE_DIR=$RUNNER_TEMP/raylib-install/include" >> "$GITHUB_ENV" + if [[ "$RUNNER_OS" == "macOS" ]]; then + ln -s "$RUNNER_TEMP/raylib-install/lib/libraylib.dylib" ./libraylib.dylib + else + ln -s "$RUNNER_TEMP/raylib-install/lib/libraylib.so" ./libraylib.so + echo "LD_LIBRARY_PATH=$RUNNER_TEMP/raylib-install/lib" >> "$GITHUB_ENV" + fi + + - name: Download pinned GocciaScript release + shell: bash + run: | + case "$RUNNER_OS-$RUNNER_ARCH" in + macOS-ARM64) + asset="gocciascript-0.10.0-macos-arm64.zip" + ;; + macOS-X64) + asset="gocciascript-0.10.0-macos-x64.zip" + ;; + Linux-ARM64) + asset="gocciascript-0.10.0-linux-arm64.tar.gz" + ;; + Linux-X64) + asset="gocciascript-0.10.0-linux-x64.tar.gz" + ;; + *) + echo "Unsupported runner: $RUNNER_OS-$RUNNER_ARCH" >&2 + exit 1 + ;; + esac + curl --fail --location \ + "https://github.com/frostney/GocciaScript/releases/download/0.10.0/$asset" \ + --output "$RUNNER_TEMP/$asset" + mkdir -p "$RUNNER_TEMP/gocciascript" + if [[ "$asset" == *.zip ]]; then + unzip -q "$RUNNER_TEMP/$asset" -d "$RUNNER_TEMP/gocciascript" + else + tar -xzf "$RUNNER_TEMP/$asset" -C "$RUNNER_TEMP/gocciascript" + fi + loader="$(find "$RUNNER_TEMP/gocciascript" -type f -name GocciaScriptLoader -print -quit)" + test_runner="$(find "$RUNNER_TEMP/gocciascript" -type f -name GocciaTestRunner -print -quit)" + chmod +x "$loader" "$test_runner" + echo "GOCCIA_LOADER=$loader" >> "$GITHUB_ENV" + echo "GOCCIA_TEST_RUNNER=$test_runner" >> "$GITHUB_ENV" + + - run: npm ci + - run: npm run generate + - run: git diff --exit-code + - run: npm test + - run: npm run check:generated + - run: npm run test:types + - run: npm run test:abi + - run: npm run test:ffi + - run: npm run pack:check + + - name: Example startup smokes + if: runner.os == 'Linux' + shell: bash + run: | + mkdir -p .cache + xvfb-run -a "$GOCCIA_LOADER" tests/fixtures/basic-window-smoke.ts + xvfb-run -a "$GOCCIA_LOADER" tests/fixtures/basic-input-smoke.ts + xvfb-run -a "$GOCCIA_LOADER" tests/fixtures/image-loading-smoke.ts + xvfb-run -a "$GOCCIA_LOADER" examples/smoke.ts + xvfb-run -a "$GOCCIA_LOADER" tests/fixtures/doom-smoke.ts + test -s .cache/doom-smoke.png + + - name: Goccia-executed DOOM GPL smoke + if: runner.os == 'Linux' + shell: bash + run: xvfb-run -a make -C examples/doom-gpl smoke diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e1c5fc7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +.cache/ +dist/ +node_modules/ +*.tgz +.DS_Store +libraylib.dylib +libraylib.so +raylib.dll diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..640c640 --- /dev/null +++ b/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2026 John Stein + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index 35c0a5e..f7cbdb4 100644 --- a/README.md +++ b/README.md @@ -1 +1,175 @@ -# GocciaScript-Raylib \ No newline at end of file +# GocciaScript raylib + +Generated, ABI-checked [raylib 6.0](https://github.com/raysan5/raylib/releases/tag/6.0) +bindings for [GocciaScript 0.10.0](https://github.com/frostney/GocciaScript/releases/tag/0.10.0). +The bindings load raylib as a dynamic library and keep unsafe FFI use explicit. + +## What is included + +- deterministic TypeScript bindings and declarations generated from the pinned + official `raylib_api.json`; +- all 35 native struct layouts checked against `raylib.h`; +- a machine-readable stable-runtime skip report; +- macOS and Linux dynamic-library discovery; +- typed basic-window, keyboard-input, embedded-image, Bunnymark, and playable + raycasting examples, all with an on-screen FPS counter; +- a separately licensed DOOM port whose game logic and software renderer + execute inside GocciaScript, with dynamic raylib used only for platform I/O; +- package, generator, ABI, and representative native-call validation. + +GocciaScript reserves aggregate properties named `buffer` and `byteOffset`. +raylib's `AudioStream.buffer` is therefore exposed as `nativeBuffer`; the +generated `RAYLIB_FIELD_ALIASES` object records this sole 6.0 rename. + +`const char *` values and non-owned text returns use GocciaScript's UTF-8 +string descriptor. Mutable `char *` arguments and owned `char *` returns remain +raw pointers so callers can mutate them and return the exact allocation to +`UnloadFileText`, `UnloadUTF8`, or `MemFree`. Pointer arguments accept native +pointers, buffers, typed arrays, aggregates, and `null`. + +Stable FFI cannot express a parameter that accepts either a JavaScript string +or a null pointer with one descriptor. `LoadShaderRaw`, +`LoadShaderFromMemoryRaw`, and `LoadAutomationEventListRaw` are therefore +generated as additional raw-pointer bindings for their documented nullable +C-string parameters. The four text-replacement APIs likewise expose `Raw` +variants for their nullable replacement argument. The normal exports remain +convenient for non-null strings. + +The official raylib 6.0 API describes 600 functions. Three are intentionally +outside the 0.1 scope (`TraceLog`, `TextFormat`, and `DrawBillboardPro`). +GocciaScript 0.10.0 also rejects functions that mix a top-level `f32` argument +with other top-level argument types. Every other function is generated, and +[SKIPPED.md](SKIPPED.md) records the exact stable-version boundary. No shim is +presented as native coverage. + +## Requirements + +- GocciaScript 0.10.0 +- raylib 6.0 built as a shared/dynamic library +- Node.js 24 or newer for host filesystem, hashing, compiler, and packaging + orchestration +- a C11 compiler for ABI validation + +On macOS: + +```sh +brew install raylib +``` + +On Linux, install or build raylib 6.0 with `BUILD_SHARED_LIBS=ON` and make +`libraylib.so` discoverable. The generated module checks the current directory, +common `/usr` and `/usr/local` paths, and the platform loader path. A launcher +can set `globalThis.RAYLIB_LIBRARY_PATH` before dynamically importing the +bindings when raylib lives elsewhere. + +## Run an example + +The repository `goccia.json` opts into only the unsafe FFI extension. The +examples are TypeScript, which GocciaScript parses as types-as-comments, and +use `for...of`; neither the traditional-`for` nor `while` compatibility flag +is required: + +```sh +GocciaScriptLoader examples/basic-window.ts +GocciaScriptLoader examples/basic-input.ts +GocciaScriptLoader examples/image-loading.ts +GocciaScriptLoader examples/bunnymark.ts +GocciaScriptLoader examples/doom-clone.ts +``` + +Bunnymark uses an immutable ESM byte import of the pinned `raybunny.png`; it +does not read an asset through a host filesystem API. + +`doom-clone.ts` remains a small, clean-room MIT raycaster. The repository also +contains [an actual DOOM engine example](examples/doom-gpl/README.md) in the +separately licensed `examples/doom-gpl/` subproject: + +```sh +make -C examples/doom-gpl run IWAD=/absolute/path/to/doom.wad +# Or download checksummed, freely redistributable Freedoom data: +make -C examples/doom-gpl run-freedoom +``` + +The GPL subproject adapts a pinned pure-JavaScript LinuxDoom port into static +GocciaScript TypeScript modules. WAD parsing, thinkers, AI, BSP traversal, and +software rendering run in GocciaScript bytecode. There is no native or +WebAssembly DOOM engine; dynamic raylib handles the window, input, framebuffer +upload, and FPS overlay. No proprietary IWAD is committed, and the entire GPL +directory is excluded from the MIT npm tarball. + +The full engine legitimately uses classic `for`, `while`, and `do...while` +loops. Their compatibility flags are scoped to `examples/doom-gpl/goccia.json`; +the bindings and smaller MIT examples do not enable them. The initial +GocciaScript 0.10.0 implementation renders at roughly 3 FPS on an Apple M1 Max, +so it is genuine but not yet real-time. + +## Bunnymark performance + +A five-trial, uncapped comparison with 10,000 fixed-seed sprites found no +performance case for compatibility loops: + +| Loop | Mean observed FPS | Mean 25-frame time after startup | +|---|---:|---:| +| current `for...of` | 4.06 | 6.3348 s | +| indexed classic `for` | 3.96 | 6.4842 s | +| indexed `while` | 4.02 | 6.3692 s | + +The result is dominated by rendering and the per-sprite `DrawTextureV` FFI +crossing. The current `for...of` loop stays, and both legacy loop flags remain +disabled. [Full methodology and raw results](benchmarks/bunnymark-loop-syntax.md) +are recorded in the repository. + +## Project scripts and tests + +The pure API-repair and normalization core is GocciaScript-compatible +TypeScript in `scripts/lib/api-core.ts`, and the unit suite runs in +GocciaScript's own test runner in both interpreter and bytecode modes. + +The thin `.mjs` host adapters remain Node scripts because regeneration must +read and write the real checkout, compute SHA-256 digests, invoke the C +compiler, and inspect `npm pack`. Stable `GocciaScriptLoader` intentionally +does not expose ambient host filesystem or process APIs; the sandbox runner +uses a virtual filesystem whose writes are returned as a diff rather than +materialized into the checkout. + +## Regenerate and validate + +```sh +npm run vendor:update # only when intentionally refreshing pinned inputs +npm run generate +npm test +npm run check:generated +npm run test:types + +GOCCIA_LOADER=/path/to/GocciaScriptLoader npm run test:abi +GOCCIA_LOADER=/path/to/GocciaScriptLoader npm run test:ffi +npm run pack:check +``` + +`RAYLIB_INCLUDE_DIR` may point at a non-standard header directory for the ABI +test. Regeneration verifies the pinned commit, checksums, repaired JSON defect, +inventory, and output determinism before writing artifacts. + +The Linux release lane can also be reproduced from macOS or Linux with: + +```sh +docker build -f tests/linux/Dockerfile . +``` + +## Upgrade policy + +1. Update `metadata/raylib.json` to an official stable tag and commit. +2. Record new source and asset SHA-256 values. +3. Run `npm run vendor:update && npm run generate`. +4. Review the normalized inventory and skip report. +5. Run unit, ABI, FFI, package, and example smoke validation on macOS and Linux. + +Do not silently accept upstream input drift: pin changes and the narrow JSON +repair are reviewable release changes. + +## License + +This package is available under the [MIT License](LICENSE). raylib remains +under its upstream zlib license. `examples/doom-gpl/` is an explicitly +separate GPL-2.0-only subproject and is excluded from the MIT npm package. +No proprietary IWAD is included anywhere. diff --git a/SKIPPED.json b/SKIPPED.json new file mode 100644 index 0000000..a951f40 --- /dev/null +++ b/SKIPPED.json @@ -0,0 +1,684 @@ +{ + "schemaVersion": 1, + "raylibVersion": "6.0", + "raylibCommit": "dbc56a87da87d973a9c5baa4e7438a9d20121d28", + "gocciaScriptVersion": "0.10.0", + "apiFunctions": 600, + "callableTargetAfterUpstreamSupport": 597, + "generatedFunctions": 488, + "skippedFunctions": 112, + "skipped": [ + { + "name": "TraceLog", + "reason": "varargs", + "category": "intentional-0.1-scope", + "signature": "void TraceLog(int, const char *, ...)" + }, + { + "name": "SetGamepadVibration", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "void SetGamepadVibration(int, float, float, float)" + }, + { + "name": "UpdateCameraPro", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "void UpdateCameraPro(Camera *, Vector3, Vector3, float)" + }, + { + "name": "DrawLineEx", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "void DrawLineEx(Vector2, Vector2, float, Color)" + }, + { + "name": "DrawLineBezier", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "void DrawLineBezier(Vector2, Vector2, float, Color)" + }, + { + "name": "DrawCircle", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "void DrawCircle(int, int, float, Color)" + }, + { + "name": "DrawCircleV", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "void DrawCircleV(Vector2, float, Color)" + }, + { + "name": "DrawCircleGradient", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "void DrawCircleGradient(Vector2, float, Color, Color)" + }, + { + "name": "DrawCircleSector", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "void DrawCircleSector(Vector2, float, float, float, int, Color)" + }, + { + "name": "DrawCircleSectorLines", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "void DrawCircleSectorLines(Vector2, float, float, float, int, Color)" + }, + { + "name": "DrawCircleLines", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "void DrawCircleLines(int, int, float, Color)" + }, + { + "name": "DrawCircleLinesV", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "void DrawCircleLinesV(Vector2, float, Color)" + }, + { + "name": "DrawEllipse", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "void DrawEllipse(int, int, float, float, Color)" + }, + { + "name": "DrawEllipseV", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "void DrawEllipseV(Vector2, float, float, Color)" + }, + { + "name": "DrawEllipseLines", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "void DrawEllipseLines(int, int, float, float, Color)" + }, + { + "name": "DrawEllipseLinesV", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "void DrawEllipseLinesV(Vector2, float, float, Color)" + }, + { + "name": "DrawRing", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "void DrawRing(Vector2, float, float, float, float, int, Color)" + }, + { + "name": "DrawRingLines", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "void DrawRingLines(Vector2, float, float, float, float, int, Color)" + }, + { + "name": "DrawRectanglePro", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "void DrawRectanglePro(Rectangle, Vector2, float, Color)" + }, + { + "name": "DrawRectangleLinesEx", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "void DrawRectangleLinesEx(Rectangle, float, Color)" + }, + { + "name": "DrawRectangleRounded", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "void DrawRectangleRounded(Rectangle, float, int, Color)" + }, + { + "name": "DrawRectangleRoundedLines", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "void DrawRectangleRoundedLines(Rectangle, float, int, Color)" + }, + { + "name": "DrawRectangleRoundedLinesEx", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "void DrawRectangleRoundedLinesEx(Rectangle, float, int, float, Color)" + }, + { + "name": "DrawPoly", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "void DrawPoly(Vector2, int, float, float, Color)" + }, + { + "name": "DrawPolyLines", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "void DrawPolyLines(Vector2, int, float, float, Color)" + }, + { + "name": "DrawPolyLinesEx", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "void DrawPolyLinesEx(Vector2, int, float, float, float, Color)" + }, + { + "name": "DrawSplineLinear", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "void DrawSplineLinear(const Vector2 *, int, float, Color)" + }, + { + "name": "DrawSplineBasis", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "void DrawSplineBasis(const Vector2 *, int, float, Color)" + }, + { + "name": "DrawSplineCatmullRom", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "void DrawSplineCatmullRom(const Vector2 *, int, float, Color)" + }, + { + "name": "DrawSplineBezierQuadratic", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "void DrawSplineBezierQuadratic(const Vector2 *, int, float, Color)" + }, + { + "name": "DrawSplineBezierCubic", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "void DrawSplineBezierCubic(const Vector2 *, int, float, Color)" + }, + { + "name": "DrawSplineSegmentLinear", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "void DrawSplineSegmentLinear(Vector2, Vector2, float, Color)" + }, + { + "name": "DrawSplineSegmentBasis", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "void DrawSplineSegmentBasis(Vector2, Vector2, Vector2, Vector2, float, Color)" + }, + { + "name": "DrawSplineSegmentCatmullRom", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "void DrawSplineSegmentCatmullRom(Vector2, Vector2, Vector2, Vector2, float, Color)" + }, + { + "name": "DrawSplineSegmentBezierQuadratic", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "void DrawSplineSegmentBezierQuadratic(Vector2, Vector2, Vector2, float, Color)" + }, + { + "name": "DrawSplineSegmentBezierCubic", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "void DrawSplineSegmentBezierCubic(Vector2, Vector2, Vector2, Vector2, float, Color)" + }, + { + "name": "GetSplinePointLinear", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "Vector2 GetSplinePointLinear(Vector2, Vector2, float)" + }, + { + "name": "GetSplinePointBasis", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "Vector2 GetSplinePointBasis(Vector2, Vector2, Vector2, Vector2, float)" + }, + { + "name": "GetSplinePointCatmullRom", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "Vector2 GetSplinePointCatmullRom(Vector2, Vector2, Vector2, Vector2, float)" + }, + { + "name": "GetSplinePointBezierQuad", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "Vector2 GetSplinePointBezierQuad(Vector2, Vector2, Vector2, float)" + }, + { + "name": "GetSplinePointBezierCubic", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "Vector2 GetSplinePointBezierCubic(Vector2, Vector2, Vector2, Vector2, float)" + }, + { + "name": "CheckCollisionCircles", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "bool CheckCollisionCircles(Vector2, float, Vector2, float)" + }, + { + "name": "CheckCollisionCircleRec", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "bool CheckCollisionCircleRec(Vector2, float, Rectangle)" + }, + { + "name": "CheckCollisionCircleLine", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "bool CheckCollisionCircleLine(Vector2, float, Vector2, Vector2)" + }, + { + "name": "CheckCollisionPointCircle", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "bool CheckCollisionPointCircle(Vector2, Vector2, float)" + }, + { + "name": "GenImageGradientRadial", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "Image GenImageGradientRadial(int, int, float, Color, Color)" + }, + { + "name": "GenImageGradientSquare", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "Image GenImageGradientSquare(int, int, float, Color, Color)" + }, + { + "name": "GenImageWhiteNoise", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "Image GenImageWhiteNoise(int, int, float)" + }, + { + "name": "GenImagePerlinNoise", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "Image GenImagePerlinNoise(int, int, int, int, float)" + }, + { + "name": "ImageTextEx", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "Image ImageTextEx(Font, const char *, float, float, Color)" + }, + { + "name": "ImageAlphaCrop", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "void ImageAlphaCrop(Image *, float)" + }, + { + "name": "ImageAlphaClear", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "void ImageAlphaClear(Image *, Color, float)" + }, + { + "name": "ImageColorContrast", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "void ImageColorContrast(Image *, float)" + }, + { + "name": "GetImageAlphaBorder", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "Rectangle GetImageAlphaBorder(Image, float)" + }, + { + "name": "ImageDrawTextEx", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "void ImageDrawTextEx(Image *, Font, const char *, Vector2, float, float, Color)" + }, + { + "name": "DrawTextureEx", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "void DrawTextureEx(Texture2D, Vector2, float, float, Color)" + }, + { + "name": "DrawTexturePro", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "void DrawTexturePro(Texture2D, Rectangle, Rectangle, Vector2, float, Color)" + }, + { + "name": "DrawTextureNPatch", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "void DrawTextureNPatch(Texture2D, NPatchInfo, Rectangle, Vector2, float, Color)" + }, + { + "name": "Fade", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "Color Fade(Color, float)" + }, + { + "name": "ColorBrightness", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "Color ColorBrightness(Color, float)" + }, + { + "name": "ColorContrast", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "Color ColorContrast(Color, float)" + }, + { + "name": "ColorAlpha", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "Color ColorAlpha(Color, float)" + }, + { + "name": "ColorLerp", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "Color ColorLerp(Color, Color, float)" + }, + { + "name": "DrawTextEx", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "void DrawTextEx(Font, const char *, Vector2, float, float, Color)" + }, + { + "name": "DrawTextPro", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "void DrawTextPro(Font, const char *, Vector2, Vector2, float, float, float, Color)" + }, + { + "name": "DrawTextCodepoint", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "void DrawTextCodepoint(Font, int, Vector2, float, Color)" + }, + { + "name": "DrawTextCodepoints", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "void DrawTextCodepoints(Font, const int *, int, Vector2, float, float, Color)" + }, + { + "name": "MeasureTextEx", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "Vector2 MeasureTextEx(Font, const char *, float, float)" + }, + { + "name": "MeasureTextCodepoints", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "Vector2 MeasureTextCodepoints(Font, const int *, int, float, float)" + }, + { + "name": "TextFormat", + "reason": "varargs", + "category": "intentional-0.1-scope", + "signature": "const char * TextFormat(const char *, ...)" + }, + { + "name": "DrawCircle3D", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "void DrawCircle3D(Vector3, float, Vector3, float, Color)" + }, + { + "name": "DrawCube", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "void DrawCube(Vector3, float, float, float, Color)" + }, + { + "name": "DrawCubeWires", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "void DrawCubeWires(Vector3, float, float, float, Color)" + }, + { + "name": "DrawSphere", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "void DrawSphere(Vector3, float, Color)" + }, + { + "name": "DrawSphereEx", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "void DrawSphereEx(Vector3, float, int, int, Color)" + }, + { + "name": "DrawSphereWires", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "void DrawSphereWires(Vector3, float, int, int, Color)" + }, + { + "name": "DrawCylinder", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "void DrawCylinder(Vector3, float, float, float, int, Color)" + }, + { + "name": "DrawCylinderEx", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "void DrawCylinderEx(Vector3, Vector3, float, float, int, Color)" + }, + { + "name": "DrawCylinderWires", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "void DrawCylinderWires(Vector3, float, float, float, int, Color)" + }, + { + "name": "DrawCylinderWiresEx", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "void DrawCylinderWiresEx(Vector3, Vector3, float, float, int, Color)" + }, + { + "name": "DrawCapsule", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "void DrawCapsule(Vector3, Vector3, float, int, int, Color)" + }, + { + "name": "DrawCapsuleWires", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "void DrawCapsuleWires(Vector3, Vector3, float, int, int, Color)" + }, + { + "name": "DrawGrid", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "void DrawGrid(int, float)" + }, + { + "name": "DrawModel", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "void DrawModel(Model, Vector3, float, Color)" + }, + { + "name": "DrawModelEx", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "void DrawModelEx(Model, Vector3, Vector3, float, Vector3, Color)" + }, + { + "name": "DrawModelWires", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "void DrawModelWires(Model, Vector3, float, Color)" + }, + { + "name": "DrawModelWiresEx", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "void DrawModelWiresEx(Model, Vector3, Vector3, float, Vector3, Color)" + }, + { + "name": "DrawBillboard", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "void DrawBillboard(Camera, Texture2D, Vector3, float, Color)" + }, + { + "name": "DrawBillboardPro", + "reason": "more-than-8-arguments", + "category": "intentional-0.1-scope", + "signature": "void DrawBillboardPro(Camera, Texture2D, Rectangle, Vector3, Vector3, Vector2, Vector2, float, Color)" + }, + { + "name": "GenMeshPoly", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "Mesh GenMeshPoly(int, float)" + }, + { + "name": "GenMeshPlane", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "Mesh GenMeshPlane(float, float, int, int)" + }, + { + "name": "GenMeshSphere", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "Mesh GenMeshSphere(float, int, int)" + }, + { + "name": "GenMeshHemiSphere", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "Mesh GenMeshHemiSphere(float, int, int)" + }, + { + "name": "GenMeshCylinder", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "Mesh GenMeshCylinder(float, float, int)" + }, + { + "name": "GenMeshCone", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "Mesh GenMeshCone(float, float, int)" + }, + { + "name": "GenMeshTorus", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "Mesh GenMeshTorus(float, float, int, int)" + }, + { + "name": "GenMeshKnot", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "Mesh GenMeshKnot(float, float, int, int)" + }, + { + "name": "UpdateModelAnimation", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "void UpdateModelAnimation(Model, ModelAnimation, float)" + }, + { + "name": "UpdateModelAnimationEx", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "void UpdateModelAnimationEx(Model, ModelAnimation, float, ModelAnimation, float, float)" + }, + { + "name": "CheckCollisionSpheres", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "bool CheckCollisionSpheres(Vector3, float, Vector3, float)" + }, + { + "name": "CheckCollisionBoxSphere", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "bool CheckCollisionBoxSphere(BoundingBox, Vector3, float)" + }, + { + "name": "GetRayCollisionSphere", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "RayCollision GetRayCollisionSphere(Ray, Vector3, float)" + }, + { + "name": "SetSoundVolume", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "void SetSoundVolume(Sound, float)" + }, + { + "name": "SetSoundPitch", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "void SetSoundPitch(Sound, float)" + }, + { + "name": "SetSoundPan", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "void SetSoundPan(Sound, float)" + }, + { + "name": "SeekMusicStream", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "void SeekMusicStream(Music, float)" + }, + { + "name": "SetMusicVolume", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "void SetMusicVolume(Music, float)" + }, + { + "name": "SetMusicPitch", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "void SetMusicPitch(Music, float)" + }, + { + "name": "SetMusicPan", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "void SetMusicPan(Music, float)" + }, + { + "name": "SetAudioStreamVolume", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "void SetAudioStreamVolume(AudioStream, float)" + }, + { + "name": "SetAudioStreamPitch", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "void SetAudioStreamPitch(AudioStream, float)" + }, + { + "name": "SetAudioStreamPan", + "reason": "mixed-top-level-f32", + "category": "stable-runtime-limit", + "signature": "void SetAudioStreamPan(AudioStream, float)" + } + ] +} diff --git a/SKIPPED.md b/SKIPPED.md new file mode 100644 index 0000000..e9af94f --- /dev/null +++ b/SKIPPED.md @@ -0,0 +1,134 @@ +# Skipped raylib functions + +Generated against raylib 6.0 at `dbc56a87da87d973a9c5baa4e7438a9d20121d28` and +GocciaScript 0.10.0. + +- Official API functions: 600 +- Generated and callable on the pinned stable runtime: 488 +- Deterministically skipped: 112 +- Target after mixed-top-level-`f32` support: 597 + +The report is a compatibility boundary, not a claim that skipped functions are +implemented. Re-run the generator after the upstream FFI restriction is removed. +The three intentional 0.1 exclusions remain out of scope. + +## intentional-0.1-scope: varargs (2) + +- `void TraceLog(int, const char *, ...)` +- `const char * TextFormat(const char *, ...)` + +## stable-runtime-limit: mixed-top-level-f32 (109) + +- `void SetGamepadVibration(int, float, float, float)` +- `void UpdateCameraPro(Camera *, Vector3, Vector3, float)` +- `void DrawLineEx(Vector2, Vector2, float, Color)` +- `void DrawLineBezier(Vector2, Vector2, float, Color)` +- `void DrawCircle(int, int, float, Color)` +- `void DrawCircleV(Vector2, float, Color)` +- `void DrawCircleGradient(Vector2, float, Color, Color)` +- `void DrawCircleSector(Vector2, float, float, float, int, Color)` +- `void DrawCircleSectorLines(Vector2, float, float, float, int, Color)` +- `void DrawCircleLines(int, int, float, Color)` +- `void DrawCircleLinesV(Vector2, float, Color)` +- `void DrawEllipse(int, int, float, float, Color)` +- `void DrawEllipseV(Vector2, float, float, Color)` +- `void DrawEllipseLines(int, int, float, float, Color)` +- `void DrawEllipseLinesV(Vector2, float, float, Color)` +- `void DrawRing(Vector2, float, float, float, float, int, Color)` +- `void DrawRingLines(Vector2, float, float, float, float, int, Color)` +- `void DrawRectanglePro(Rectangle, Vector2, float, Color)` +- `void DrawRectangleLinesEx(Rectangle, float, Color)` +- `void DrawRectangleRounded(Rectangle, float, int, Color)` +- `void DrawRectangleRoundedLines(Rectangle, float, int, Color)` +- `void DrawRectangleRoundedLinesEx(Rectangle, float, int, float, Color)` +- `void DrawPoly(Vector2, int, float, float, Color)` +- `void DrawPolyLines(Vector2, int, float, float, Color)` +- `void DrawPolyLinesEx(Vector2, int, float, float, float, Color)` +- `void DrawSplineLinear(const Vector2 *, int, float, Color)` +- `void DrawSplineBasis(const Vector2 *, int, float, Color)` +- `void DrawSplineCatmullRom(const Vector2 *, int, float, Color)` +- `void DrawSplineBezierQuadratic(const Vector2 *, int, float, Color)` +- `void DrawSplineBezierCubic(const Vector2 *, int, float, Color)` +- `void DrawSplineSegmentLinear(Vector2, Vector2, float, Color)` +- `void DrawSplineSegmentBasis(Vector2, Vector2, Vector2, Vector2, float, Color)` +- `void DrawSplineSegmentCatmullRom(Vector2, Vector2, Vector2, Vector2, float, Color)` +- `void DrawSplineSegmentBezierQuadratic(Vector2, Vector2, Vector2, float, Color)` +- `void DrawSplineSegmentBezierCubic(Vector2, Vector2, Vector2, Vector2, float, Color)` +- `Vector2 GetSplinePointLinear(Vector2, Vector2, float)` +- `Vector2 GetSplinePointBasis(Vector2, Vector2, Vector2, Vector2, float)` +- `Vector2 GetSplinePointCatmullRom(Vector2, Vector2, Vector2, Vector2, float)` +- `Vector2 GetSplinePointBezierQuad(Vector2, Vector2, Vector2, float)` +- `Vector2 GetSplinePointBezierCubic(Vector2, Vector2, Vector2, Vector2, float)` +- `bool CheckCollisionCircles(Vector2, float, Vector2, float)` +- `bool CheckCollisionCircleRec(Vector2, float, Rectangle)` +- `bool CheckCollisionCircleLine(Vector2, float, Vector2, Vector2)` +- `bool CheckCollisionPointCircle(Vector2, Vector2, float)` +- `Image GenImageGradientRadial(int, int, float, Color, Color)` +- `Image GenImageGradientSquare(int, int, float, Color, Color)` +- `Image GenImageWhiteNoise(int, int, float)` +- `Image GenImagePerlinNoise(int, int, int, int, float)` +- `Image ImageTextEx(Font, const char *, float, float, Color)` +- `void ImageAlphaCrop(Image *, float)` +- `void ImageAlphaClear(Image *, Color, float)` +- `void ImageColorContrast(Image *, float)` +- `Rectangle GetImageAlphaBorder(Image, float)` +- `void ImageDrawTextEx(Image *, Font, const char *, Vector2, float, float, Color)` +- `void DrawTextureEx(Texture2D, Vector2, float, float, Color)` +- `void DrawTexturePro(Texture2D, Rectangle, Rectangle, Vector2, float, Color)` +- `void DrawTextureNPatch(Texture2D, NPatchInfo, Rectangle, Vector2, float, Color)` +- `Color Fade(Color, float)` +- `Color ColorBrightness(Color, float)` +- `Color ColorContrast(Color, float)` +- `Color ColorAlpha(Color, float)` +- `Color ColorLerp(Color, Color, float)` +- `void DrawTextEx(Font, const char *, Vector2, float, float, Color)` +- `void DrawTextPro(Font, const char *, Vector2, Vector2, float, float, float, Color)` +- `void DrawTextCodepoint(Font, int, Vector2, float, Color)` +- `void DrawTextCodepoints(Font, const int *, int, Vector2, float, float, Color)` +- `Vector2 MeasureTextEx(Font, const char *, float, float)` +- `Vector2 MeasureTextCodepoints(Font, const int *, int, float, float)` +- `void DrawCircle3D(Vector3, float, Vector3, float, Color)` +- `void DrawCube(Vector3, float, float, float, Color)` +- `void DrawCubeWires(Vector3, float, float, float, Color)` +- `void DrawSphere(Vector3, float, Color)` +- `void DrawSphereEx(Vector3, float, int, int, Color)` +- `void DrawSphereWires(Vector3, float, int, int, Color)` +- `void DrawCylinder(Vector3, float, float, float, int, Color)` +- `void DrawCylinderEx(Vector3, Vector3, float, float, int, Color)` +- `void DrawCylinderWires(Vector3, float, float, float, int, Color)` +- `void DrawCylinderWiresEx(Vector3, Vector3, float, float, int, Color)` +- `void DrawCapsule(Vector3, Vector3, float, int, int, Color)` +- `void DrawCapsuleWires(Vector3, Vector3, float, int, int, Color)` +- `void DrawGrid(int, float)` +- `void DrawModel(Model, Vector3, float, Color)` +- `void DrawModelEx(Model, Vector3, Vector3, float, Vector3, Color)` +- `void DrawModelWires(Model, Vector3, float, Color)` +- `void DrawModelWiresEx(Model, Vector3, Vector3, float, Vector3, Color)` +- `void DrawBillboard(Camera, Texture2D, Vector3, float, Color)` +- `Mesh GenMeshPoly(int, float)` +- `Mesh GenMeshPlane(float, float, int, int)` +- `Mesh GenMeshSphere(float, int, int)` +- `Mesh GenMeshHemiSphere(float, int, int)` +- `Mesh GenMeshCylinder(float, float, int)` +- `Mesh GenMeshCone(float, float, int)` +- `Mesh GenMeshTorus(float, float, int, int)` +- `Mesh GenMeshKnot(float, float, int, int)` +- `void UpdateModelAnimation(Model, ModelAnimation, float)` +- `void UpdateModelAnimationEx(Model, ModelAnimation, float, ModelAnimation, float, float)` +- `bool CheckCollisionSpheres(Vector3, float, Vector3, float)` +- `bool CheckCollisionBoxSphere(BoundingBox, Vector3, float)` +- `RayCollision GetRayCollisionSphere(Ray, Vector3, float)` +- `void SetSoundVolume(Sound, float)` +- `void SetSoundPitch(Sound, float)` +- `void SetSoundPan(Sound, float)` +- `void SeekMusicStream(Music, float)` +- `void SetMusicVolume(Music, float)` +- `void SetMusicPitch(Music, float)` +- `void SetMusicPan(Music, float)` +- `void SetAudioStreamVolume(AudioStream, float)` +- `void SetAudioStreamPitch(AudioStream, float)` +- `void SetAudioStreamPan(AudioStream, float)` + +## intentional-0.1-scope: more-than-8-arguments (1) + +- `void DrawBillboardPro(Camera, Texture2D, Rectangle, Vector3, Vector3, Vector2, Vector2, float, Color)` diff --git a/benchmarks/bunnymark-loop-syntax.md b/benchmarks/bunnymark-loop-syntax.md new file mode 100644 index 0000000..634e508 --- /dev/null +++ b/benchmarks/bunnymark-loop-syntax.md @@ -0,0 +1,38 @@ +# Bunnymark loop syntax benchmark + +Measured on 2026-07-23 to determine whether the Bunnymark example should +enable GocciaScript's traditional-`for` or `while` compatibility syntax. + +## Setup + +- Apple M1 Max +- GocciaScript 0.10.0, bytecode mode +- dynamically loaded raylib 6.0 +- 10,000 fixed-seed bunnies +- identical update, `DrawTextureV`, input, FFI, and rendering work +- target-FPS cap disabled +- 25 frames per run +- one complete warm-up per variant +- five interleaved measured trials +- all variants ran with the same compatibility flags so the flag configuration + itself could not bias one variant + +## Results + +| Loop | Observed FPS trials | Mean FPS | Mean real time | Mean 25-frame time after startup | +|---|---|---:|---:|---:| +| current `for...of` | 4.1, 4.0, 4.1, 4.0, 4.1 | 4.06 | 8.006 s | 6.3348 s | +| indexed classic `for` | 4.0, 3.9, 3.9, 4.0, 4.0 | 3.96 | 8.168 s | 6.4842 s | +| indexed `while` | 4.0, 4.0, 4.0, 4.0, 4.1 | 4.02 | 8.012 s | 6.3692 s | + +The `while` result was effectively tied with `for...of` and about 0.5% slower +after startup, within normal run noise. Classic `for` was consistently about +2.4% slower in the measured frame portion. + +## Decision + +Keep `for...of` and leave both compatibility flags disabled. Loop syntax is +not the Bunnymark bottleneck: at this sprite count, rendering and the +per-sprite FFI call to `DrawTextureV` dominate. A material speed-up therefore +needs fewer native crossings or a batched native drawing surface, not legacy +loop syntax. diff --git a/bindings/raylib.d.ts b/bindings/raylib.d.ts new file mode 100644 index 0000000..6f5df10 --- /dev/null +++ b/bindings/raylib.d.ts @@ -0,0 +1,2647 @@ +// Generated from official raylib 6.0. Do not edit. + +export interface FFIPointer { + readonly address: number; + readonly isNull: boolean; +} +/** Structural fallback for GocciaScript's Float16Array on TypeScript lib targets before ES2025. */ +export interface FFIFloat16Array { + readonly buffer: ArrayBufferLike; + readonly byteOffset: number; + readonly byteLength: number; + readonly length: number; + readonly BYTES_PER_ELEMENT: number; + readonly [index: number]: number; +} +export type FFITypedArray = + | Int8Array + | Uint8Array + | Uint8ClampedArray + | Int16Array + | Uint16Array + | Int32Array + | Uint32Array + | FFIFloat16Array + | Float32Array + | Float64Array + | BigInt64Array + | BigUint64Array; +export type FFIPointerInput = + | FFIPointer + | ArrayBuffer + | SharedArrayBuffer + | FFITypedArray + | FFIAggregateValue + | null; +export interface FFIAggregateValue { + readonly buffer: ArrayBuffer; + readonly byteOffset: number; + readonly size: number; +} +export interface FFIArrayValue extends FFIAggregateValue { + readonly length: number; + [index: number]: T; +} +export interface FFIStructDescriptor { + readonly kind: "struct"; + readonly size: number; + readonly alignment: number; + create(initializer?: Partial): T; +} +export interface FFILibrary { + readonly path: string; + readonly closed: boolean; + bind( + name: string, + signature: { args: readonly unknown[]; returns: unknown }, + ): (...args: unknown[]) => unknown; + symbol(name: string): FFIPointer; + close(): void; +} +export declare const RAYLIB_BINDING_INFO: { + raylibVersion: "6.0"; + raylibCommit: "dbc56a87da87d973a9c5baa4e7438a9d20121d28"; + gocciaScriptVersion: string; + linkage: "dynamic"; +}; +export declare const RAYLIB_FIELD_ALIASES: { + AudioStream: { buffer: "nativeBuffer" }; +}; +export declare const raylibLibrary: FFILibrary; +export declare function closeRaylib(): void; + +/** Vector2, 2 components */ +export interface Vector2Value extends FFIAggregateValue { + "x": number; + "y": number; +} +export declare const Vector2: FFIStructDescriptor; + +/** Vector3, 3 components */ +export interface Vector3Value extends FFIAggregateValue { + "x": number; + "y": number; + "z": number; +} +export declare const Vector3: FFIStructDescriptor; + +/** Vector4, 4 components */ +export interface Vector4Value extends FFIAggregateValue { + "x": number; + "y": number; + "z": number; + "w": number; +} +export declare const Vector4: FFIStructDescriptor; + +/** Matrix, 4x4 components, column major, OpenGL style, right-handed */ +export interface MatrixValue extends FFIAggregateValue { + "m0": number; + "m4": number; + "m8": number; + "m12": number; + "m1": number; + "m5": number; + "m9": number; + "m13": number; + "m2": number; + "m6": number; + "m10": number; + "m14": number; + "m3": number; + "m7": number; + "m11": number; + "m15": number; +} +export declare const Matrix: FFIStructDescriptor; + +/** Color, 4 components, R8G8B8A8 (32bit) */ +export interface ColorValue extends FFIAggregateValue { + "r": number; + "g": number; + "b": number; + "a": number; +} +export declare const Color: FFIStructDescriptor; + +/** Rectangle, 4 components */ +export interface RectangleValue extends FFIAggregateValue { + "x": number; + "y": number; + "width": number; + "height": number; +} +export declare const Rectangle: FFIStructDescriptor; + +/** Image, pixel data stored in CPU memory (RAM) */ +export interface ImageValue extends FFIAggregateValue { + "data": FFIPointer; + "width": number; + "height": number; + "mipmaps": number; + "format": number; +} +export declare const Image: FFIStructDescriptor; + +/** Texture, tex data stored in GPU memory (VRAM) */ +export interface TextureValue extends FFIAggregateValue { + "id": number; + "width": number; + "height": number; + "mipmaps": number; + "format": number; +} +export declare const Texture: FFIStructDescriptor; + +/** RenderTexture, fbo for texture rendering */ +export interface RenderTextureValue extends FFIAggregateValue { + "id": number; + "texture": TextureValue; + "depth": TextureValue; +} +export declare const RenderTexture: FFIStructDescriptor; + +/** NPatchInfo, n-patch layout info */ +export interface NPatchInfoValue extends FFIAggregateValue { + "source": RectangleValue; + "left": number; + "top": number; + "right": number; + "bottom": number; + "layout": number; +} +export declare const NPatchInfo: FFIStructDescriptor; + +/** GlyphInfo, font characters glyphs info */ +export interface GlyphInfoValue extends FFIAggregateValue { + "value": number; + "offsetX": number; + "offsetY": number; + "advanceX": number; + "image": ImageValue; +} +export declare const GlyphInfo: FFIStructDescriptor; + +/** Font, font texture and GlyphInfo array data */ +export interface FontValue extends FFIAggregateValue { + "baseSize": number; + "glyphCount": number; + "glyphPadding": number; + "texture": Texture2DValue; + "recs": FFIPointer; + "glyphs": FFIPointer; +} +export declare const Font: FFIStructDescriptor; + +/** Camera, defines position/orientation in 3d space */ +export interface Camera3DValue extends FFIAggregateValue { + "position": Vector3Value; + "target": Vector3Value; + "up": Vector3Value; + "fovy": number; + "projection": number; +} +export declare const Camera3D: FFIStructDescriptor; + +/** Camera2D, defines position/orientation in 2d space */ +export interface Camera2DValue extends FFIAggregateValue { + "offset": Vector2Value; + "target": Vector2Value; + "rotation": number; + "zoom": number; +} +export declare const Camera2D: FFIStructDescriptor; + +/** Mesh, vertex data and vao/vbo */ +export interface MeshValue extends FFIAggregateValue { + "vertexCount": number; + "triangleCount": number; + "vertices": FFIPointer; + "texcoords": FFIPointer; + "texcoords2": FFIPointer; + "normals": FFIPointer; + "tangents": FFIPointer; + "colors": FFIPointer; + "indices": FFIPointer; + "boneCount": number; + "boneIndices": FFIPointer; + "boneWeights": FFIPointer; + "animVertices": FFIPointer; + "animNormals": FFIPointer; + "vaoId": number; + "vboId": FFIPointer; +} +export declare const Mesh: FFIStructDescriptor; + +/** Shader */ +export interface ShaderValue extends FFIAggregateValue { + "id": number; + "locs": FFIPointer; +} +export declare const Shader: FFIStructDescriptor; + +/** MaterialMap */ +export interface MaterialMapValue extends FFIAggregateValue { + "texture": Texture2DValue; + "color": ColorValue; + "value": number; +} +export declare const MaterialMap: FFIStructDescriptor; + +/** Material, includes shader and maps */ +export interface MaterialValue extends FFIAggregateValue { + "shader": ShaderValue; + "maps": FFIPointer; + "params": FFIArrayValue; +} +export declare const Material: FFIStructDescriptor; + +/** Transform, vertex transformation data */ +export interface TransformValue extends FFIAggregateValue { + "translation": Vector3Value; + "rotation": QuaternionValue; + "scale": Vector3Value; +} +export declare const Transform: FFIStructDescriptor; + +/** Bone, skeletal animation bone */ +export interface BoneInfoValue extends FFIAggregateValue { + "name": FFIArrayValue; + "parent": number; +} +export declare const BoneInfo: FFIStructDescriptor; + +/** Skeleton, animation bones hierarchy */ +export interface ModelSkeletonValue extends FFIAggregateValue { + "boneCount": number; + "bones": FFIPointer; + "bindPose": FFIPointer; +} +export declare const ModelSkeleton: FFIStructDescriptor; + +/** Model, meshes, materials and animation data */ +export interface ModelValue extends FFIAggregateValue { + "transform": MatrixValue; + "meshCount": number; + "materialCount": number; + "meshes": FFIPointer; + "materials": FFIPointer; + "meshMaterial": FFIPointer; + "skeleton": ModelSkeletonValue; + "currentPose": FFIPointer; + "boneMatrices": FFIPointer; +} +export declare const Model: FFIStructDescriptor; + +/** ModelAnimation, contains a full animation sequence */ +export interface ModelAnimationValue extends FFIAggregateValue { + "name": FFIArrayValue; + "boneCount": number; + "keyframeCount": number; + "keyframePoses": FFIPointer; +} +export declare const ModelAnimation: FFIStructDescriptor; + +/** Ray, ray for raycasting */ +export interface RayValue extends FFIAggregateValue { + "position": Vector3Value; + "direction": Vector3Value; +} +export declare const Ray: FFIStructDescriptor; + +/** RayCollision, ray hit information */ +export interface RayCollisionValue extends FFIAggregateValue { + "hit": boolean; + "distance": number; + "point": Vector3Value; + "normal": Vector3Value; +} +export declare const RayCollision: FFIStructDescriptor; + +/** BoundingBox */ +export interface BoundingBoxValue extends FFIAggregateValue { + "min": Vector3Value; + "max": Vector3Value; +} +export declare const BoundingBox: FFIStructDescriptor; + +/** Wave, audio wave data */ +export interface WaveValue extends FFIAggregateValue { + "frameCount": number; + "sampleRate": number; + "sampleSize": number; + "channels": number; + "data": FFIPointer; +} +export declare const Wave: FFIStructDescriptor; + +/** AudioStream, custom audio stream */ +export interface AudioStreamValue extends FFIAggregateValue { + /** Native C field: buffer. */ + "nativeBuffer": FFIPointer; + "processor": FFIPointer; + "sampleRate": number; + "sampleSize": number; + "channels": number; +} +export declare const AudioStream: FFIStructDescriptor; + +/** Sound */ +export interface SoundValue extends FFIAggregateValue { + "stream": AudioStreamValue; + "frameCount": number; +} +export declare const Sound: FFIStructDescriptor; + +/** Music, audio stream, anything longer than ~10 seconds should be streamed */ +export interface MusicValue extends FFIAggregateValue { + "stream": AudioStreamValue; + "frameCount": number; + "looping": boolean; + "ctxType": number; + "ctxData": FFIPointer; +} +export declare const Music: FFIStructDescriptor; + +/** VrDeviceInfo, Head-Mounted-Display device parameters */ +export interface VrDeviceInfoValue extends FFIAggregateValue { + "hResolution": number; + "vResolution": number; + "hScreenSize": number; + "vScreenSize": number; + "eyeToScreenDistance": number; + "lensSeparationDistance": number; + "interpupillaryDistance": number; + "lensDistortionValues": FFIArrayValue; + "chromaAbCorrection": FFIArrayValue; +} +export declare const VrDeviceInfo: FFIStructDescriptor; + +/** VrStereoConfig, VR stereo rendering configuration for simulator */ +export interface VrStereoConfigValue extends FFIAggregateValue { + "projection": FFIArrayValue; + "viewOffset": FFIArrayValue; + "leftLensCenter": FFIArrayValue; + "rightLensCenter": FFIArrayValue; + "leftScreenCenter": FFIArrayValue; + "rightScreenCenter": FFIArrayValue; + "scale": FFIArrayValue; + "scaleIn": FFIArrayValue; +} +export declare const VrStereoConfig: FFIStructDescriptor; + +/** File path list */ +export interface FilePathListValue extends FFIAggregateValue { + "count": number; + "paths": FFIPointer; +} +export declare const FilePathList: FFIStructDescriptor; + +/** Automation event */ +export interface AutomationEventValue extends FFIAggregateValue { + "frame": number; + "type": number; + "params": FFIArrayValue; +} +export declare const AutomationEvent: FFIStructDescriptor; + +/** Automation event list */ +export interface AutomationEventListValue extends FFIAggregateValue { + "capacity": number; + "count": number; + "events": FFIPointer; +} +export declare const AutomationEventList: FFIStructDescriptor; + +/** Quaternion, 4 components (Vector4 alias) */ +export type QuaternionValue = Vector4Value; +export declare const Quaternion: typeof Vector4; + +/** Texture2D, same as Texture */ +export type Texture2DValue = TextureValue; +export declare const Texture2D: typeof Texture; + +/** TextureCubemap, same as Texture */ +export type TextureCubemapValue = TextureValue; +export declare const TextureCubemap: typeof Texture; + +/** RenderTexture2D, same as RenderTexture */ +export type RenderTexture2DValue = RenderTextureValue; +export declare const RenderTexture2D: typeof RenderTexture; + +/** Camera type fallback, defaults to Camera3D */ +export type CameraValue = Camera3DValue; +export declare const Camera: typeof Camera3D; + +/** Anim pose, an array of Transform[] */ +export type ModelAnimPoseValue = FFIPointer; +export declare const ModelAnimPose: "pointer"; + +/** Logging: Redirect trace log messages */ +export type TraceLogCallbackValue = FFIPointer; +export declare const TraceLogCallback: "pointer"; + +/** FileIO: Load binary data */ +export type LoadFileDataCallbackValue = FFIPointer; +export declare const LoadFileDataCallback: "pointer"; + +/** FileIO: Save binary data */ +export type SaveFileDataCallbackValue = FFIPointer; +export declare const SaveFileDataCallback: "pointer"; + +/** FileIO: Load text data */ +export type LoadFileTextCallbackValue = FFIPointer; +export declare const LoadFileTextCallback: "pointer"; + +/** FileIO: Save text data */ +export type SaveFileTextCallbackValue = FFIPointer; +export declare const SaveFileTextCallback: "pointer"; + +export type AudioCallbackValue = FFIPointer; +export declare const AudioCallback: "pointer"; + +/** Set to try enabling V-Sync on GPU */ +export declare const FLAG_VSYNC_HINT: 64; +/** Set to run program in fullscreen */ +export declare const FLAG_FULLSCREEN_MODE: 2; +/** Set to allow resizable window */ +export declare const FLAG_WINDOW_RESIZABLE: 4; +/** Set to disable window decoration (frame and buttons) */ +export declare const FLAG_WINDOW_UNDECORATED: 8; +/** Set to hide window */ +export declare const FLAG_WINDOW_HIDDEN: 128; +/** Set to minimize window (iconify) */ +export declare const FLAG_WINDOW_MINIMIZED: 512; +/** Set to maximize window (expanded to monitor) */ +export declare const FLAG_WINDOW_MAXIMIZED: 1024; +/** Set to window non focused */ +export declare const FLAG_WINDOW_UNFOCUSED: 2048; +/** Set to window always on top */ +export declare const FLAG_WINDOW_TOPMOST: 4096; +/** Set to allow windows running while minimized */ +export declare const FLAG_WINDOW_ALWAYS_RUN: 256; +/** Set to allow transparent framebuffer */ +export declare const FLAG_WINDOW_TRANSPARENT: 16; +/** Set to support HighDPI */ +export declare const FLAG_WINDOW_HIGHDPI: 8192; +/** Set to support mouse passthrough, only supported when FLAG_WINDOW_UNDECORATED */ +export declare const FLAG_WINDOW_MOUSE_PASSTHROUGH: 16384; +/** Set to run program in borderless windowed mode */ +export declare const FLAG_BORDERLESS_WINDOWED_MODE: 32768; +/** Set to try enabling MSAA 4X */ +export declare const FLAG_MSAA_4X_HINT: 32; +/** Set to try enabling interlaced video format (for V3D) */ +export declare const FLAG_INTERLACED_HINT: 65536; + +/** Display all logs */ +export declare const LOG_ALL: 0; +/** Trace logging, intended for internal use only */ +export declare const LOG_TRACE: 1; +/** Debug logging, used for internal debugging, it should be disabled on release builds */ +export declare const LOG_DEBUG: 2; +/** Info logging, used for program execution info */ +export declare const LOG_INFO: 3; +/** Warning logging, used on recoverable failures */ +export declare const LOG_WARNING: 4; +/** Error logging, used on unrecoverable failures */ +export declare const LOG_ERROR: 5; +/** Fatal logging, used to abort program: exit(EXIT_FAILURE) */ +export declare const LOG_FATAL: 6; +/** Disable logging */ +export declare const LOG_NONE: 7; + +/** Key: NULL, used for no key pressed */ +export declare const KEY_NULL: 0; +/** Key: ' */ +export declare const KEY_APOSTROPHE: 39; +/** Key: , */ +export declare const KEY_COMMA: 44; +/** Key: - */ +export declare const KEY_MINUS: 45; +/** Key: . */ +export declare const KEY_PERIOD: 46; +/** Key: / */ +export declare const KEY_SLASH: 47; +/** Key: 0 */ +export declare const KEY_ZERO: 48; +/** Key: 1 */ +export declare const KEY_ONE: 49; +/** Key: 2 */ +export declare const KEY_TWO: 50; +/** Key: 3 */ +export declare const KEY_THREE: 51; +/** Key: 4 */ +export declare const KEY_FOUR: 52; +/** Key: 5 */ +export declare const KEY_FIVE: 53; +/** Key: 6 */ +export declare const KEY_SIX: 54; +/** Key: 7 */ +export declare const KEY_SEVEN: 55; +/** Key: 8 */ +export declare const KEY_EIGHT: 56; +/** Key: 9 */ +export declare const KEY_NINE: 57; +/** Key: ; */ +export declare const KEY_SEMICOLON: 59; +/** Key: = */ +export declare const KEY_EQUAL: 61; +/** Key: A | a */ +export declare const KEY_A: 65; +/** Key: B | b */ +export declare const KEY_B: 66; +/** Key: C | c */ +export declare const KEY_C: 67; +/** Key: D | d */ +export declare const KEY_D: 68; +/** Key: E | e */ +export declare const KEY_E: 69; +/** Key: F | f */ +export declare const KEY_F: 70; +/** Key: G | g */ +export declare const KEY_G: 71; +/** Key: H | h */ +export declare const KEY_H: 72; +/** Key: I | i */ +export declare const KEY_I: 73; +/** Key: J | j */ +export declare const KEY_J: 74; +/** Key: K | k */ +export declare const KEY_K: 75; +/** Key: L | l */ +export declare const KEY_L: 76; +/** Key: M | m */ +export declare const KEY_M: 77; +/** Key: N | n */ +export declare const KEY_N: 78; +/** Key: O | o */ +export declare const KEY_O: 79; +/** Key: P | p */ +export declare const KEY_P: 80; +/** Key: Q | q */ +export declare const KEY_Q: 81; +/** Key: R | r */ +export declare const KEY_R: 82; +/** Key: S | s */ +export declare const KEY_S: 83; +/** Key: T | t */ +export declare const KEY_T: 84; +/** Key: U | u */ +export declare const KEY_U: 85; +/** Key: V | v */ +export declare const KEY_V: 86; +/** Key: W | w */ +export declare const KEY_W: 87; +/** Key: X | x */ +export declare const KEY_X: 88; +/** Key: Y | y */ +export declare const KEY_Y: 89; +/** Key: Z | z */ +export declare const KEY_Z: 90; +/** Key: [ */ +export declare const KEY_LEFT_BRACKET: 91; +/** Key: '\' */ +export declare const KEY_BACKSLASH: 92; +/** Key: ] */ +export declare const KEY_RIGHT_BRACKET: 93; +/** Key: ` */ +export declare const KEY_GRAVE: 96; +/** Key: Space */ +export declare const KEY_SPACE: 32; +/** Key: Esc */ +export declare const KEY_ESCAPE: 256; +/** Key: Enter */ +export declare const KEY_ENTER: 257; +/** Key: Tab */ +export declare const KEY_TAB: 258; +/** Key: Backspace */ +export declare const KEY_BACKSPACE: 259; +/** Key: Ins */ +export declare const KEY_INSERT: 260; +/** Key: Del */ +export declare const KEY_DELETE: 261; +/** Key: Cursor right */ +export declare const KEY_RIGHT: 262; +/** Key: Cursor left */ +export declare const KEY_LEFT: 263; +/** Key: Cursor down */ +export declare const KEY_DOWN: 264; +/** Key: Cursor up */ +export declare const KEY_UP: 265; +/** Key: Page up */ +export declare const KEY_PAGE_UP: 266; +/** Key: Page down */ +export declare const KEY_PAGE_DOWN: 267; +/** Key: Home */ +export declare const KEY_HOME: 268; +/** Key: End */ +export declare const KEY_END: 269; +/** Key: Caps lock */ +export declare const KEY_CAPS_LOCK: 280; +/** Key: Scroll down */ +export declare const KEY_SCROLL_LOCK: 281; +/** Key: Num lock */ +export declare const KEY_NUM_LOCK: 282; +/** Key: Print screen */ +export declare const KEY_PRINT_SCREEN: 283; +/** Key: Pause */ +export declare const KEY_PAUSE: 284; +/** Key: F1 */ +export declare const KEY_F1: 290; +/** Key: F2 */ +export declare const KEY_F2: 291; +/** Key: F3 */ +export declare const KEY_F3: 292; +/** Key: F4 */ +export declare const KEY_F4: 293; +/** Key: F5 */ +export declare const KEY_F5: 294; +/** Key: F6 */ +export declare const KEY_F6: 295; +/** Key: F7 */ +export declare const KEY_F7: 296; +/** Key: F8 */ +export declare const KEY_F8: 297; +/** Key: F9 */ +export declare const KEY_F9: 298; +/** Key: F10 */ +export declare const KEY_F10: 299; +/** Key: F11 */ +export declare const KEY_F11: 300; +/** Key: F12 */ +export declare const KEY_F12: 301; +/** Key: Shift left */ +export declare const KEY_LEFT_SHIFT: 340; +/** Key: Control left */ +export declare const KEY_LEFT_CONTROL: 341; +/** Key: Alt left */ +export declare const KEY_LEFT_ALT: 342; +/** Key: Super left */ +export declare const KEY_LEFT_SUPER: 343; +/** Key: Shift right */ +export declare const KEY_RIGHT_SHIFT: 344; +/** Key: Control right */ +export declare const KEY_RIGHT_CONTROL: 345; +/** Key: Alt right */ +export declare const KEY_RIGHT_ALT: 346; +/** Key: Super right */ +export declare const KEY_RIGHT_SUPER: 347; +/** Key: KB menu */ +export declare const KEY_KB_MENU: 348; +/** Key: Keypad 0 */ +export declare const KEY_KP_0: 320; +/** Key: Keypad 1 */ +export declare const KEY_KP_1: 321; +/** Key: Keypad 2 */ +export declare const KEY_KP_2: 322; +/** Key: Keypad 3 */ +export declare const KEY_KP_3: 323; +/** Key: Keypad 4 */ +export declare const KEY_KP_4: 324; +/** Key: Keypad 5 */ +export declare const KEY_KP_5: 325; +/** Key: Keypad 6 */ +export declare const KEY_KP_6: 326; +/** Key: Keypad 7 */ +export declare const KEY_KP_7: 327; +/** Key: Keypad 8 */ +export declare const KEY_KP_8: 328; +/** Key: Keypad 9 */ +export declare const KEY_KP_9: 329; +/** Key: Keypad . */ +export declare const KEY_KP_DECIMAL: 330; +/** Key: Keypad / */ +export declare const KEY_KP_DIVIDE: 331; +/** Key: Keypad * */ +export declare const KEY_KP_MULTIPLY: 332; +/** Key: Keypad - */ +export declare const KEY_KP_SUBTRACT: 333; +/** Key: Keypad + */ +export declare const KEY_KP_ADD: 334; +/** Key: Keypad Enter */ +export declare const KEY_KP_ENTER: 335; +/** Key: Keypad = */ +export declare const KEY_KP_EQUAL: 336; +/** Key: Android back button */ +export declare const KEY_BACK: 4; +/** Key: Android menu button */ +export declare const KEY_MENU: 5; +/** Key: Android volume up button */ +export declare const KEY_VOLUME_UP: 24; +/** Key: Android volume down button */ +export declare const KEY_VOLUME_DOWN: 25; + +/** Mouse button left */ +export declare const MOUSE_BUTTON_LEFT: 0; +/** Mouse button right */ +export declare const MOUSE_BUTTON_RIGHT: 1; +/** Mouse button middle (pressed wheel) */ +export declare const MOUSE_BUTTON_MIDDLE: 2; +/** Mouse button side (advanced mouse device) */ +export declare const MOUSE_BUTTON_SIDE: 3; +/** Mouse button extra (advanced mouse device) */ +export declare const MOUSE_BUTTON_EXTRA: 4; +/** Mouse button forward (advanced mouse device) */ +export declare const MOUSE_BUTTON_FORWARD: 5; +/** Mouse button back (advanced mouse device) */ +export declare const MOUSE_BUTTON_BACK: 6; + +/** Default pointer shape */ +export declare const MOUSE_CURSOR_DEFAULT: 0; +/** Arrow shape */ +export declare const MOUSE_CURSOR_ARROW: 1; +/** Text writing cursor shape */ +export declare const MOUSE_CURSOR_IBEAM: 2; +/** Cross shape */ +export declare const MOUSE_CURSOR_CROSSHAIR: 3; +/** Pointing hand cursor */ +export declare const MOUSE_CURSOR_POINTING_HAND: 4; +/** Horizontal resize/move arrow shape */ +export declare const MOUSE_CURSOR_RESIZE_EW: 5; +/** Vertical resize/move arrow shape */ +export declare const MOUSE_CURSOR_RESIZE_NS: 6; +/** Top-left to bottom-right diagonal resize/move arrow shape */ +export declare const MOUSE_CURSOR_RESIZE_NWSE: 7; +/** The top-right to bottom-left diagonal resize/move arrow shape */ +export declare const MOUSE_CURSOR_RESIZE_NESW: 8; +/** The omnidirectional resize/move cursor shape */ +export declare const MOUSE_CURSOR_RESIZE_ALL: 9; +/** The operation-not-allowed shape */ +export declare const MOUSE_CURSOR_NOT_ALLOWED: 10; + +/** Unknown button, for error checking */ +export declare const GAMEPAD_BUTTON_UNKNOWN: 0; +/** Gamepad left DPAD up button */ +export declare const GAMEPAD_BUTTON_LEFT_FACE_UP: 1; +/** Gamepad left DPAD right button */ +export declare const GAMEPAD_BUTTON_LEFT_FACE_RIGHT: 2; +/** Gamepad left DPAD down button */ +export declare const GAMEPAD_BUTTON_LEFT_FACE_DOWN: 3; +/** Gamepad left DPAD left button */ +export declare const GAMEPAD_BUTTON_LEFT_FACE_LEFT: 4; +/** Gamepad right button up (i.e. PS3: Triangle, Xbox: Y) */ +export declare const GAMEPAD_BUTTON_RIGHT_FACE_UP: 5; +/** Gamepad right button right (i.e. PS3: Circle, Xbox: B) */ +export declare const GAMEPAD_BUTTON_RIGHT_FACE_RIGHT: 6; +/** Gamepad right button down (i.e. PS3: Cross, Xbox: A) */ +export declare const GAMEPAD_BUTTON_RIGHT_FACE_DOWN: 7; +/** Gamepad right button left (i.e. PS3: Square, Xbox: X) */ +export declare const GAMEPAD_BUTTON_RIGHT_FACE_LEFT: 8; +/** Gamepad top/back trigger left (first), it could be a trailing button */ +export declare const GAMEPAD_BUTTON_LEFT_TRIGGER_1: 9; +/** Gamepad top/back trigger left (second), it could be a trailing button */ +export declare const GAMEPAD_BUTTON_LEFT_TRIGGER_2: 10; +/** Gamepad top/back trigger right (first), it could be a trailing button */ +export declare const GAMEPAD_BUTTON_RIGHT_TRIGGER_1: 11; +/** Gamepad top/back trigger right (second), it could be a trailing button */ +export declare const GAMEPAD_BUTTON_RIGHT_TRIGGER_2: 12; +/** Gamepad center buttons, left one (i.e. PS3: Select) */ +export declare const GAMEPAD_BUTTON_MIDDLE_LEFT: 13; +/** Gamepad center buttons, middle one (i.e. PS3: PS, Xbox: XBOX) */ +export declare const GAMEPAD_BUTTON_MIDDLE: 14; +/** Gamepad center buttons, right one (i.e. PS3: Start) */ +export declare const GAMEPAD_BUTTON_MIDDLE_RIGHT: 15; +/** Gamepad joystick pressed button left */ +export declare const GAMEPAD_BUTTON_LEFT_THUMB: 16; +/** Gamepad joystick pressed button right */ +export declare const GAMEPAD_BUTTON_RIGHT_THUMB: 17; + +/** Gamepad left stick X axis */ +export declare const GAMEPAD_AXIS_LEFT_X: 0; +/** Gamepad left stick Y axis */ +export declare const GAMEPAD_AXIS_LEFT_Y: 1; +/** Gamepad right stick X axis */ +export declare const GAMEPAD_AXIS_RIGHT_X: 2; +/** Gamepad right stick Y axis */ +export declare const GAMEPAD_AXIS_RIGHT_Y: 3; +/** Gamepad back trigger left, pressure level: [1..-1] */ +export declare const GAMEPAD_AXIS_LEFT_TRIGGER: 4; +/** Gamepad back trigger right, pressure level: [1..-1] */ +export declare const GAMEPAD_AXIS_RIGHT_TRIGGER: 5; + +/** Albedo material (same as: MATERIAL_MAP_DIFFUSE) */ +export declare const MATERIAL_MAP_ALBEDO: 0; +/** Metalness material (same as: MATERIAL_MAP_SPECULAR) */ +export declare const MATERIAL_MAP_METALNESS: 1; +/** Normal material */ +export declare const MATERIAL_MAP_NORMAL: 2; +/** Roughness material */ +export declare const MATERIAL_MAP_ROUGHNESS: 3; +/** Ambient occlusion material */ +export declare const MATERIAL_MAP_OCCLUSION: 4; +/** Emission material */ +export declare const MATERIAL_MAP_EMISSION: 5; +/** Heightmap material */ +export declare const MATERIAL_MAP_HEIGHT: 6; +/** Cubemap material (NOTE: Uses GL_TEXTURE_CUBE_MAP) */ +export declare const MATERIAL_MAP_CUBEMAP: 7; +/** Irradiance material (NOTE: Uses GL_TEXTURE_CUBE_MAP) */ +export declare const MATERIAL_MAP_IRRADIANCE: 8; +/** Prefilter material (NOTE: Uses GL_TEXTURE_CUBE_MAP) */ +export declare const MATERIAL_MAP_PREFILTER: 9; +/** Brdf material */ +export declare const MATERIAL_MAP_BRDF: 10; + +/** Shader location: vertex attribute: position */ +export declare const SHADER_LOC_VERTEX_POSITION: 0; +/** Shader location: vertex attribute: texcoord01 */ +export declare const SHADER_LOC_VERTEX_TEXCOORD01: 1; +/** Shader location: vertex attribute: texcoord02 */ +export declare const SHADER_LOC_VERTEX_TEXCOORD02: 2; +/** Shader location: vertex attribute: normal */ +export declare const SHADER_LOC_VERTEX_NORMAL: 3; +/** Shader location: vertex attribute: tangent */ +export declare const SHADER_LOC_VERTEX_TANGENT: 4; +/** Shader location: vertex attribute: color */ +export declare const SHADER_LOC_VERTEX_COLOR: 5; +/** Shader location: matrix uniform: model-view-projection */ +export declare const SHADER_LOC_MATRIX_MVP: 6; +/** Shader location: matrix uniform: view (camera transform) */ +export declare const SHADER_LOC_MATRIX_VIEW: 7; +/** Shader location: matrix uniform: projection */ +export declare const SHADER_LOC_MATRIX_PROJECTION: 8; +/** Shader location: matrix uniform: model (transform) */ +export declare const SHADER_LOC_MATRIX_MODEL: 9; +/** Shader location: matrix uniform: normal */ +export declare const SHADER_LOC_MATRIX_NORMAL: 10; +/** Shader location: vector uniform: view */ +export declare const SHADER_LOC_VECTOR_VIEW: 11; +/** Shader location: vector uniform: diffuse color */ +export declare const SHADER_LOC_COLOR_DIFFUSE: 12; +/** Shader location: vector uniform: specular color */ +export declare const SHADER_LOC_COLOR_SPECULAR: 13; +/** Shader location: vector uniform: ambient color */ +export declare const SHADER_LOC_COLOR_AMBIENT: 14; +/** Shader location: sampler2d texture: albedo (same as: SHADER_LOC_MAP_DIFFUSE) */ +export declare const SHADER_LOC_MAP_ALBEDO: 15; +/** Shader location: sampler2d texture: metalness (same as: SHADER_LOC_MAP_SPECULAR) */ +export declare const SHADER_LOC_MAP_METALNESS: 16; +/** Shader location: sampler2d texture: normal */ +export declare const SHADER_LOC_MAP_NORMAL: 17; +/** Shader location: sampler2d texture: roughness */ +export declare const SHADER_LOC_MAP_ROUGHNESS: 18; +/** Shader location: sampler2d texture: occlusion */ +export declare const SHADER_LOC_MAP_OCCLUSION: 19; +/** Shader location: sampler2d texture: emission */ +export declare const SHADER_LOC_MAP_EMISSION: 20; +/** Shader location: sampler2d texture: heightmap */ +export declare const SHADER_LOC_MAP_HEIGHT: 21; +/** Shader location: samplerCube texture: cubemap */ +export declare const SHADER_LOC_MAP_CUBEMAP: 22; +/** Shader location: samplerCube texture: irradiance */ +export declare const SHADER_LOC_MAP_IRRADIANCE: 23; +/** Shader location: samplerCube texture: prefilter */ +export declare const SHADER_LOC_MAP_PREFILTER: 24; +/** Shader location: sampler2d texture: brdf */ +export declare const SHADER_LOC_MAP_BRDF: 25; +/** Shader location: vertex attribute: bone indices */ +export declare const SHADER_LOC_VERTEX_BONEIDS: 26; +/** Shader location: vertex attribute: bone weights */ +export declare const SHADER_LOC_VERTEX_BONEWEIGHTS: 27; +/** Shader location: matrix attribute: bone transforms (animation) */ +export declare const SHADER_LOC_MATRIX_BONETRANSFORMS: 28; +/** Shader location: vertex attribute: instance transforms */ +export declare const SHADER_LOC_VERTEX_INSTANCETRANSFORM: 29; + +/** Shader uniform type: float */ +export declare const SHADER_UNIFORM_FLOAT: 0; +/** Shader uniform type: vec2 (2 float) */ +export declare const SHADER_UNIFORM_VEC2: 1; +/** Shader uniform type: vec3 (3 float) */ +export declare const SHADER_UNIFORM_VEC3: 2; +/** Shader uniform type: vec4 (4 float) */ +export declare const SHADER_UNIFORM_VEC4: 3; +/** Shader uniform type: int */ +export declare const SHADER_UNIFORM_INT: 4; +/** Shader uniform type: ivec2 (2 int) */ +export declare const SHADER_UNIFORM_IVEC2: 5; +/** Shader uniform type: ivec3 (3 int) */ +export declare const SHADER_UNIFORM_IVEC3: 6; +/** Shader uniform type: ivec4 (4 int) */ +export declare const SHADER_UNIFORM_IVEC4: 7; +/** Shader uniform type: unsigned int */ +export declare const SHADER_UNIFORM_UINT: 8; +/** Shader uniform type: uivec2 (2 unsigned int) */ +export declare const SHADER_UNIFORM_UIVEC2: 9; +/** Shader uniform type: uivec3 (3 unsigned int) */ +export declare const SHADER_UNIFORM_UIVEC3: 10; +/** Shader uniform type: uivec4 (4 unsigned int) */ +export declare const SHADER_UNIFORM_UIVEC4: 11; +/** Shader uniform type: sampler2d */ +export declare const SHADER_UNIFORM_SAMPLER2D: 12; + +/** Shader attribute type: float */ +export declare const SHADER_ATTRIB_FLOAT: 0; +/** Shader attribute type: vec2 (2 float) */ +export declare const SHADER_ATTRIB_VEC2: 1; +/** Shader attribute type: vec3 (3 float) */ +export declare const SHADER_ATTRIB_VEC3: 2; +/** Shader attribute type: vec4 (4 float) */ +export declare const SHADER_ATTRIB_VEC4: 3; + +/** 8 bit per pixel (no alpha) */ +export declare const PIXELFORMAT_UNCOMPRESSED_GRAYSCALE: 1; +/** 8*2 bpp (2 channels) */ +export declare const PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA: 2; +/** 16 bpp */ +export declare const PIXELFORMAT_UNCOMPRESSED_R5G6B5: 3; +/** 24 bpp */ +export declare const PIXELFORMAT_UNCOMPRESSED_R8G8B8: 4; +/** 16 bpp (1 bit alpha) */ +export declare const PIXELFORMAT_UNCOMPRESSED_R5G5B5A1: 5; +/** 16 bpp (4 bit alpha) */ +export declare const PIXELFORMAT_UNCOMPRESSED_R4G4B4A4: 6; +/** 32 bpp */ +export declare const PIXELFORMAT_UNCOMPRESSED_R8G8B8A8: 7; +/** 32 bpp (1 channel - float) */ +export declare const PIXELFORMAT_UNCOMPRESSED_R32: 8; +/** 32*3 bpp (3 channels - float) */ +export declare const PIXELFORMAT_UNCOMPRESSED_R32G32B32: 9; +/** 32*4 bpp (4 channels - float) */ +export declare const PIXELFORMAT_UNCOMPRESSED_R32G32B32A32: 10; +/** 16 bpp (1 channel - half float) */ +export declare const PIXELFORMAT_UNCOMPRESSED_R16: 11; +/** 16*3 bpp (3 channels - half float) */ +export declare const PIXELFORMAT_UNCOMPRESSED_R16G16B16: 12; +/** 16*4 bpp (4 channels - half float) */ +export declare const PIXELFORMAT_UNCOMPRESSED_R16G16B16A16: 13; +/** 4 bpp (no alpha) */ +export declare const PIXELFORMAT_COMPRESSED_DXT1_RGB: 14; +/** 4 bpp (1 bit alpha) */ +export declare const PIXELFORMAT_COMPRESSED_DXT1_RGBA: 15; +/** 8 bpp */ +export declare const PIXELFORMAT_COMPRESSED_DXT3_RGBA: 16; +/** 8 bpp */ +export declare const PIXELFORMAT_COMPRESSED_DXT5_RGBA: 17; +/** 4 bpp */ +export declare const PIXELFORMAT_COMPRESSED_ETC1_RGB: 18; +/** 4 bpp */ +export declare const PIXELFORMAT_COMPRESSED_ETC2_RGB: 19; +/** 8 bpp */ +export declare const PIXELFORMAT_COMPRESSED_ETC2_EAC_RGBA: 20; +/** 4 bpp */ +export declare const PIXELFORMAT_COMPRESSED_PVRT_RGB: 21; +/** 4 bpp */ +export declare const PIXELFORMAT_COMPRESSED_PVRT_RGBA: 22; +/** 8 bpp */ +export declare const PIXELFORMAT_COMPRESSED_ASTC_4x4_RGBA: 23; +/** 2 bpp */ +export declare const PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA: 24; + +/** No filter, pixel approximation */ +export declare const TEXTURE_FILTER_POINT: 0; +/** Linear filtering */ +export declare const TEXTURE_FILTER_BILINEAR: 1; +/** Trilinear filtering (linear with mipmaps) */ +export declare const TEXTURE_FILTER_TRILINEAR: 2; +/** Anisotropic filtering 4x */ +export declare const TEXTURE_FILTER_ANISOTROPIC_4X: 3; +/** Anisotropic filtering 8x */ +export declare const TEXTURE_FILTER_ANISOTROPIC_8X: 4; +/** Anisotropic filtering 16x */ +export declare const TEXTURE_FILTER_ANISOTROPIC_16X: 5; + +/** Repeats texture in tiled mode */ +export declare const TEXTURE_WRAP_REPEAT: 0; +/** Clamps texture to edge pixel in tiled mode */ +export declare const TEXTURE_WRAP_CLAMP: 1; +/** Mirrors and repeats the texture in tiled mode */ +export declare const TEXTURE_WRAP_MIRROR_REPEAT: 2; +/** Mirrors and clamps to border the texture in tiled mode */ +export declare const TEXTURE_WRAP_MIRROR_CLAMP: 3; + +/** Automatically detect layout type */ +export declare const CUBEMAP_LAYOUT_AUTO_DETECT: 0; +/** Layout is defined by a vertical line with faces */ +export declare const CUBEMAP_LAYOUT_LINE_VERTICAL: 1; +/** Layout is defined by a horizontal line with faces */ +export declare const CUBEMAP_LAYOUT_LINE_HORIZONTAL: 2; +/** Layout is defined by a 3x4 cross with cubemap faces */ +export declare const CUBEMAP_LAYOUT_CROSS_THREE_BY_FOUR: 3; +/** Layout is defined by a 4x3 cross with cubemap faces */ +export declare const CUBEMAP_LAYOUT_CROSS_FOUR_BY_THREE: 4; + +/** Default font generation, anti-aliased */ +export declare const FONT_DEFAULT: 0; +/** Bitmap font generation, no anti-aliasing */ +export declare const FONT_BITMAP: 1; +/** SDF font generation, requires external shader */ +export declare const FONT_SDF: 2; + +/** Blend textures considering alpha (default) */ +export declare const BLEND_ALPHA: 0; +/** Blend textures adding colors */ +export declare const BLEND_ADDITIVE: 1; +/** Blend textures multiplying colors */ +export declare const BLEND_MULTIPLIED: 2; +/** Blend textures adding colors (alternative) */ +export declare const BLEND_ADD_COLORS: 3; +/** Blend textures subtracting colors (alternative) */ +export declare const BLEND_SUBTRACT_COLORS: 4; +/** Blend premultiplied textures considering alpha */ +export declare const BLEND_ALPHA_PREMULTIPLY: 5; +/** Blend textures using custom src/dst factors (use rlSetBlendFactors()) */ +export declare const BLEND_CUSTOM: 6; +/** Blend textures using custom rgb/alpha separate src/dst factors (use rlSetBlendFactorsSeparate()) */ +export declare const BLEND_CUSTOM_SEPARATE: 7; + +/** No gesture */ +export declare const GESTURE_NONE: 0; +/** Tap gesture */ +export declare const GESTURE_TAP: 1; +/** Double tap gesture */ +export declare const GESTURE_DOUBLETAP: 2; +/** Hold gesture */ +export declare const GESTURE_HOLD: 4; +/** Drag gesture */ +export declare const GESTURE_DRAG: 8; +/** Swipe right gesture */ +export declare const GESTURE_SWIPE_RIGHT: 16; +/** Swipe left gesture */ +export declare const GESTURE_SWIPE_LEFT: 32; +/** Swipe up gesture */ +export declare const GESTURE_SWIPE_UP: 64; +/** Swipe down gesture */ +export declare const GESTURE_SWIPE_DOWN: 128; +/** Pinch in gesture */ +export declare const GESTURE_PINCH_IN: 256; +/** Pinch out gesture */ +export declare const GESTURE_PINCH_OUT: 512; + +/** Camera custom, controlled by user (UpdateCamera() does nothing) */ +export declare const CAMERA_CUSTOM: 0; +/** Camera free mode */ +export declare const CAMERA_FREE: 1; +/** Camera orbital, around target, zoom supported */ +export declare const CAMERA_ORBITAL: 2; +/** Camera first person */ +export declare const CAMERA_FIRST_PERSON: 3; +/** Camera third person */ +export declare const CAMERA_THIRD_PERSON: 4; + +/** Perspective projection */ +export declare const CAMERA_PERSPECTIVE: 0; +/** Orthographic projection */ +export declare const CAMERA_ORTHOGRAPHIC: 1; + +/** Npatch layout: 3x3 tiles */ +export declare const NPATCH_NINE_PATCH: 0; +/** Npatch layout: 1x3 tiles */ +export declare const NPATCH_THREE_PATCH_VERTICAL: 1; +/** Npatch layout: 3x1 tiles */ +export declare const NPATCH_THREE_PATCH_HORIZONTAL: 2; + +export declare const RAYLIB_VERSION_MAJOR: 6; +export declare const RAYLIB_VERSION_MINOR: 0; +export declare const RAYLIB_VERSION_PATCH: 0; +export declare const RAYLIB_VERSION: "6.0"; +export declare const PI: 3.141592653589793; +export declare const DEG2RAD: number; +export declare const RAD2DEG: number; +/** Light Gray */ +export declare const LIGHTGRAY: ColorValue; +/** Gray */ +export declare const GRAY: ColorValue; +/** Dark Gray */ +export declare const DARKGRAY: ColorValue; +/** Yellow */ +export declare const YELLOW: ColorValue; +/** Gold */ +export declare const GOLD: ColorValue; +/** Orange */ +export declare const ORANGE: ColorValue; +/** Pink */ +export declare const PINK: ColorValue; +/** Red */ +export declare const RED: ColorValue; +/** Maroon */ +export declare const MAROON: ColorValue; +/** Green */ +export declare const GREEN: ColorValue; +/** Lime */ +export declare const LIME: ColorValue; +/** Dark Green */ +export declare const DARKGREEN: ColorValue; +/** Sky Blue */ +export declare const SKYBLUE: ColorValue; +/** Blue */ +export declare const BLUE: ColorValue; +/** Dark Blue */ +export declare const DARKBLUE: ColorValue; +/** Purple */ +export declare const PURPLE: ColorValue; +/** Violet */ +export declare const VIOLET: ColorValue; +/** Dark Purple */ +export declare const DARKPURPLE: ColorValue; +/** Beige */ +export declare const BEIGE: ColorValue; +/** Brown */ +export declare const BROWN: ColorValue; +/** Dark Brown */ +export declare const DARKBROWN: ColorValue; +/** White */ +export declare const WHITE: ColorValue; +/** Black */ +export declare const BLACK: ColorValue; +/** Blank (Transparent) */ +export declare const BLANK: ColorValue; +/** Magenta */ +export declare const MAGENTA: ColorValue; +/** My own White (raylib logo) */ +export declare const RAYWHITE: ColorValue; + +/** Initialize window and OpenGL context */ +export declare function InitWindow(width: number, height: number, title: string): void; + +/** Close window and unload OpenGL context */ +export declare function CloseWindow(): void; + +/** Check if application should close (KEY_ESCAPE pressed or windows close icon clicked) */ +export declare function WindowShouldClose(): boolean; + +/** Check if window has been initialized successfully */ +export declare function IsWindowReady(): boolean; + +/** Check if window is currently fullscreen */ +export declare function IsWindowFullscreen(): boolean; + +/** Check if window is currently hidden */ +export declare function IsWindowHidden(): boolean; + +/** Check if window is currently minimized */ +export declare function IsWindowMinimized(): boolean; + +/** Check if window is currently maximized */ +export declare function IsWindowMaximized(): boolean; + +/** Check if window is currently focused */ +export declare function IsWindowFocused(): boolean; + +/** Check if window has been resized last frame */ +export declare function IsWindowResized(): boolean; + +/** Check if one specific window flag is enabled */ +export declare function IsWindowState(flag: number): boolean; + +/** Set window configuration state using flags */ +export declare function SetWindowState(flags: number): void; + +/** Clear window configuration state flags */ +export declare function ClearWindowState(flags: number): void; + +/** Toggle window state: fullscreen/windowed, resizes monitor to match window resolution */ +export declare function ToggleFullscreen(): void; + +/** Toggle window state: borderless windowed, resizes window to match monitor resolution */ +export declare function ToggleBorderlessWindowed(): void; + +/** Set window state: maximized, if resizable */ +export declare function MaximizeWindow(): void; + +/** Set window state: minimized, if resizable */ +export declare function MinimizeWindow(): void; + +/** Restore window from being minimized/maximized */ +export declare function RestoreWindow(): void; + +/** Set icon for window (single image, RGBA 32bit) */ +export declare function SetWindowIcon(image: ImageValue): void; + +/** Set icon for window (multiple images, RGBA 32bit) */ +export declare function SetWindowIcons(images: FFIPointerInput, count: number): void; + +/** Set title for window */ +export declare function SetWindowTitle(title: string): void; + +/** Set window position on screen */ +export declare function SetWindowPosition(x: number, y: number): void; + +/** Set monitor for the current window */ +export declare function SetWindowMonitor(monitor: number): void; + +/** Set window minimum dimensions (for FLAG_WINDOW_RESIZABLE) */ +export declare function SetWindowMinSize(width: number, height: number): void; + +/** Set window maximum dimensions (for FLAG_WINDOW_RESIZABLE) */ +export declare function SetWindowMaxSize(width: number, height: number): void; + +/** Set window dimensions */ +export declare function SetWindowSize(width: number, height: number): void; + +/** Set window opacity [0.0f..1.0f] */ +export declare function SetWindowOpacity(opacity: number): void; + +/** Set window focused */ +export declare function SetWindowFocused(): void; + +/** Get native window handle */ +export declare function GetWindowHandle(): FFIPointer; + +/** Get current screen width */ +export declare function GetScreenWidth(): number; + +/** Get current screen height */ +export declare function GetScreenHeight(): number; + +/** Get current render width (it considers HiDPI) */ +export declare function GetRenderWidth(): number; + +/** Get current render height (it considers HiDPI) */ +export declare function GetRenderHeight(): number; + +/** Get number of connected monitors */ +export declare function GetMonitorCount(): number; + +/** Get current monitor where window is placed */ +export declare function GetCurrentMonitor(): number; + +/** Get specified monitor position */ +export declare function GetMonitorPosition(monitor: number): Vector2Value; + +/** Get specified monitor width (current video mode used by monitor) */ +export declare function GetMonitorWidth(monitor: number): number; + +/** Get specified monitor height (current video mode used by monitor) */ +export declare function GetMonitorHeight(monitor: number): number; + +/** Get specified monitor physical width in millimetres */ +export declare function GetMonitorPhysicalWidth(monitor: number): number; + +/** Get specified monitor physical height in millimetres */ +export declare function GetMonitorPhysicalHeight(monitor: number): number; + +/** Get specified monitor refresh rate */ +export declare function GetMonitorRefreshRate(monitor: number): number; + +/** Get window position XY on monitor */ +export declare function GetWindowPosition(): Vector2Value; + +/** Get window scale DPI factor */ +export declare function GetWindowScaleDPI(): Vector2Value; + +/** Get the human-readable, UTF-8 encoded name of the specified monitor */ +export declare function GetMonitorName(monitor: number): string; + +/** Set clipboard text content */ +export declare function SetClipboardText(text: string): void; + +/** Get clipboard text content */ +export declare function GetClipboardText(): string; + +/** Get clipboard image content */ +export declare function GetClipboardImage(): ImageValue; + +/** Enable waiting for events on EndDrawing(), no automatic event polling */ +export declare function EnableEventWaiting(): void; + +/** Disable waiting for events on EndDrawing(), automatic events polling */ +export declare function DisableEventWaiting(): void; + +/** Shows cursor */ +export declare function ShowCursor(): void; + +/** Hides cursor */ +export declare function HideCursor(): void; + +/** Check if cursor is not visible */ +export declare function IsCursorHidden(): boolean; + +/** Enables cursor (unlock cursor) */ +export declare function EnableCursor(): void; + +/** Disables cursor (lock cursor) */ +export declare function DisableCursor(): void; + +/** Check if cursor is on the screen */ +export declare function IsCursorOnScreen(): boolean; + +/** Set background color (framebuffer clear color) */ +export declare function ClearBackground(color: ColorValue): void; + +/** Setup canvas (framebuffer) to start drawing */ +export declare function BeginDrawing(): void; + +/** End canvas drawing and swap buffers (double buffering) */ +export declare function EndDrawing(): void; + +/** Begin 2D mode with custom camera (2D) */ +export declare function BeginMode2D(camera: Camera2DValue): void; + +/** Ends 2D mode with custom camera */ +export declare function EndMode2D(): void; + +/** Begin 3D mode with custom camera (3D) */ +export declare function BeginMode3D(camera: Camera3DValue): void; + +/** Ends 3D mode and returns to default 2D orthographic mode */ +export declare function EndMode3D(): void; + +/** Begin drawing to render texture */ +export declare function BeginTextureMode(target: RenderTexture2DValue): void; + +/** Ends drawing to render texture */ +export declare function EndTextureMode(): void; + +/** Begin custom shader drawing */ +export declare function BeginShaderMode(shader: ShaderValue): void; + +/** End custom shader drawing (use default shader) */ +export declare function EndShaderMode(): void; + +/** Begin blending mode (alpha, additive, multiplied, subtract, custom) */ +export declare function BeginBlendMode(mode: number): void; + +/** End blending mode (reset to default: alpha blending) */ +export declare function EndBlendMode(): void; + +/** Begin scissor mode (define screen area for following drawing) */ +export declare function BeginScissorMode(x: number, y: number, width: number, height: number): void; + +/** End scissor mode */ +export declare function EndScissorMode(): void; + +/** Begin stereo rendering (requires VR simulator) */ +export declare function BeginVrStereoMode(config: VrStereoConfigValue): void; + +/** End stereo rendering (requires VR simulator) */ +export declare function EndVrStereoMode(): void; + +/** Load VR stereo config for VR simulator device parameters */ +export declare function LoadVrStereoConfig(device: VrDeviceInfoValue): VrStereoConfigValue; + +/** Unload VR stereo config */ +export declare function UnloadVrStereoConfig(config: VrStereoConfigValue): void; + +/** Load shader from files and bind default locations */ +export declare function LoadShader(vsFileName: string, fsFileName: string): ShaderValue; + +/** Raw-pointer variant for nullable C string parameters. */ +export declare function LoadShaderRaw(vsFileName: FFIPointerInput, fsFileName: FFIPointerInput): ShaderValue; + +/** Load shader from code strings and bind default locations */ +export declare function LoadShaderFromMemory(vsCode: string, fsCode: string): ShaderValue; + +/** Raw-pointer variant for nullable C string parameters. */ +export declare function LoadShaderFromMemoryRaw(vsCode: FFIPointerInput, fsCode: FFIPointerInput): ShaderValue; + +/** Check if a shader is valid (loaded on GPU) */ +export declare function IsShaderValid(shader: ShaderValue): boolean; + +/** Get shader uniform location */ +export declare function GetShaderLocation(shader: ShaderValue, uniformName: string): number; + +/** Get shader attribute location */ +export declare function GetShaderLocationAttrib(shader: ShaderValue, attribName: string): number; + +/** Set shader uniform value */ +export declare function SetShaderValue(shader: ShaderValue, locIndex: number, value: FFIPointerInput, uniformType: number): void; + +/** Set shader uniform value vector */ +export declare function SetShaderValueV(shader: ShaderValue, locIndex: number, value: FFIPointerInput, uniformType: number, count: number): void; + +/** Set shader uniform value (matrix 4x4) */ +export declare function SetShaderValueMatrix(shader: ShaderValue, locIndex: number, mat: MatrixValue): void; + +/** Set shader uniform value and bind the texture (sampler2d) */ +export declare function SetShaderValueTexture(shader: ShaderValue, locIndex: number, texture: Texture2DValue): void; + +/** Unload shader from GPU memory (VRAM) */ +export declare function UnloadShader(shader: ShaderValue): void; + +/** Get a ray trace from screen position (i.e mouse) */ +export declare function GetScreenToWorldRay(position: Vector2Value, camera: CameraValue): RayValue; + +/** Get a ray trace from screen position (i.e mouse) in a viewport */ +export declare function GetScreenToWorldRayEx(position: Vector2Value, camera: CameraValue, width: number, height: number): RayValue; + +/** Get the screen space position for a 3d world space position */ +export declare function GetWorldToScreen(position: Vector3Value, camera: CameraValue): Vector2Value; + +/** Get size position for a 3d world space position */ +export declare function GetWorldToScreenEx(position: Vector3Value, camera: CameraValue, width: number, height: number): Vector2Value; + +/** Get the screen space position for a 2d camera world space position */ +export declare function GetWorldToScreen2D(position: Vector2Value, camera: Camera2DValue): Vector2Value; + +/** Get the world space position for a 2d camera screen space position */ +export declare function GetScreenToWorld2D(position: Vector2Value, camera: Camera2DValue): Vector2Value; + +/** Get camera transform matrix (view matrix) */ +export declare function GetCameraMatrix(camera: CameraValue): MatrixValue; + +/** Get camera 2d transform matrix */ +export declare function GetCameraMatrix2D(camera: Camera2DValue): MatrixValue; + +/** Set target FPS (maximum) */ +export declare function SetTargetFPS(fps: number): void; + +/** Get time in seconds for last frame drawn (delta time) */ +export declare function GetFrameTime(): number; + +/** Get elapsed time in seconds since InitWindow() */ +export declare function GetTime(): number; + +/** Get current FPS */ +export declare function GetFPS(): number; + +/** Swap back buffer with front buffer (screen drawing) */ +export declare function SwapScreenBuffer(): void; + +/** Register all input events */ +export declare function PollInputEvents(): void; + +/** Wait for some time (halt program execution) */ +export declare function WaitTime(seconds: number): void; + +/** Set the seed for the random number generator */ +export declare function SetRandomSeed(seed: number): void; + +/** Get a random value between min and max (both included) */ +export declare function GetRandomValue(min: number, max: number): number; + +/** Load random values sequence, no values repeated */ +export declare function LoadRandomSequence(count: number, min: number, max: number): FFIPointer; + +/** Unload random values sequence */ +export declare function UnloadRandomSequence(sequence: FFIPointerInput): void; + +/** Takes a screenshot of current screen (filename extension defines format) */ +export declare function TakeScreenshot(fileName: string): void; + +/** Setup init configuration flags (view FLAGS) */ +export declare function SetConfigFlags(flags: number): void; + +/** Open URL with default system browser (if available) */ +export declare function OpenURL(url: string): void; + +/** Set the current threshold (minimum) log level */ +export declare function SetTraceLogLevel(logLevel: number): void; + +/** Set custom trace log */ +export declare function SetTraceLogCallback(callback: FFIPointerInput): void; + +/** Internal memory allocator */ +export declare function MemAlloc(size: number): FFIPointer; + +/** Internal memory reallocator */ +export declare function MemRealloc(ptr: FFIPointerInput, size: number): FFIPointer; + +/** Internal memory free */ +export declare function MemFree(ptr: FFIPointerInput): void; + +/** Load file data as byte array (read) */ +export declare function LoadFileData(fileName: string, dataSize: FFIPointerInput): FFIPointer; + +/** Unload file data allocated by LoadFileData() */ +export declare function UnloadFileData(data: FFIPointerInput): void; + +/** Save data to file from byte array (write), returns true on success */ +export declare function SaveFileData(fileName: string, data: FFIPointerInput, dataSize: number): boolean; + +/** Export data to code (.h), returns true on success */ +export declare function ExportDataAsCode(data: FFIPointerInput, dataSize: number, fileName: string): boolean; + +/** Load text data from file (read), returns a '\0' terminated string */ +export declare function LoadFileText(fileName: string): FFIPointer; + +/** Unload file text data allocated by LoadFileText() */ +export declare function UnloadFileText(text: FFIPointerInput): void; + +/** Save text data to file (write), string must be '\0' terminated, returns true on success */ +export declare function SaveFileText(fileName: string, text: string): boolean; + +/** Set custom file binary data loader */ +export declare function SetLoadFileDataCallback(callback: FFIPointerInput): void; + +/** Set custom file binary data saver */ +export declare function SetSaveFileDataCallback(callback: FFIPointerInput): void; + +/** Set custom file text data loader */ +export declare function SetLoadFileTextCallback(callback: FFIPointerInput): void; + +/** Set custom file text data saver */ +export declare function SetSaveFileTextCallback(callback: FFIPointerInput): void; + +/** Rename file (if exists) */ +export declare function FileRename(fileName: string, fileRename: string): number; + +/** Remove file (if exists) */ +export declare function FileRemove(fileName: string): number; + +/** Copy file from one path to another, dstPath created if it doesn't exist */ +export declare function FileCopy(srcPath: string, dstPath: string): number; + +/** Move file from one directory to another, dstPath created if it doesn't exist */ +export declare function FileMove(srcPath: string, dstPath: string): number; + +/** Replace text in an existing file */ +export declare function FileTextReplace(fileName: string, search: string, replacement: string): number; + +/** Find text in existing file */ +export declare function FileTextFindIndex(fileName: string, search: string): number; + +/** Check if file exists */ +export declare function FileExists(fileName: string): boolean; + +/** Check if a directory path exists */ +export declare function DirectoryExists(dirPath: string): boolean; + +/** Check file extension (recommended include point: .png, .wav) */ +export declare function IsFileExtension(fileName: string, ext: string): boolean; + +/** Get file length in bytes (NOTE: GetFileSize() conflicts with windows.h) */ +export declare function GetFileLength(fileName: string): number; + +/** Get file modification time (last write time) */ +export declare function GetFileModTime(fileName: string): number; + +/** Get pointer to extension for a filename string (includes dot: '.png') */ +export declare function GetFileExtension(fileName: string): string; + +/** Get pointer to filename for a path string */ +export declare function GetFileName(filePath: string): string; + +/** Get filename string without extension (uses static string) */ +export declare function GetFileNameWithoutExt(filePath: string): string; + +/** Get full path for a given fileName with path (uses static string) */ +export declare function GetDirectoryPath(filePath: string): string; + +/** Get previous directory path for a given path (uses static string) */ +export declare function GetPrevDirectoryPath(dirPath: string): string; + +/** Get current working directory (uses static string) */ +export declare function GetWorkingDirectory(): string; + +/** Get the directory of the running application (uses static string) */ +export declare function GetApplicationDirectory(): string; + +/** Create directories (including full path requested), returns 0 on success */ +export declare function MakeDirectory(dirPath: string): number; + +/** Change working directory, return true on success */ +export declare function ChangeDirectory(dirPath: string): boolean; + +/** Check if a given path is a file or a directory */ +export declare function IsPathFile(path: string): boolean; + +/** Check if fileName is valid for the platform/OS */ +export declare function IsFileNameValid(fileName: string): boolean; + +/** Load directory filepaths, files and directories, no subdirs scan */ +export declare function LoadDirectoryFiles(dirPath: string): FilePathListValue; + +/** Load directory filepaths with extension filtering and subdir scan; some filters available: "*.*", "FILES*", "DIRS*" */ +export declare function LoadDirectoryFilesEx(basePath: string, filter: string, scanSubdirs: boolean): FilePathListValue; + +/** Unload filepaths */ +export declare function UnloadDirectoryFiles(files: FilePathListValue): void; + +/** Check if a file has been dropped into window */ +export declare function IsFileDropped(): boolean; + +/** Load dropped filepaths */ +export declare function LoadDroppedFiles(): FilePathListValue; + +/** Unload dropped filepaths */ +export declare function UnloadDroppedFiles(files: FilePathListValue): void; + +/** Get the file count in a directory */ +export declare function GetDirectoryFileCount(dirPath: string): number; + +/** Get the file count in a directory with extension filtering and recursive directory scan. Use 'DIR' in the filter string to include directories in the result */ +export declare function GetDirectoryFileCountEx(basePath: string, filter: string, scanSubdirs: boolean): number; + +/** Compress data (DEFLATE algorithm), memory must be MemFree() */ +export declare function CompressData(data: FFIPointerInput, dataSize: number, compDataSize: FFIPointerInput): FFIPointer; + +/** Decompress data (DEFLATE algorithm), memory must be MemFree() */ +export declare function DecompressData(compData: FFIPointerInput, compDataSize: number, dataSize: FFIPointerInput): FFIPointer; + +/** Encode data to Base64 string (includes NULL terminator), memory must be MemFree() */ +export declare function EncodeDataBase64(data: FFIPointerInput, dataSize: number, outputSize: FFIPointerInput): FFIPointer; + +/** Decode Base64 string (expected NULL terminated), memory must be MemFree() */ +export declare function DecodeDataBase64(text: string, outputSize: FFIPointerInput): FFIPointer; + +/** Compute CRC32 hash code */ +export declare function ComputeCRC32(data: FFIPointerInput, dataSize: number): number; + +/** Compute MD5 hash code, returns static int[4] (16 bytes) */ +export declare function ComputeMD5(data: FFIPointerInput, dataSize: number): FFIPointer; + +/** Compute SHA1 hash code, returns static int[5] (20 bytes) */ +export declare function ComputeSHA1(data: FFIPointerInput, dataSize: number): FFIPointer; + +/** Compute SHA256 hash code, returns static int[8] (32 bytes) */ +export declare function ComputeSHA256(data: FFIPointerInput, dataSize: number): FFIPointer; + +/** Load automation events list from file, NULL for empty list, capacity = MAX_AUTOMATION_EVENTS */ +export declare function LoadAutomationEventList(fileName: string): AutomationEventListValue; + +/** Raw-pointer variant for nullable C string parameters. */ +export declare function LoadAutomationEventListRaw(fileName: FFIPointerInput): AutomationEventListValue; + +/** Unload automation events list from file */ +export declare function UnloadAutomationEventList(list: AutomationEventListValue): void; + +/** Export automation events list as text file */ +export declare function ExportAutomationEventList(list: AutomationEventListValue, fileName: string): boolean; + +/** Set automation event list to record to */ +export declare function SetAutomationEventList(list: FFIPointerInput): void; + +/** Set automation event internal base frame to start recording */ +export declare function SetAutomationEventBaseFrame(frame: number): void; + +/** Start recording automation events (AutomationEventList must be set) */ +export declare function StartAutomationEventRecording(): void; + +/** Stop recording automation events */ +export declare function StopAutomationEventRecording(): void; + +/** Play a recorded automation event */ +export declare function PlayAutomationEvent(event: AutomationEventValue): void; + +/** Check if a key has been pressed once */ +export declare function IsKeyPressed(key: number): boolean; + +/** Check if a key has been pressed again */ +export declare function IsKeyPressedRepeat(key: number): boolean; + +/** Check if a key is being pressed */ +export declare function IsKeyDown(key: number): boolean; + +/** Check if a key has been released once */ +export declare function IsKeyReleased(key: number): boolean; + +/** Check if a key is NOT being pressed */ +export declare function IsKeyUp(key: number): boolean; + +/** Get key pressed (keycode), call it multiple times for keys queued, returns 0 when the queue is empty */ +export declare function GetKeyPressed(): number; + +/** Get char pressed (unicode), call it multiple times for chars queued, returns 0 when the queue is empty */ +export declare function GetCharPressed(): number; + +/** Get name of a QWERTY key on the current keyboard layout (eg returns string 'q' for KEY_A on an AZERTY keyboard) */ +export declare function GetKeyName(key: number): string; + +/** Set a custom key to exit program (default is ESC) */ +export declare function SetExitKey(key: number): void; + +/** Check if a gamepad is available */ +export declare function IsGamepadAvailable(gamepad: number): boolean; + +/** Get gamepad internal name id */ +export declare function GetGamepadName(gamepad: number): string; + +/** Check if a gamepad button has been pressed once */ +export declare function IsGamepadButtonPressed(gamepad: number, button: number): boolean; + +/** Check if a gamepad button is being pressed */ +export declare function IsGamepadButtonDown(gamepad: number, button: number): boolean; + +/** Check if a gamepad button has been released once */ +export declare function IsGamepadButtonReleased(gamepad: number, button: number): boolean; + +/** Check if a gamepad button is NOT being pressed */ +export declare function IsGamepadButtonUp(gamepad: number, button: number): boolean; + +/** Get the last gamepad button pressed */ +export declare function GetGamepadButtonPressed(): number; + +/** Get axis count for a gamepad */ +export declare function GetGamepadAxisCount(gamepad: number): number; + +/** Get movement value for a gamepad axis */ +export declare function GetGamepadAxisMovement(gamepad: number, axis: number): number; + +/** Set internal gamepad mappings (SDL_GameControllerDB) */ +export declare function SetGamepadMappings(mappings: string): number; + +/** Check if a mouse button has been pressed once */ +export declare function IsMouseButtonPressed(button: number): boolean; + +/** Check if a mouse button is being pressed */ +export declare function IsMouseButtonDown(button: number): boolean; + +/** Check if a mouse button has been released once */ +export declare function IsMouseButtonReleased(button: number): boolean; + +/** Check if a mouse button is NOT being pressed */ +export declare function IsMouseButtonUp(button: number): boolean; + +/** Get mouse position X */ +export declare function GetMouseX(): number; + +/** Get mouse position Y */ +export declare function GetMouseY(): number; + +/** Get mouse position XY */ +export declare function GetMousePosition(): Vector2Value; + +/** Get mouse delta between frames */ +export declare function GetMouseDelta(): Vector2Value; + +/** Set mouse position XY */ +export declare function SetMousePosition(x: number, y: number): void; + +/** Set mouse offset */ +export declare function SetMouseOffset(offsetX: number, offsetY: number): void; + +/** Set mouse scaling */ +export declare function SetMouseScale(scaleX: number, scaleY: number): void; + +/** Get mouse wheel movement for X or Y, whichever is larger */ +export declare function GetMouseWheelMove(): number; + +/** Get mouse wheel movement for both X and Y */ +export declare function GetMouseWheelMoveV(): Vector2Value; + +/** Set mouse cursor */ +export declare function SetMouseCursor(cursor: number): void; + +/** Get touch position X for touch point 0 (relative to screen size) */ +export declare function GetTouchX(): number; + +/** Get touch position Y for touch point 0 (relative to screen size) */ +export declare function GetTouchY(): number; + +/** Get touch position XY for a touch point index (relative to screen size) */ +export declare function GetTouchPosition(index: number): Vector2Value; + +/** Get touch point identifier for given index */ +export declare function GetTouchPointId(index: number): number; + +/** Get number of touch points */ +export declare function GetTouchPointCount(): number; + +/** Enable a set of gestures using flags */ +export declare function SetGesturesEnabled(flags: number): void; + +/** Check if a gesture have been detected */ +export declare function IsGestureDetected(gesture: number): boolean; + +/** Get latest detected gesture */ +export declare function GetGestureDetected(): number; + +/** Get gesture hold time in seconds */ +export declare function GetGestureHoldDuration(): number; + +/** Get gesture drag vector */ +export declare function GetGestureDragVector(): Vector2Value; + +/** Get gesture drag angle */ +export declare function GetGestureDragAngle(): number; + +/** Get gesture pinch delta */ +export declare function GetGesturePinchVector(): Vector2Value; + +/** Get gesture pinch angle */ +export declare function GetGesturePinchAngle(): number; + +/** Update camera position for selected mode */ +export declare function UpdateCamera(camera: FFIPointerInput, mode: number): void; + +/** Set texture and rectangle to be used on shapes drawing */ +export declare function SetShapesTexture(texture: Texture2DValue, source: RectangleValue): void; + +/** Get texture that is used for shapes drawing */ +export declare function GetShapesTexture(): Texture2DValue; + +/** Get texture source rectangle that is used for shapes drawing */ +export declare function GetShapesTextureRectangle(): RectangleValue; + +/** Draw a pixel using geometry [Can be slow, use with care] */ +export declare function DrawPixel(posX: number, posY: number, color: ColorValue): void; + +/** Draw a pixel using geometry (Vector version) [Can be slow, use with care] */ +export declare function DrawPixelV(position: Vector2Value, color: ColorValue): void; + +/** Draw a line */ +export declare function DrawLine(startPosX: number, startPosY: number, endPosX: number, endPosY: number, color: ColorValue): void; + +/** Draw a line (using gl lines) */ +export declare function DrawLineV(startPos: Vector2Value, endPos: Vector2Value, color: ColorValue): void; + +/** Draw lines sequence (using gl lines) */ +export declare function DrawLineStrip(points: FFIPointerInput, pointCount: number, color: ColorValue): void; + +/** Draw a dashed line */ +export declare function DrawLineDashed(startPos: Vector2Value, endPos: Vector2Value, dashSize: number, spaceSize: number, color: ColorValue): void; + +/** Draw a color-filled rectangle */ +export declare function DrawRectangle(posX: number, posY: number, width: number, height: number, color: ColorValue): void; + +/** Draw a color-filled rectangle (Vector version) */ +export declare function DrawRectangleV(position: Vector2Value, size: Vector2Value, color: ColorValue): void; + +/** Draw a color-filled rectangle */ +export declare function DrawRectangleRec(rec: RectangleValue, color: ColorValue): void; + +/** Draw a vertical-gradient-filled rectangle */ +export declare function DrawRectangleGradientV(posX: number, posY: number, width: number, height: number, top: ColorValue, bottom: ColorValue): void; + +/** Draw a horizontal-gradient-filled rectangle */ +export declare function DrawRectangleGradientH(posX: number, posY: number, width: number, height: number, left: ColorValue, right: ColorValue): void; + +/** Draw a gradient-filled rectangle with custom vertex colors */ +export declare function DrawRectangleGradientEx(rec: RectangleValue, topLeft: ColorValue, bottomLeft: ColorValue, bottomRight: ColorValue, topRight: ColorValue): void; + +/** Draw rectangle outline */ +export declare function DrawRectangleLines(posX: number, posY: number, width: number, height: number, color: ColorValue): void; + +/** Draw a color-filled triangle (vertex in counter-clockwise order!) */ +export declare function DrawTriangle(v1: Vector2Value, v2: Vector2Value, v3: Vector2Value, color: ColorValue): void; + +/** Draw triangle outline (vertex in counter-clockwise order!) */ +export declare function DrawTriangleLines(v1: Vector2Value, v2: Vector2Value, v3: Vector2Value, color: ColorValue): void; + +/** Draw a triangle fan defined by points (first vertex is the center) */ +export declare function DrawTriangleFan(points: FFIPointerInput, pointCount: number, color: ColorValue): void; + +/** Draw a triangle strip defined by points */ +export declare function DrawTriangleStrip(points: FFIPointerInput, pointCount: number, color: ColorValue): void; + +/** Check collision between two rectangles */ +export declare function CheckCollisionRecs(rec1: RectangleValue, rec2: RectangleValue): boolean; + +/** Check if point is inside rectangle */ +export declare function CheckCollisionPointRec(point: Vector2Value, rec: RectangleValue): boolean; + +/** Check if point is inside a triangle */ +export declare function CheckCollisionPointTriangle(point: Vector2Value, p1: Vector2Value, p2: Vector2Value, p3: Vector2Value): boolean; + +/** Check if point belongs to line created between two points [p1] and [p2] with defined margin in pixels [threshold] */ +export declare function CheckCollisionPointLine(point: Vector2Value, p1: Vector2Value, p2: Vector2Value, threshold: number): boolean; + +/** Check if point is within a polygon described by array of vertices */ +export declare function CheckCollisionPointPoly(point: Vector2Value, points: FFIPointerInput, pointCount: number): boolean; + +/** Check the collision between two lines defined by two points each, returns collision point by reference */ +export declare function CheckCollisionLines(startPos1: Vector2Value, endPos1: Vector2Value, startPos2: Vector2Value, endPos2: Vector2Value, collisionPoint: FFIPointerInput): boolean; + +/** Get collision rectangle for two rectangles collision */ +export declare function GetCollisionRec(rec1: RectangleValue, rec2: RectangleValue): RectangleValue; + +/** Load image from file into CPU memory (RAM) */ +export declare function LoadImage(fileName: string): ImageValue; + +/** Load image from RAW file data */ +export declare function LoadImageRaw(fileName: string, width: number, height: number, format: number, headerSize: number): ImageValue; + +/** Load image sequence from file (frames appended to image.data) */ +export declare function LoadImageAnim(fileName: string, frames: FFIPointerInput): ImageValue; + +/** Load image sequence from memory buffer */ +export declare function LoadImageAnimFromMemory(fileType: string, fileData: FFIPointerInput, dataSize: number, frames: FFIPointerInput): ImageValue; + +/** Load image from memory buffer, fileType refers to extension: i.e. '.png' */ +export declare function LoadImageFromMemory(fileType: string, fileData: FFIPointerInput, dataSize: number): ImageValue; + +/** Load image from GPU texture data */ +export declare function LoadImageFromTexture(texture: Texture2DValue): ImageValue; + +/** Load image from screen buffer and (screenshot) */ +export declare function LoadImageFromScreen(): ImageValue; + +/** Check if an image is valid (data and parameters) */ +export declare function IsImageValid(image: ImageValue): boolean; + +/** Unload image from CPU memory (RAM) */ +export declare function UnloadImage(image: ImageValue): void; + +/** Export image data to file, returns true on success */ +export declare function ExportImage(image: ImageValue, fileName: string): boolean; + +/** Export image to memory buffer, memory must be MemFree() */ +export declare function ExportImageToMemory(image: ImageValue, fileType: string, fileSize: FFIPointerInput): FFIPointer; + +/** Export image as code file defining an array of bytes, returns true on success */ +export declare function ExportImageAsCode(image: ImageValue, fileName: string): boolean; + +/** Generate image: plain color */ +export declare function GenImageColor(width: number, height: number, color: ColorValue): ImageValue; + +/** Generate image: linear gradient, direction in degrees [0..360], 0=Vertical gradient */ +export declare function GenImageGradientLinear(width: number, height: number, direction: number, start: ColorValue, end: ColorValue): ImageValue; + +/** Generate image: checked */ +export declare function GenImageChecked(width: number, height: number, checksX: number, checksY: number, col1: ColorValue, col2: ColorValue): ImageValue; + +/** Generate image: cellular algorithm, bigger tileSize means bigger cells */ +export declare function GenImageCellular(width: number, height: number, tileSize: number): ImageValue; + +/** Generate image: grayscale image from text data */ +export declare function GenImageText(width: number, height: number, text: string): ImageValue; + +/** Create an image duplicate (useful for transformations) */ +export declare function ImageCopy(image: ImageValue): ImageValue; + +/** Create an image from another image piece */ +export declare function ImageFromImage(image: ImageValue, rec: RectangleValue): ImageValue; + +/** Create an image from a selected channel of another image (GRAYSCALE) */ +export declare function ImageFromChannel(image: ImageValue, selectedChannel: number): ImageValue; + +/** Create an image from text (default font) */ +export declare function ImageText(text: string, fontSize: number, color: ColorValue): ImageValue; + +/** Convert image data to desired format */ +export declare function ImageFormat(image: FFIPointerInput, newFormat: number): void; + +/** Convert image to POT (power-of-two) */ +export declare function ImageToPOT(image: FFIPointerInput, fill: ColorValue): void; + +/** Crop an image to a defined rectangle */ +export declare function ImageCrop(image: FFIPointerInput, crop: RectangleValue): void; + +/** Apply alpha mask to image */ +export declare function ImageAlphaMask(image: FFIPointerInput, alphaMask: ImageValue): void; + +/** Premultiply alpha channel */ +export declare function ImageAlphaPremultiply(image: FFIPointerInput): void; + +/** Apply Gaussian blur using a box blur approximation */ +export declare function ImageBlurGaussian(image: FFIPointerInput, blurSize: number): void; + +/** Apply custom square convolution kernel to image */ +export declare function ImageKernelConvolution(image: FFIPointerInput, kernel: FFIPointerInput, kernelSize: number): void; + +/** Resize image (Bicubic scaling algorithm) */ +export declare function ImageResize(image: FFIPointerInput, newWidth: number, newHeight: number): void; + +/** Resize image (Nearest-Neighbor scaling algorithm) */ +export declare function ImageResizeNN(image: FFIPointerInput, newWidth: number, newHeight: number): void; + +/** Resize canvas and fill with color */ +export declare function ImageResizeCanvas(image: FFIPointerInput, newWidth: number, newHeight: number, offsetX: number, offsetY: number, fill: ColorValue): void; + +/** Compute all mipmap levels for a provided image */ +export declare function ImageMipmaps(image: FFIPointerInput): void; + +/** Dither image data to 16bpp or lower (Floyd-Steinberg dithering) */ +export declare function ImageDither(image: FFIPointerInput, rBpp: number, gBpp: number, bBpp: number, aBpp: number): void; + +/** Flip image vertically */ +export declare function ImageFlipVertical(image: FFIPointerInput): void; + +/** Flip image horizontally */ +export declare function ImageFlipHorizontal(image: FFIPointerInput): void; + +/** Rotate image by input angle in degrees (-359 to 359) */ +export declare function ImageRotate(image: FFIPointerInput, degrees: number): void; + +/** Rotate image clockwise 90deg */ +export declare function ImageRotateCW(image: FFIPointerInput): void; + +/** Rotate image counter-clockwise 90deg */ +export declare function ImageRotateCCW(image: FFIPointerInput): void; + +/** Modify image color: tint */ +export declare function ImageColorTint(image: FFIPointerInput, color: ColorValue): void; + +/** Modify image color: invert */ +export declare function ImageColorInvert(image: FFIPointerInput): void; + +/** Modify image color: grayscale */ +export declare function ImageColorGrayscale(image: FFIPointerInput): void; + +/** Modify image color: brightness (-255 to 255) */ +export declare function ImageColorBrightness(image: FFIPointerInput, brightness: number): void; + +/** Modify image color: replace color */ +export declare function ImageColorReplace(image: FFIPointerInput, color: ColorValue, replace: ColorValue): void; + +/** Load color data from image as a Color array (RGBA - 32bit) */ +export declare function LoadImageColors(image: ImageValue): FFIPointer; + +/** Load colors palette from image as a Color array (RGBA - 32bit) */ +export declare function LoadImagePalette(image: ImageValue, maxPaletteSize: number, colorCount: FFIPointerInput): FFIPointer; + +/** Unload color data loaded with LoadImageColors() */ +export declare function UnloadImageColors(colors: FFIPointerInput): void; + +/** Unload colors palette loaded with LoadImagePalette() */ +export declare function UnloadImagePalette(colors: FFIPointerInput): void; + +/** Get image pixel color at (x, y) position */ +export declare function GetImageColor(image: ImageValue, x: number, y: number): ColorValue; + +/** Clear image background with given color */ +export declare function ImageClearBackground(dst: FFIPointerInput, color: ColorValue): void; + +/** Draw pixel within an image */ +export declare function ImageDrawPixel(dst: FFIPointerInput, posX: number, posY: number, color: ColorValue): void; + +/** Draw pixel within an image (Vector version) */ +export declare function ImageDrawPixelV(dst: FFIPointerInput, position: Vector2Value, color: ColorValue): void; + +/** Draw line within an image */ +export declare function ImageDrawLine(dst: FFIPointerInput, startPosX: number, startPosY: number, endPosX: number, endPosY: number, color: ColorValue): void; + +/** Draw line within an image (Vector version) */ +export declare function ImageDrawLineV(dst: FFIPointerInput, start: Vector2Value, end: Vector2Value, color: ColorValue): void; + +/** Draw a line defining thickness within an image */ +export declare function ImageDrawLineEx(dst: FFIPointerInput, start: Vector2Value, end: Vector2Value, thick: number, color: ColorValue): void; + +/** Draw a filled circle within an image */ +export declare function ImageDrawCircle(dst: FFIPointerInput, centerX: number, centerY: number, radius: number, color: ColorValue): void; + +/** Draw a filled circle within an image (Vector version) */ +export declare function ImageDrawCircleV(dst: FFIPointerInput, center: Vector2Value, radius: number, color: ColorValue): void; + +/** Draw circle outline within an image */ +export declare function ImageDrawCircleLines(dst: FFIPointerInput, centerX: number, centerY: number, radius: number, color: ColorValue): void; + +/** Draw circle outline within an image (Vector version) */ +export declare function ImageDrawCircleLinesV(dst: FFIPointerInput, center: Vector2Value, radius: number, color: ColorValue): void; + +/** Draw rectangle within an image */ +export declare function ImageDrawRectangle(dst: FFIPointerInput, posX: number, posY: number, width: number, height: number, color: ColorValue): void; + +/** Draw rectangle within an image (Vector version) */ +export declare function ImageDrawRectangleV(dst: FFIPointerInput, position: Vector2Value, size: Vector2Value, color: ColorValue): void; + +/** Draw rectangle within an image */ +export declare function ImageDrawRectangleRec(dst: FFIPointerInput, rec: RectangleValue, color: ColorValue): void; + +/** Draw rectangle lines within an image */ +export declare function ImageDrawRectangleLines(dst: FFIPointerInput, rec: RectangleValue, thick: number, color: ColorValue): void; + +/** Draw triangle within an image */ +export declare function ImageDrawTriangle(dst: FFIPointerInput, v1: Vector2Value, v2: Vector2Value, v3: Vector2Value, color: ColorValue): void; + +/** Draw triangle with interpolated colors within an image */ +export declare function ImageDrawTriangleEx(dst: FFIPointerInput, v1: Vector2Value, v2: Vector2Value, v3: Vector2Value, c1: ColorValue, c2: ColorValue, c3: ColorValue): void; + +/** Draw triangle outline within an image */ +export declare function ImageDrawTriangleLines(dst: FFIPointerInput, v1: Vector2Value, v2: Vector2Value, v3: Vector2Value, color: ColorValue): void; + +/** Draw a triangle fan defined by points within an image (first vertex is the center) */ +export declare function ImageDrawTriangleFan(dst: FFIPointerInput, points: FFIPointerInput, pointCount: number, color: ColorValue): void; + +/** Draw a triangle strip defined by points within an image */ +export declare function ImageDrawTriangleStrip(dst: FFIPointerInput, points: FFIPointerInput, pointCount: number, color: ColorValue): void; + +/** Draw a source image within a destination image (tint applied to source) */ +export declare function ImageDraw(dst: FFIPointerInput, src: ImageValue, srcRec: RectangleValue, dstRec: RectangleValue, tint: ColorValue): void; + +/** Draw text (using default font) within an image (destination) */ +export declare function ImageDrawText(dst: FFIPointerInput, text: string, posX: number, posY: number, fontSize: number, color: ColorValue): void; + +/** Load texture from file into GPU memory (VRAM) */ +export declare function LoadTexture(fileName: string): Texture2DValue; + +/** Load texture from image data */ +export declare function LoadTextureFromImage(image: ImageValue): Texture2DValue; + +/** Load cubemap from image, multiple image cubemap layouts supported */ +export declare function LoadTextureCubemap(image: ImageValue, layout: number): TextureCubemapValue; + +/** Load texture for rendering (framebuffer) */ +export declare function LoadRenderTexture(width: number, height: number): RenderTexture2DValue; + +/** Check if a texture is valid (loaded in GPU) */ +export declare function IsTextureValid(texture: Texture2DValue): boolean; + +/** Unload texture from GPU memory (VRAM) */ +export declare function UnloadTexture(texture: Texture2DValue): void; + +/** Check if a render texture is valid (loaded in GPU) */ +export declare function IsRenderTextureValid(target: RenderTexture2DValue): boolean; + +/** Unload render texture from GPU memory (VRAM) */ +export declare function UnloadRenderTexture(target: RenderTexture2DValue): void; + +/** Update GPU texture with new data (pixels should be able to fill texture) */ +export declare function UpdateTexture(texture: Texture2DValue, pixels: FFIPointerInput): void; + +/** Update GPU texture rectangle with new data (pixels and rec should fit in texture) */ +export declare function UpdateTextureRec(texture: Texture2DValue, rec: RectangleValue, pixels: FFIPointerInput): void; + +/** Generate GPU mipmaps for a texture */ +export declare function GenTextureMipmaps(texture: FFIPointerInput): void; + +/** Set texture scaling filter mode */ +export declare function SetTextureFilter(texture: Texture2DValue, filter: number): void; + +/** Set texture wrapping mode */ +export declare function SetTextureWrap(texture: Texture2DValue, wrap: number): void; + +/** Draw a Texture2D */ +export declare function DrawTexture(texture: Texture2DValue, posX: number, posY: number, tint: ColorValue): void; + +/** Draw a Texture2D with position defined as Vector2 */ +export declare function DrawTextureV(texture: Texture2DValue, position: Vector2Value, tint: ColorValue): void; + +/** Draw a part of a texture defined by a rectangle */ +export declare function DrawTextureRec(texture: Texture2DValue, source: RectangleValue, position: Vector2Value, tint: ColorValue): void; + +/** Check if two colors are equal */ +export declare function ColorIsEqual(col1: ColorValue, col2: ColorValue): boolean; + +/** Get hexadecimal value for a Color (0xRRGGBBAA) */ +export declare function ColorToInt(color: ColorValue): number; + +/** Get Color normalized as float [0..1] */ +export declare function ColorNormalize(color: ColorValue): Vector4Value; + +/** Get Color from normalized values [0..1] */ +export declare function ColorFromNormalized(normalized: Vector4Value): ColorValue; + +/** Get HSV values for a Color, hue [0..360], saturation/value [0..1] */ +export declare function ColorToHSV(color: ColorValue): Vector3Value; + +/** Get a Color from HSV values, hue [0..360], saturation/value [0..1] */ +export declare function ColorFromHSV(hue: number, saturation: number, value: number): ColorValue; + +/** Get color multiplied with another color */ +export declare function ColorTint(color: ColorValue, tint: ColorValue): ColorValue; + +/** Get src alpha-blended into dst color with tint */ +export declare function ColorAlphaBlend(dst: ColorValue, src: ColorValue, tint: ColorValue): ColorValue; + +/** Get Color structure from hexadecimal value */ +export declare function GetColor(hexValue: number): ColorValue; + +/** Get Color from a source pixel pointer of certain format */ +export declare function GetPixelColor(srcPtr: FFIPointerInput, format: number): ColorValue; + +/** Set color formatted into destination pixel pointer */ +export declare function SetPixelColor(dstPtr: FFIPointerInput, color: ColorValue, format: number): void; + +/** Get pixel data size in bytes for certain format */ +export declare function GetPixelDataSize(width: number, height: number, format: number): number; + +/** Get the default Font */ +export declare function GetFontDefault(): FontValue; + +/** Load font from file into GPU memory (VRAM) */ +export declare function LoadFont(fileName: string): FontValue; + +/** Load font from file with extended parameters, use NULL for codepoints and 0 for codepointCount to load the default character set, font size is provided in pixels height */ +export declare function LoadFontEx(fileName: string, fontSize: number, codepoints: FFIPointerInput, codepointCount: number): FontValue; + +/** Load font from Image (XNA style) */ +export declare function LoadFontFromImage(image: ImageValue, key: ColorValue, firstChar: number): FontValue; + +/** Load font from memory buffer, fileType refers to extension: i.e. '.ttf' */ +export declare function LoadFontFromMemory(fileType: string, fileData: FFIPointerInput, dataSize: number, fontSize: number, codepoints: FFIPointerInput, codepointCount: number): FontValue; + +/** Check if a font is valid (font data loaded, WARNING: GPU texture not checked) */ +export declare function IsFontValid(font: FontValue): boolean; + +/** Load font data for further use */ +export declare function LoadFontData(fileData: FFIPointerInput, dataSize: number, fontSize: number, codepoints: FFIPointerInput, codepointCount: number, type: number, glyphCount: FFIPointerInput): FFIPointer; + +/** Generate image font atlas using chars info */ +export declare function GenImageFontAtlas(glyphs: FFIPointerInput, glyphRecs: FFIPointerInput, glyphCount: number, fontSize: number, padding: number, packMethod: number): ImageValue; + +/** Unload font chars info data (RAM) */ +export declare function UnloadFontData(glyphs: FFIPointerInput, glyphCount: number): void; + +/** Unload font from GPU memory (VRAM) */ +export declare function UnloadFont(font: FontValue): void; + +/** Export font as code file, returns true on success */ +export declare function ExportFontAsCode(font: FontValue, fileName: string): boolean; + +/** Draw current FPS */ +export declare function DrawFPS(posX: number, posY: number): void; + +/** Draw text (using default font) */ +export declare function DrawText(text: string, posX: number, posY: number, fontSize: number, color: ColorValue): void; + +/** Set vertical line spacing when drawing with line-breaks */ +export declare function SetTextLineSpacing(spacing: number): void; + +/** Measure string width for default font */ +export declare function MeasureText(text: string, fontSize: number): number; + +/** Get glyph index position in font for a codepoint (unicode character), fallback to '?' if not found */ +export declare function GetGlyphIndex(font: FontValue, codepoint: number): number; + +/** Get glyph font info data for a codepoint (unicode character), fallback to '?' if not found */ +export declare function GetGlyphInfo(font: FontValue, codepoint: number): GlyphInfoValue; + +/** Get glyph rectangle in font atlas for a codepoint (unicode character), fallback to '?' if not found */ +export declare function GetGlyphAtlasRec(font: FontValue, codepoint: number): RectangleValue; + +/** Load UTF-8 text encoded from codepoints array */ +export declare function LoadUTF8(codepoints: FFIPointerInput, length: number): FFIPointer; + +/** Unload UTF-8 text encoded from codepoints array */ +export declare function UnloadUTF8(text: FFIPointerInput): void; + +/** Load all codepoints from a UTF-8 text string, codepoints count returned by parameter */ +export declare function LoadCodepoints(text: string, count: FFIPointerInput): FFIPointer; + +/** Unload codepoints data from memory */ +export declare function UnloadCodepoints(codepoints: FFIPointerInput): void; + +/** Get total number of codepoints in a UTF-8 encoded string */ +export declare function GetCodepointCount(text: string): number; + +/** Get next codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure */ +export declare function GetCodepoint(text: string, codepointSize: FFIPointerInput): number; + +/** Get next codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure */ +export declare function GetCodepointNext(text: string, codepointSize: FFIPointerInput): number; + +/** Get previous codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure */ +export declare function GetCodepointPrevious(text: string, codepointSize: FFIPointerInput): number; + +/** Encode one codepoint into UTF-8 byte array (array length returned as parameter) */ +export declare function CodepointToUTF8(codepoint: number, utf8Size: FFIPointerInput): string; + +/** Load text as separate lines ('\n') */ +export declare function LoadTextLines(text: string, count: FFIPointerInput): FFIPointer; + +/** Unload text lines */ +export declare function UnloadTextLines(text: FFIPointerInput, lineCount: number): void; + +/** Copy one string to another, returns bytes copied */ +export declare function TextCopy(dst: FFIPointerInput, src: string): number; + +/** Check if two text string are equal */ +export declare function TextIsEqual(text1: string, text2: string): boolean; + +/** Get text length, checks for '\0' ending */ +export declare function TextLength(text: string): number; + +/** Get a piece of a text string */ +export declare function TextSubtext(text: string, position: number, length: number): string; + +/** Remove text spaces, concat words */ +export declare function TextRemoveSpaces(text: string): string; + +/** Get text between two strings */ +export declare function GetTextBetween(text: string, begin: string, end: string): string; + +/** Replace text string with new string */ +export declare function TextReplace(text: string, search: string, replacement: string): string; + +/** Raw-pointer variant for nullable C string parameters. */ +export declare function TextReplaceRaw(text: string, search: string, replacement: FFIPointerInput): string; + +/** Replace text string with new string, memory must be MemFree() */ +export declare function TextReplaceAlloc(text: string, search: string, replacement: string): FFIPointer; + +/** Raw-pointer variant for nullable C string parameters. */ +export declare function TextReplaceAllocRaw(text: string, search: string, replacement: FFIPointerInput): FFIPointer; + +/** Replace text between two specific strings */ +export declare function TextReplaceBetween(text: string, begin: string, end: string, replacement: string): string; + +/** Raw-pointer variant for nullable C string parameters. */ +export declare function TextReplaceBetweenRaw(text: string, begin: string, end: string, replacement: FFIPointerInput): string; + +/** Replace text between two specific strings, memory must be MemFree() */ +export declare function TextReplaceBetweenAlloc(text: string, begin: string, end: string, replacement: string): FFIPointer; + +/** Raw-pointer variant for nullable C string parameters. */ +export declare function TextReplaceBetweenAllocRaw(text: string, begin: string, end: string, replacement: FFIPointerInput): FFIPointer; + +/** Insert text in a defined byte position */ +export declare function TextInsert(text: string, insert: string, position: number): string; + +/** Insert text in a defined byte position, memory must be MemFree() */ +export declare function TextInsertAlloc(text: string, insert: string, position: number): FFIPointer; + +/** Join text strings with delimiter */ +export declare function TextJoin(textList: FFIPointerInput, count: number, delimiter: string): string; + +/** Split text into multiple strings, using MAX_TEXTSPLIT_COUNT static strings */ +export declare function TextSplit(text: string, delimiter: number, count: FFIPointerInput): FFIPointer; + +/** Append text at specific position and move cursor */ +export declare function TextAppend(text: FFIPointerInput, append: string, position: FFIPointerInput): void; + +/** Find first text occurrence within a string, -1 if not found */ +export declare function TextFindIndex(text: string, search: string): number; + +/** Get upper case version of provided string */ +export declare function TextToUpper(text: string): string; + +/** Get lower case version of provided string */ +export declare function TextToLower(text: string): string; + +/** Get Pascal case notation version of provided string */ +export declare function TextToPascal(text: string): string; + +/** Get Snake case notation version of provided string */ +export declare function TextToSnake(text: string): string; + +/** Get Camel case notation version of provided string */ +export declare function TextToCamel(text: string): string; + +/** Get integer value from text */ +export declare function TextToInteger(text: string): number; + +/** Get float value from text */ +export declare function TextToFloat(text: string): number; + +/** Draw a line in 3D world space */ +export declare function DrawLine3D(startPos: Vector3Value, endPos: Vector3Value, color: ColorValue): void; + +/** Draw a point in 3D space, actually a small line */ +export declare function DrawPoint3D(position: Vector3Value, color: ColorValue): void; + +/** Draw a color-filled triangle (vertex in counter-clockwise order!) */ +export declare function DrawTriangle3D(v1: Vector3Value, v2: Vector3Value, v3: Vector3Value, color: ColorValue): void; + +/** Draw a triangle strip defined by points */ +export declare function DrawTriangleStrip3D(points: FFIPointerInput, pointCount: number, color: ColorValue): void; + +/** Draw cube (Vector version) */ +export declare function DrawCubeV(position: Vector3Value, size: Vector3Value, color: ColorValue): void; + +/** Draw cube wires (Vector version) */ +export declare function DrawCubeWiresV(position: Vector3Value, size: Vector3Value, color: ColorValue): void; + +/** Draw a plane XZ */ +export declare function DrawPlane(centerPos: Vector3Value, size: Vector2Value, color: ColorValue): void; + +/** Draw a ray line */ +export declare function DrawRay(ray: RayValue, color: ColorValue): void; + +/** Load model from files (meshes and materials) */ +export declare function LoadModel(fileName: string): ModelValue; + +/** Load model from generated mesh (default material) */ +export declare function LoadModelFromMesh(mesh: MeshValue): ModelValue; + +/** Check if a model is valid (loaded in GPU, VAO/VBOs) */ +export declare function IsModelValid(model: ModelValue): boolean; + +/** Unload model (including meshes) from memory (RAM and/or VRAM) */ +export declare function UnloadModel(model: ModelValue): void; + +/** Compute model bounding box limits (considers all meshes) */ +export declare function GetModelBoundingBox(model: ModelValue): BoundingBoxValue; + +/** Draw bounding box (wires) */ +export declare function DrawBoundingBox(box: BoundingBoxValue, color: ColorValue): void; + +/** Draw a billboard texture defined by source */ +export declare function DrawBillboardRec(camera: CameraValue, texture: Texture2DValue, source: RectangleValue, position: Vector3Value, size: Vector2Value, tint: ColorValue): void; + +/** Upload mesh vertex data in GPU and provide VAO/VBO ids */ +export declare function UploadMesh(mesh: FFIPointerInput, dynamic: boolean): void; + +/** Update mesh vertex data in GPU for a specific buffer index */ +export declare function UpdateMeshBuffer(mesh: MeshValue, index: number, data: FFIPointerInput, dataSize: number, offset: number): void; + +/** Unload mesh data from CPU and GPU */ +export declare function UnloadMesh(mesh: MeshValue): void; + +/** Draw a 3d mesh with material and transform */ +export declare function DrawMesh(mesh: MeshValue, material: MaterialValue, transform: MatrixValue): void; + +/** Draw multiple mesh instances with material and different transforms */ +export declare function DrawMeshInstanced(mesh: MeshValue, material: MaterialValue, transforms: FFIPointerInput, instances: number): void; + +/** Compute mesh bounding box limits */ +export declare function GetMeshBoundingBox(mesh: MeshValue): BoundingBoxValue; + +/** Compute mesh tangents */ +export declare function GenMeshTangents(mesh: FFIPointerInput): void; + +/** Export mesh data to file, returns true on success */ +export declare function ExportMesh(mesh: MeshValue, fileName: string): boolean; + +/** Export mesh as code file (.h) defining multiple arrays of vertex attributes */ +export declare function ExportMeshAsCode(mesh: MeshValue, fileName: string): boolean; + +/** Generate cuboid mesh */ +export declare function GenMeshCube(width: number, height: number, length: number): MeshValue; + +/** Generate heightmap mesh from image data */ +export declare function GenMeshHeightmap(heightmap: ImageValue, size: Vector3Value): MeshValue; + +/** Generate cubes-based map mesh from image data */ +export declare function GenMeshCubicmap(cubicmap: ImageValue, cubeSize: Vector3Value): MeshValue; + +/** Load materials from model file */ +export declare function LoadMaterials(fileName: string, materialCount: FFIPointerInput): FFIPointer; + +/** Load default material (Supports: DIFFUSE, SPECULAR, NORMAL maps) */ +export declare function LoadMaterialDefault(): MaterialValue; + +/** Check if a material is valid (shader assigned, map textures loaded in GPU) */ +export declare function IsMaterialValid(material: MaterialValue): boolean; + +/** Unload material from GPU memory (VRAM) */ +export declare function UnloadMaterial(material: MaterialValue): void; + +/** Set texture for a material map type (MATERIAL_MAP_DIFFUSE, MATERIAL_MAP_SPECULAR...) */ +export declare function SetMaterialTexture(material: FFIPointerInput, mapType: number, texture: Texture2DValue): void; + +/** Set material for a mesh */ +export declare function SetModelMeshMaterial(model: FFIPointerInput, meshId: number, materialId: number): void; + +/** Load model animations from file */ +export declare function LoadModelAnimations(fileName: string, animCount: FFIPointerInput): FFIPointer; + +/** Unload animation array data */ +export declare function UnloadModelAnimations(animations: FFIPointerInput, animCount: number): void; + +/** Check model animation skeleton match */ +export declare function IsModelAnimationValid(model: ModelValue, anim: ModelAnimationValue): boolean; + +/** Check collision between two bounding boxes */ +export declare function CheckCollisionBoxes(box1: BoundingBoxValue, box2: BoundingBoxValue): boolean; + +/** Get collision info between ray and box */ +export declare function GetRayCollisionBox(ray: RayValue, box: BoundingBoxValue): RayCollisionValue; + +/** Get collision info between ray and mesh */ +export declare function GetRayCollisionMesh(ray: RayValue, mesh: MeshValue, transform: MatrixValue): RayCollisionValue; + +/** Get collision info between ray and triangle */ +export declare function GetRayCollisionTriangle(ray: RayValue, p1: Vector3Value, p2: Vector3Value, p3: Vector3Value): RayCollisionValue; + +/** Get collision info between ray and quad */ +export declare function GetRayCollisionQuad(ray: RayValue, p1: Vector3Value, p2: Vector3Value, p3: Vector3Value, p4: Vector3Value): RayCollisionValue; + +/** Initialize audio device and context */ +export declare function InitAudioDevice(): void; + +/** Close the audio device and context */ +export declare function CloseAudioDevice(): void; + +/** Check if audio device has been initialized successfully */ +export declare function IsAudioDeviceReady(): boolean; + +/** Set master volume (listener) */ +export declare function SetMasterVolume(volume: number): void; + +/** Get master volume (listener) */ +export declare function GetMasterVolume(): number; + +/** Load wave data from file */ +export declare function LoadWave(fileName: string): WaveValue; + +/** Load wave from memory buffer, fileType refers to extension: i.e. '.wav' */ +export declare function LoadWaveFromMemory(fileType: string, fileData: FFIPointerInput, dataSize: number): WaveValue; + +/** Checks if wave data is valid (data loaded and parameters) */ +export declare function IsWaveValid(wave: WaveValue): boolean; + +/** Load sound from file */ +export declare function LoadSound(fileName: string): SoundValue; + +/** Load sound from wave data */ +export declare function LoadSoundFromWave(wave: WaveValue): SoundValue; + +/** Create a new sound that shares the same sample data as the source sound, does not own the sound data */ +export declare function LoadSoundAlias(source: SoundValue): SoundValue; + +/** Checks if a sound is valid (data loaded and buffers initialized) */ +export declare function IsSoundValid(sound: SoundValue): boolean; + +/** Update sound buffer with new data (default data format: 32 bit float, stereo) */ +export declare function UpdateSound(sound: SoundValue, data: FFIPointerInput, sampleCount: number): void; + +/** Unload wave data */ +export declare function UnloadWave(wave: WaveValue): void; + +/** Unload sound */ +export declare function UnloadSound(sound: SoundValue): void; + +/** Unload a sound alias (does not deallocate sample data) */ +export declare function UnloadSoundAlias(alias: SoundValue): void; + +/** Export wave data to file, returns true on success */ +export declare function ExportWave(wave: WaveValue, fileName: string): boolean; + +/** Export wave sample data to code (.h), returns true on success */ +export declare function ExportWaveAsCode(wave: WaveValue, fileName: string): boolean; + +/** Play a sound */ +export declare function PlaySound(sound: SoundValue): void; + +/** Stop playing a sound */ +export declare function StopSound(sound: SoundValue): void; + +/** Pause a sound */ +export declare function PauseSound(sound: SoundValue): void; + +/** Resume a paused sound */ +export declare function ResumeSound(sound: SoundValue): void; + +/** Check if a sound is currently playing */ +export declare function IsSoundPlaying(sound: SoundValue): boolean; + +/** Copy a wave to a new wave */ +export declare function WaveCopy(wave: WaveValue): WaveValue; + +/** Crop a wave to defined frames range */ +export declare function WaveCrop(wave: FFIPointerInput, initFrame: number, finalFrame: number): void; + +/** Convert wave data to desired format */ +export declare function WaveFormat(wave: FFIPointerInput, sampleRate: number, sampleSize: number, channels: number): void; + +/** Load samples data from wave as a 32bit float data array */ +export declare function LoadWaveSamples(wave: WaveValue): FFIPointer; + +/** Unload samples data loaded with LoadWaveSamples() */ +export declare function UnloadWaveSamples(samples: FFIPointerInput): void; + +/** Load music stream from file */ +export declare function LoadMusicStream(fileName: string): MusicValue; + +/** Load music stream from data */ +export declare function LoadMusicStreamFromMemory(fileType: string, data: FFIPointerInput, dataSize: number): MusicValue; + +/** Checks if a music stream is valid (context and buffers initialized) */ +export declare function IsMusicValid(music: MusicValue): boolean; + +/** Unload music stream */ +export declare function UnloadMusicStream(music: MusicValue): void; + +/** Start music playing */ +export declare function PlayMusicStream(music: MusicValue): void; + +/** Check if music is playing */ +export declare function IsMusicStreamPlaying(music: MusicValue): boolean; + +/** Updates buffers for music streaming */ +export declare function UpdateMusicStream(music: MusicValue): void; + +/** Stop music playing */ +export declare function StopMusicStream(music: MusicValue): void; + +/** Pause music playing */ +export declare function PauseMusicStream(music: MusicValue): void; + +/** Resume playing paused music */ +export declare function ResumeMusicStream(music: MusicValue): void; + +/** Get music time length (in seconds) */ +export declare function GetMusicTimeLength(music: MusicValue): number; + +/** Get current music time played (in seconds) */ +export declare function GetMusicTimePlayed(music: MusicValue): number; + +/** Load audio stream (to stream raw audio pcm data) */ +export declare function LoadAudioStream(sampleRate: number, sampleSize: number, channels: number): AudioStreamValue; + +/** Checks if an audio stream is valid (buffers initialized) */ +export declare function IsAudioStreamValid(stream: AudioStreamValue): boolean; + +/** Unload audio stream and free memory */ +export declare function UnloadAudioStream(stream: AudioStreamValue): void; + +/** Update audio stream buffers with data */ +export declare function UpdateAudioStream(stream: AudioStreamValue, data: FFIPointerInput, frameCount: number): void; + +/** Check if any audio stream buffers requires refill */ +export declare function IsAudioStreamProcessed(stream: AudioStreamValue): boolean; + +/** Play audio stream */ +export declare function PlayAudioStream(stream: AudioStreamValue): void; + +/** Pause audio stream */ +export declare function PauseAudioStream(stream: AudioStreamValue): void; + +/** Resume audio stream */ +export declare function ResumeAudioStream(stream: AudioStreamValue): void; + +/** Check if audio stream is playing */ +export declare function IsAudioStreamPlaying(stream: AudioStreamValue): boolean; + +/** Stop audio stream */ +export declare function StopAudioStream(stream: AudioStreamValue): void; + +/** Default size for new audio streams */ +export declare function SetAudioStreamBufferSizeDefault(size: number): void; + +/** Audio thread callback to request new data */ +export declare function SetAudioStreamCallback(stream: AudioStreamValue, callback: FFIPointerInput): void; + +/** Attach audio stream processor to stream, receives frames x 2 samples as 'float' (stereo) */ +export declare function AttachAudioStreamProcessor(stream: AudioStreamValue, processor: FFIPointerInput): void; + +/** Detach audio stream processor from stream */ +export declare function DetachAudioStreamProcessor(stream: AudioStreamValue, processor: FFIPointerInput): void; + +/** Attach audio stream processor to the entire audio pipeline, receives frames x 2 samples as 'float' (stereo) */ +export declare function AttachAudioMixedProcessor(processor: FFIPointerInput): void; + +/** Detach audio stream processor from the entire audio pipeline */ +export declare function DetachAudioMixedProcessor(processor: FFIPointerInput): void; + +export declare const MOUSE_LEFT_BUTTON: typeof MOUSE_BUTTON_LEFT; +export declare const MOUSE_RIGHT_BUTTON: typeof MOUSE_BUTTON_RIGHT; +export declare const MOUSE_MIDDLE_BUTTON: typeof MOUSE_BUTTON_MIDDLE; +export declare const MATERIAL_MAP_DIFFUSE: typeof MATERIAL_MAP_ALBEDO; +export declare const MATERIAL_MAP_SPECULAR: typeof MATERIAL_MAP_METALNESS; +export declare const SHADER_LOC_MAP_DIFFUSE: typeof SHADER_LOC_MAP_ALBEDO; +export declare const SHADER_LOC_MAP_SPECULAR: typeof SHADER_LOC_MAP_METALNESS; +/** Compatibility hack for previous raylib versions */ +export declare const GetMouseRay: typeof GetScreenToWorldRay; diff --git a/bindings/raylib.ts b/bindings/raylib.ts new file mode 100644 index 0000000..afb3c0d --- /dev/null +++ b/bindings/raylib.ts @@ -0,0 +1,2592 @@ +// Generated from official raylib 6.0 (dbc56a87da87d973a9c5baa4e7438a9d20121d28). +// Do not edit by hand; run npm run generate. + +export const RAYLIB_BINDING_INFO = { + raylibVersion: "6.0", + raylibCommit: "dbc56a87da87d973a9c5baa4e7438a9d20121d28", + gocciaScriptVersion: "0.10.0", + linkage: "dynamic", +}; +export const RAYLIB_FIELD_ALIASES = { + AudioStream: { buffer: "nativeBuffer" }, +}; + +const raylibCandidates = (): string[] => { + const suffix = FFI.suffix; + const override = globalThis.RAYLIB_LIBRARY_PATH; + let candidates: string[]; + if (suffix === ".dylib") { + candidates = [ + "./libraylib.dylib", + "/opt/homebrew/lib/libraylib.dylib", + "/usr/local/lib/libraylib.dylib", + "libraylib.dylib", + ]; + } else if (suffix === ".so") { + candidates = [ + "./libraylib.so", + "/usr/local/lib/libraylib.so", + "/usr/lib/libraylib.so", + "/usr/lib/x86_64-linux-gnu/libraylib.so", + "/usr/lib/aarch64-linux-gnu/libraylib.so", + "libraylib.so", + ]; + } else { + candidates = ["./raylib.dll", "raylib.dll"]; + } + if (typeof override === "string" && override.length > 0) { + candidates.unshift(override); + } + return candidates; +}; + +const openRaylib = () => { + const candidates = raylibCandidates(); + let lastError: string = ""; + for (const candidate of candidates) { + try { + return FFI.open(candidate); + } catch (error) { + lastError = String(error); + } + } + throw new TypeError( + "Unable to load the raylib 6.0 dynamic library. Tried: " + + candidates.join(", ") + + ". Last error: " + + lastError, + ); +}; + +export const raylibLibrary = openRaylib(); +export const closeRaylib = (): void => { + if (!raylibLibrary.closed) raylibLibrary.close(); +}; + +/** Vector2, 2 components */ +export const Vector2 = FFI.struct({ + "x": "f32", + "y": "f32", +}); + +/** Vector3, 3 components */ +export const Vector3 = FFI.struct({ + "x": "f32", + "y": "f32", + "z": "f32", +}); + +/** Vector4, 4 components */ +export const Vector4 = FFI.struct({ + "x": "f32", + "y": "f32", + "z": "f32", + "w": "f32", +}); + +/** Matrix, 4x4 components, column major, OpenGL style, right-handed */ +export const Matrix = FFI.struct({ + "m0": "f32", + "m4": "f32", + "m8": "f32", + "m12": "f32", + "m1": "f32", + "m5": "f32", + "m9": "f32", + "m13": "f32", + "m2": "f32", + "m6": "f32", + "m10": "f32", + "m14": "f32", + "m3": "f32", + "m7": "f32", + "m11": "f32", + "m15": "f32", +}); + +/** Color, 4 components, R8G8B8A8 (32bit) */ +export const Color = FFI.struct({ + "r": "u8", + "g": "u8", + "b": "u8", + "a": "u8", +}); + +/** Rectangle, 4 components */ +export const Rectangle = FFI.struct({ + "x": "f32", + "y": "f32", + "width": "f32", + "height": "f32", +}); + +/** Image, pixel data stored in CPU memory (RAM) */ +export const Image = FFI.struct({ + "data": "pointer", + "width": "i32", + "height": "i32", + "mipmaps": "i32", + "format": "i32", +}); + +/** Texture, tex data stored in GPU memory (VRAM) */ +export const Texture = FFI.struct({ + "id": "u32", + "width": "i32", + "height": "i32", + "mipmaps": "i32", + "format": "i32", +}); + +/** RenderTexture, fbo for texture rendering */ +export const RenderTexture = FFI.struct({ + "id": "u32", + "texture": Texture, + "depth": Texture, +}); + +/** NPatchInfo, n-patch layout info */ +export const NPatchInfo = FFI.struct({ + "source": Rectangle, + "left": "i32", + "top": "i32", + "right": "i32", + "bottom": "i32", + "layout": "i32", +}); + +/** GlyphInfo, font characters glyphs info */ +export const GlyphInfo = FFI.struct({ + "value": "i32", + "offsetX": "i32", + "offsetY": "i32", + "advanceX": "i32", + "image": Image, +}); + +/** Font, font texture and GlyphInfo array data */ +export const Font = FFI.struct({ + "baseSize": "i32", + "glyphCount": "i32", + "glyphPadding": "i32", + "texture": Texture, + "recs": "pointer", + "glyphs": "pointer", +}); + +/** Camera, defines position/orientation in 3d space */ +export const Camera3D = FFI.struct({ + "position": Vector3, + "target": Vector3, + "up": Vector3, + "fovy": "f32", + "projection": "i32", +}); + +/** Camera2D, defines position/orientation in 2d space */ +export const Camera2D = FFI.struct({ + "offset": Vector2, + "target": Vector2, + "rotation": "f32", + "zoom": "f32", +}); + +/** Mesh, vertex data and vao/vbo */ +export const Mesh = FFI.struct({ + "vertexCount": "i32", + "triangleCount": "i32", + "vertices": "pointer", + "texcoords": "pointer", + "texcoords2": "pointer", + "normals": "pointer", + "tangents": "pointer", + "colors": "pointer", + "indices": "pointer", + "boneCount": "i32", + "boneIndices": "pointer", + "boneWeights": "pointer", + "animVertices": "pointer", + "animNormals": "pointer", + "vaoId": "u32", + "vboId": "pointer", +}); + +/** Shader */ +export const Shader = FFI.struct({ + "id": "u32", + "locs": "pointer", +}); + +/** MaterialMap */ +export const MaterialMap = FFI.struct({ + "texture": Texture, + "color": Color, + "value": "f32", +}); + +/** Material, includes shader and maps */ +export const Material = FFI.struct({ + "shader": Shader, + "maps": "pointer", + "params": FFI.array("f32", 4), +}); + +/** Transform, vertex transformation data */ +export const Transform = FFI.struct({ + "translation": Vector3, + "rotation": Vector4, + "scale": Vector3, +}); + +/** Bone, skeletal animation bone */ +export const BoneInfo = FFI.struct({ + "name": FFI.array("i8", 32), + "parent": "i32", +}); + +/** Skeleton, animation bones hierarchy */ +export const ModelSkeleton = FFI.struct({ + "boneCount": "i32", + "bones": "pointer", + "bindPose": "pointer", +}); + +/** Model, meshes, materials and animation data */ +export const Model = FFI.struct({ + "transform": Matrix, + "meshCount": "i32", + "materialCount": "i32", + "meshes": "pointer", + "materials": "pointer", + "meshMaterial": "pointer", + "skeleton": ModelSkeleton, + "currentPose": "pointer", + "boneMatrices": "pointer", +}); + +/** ModelAnimation, contains a full animation sequence */ +export const ModelAnimation = FFI.struct({ + "name": FFI.array("i8", 32), + "boneCount": "i32", + "keyframeCount": "i32", + "keyframePoses": "pointer", +}); + +/** Ray, ray for raycasting */ +export const Ray = FFI.struct({ + "position": Vector3, + "direction": Vector3, +}); + +/** RayCollision, ray hit information */ +export const RayCollision = FFI.struct({ + "hit": "bool", + "distance": "f32", + "point": Vector3, + "normal": Vector3, +}); + +/** BoundingBox */ +export const BoundingBox = FFI.struct({ + "min": Vector3, + "max": Vector3, +}); + +/** Wave, audio wave data */ +export const Wave = FFI.struct({ + "frameCount": "u32", + "sampleRate": "u32", + "sampleSize": "u32", + "channels": "u32", + "data": "pointer", +}); + +/** AudioStream, custom audio stream */ +export const AudioStream = FFI.struct({ + "nativeBuffer": "pointer", + "processor": "pointer", + "sampleRate": "u32", + "sampleSize": "u32", + "channels": "u32", +}); + +/** Sound */ +export const Sound = FFI.struct({ + "stream": AudioStream, + "frameCount": "u32", +}); + +/** Music, audio stream, anything longer than ~10 seconds should be streamed */ +export const Music = FFI.struct({ + "stream": AudioStream, + "frameCount": "u32", + "looping": "bool", + "ctxType": "i32", + "ctxData": "pointer", +}); + +/** VrDeviceInfo, Head-Mounted-Display device parameters */ +export const VrDeviceInfo = FFI.struct({ + "hResolution": "i32", + "vResolution": "i32", + "hScreenSize": "f32", + "vScreenSize": "f32", + "eyeToScreenDistance": "f32", + "lensSeparationDistance": "f32", + "interpupillaryDistance": "f32", + "lensDistortionValues": FFI.array("f32", 4), + "chromaAbCorrection": FFI.array("f32", 4), +}); + +/** VrStereoConfig, VR stereo rendering configuration for simulator */ +export const VrStereoConfig = FFI.struct({ + "projection": FFI.array(Matrix, 2), + "viewOffset": FFI.array(Matrix, 2), + "leftLensCenter": FFI.array("f32", 2), + "rightLensCenter": FFI.array("f32", 2), + "leftScreenCenter": FFI.array("f32", 2), + "rightScreenCenter": FFI.array("f32", 2), + "scale": FFI.array("f32", 2), + "scaleIn": FFI.array("f32", 2), +}); + +/** File path list */ +export const FilePathList = FFI.struct({ + "count": "u32", + "paths": "pointer", +}); + +/** Automation event */ +export const AutomationEvent = FFI.struct({ + "frame": "u32", + "type": "u32", + "params": FFI.array("i32", 4), +}); + +/** Automation event list */ +export const AutomationEventList = FFI.struct({ + "capacity": "u32", + "count": "u32", + "events": "pointer", +}); + +/** Quaternion, 4 components (Vector4 alias) */ +export const Quaternion = Vector4; + +/** Texture2D, same as Texture */ +export const Texture2D = Texture; + +/** TextureCubemap, same as Texture */ +export const TextureCubemap = Texture; + +/** RenderTexture2D, same as RenderTexture */ +export const RenderTexture2D = RenderTexture; + +/** Camera type fallback, defaults to Camera3D */ +export const Camera = Camera3D; + +/** Anim pose, an array of Transform[] */ +export const ModelAnimPose = "pointer"; + +/** Logging: Redirect trace log messages */ +export const TraceLogCallback = "pointer"; + +/** FileIO: Load binary data */ +export const LoadFileDataCallback = "pointer"; + +/** FileIO: Save binary data */ +export const SaveFileDataCallback = "pointer"; + +/** FileIO: Load text data */ +export const LoadFileTextCallback = "pointer"; + +/** FileIO: Save text data */ +export const SaveFileTextCallback = "pointer"; + +export const AudioCallback = "pointer"; + +/** Set to try enabling V-Sync on GPU */ +export const FLAG_VSYNC_HINT = 64; +/** Set to run program in fullscreen */ +export const FLAG_FULLSCREEN_MODE = 2; +/** Set to allow resizable window */ +export const FLAG_WINDOW_RESIZABLE = 4; +/** Set to disable window decoration (frame and buttons) */ +export const FLAG_WINDOW_UNDECORATED = 8; +/** Set to hide window */ +export const FLAG_WINDOW_HIDDEN = 128; +/** Set to minimize window (iconify) */ +export const FLAG_WINDOW_MINIMIZED = 512; +/** Set to maximize window (expanded to monitor) */ +export const FLAG_WINDOW_MAXIMIZED = 1024; +/** Set to window non focused */ +export const FLAG_WINDOW_UNFOCUSED = 2048; +/** Set to window always on top */ +export const FLAG_WINDOW_TOPMOST = 4096; +/** Set to allow windows running while minimized */ +export const FLAG_WINDOW_ALWAYS_RUN = 256; +/** Set to allow transparent framebuffer */ +export const FLAG_WINDOW_TRANSPARENT = 16; +/** Set to support HighDPI */ +export const FLAG_WINDOW_HIGHDPI = 8192; +/** Set to support mouse passthrough, only supported when FLAG_WINDOW_UNDECORATED */ +export const FLAG_WINDOW_MOUSE_PASSTHROUGH = 16384; +/** Set to run program in borderless windowed mode */ +export const FLAG_BORDERLESS_WINDOWED_MODE = 32768; +/** Set to try enabling MSAA 4X */ +export const FLAG_MSAA_4X_HINT = 32; +/** Set to try enabling interlaced video format (for V3D) */ +export const FLAG_INTERLACED_HINT = 65536; + +/** Display all logs */ +export const LOG_ALL = 0; +/** Trace logging, intended for internal use only */ +export const LOG_TRACE = 1; +/** Debug logging, used for internal debugging, it should be disabled on release builds */ +export const LOG_DEBUG = 2; +/** Info logging, used for program execution info */ +export const LOG_INFO = 3; +/** Warning logging, used on recoverable failures */ +export const LOG_WARNING = 4; +/** Error logging, used on unrecoverable failures */ +export const LOG_ERROR = 5; +/** Fatal logging, used to abort program: exit(EXIT_FAILURE) */ +export const LOG_FATAL = 6; +/** Disable logging */ +export const LOG_NONE = 7; + +/** Key: NULL, used for no key pressed */ +export const KEY_NULL = 0; +/** Key: ' */ +export const KEY_APOSTROPHE = 39; +/** Key: , */ +export const KEY_COMMA = 44; +/** Key: - */ +export const KEY_MINUS = 45; +/** Key: . */ +export const KEY_PERIOD = 46; +/** Key: / */ +export const KEY_SLASH = 47; +/** Key: 0 */ +export const KEY_ZERO = 48; +/** Key: 1 */ +export const KEY_ONE = 49; +/** Key: 2 */ +export const KEY_TWO = 50; +/** Key: 3 */ +export const KEY_THREE = 51; +/** Key: 4 */ +export const KEY_FOUR = 52; +/** Key: 5 */ +export const KEY_FIVE = 53; +/** Key: 6 */ +export const KEY_SIX = 54; +/** Key: 7 */ +export const KEY_SEVEN = 55; +/** Key: 8 */ +export const KEY_EIGHT = 56; +/** Key: 9 */ +export const KEY_NINE = 57; +/** Key: ; */ +export const KEY_SEMICOLON = 59; +/** Key: = */ +export const KEY_EQUAL = 61; +/** Key: A | a */ +export const KEY_A = 65; +/** Key: B | b */ +export const KEY_B = 66; +/** Key: C | c */ +export const KEY_C = 67; +/** Key: D | d */ +export const KEY_D = 68; +/** Key: E | e */ +export const KEY_E = 69; +/** Key: F | f */ +export const KEY_F = 70; +/** Key: G | g */ +export const KEY_G = 71; +/** Key: H | h */ +export const KEY_H = 72; +/** Key: I | i */ +export const KEY_I = 73; +/** Key: J | j */ +export const KEY_J = 74; +/** Key: K | k */ +export const KEY_K = 75; +/** Key: L | l */ +export const KEY_L = 76; +/** Key: M | m */ +export const KEY_M = 77; +/** Key: N | n */ +export const KEY_N = 78; +/** Key: O | o */ +export const KEY_O = 79; +/** Key: P | p */ +export const KEY_P = 80; +/** Key: Q | q */ +export const KEY_Q = 81; +/** Key: R | r */ +export const KEY_R = 82; +/** Key: S | s */ +export const KEY_S = 83; +/** Key: T | t */ +export const KEY_T = 84; +/** Key: U | u */ +export const KEY_U = 85; +/** Key: V | v */ +export const KEY_V = 86; +/** Key: W | w */ +export const KEY_W = 87; +/** Key: X | x */ +export const KEY_X = 88; +/** Key: Y | y */ +export const KEY_Y = 89; +/** Key: Z | z */ +export const KEY_Z = 90; +/** Key: [ */ +export const KEY_LEFT_BRACKET = 91; +/** Key: '\' */ +export const KEY_BACKSLASH = 92; +/** Key: ] */ +export const KEY_RIGHT_BRACKET = 93; +/** Key: ` */ +export const KEY_GRAVE = 96; +/** Key: Space */ +export const KEY_SPACE = 32; +/** Key: Esc */ +export const KEY_ESCAPE = 256; +/** Key: Enter */ +export const KEY_ENTER = 257; +/** Key: Tab */ +export const KEY_TAB = 258; +/** Key: Backspace */ +export const KEY_BACKSPACE = 259; +/** Key: Ins */ +export const KEY_INSERT = 260; +/** Key: Del */ +export const KEY_DELETE = 261; +/** Key: Cursor right */ +export const KEY_RIGHT = 262; +/** Key: Cursor left */ +export const KEY_LEFT = 263; +/** Key: Cursor down */ +export const KEY_DOWN = 264; +/** Key: Cursor up */ +export const KEY_UP = 265; +/** Key: Page up */ +export const KEY_PAGE_UP = 266; +/** Key: Page down */ +export const KEY_PAGE_DOWN = 267; +/** Key: Home */ +export const KEY_HOME = 268; +/** Key: End */ +export const KEY_END = 269; +/** Key: Caps lock */ +export const KEY_CAPS_LOCK = 280; +/** Key: Scroll down */ +export const KEY_SCROLL_LOCK = 281; +/** Key: Num lock */ +export const KEY_NUM_LOCK = 282; +/** Key: Print screen */ +export const KEY_PRINT_SCREEN = 283; +/** Key: Pause */ +export const KEY_PAUSE = 284; +/** Key: F1 */ +export const KEY_F1 = 290; +/** Key: F2 */ +export const KEY_F2 = 291; +/** Key: F3 */ +export const KEY_F3 = 292; +/** Key: F4 */ +export const KEY_F4 = 293; +/** Key: F5 */ +export const KEY_F5 = 294; +/** Key: F6 */ +export const KEY_F6 = 295; +/** Key: F7 */ +export const KEY_F7 = 296; +/** Key: F8 */ +export const KEY_F8 = 297; +/** Key: F9 */ +export const KEY_F9 = 298; +/** Key: F10 */ +export const KEY_F10 = 299; +/** Key: F11 */ +export const KEY_F11 = 300; +/** Key: F12 */ +export const KEY_F12 = 301; +/** Key: Shift left */ +export const KEY_LEFT_SHIFT = 340; +/** Key: Control left */ +export const KEY_LEFT_CONTROL = 341; +/** Key: Alt left */ +export const KEY_LEFT_ALT = 342; +/** Key: Super left */ +export const KEY_LEFT_SUPER = 343; +/** Key: Shift right */ +export const KEY_RIGHT_SHIFT = 344; +/** Key: Control right */ +export const KEY_RIGHT_CONTROL = 345; +/** Key: Alt right */ +export const KEY_RIGHT_ALT = 346; +/** Key: Super right */ +export const KEY_RIGHT_SUPER = 347; +/** Key: KB menu */ +export const KEY_KB_MENU = 348; +/** Key: Keypad 0 */ +export const KEY_KP_0 = 320; +/** Key: Keypad 1 */ +export const KEY_KP_1 = 321; +/** Key: Keypad 2 */ +export const KEY_KP_2 = 322; +/** Key: Keypad 3 */ +export const KEY_KP_3 = 323; +/** Key: Keypad 4 */ +export const KEY_KP_4 = 324; +/** Key: Keypad 5 */ +export const KEY_KP_5 = 325; +/** Key: Keypad 6 */ +export const KEY_KP_6 = 326; +/** Key: Keypad 7 */ +export const KEY_KP_7 = 327; +/** Key: Keypad 8 */ +export const KEY_KP_8 = 328; +/** Key: Keypad 9 */ +export const KEY_KP_9 = 329; +/** Key: Keypad . */ +export const KEY_KP_DECIMAL = 330; +/** Key: Keypad / */ +export const KEY_KP_DIVIDE = 331; +/** Key: Keypad * */ +export const KEY_KP_MULTIPLY = 332; +/** Key: Keypad - */ +export const KEY_KP_SUBTRACT = 333; +/** Key: Keypad + */ +export const KEY_KP_ADD = 334; +/** Key: Keypad Enter */ +export const KEY_KP_ENTER = 335; +/** Key: Keypad = */ +export const KEY_KP_EQUAL = 336; +/** Key: Android back button */ +export const KEY_BACK = 4; +/** Key: Android menu button */ +export const KEY_MENU = 5; +/** Key: Android volume up button */ +export const KEY_VOLUME_UP = 24; +/** Key: Android volume down button */ +export const KEY_VOLUME_DOWN = 25; + +/** Mouse button left */ +export const MOUSE_BUTTON_LEFT = 0; +/** Mouse button right */ +export const MOUSE_BUTTON_RIGHT = 1; +/** Mouse button middle (pressed wheel) */ +export const MOUSE_BUTTON_MIDDLE = 2; +/** Mouse button side (advanced mouse device) */ +export const MOUSE_BUTTON_SIDE = 3; +/** Mouse button extra (advanced mouse device) */ +export const MOUSE_BUTTON_EXTRA = 4; +/** Mouse button forward (advanced mouse device) */ +export const MOUSE_BUTTON_FORWARD = 5; +/** Mouse button back (advanced mouse device) */ +export const MOUSE_BUTTON_BACK = 6; + +/** Default pointer shape */ +export const MOUSE_CURSOR_DEFAULT = 0; +/** Arrow shape */ +export const MOUSE_CURSOR_ARROW = 1; +/** Text writing cursor shape */ +export const MOUSE_CURSOR_IBEAM = 2; +/** Cross shape */ +export const MOUSE_CURSOR_CROSSHAIR = 3; +/** Pointing hand cursor */ +export const MOUSE_CURSOR_POINTING_HAND = 4; +/** Horizontal resize/move arrow shape */ +export const MOUSE_CURSOR_RESIZE_EW = 5; +/** Vertical resize/move arrow shape */ +export const MOUSE_CURSOR_RESIZE_NS = 6; +/** Top-left to bottom-right diagonal resize/move arrow shape */ +export const MOUSE_CURSOR_RESIZE_NWSE = 7; +/** The top-right to bottom-left diagonal resize/move arrow shape */ +export const MOUSE_CURSOR_RESIZE_NESW = 8; +/** The omnidirectional resize/move cursor shape */ +export const MOUSE_CURSOR_RESIZE_ALL = 9; +/** The operation-not-allowed shape */ +export const MOUSE_CURSOR_NOT_ALLOWED = 10; + +/** Unknown button, for error checking */ +export const GAMEPAD_BUTTON_UNKNOWN = 0; +/** Gamepad left DPAD up button */ +export const GAMEPAD_BUTTON_LEFT_FACE_UP = 1; +/** Gamepad left DPAD right button */ +export const GAMEPAD_BUTTON_LEFT_FACE_RIGHT = 2; +/** Gamepad left DPAD down button */ +export const GAMEPAD_BUTTON_LEFT_FACE_DOWN = 3; +/** Gamepad left DPAD left button */ +export const GAMEPAD_BUTTON_LEFT_FACE_LEFT = 4; +/** Gamepad right button up (i.e. PS3: Triangle, Xbox: Y) */ +export const GAMEPAD_BUTTON_RIGHT_FACE_UP = 5; +/** Gamepad right button right (i.e. PS3: Circle, Xbox: B) */ +export const GAMEPAD_BUTTON_RIGHT_FACE_RIGHT = 6; +/** Gamepad right button down (i.e. PS3: Cross, Xbox: A) */ +export const GAMEPAD_BUTTON_RIGHT_FACE_DOWN = 7; +/** Gamepad right button left (i.e. PS3: Square, Xbox: X) */ +export const GAMEPAD_BUTTON_RIGHT_FACE_LEFT = 8; +/** Gamepad top/back trigger left (first), it could be a trailing button */ +export const GAMEPAD_BUTTON_LEFT_TRIGGER_1 = 9; +/** Gamepad top/back trigger left (second), it could be a trailing button */ +export const GAMEPAD_BUTTON_LEFT_TRIGGER_2 = 10; +/** Gamepad top/back trigger right (first), it could be a trailing button */ +export const GAMEPAD_BUTTON_RIGHT_TRIGGER_1 = 11; +/** Gamepad top/back trigger right (second), it could be a trailing button */ +export const GAMEPAD_BUTTON_RIGHT_TRIGGER_2 = 12; +/** Gamepad center buttons, left one (i.e. PS3: Select) */ +export const GAMEPAD_BUTTON_MIDDLE_LEFT = 13; +/** Gamepad center buttons, middle one (i.e. PS3: PS, Xbox: XBOX) */ +export const GAMEPAD_BUTTON_MIDDLE = 14; +/** Gamepad center buttons, right one (i.e. PS3: Start) */ +export const GAMEPAD_BUTTON_MIDDLE_RIGHT = 15; +/** Gamepad joystick pressed button left */ +export const GAMEPAD_BUTTON_LEFT_THUMB = 16; +/** Gamepad joystick pressed button right */ +export const GAMEPAD_BUTTON_RIGHT_THUMB = 17; + +/** Gamepad left stick X axis */ +export const GAMEPAD_AXIS_LEFT_X = 0; +/** Gamepad left stick Y axis */ +export const GAMEPAD_AXIS_LEFT_Y = 1; +/** Gamepad right stick X axis */ +export const GAMEPAD_AXIS_RIGHT_X = 2; +/** Gamepad right stick Y axis */ +export const GAMEPAD_AXIS_RIGHT_Y = 3; +/** Gamepad back trigger left, pressure level: [1..-1] */ +export const GAMEPAD_AXIS_LEFT_TRIGGER = 4; +/** Gamepad back trigger right, pressure level: [1..-1] */ +export const GAMEPAD_AXIS_RIGHT_TRIGGER = 5; + +/** Albedo material (same as: MATERIAL_MAP_DIFFUSE) */ +export const MATERIAL_MAP_ALBEDO = 0; +/** Metalness material (same as: MATERIAL_MAP_SPECULAR) */ +export const MATERIAL_MAP_METALNESS = 1; +/** Normal material */ +export const MATERIAL_MAP_NORMAL = 2; +/** Roughness material */ +export const MATERIAL_MAP_ROUGHNESS = 3; +/** Ambient occlusion material */ +export const MATERIAL_MAP_OCCLUSION = 4; +/** Emission material */ +export const MATERIAL_MAP_EMISSION = 5; +/** Heightmap material */ +export const MATERIAL_MAP_HEIGHT = 6; +/** Cubemap material (NOTE: Uses GL_TEXTURE_CUBE_MAP) */ +export const MATERIAL_MAP_CUBEMAP = 7; +/** Irradiance material (NOTE: Uses GL_TEXTURE_CUBE_MAP) */ +export const MATERIAL_MAP_IRRADIANCE = 8; +/** Prefilter material (NOTE: Uses GL_TEXTURE_CUBE_MAP) */ +export const MATERIAL_MAP_PREFILTER = 9; +/** Brdf material */ +export const MATERIAL_MAP_BRDF = 10; + +/** Shader location: vertex attribute: position */ +export const SHADER_LOC_VERTEX_POSITION = 0; +/** Shader location: vertex attribute: texcoord01 */ +export const SHADER_LOC_VERTEX_TEXCOORD01 = 1; +/** Shader location: vertex attribute: texcoord02 */ +export const SHADER_LOC_VERTEX_TEXCOORD02 = 2; +/** Shader location: vertex attribute: normal */ +export const SHADER_LOC_VERTEX_NORMAL = 3; +/** Shader location: vertex attribute: tangent */ +export const SHADER_LOC_VERTEX_TANGENT = 4; +/** Shader location: vertex attribute: color */ +export const SHADER_LOC_VERTEX_COLOR = 5; +/** Shader location: matrix uniform: model-view-projection */ +export const SHADER_LOC_MATRIX_MVP = 6; +/** Shader location: matrix uniform: view (camera transform) */ +export const SHADER_LOC_MATRIX_VIEW = 7; +/** Shader location: matrix uniform: projection */ +export const SHADER_LOC_MATRIX_PROJECTION = 8; +/** Shader location: matrix uniform: model (transform) */ +export const SHADER_LOC_MATRIX_MODEL = 9; +/** Shader location: matrix uniform: normal */ +export const SHADER_LOC_MATRIX_NORMAL = 10; +/** Shader location: vector uniform: view */ +export const SHADER_LOC_VECTOR_VIEW = 11; +/** Shader location: vector uniform: diffuse color */ +export const SHADER_LOC_COLOR_DIFFUSE = 12; +/** Shader location: vector uniform: specular color */ +export const SHADER_LOC_COLOR_SPECULAR = 13; +/** Shader location: vector uniform: ambient color */ +export const SHADER_LOC_COLOR_AMBIENT = 14; +/** Shader location: sampler2d texture: albedo (same as: SHADER_LOC_MAP_DIFFUSE) */ +export const SHADER_LOC_MAP_ALBEDO = 15; +/** Shader location: sampler2d texture: metalness (same as: SHADER_LOC_MAP_SPECULAR) */ +export const SHADER_LOC_MAP_METALNESS = 16; +/** Shader location: sampler2d texture: normal */ +export const SHADER_LOC_MAP_NORMAL = 17; +/** Shader location: sampler2d texture: roughness */ +export const SHADER_LOC_MAP_ROUGHNESS = 18; +/** Shader location: sampler2d texture: occlusion */ +export const SHADER_LOC_MAP_OCCLUSION = 19; +/** Shader location: sampler2d texture: emission */ +export const SHADER_LOC_MAP_EMISSION = 20; +/** Shader location: sampler2d texture: heightmap */ +export const SHADER_LOC_MAP_HEIGHT = 21; +/** Shader location: samplerCube texture: cubemap */ +export const SHADER_LOC_MAP_CUBEMAP = 22; +/** Shader location: samplerCube texture: irradiance */ +export const SHADER_LOC_MAP_IRRADIANCE = 23; +/** Shader location: samplerCube texture: prefilter */ +export const SHADER_LOC_MAP_PREFILTER = 24; +/** Shader location: sampler2d texture: brdf */ +export const SHADER_LOC_MAP_BRDF = 25; +/** Shader location: vertex attribute: bone indices */ +export const SHADER_LOC_VERTEX_BONEIDS = 26; +/** Shader location: vertex attribute: bone weights */ +export const SHADER_LOC_VERTEX_BONEWEIGHTS = 27; +/** Shader location: matrix attribute: bone transforms (animation) */ +export const SHADER_LOC_MATRIX_BONETRANSFORMS = 28; +/** Shader location: vertex attribute: instance transforms */ +export const SHADER_LOC_VERTEX_INSTANCETRANSFORM = 29; + +/** Shader uniform type: float */ +export const SHADER_UNIFORM_FLOAT = 0; +/** Shader uniform type: vec2 (2 float) */ +export const SHADER_UNIFORM_VEC2 = 1; +/** Shader uniform type: vec3 (3 float) */ +export const SHADER_UNIFORM_VEC3 = 2; +/** Shader uniform type: vec4 (4 float) */ +export const SHADER_UNIFORM_VEC4 = 3; +/** Shader uniform type: int */ +export const SHADER_UNIFORM_INT = 4; +/** Shader uniform type: ivec2 (2 int) */ +export const SHADER_UNIFORM_IVEC2 = 5; +/** Shader uniform type: ivec3 (3 int) */ +export const SHADER_UNIFORM_IVEC3 = 6; +/** Shader uniform type: ivec4 (4 int) */ +export const SHADER_UNIFORM_IVEC4 = 7; +/** Shader uniform type: unsigned int */ +export const SHADER_UNIFORM_UINT = 8; +/** Shader uniform type: uivec2 (2 unsigned int) */ +export const SHADER_UNIFORM_UIVEC2 = 9; +/** Shader uniform type: uivec3 (3 unsigned int) */ +export const SHADER_UNIFORM_UIVEC3 = 10; +/** Shader uniform type: uivec4 (4 unsigned int) */ +export const SHADER_UNIFORM_UIVEC4 = 11; +/** Shader uniform type: sampler2d */ +export const SHADER_UNIFORM_SAMPLER2D = 12; + +/** Shader attribute type: float */ +export const SHADER_ATTRIB_FLOAT = 0; +/** Shader attribute type: vec2 (2 float) */ +export const SHADER_ATTRIB_VEC2 = 1; +/** Shader attribute type: vec3 (3 float) */ +export const SHADER_ATTRIB_VEC3 = 2; +/** Shader attribute type: vec4 (4 float) */ +export const SHADER_ATTRIB_VEC4 = 3; + +/** 8 bit per pixel (no alpha) */ +export const PIXELFORMAT_UNCOMPRESSED_GRAYSCALE = 1; +/** 8*2 bpp (2 channels) */ +export const PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA = 2; +/** 16 bpp */ +export const PIXELFORMAT_UNCOMPRESSED_R5G6B5 = 3; +/** 24 bpp */ +export const PIXELFORMAT_UNCOMPRESSED_R8G8B8 = 4; +/** 16 bpp (1 bit alpha) */ +export const PIXELFORMAT_UNCOMPRESSED_R5G5B5A1 = 5; +/** 16 bpp (4 bit alpha) */ +export const PIXELFORMAT_UNCOMPRESSED_R4G4B4A4 = 6; +/** 32 bpp */ +export const PIXELFORMAT_UNCOMPRESSED_R8G8B8A8 = 7; +/** 32 bpp (1 channel - float) */ +export const PIXELFORMAT_UNCOMPRESSED_R32 = 8; +/** 32*3 bpp (3 channels - float) */ +export const PIXELFORMAT_UNCOMPRESSED_R32G32B32 = 9; +/** 32*4 bpp (4 channels - float) */ +export const PIXELFORMAT_UNCOMPRESSED_R32G32B32A32 = 10; +/** 16 bpp (1 channel - half float) */ +export const PIXELFORMAT_UNCOMPRESSED_R16 = 11; +/** 16*3 bpp (3 channels - half float) */ +export const PIXELFORMAT_UNCOMPRESSED_R16G16B16 = 12; +/** 16*4 bpp (4 channels - half float) */ +export const PIXELFORMAT_UNCOMPRESSED_R16G16B16A16 = 13; +/** 4 bpp (no alpha) */ +export const PIXELFORMAT_COMPRESSED_DXT1_RGB = 14; +/** 4 bpp (1 bit alpha) */ +export const PIXELFORMAT_COMPRESSED_DXT1_RGBA = 15; +/** 8 bpp */ +export const PIXELFORMAT_COMPRESSED_DXT3_RGBA = 16; +/** 8 bpp */ +export const PIXELFORMAT_COMPRESSED_DXT5_RGBA = 17; +/** 4 bpp */ +export const PIXELFORMAT_COMPRESSED_ETC1_RGB = 18; +/** 4 bpp */ +export const PIXELFORMAT_COMPRESSED_ETC2_RGB = 19; +/** 8 bpp */ +export const PIXELFORMAT_COMPRESSED_ETC2_EAC_RGBA = 20; +/** 4 bpp */ +export const PIXELFORMAT_COMPRESSED_PVRT_RGB = 21; +/** 4 bpp */ +export const PIXELFORMAT_COMPRESSED_PVRT_RGBA = 22; +/** 8 bpp */ +export const PIXELFORMAT_COMPRESSED_ASTC_4x4_RGBA = 23; +/** 2 bpp */ +export const PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA = 24; + +/** No filter, pixel approximation */ +export const TEXTURE_FILTER_POINT = 0; +/** Linear filtering */ +export const TEXTURE_FILTER_BILINEAR = 1; +/** Trilinear filtering (linear with mipmaps) */ +export const TEXTURE_FILTER_TRILINEAR = 2; +/** Anisotropic filtering 4x */ +export const TEXTURE_FILTER_ANISOTROPIC_4X = 3; +/** Anisotropic filtering 8x */ +export const TEXTURE_FILTER_ANISOTROPIC_8X = 4; +/** Anisotropic filtering 16x */ +export const TEXTURE_FILTER_ANISOTROPIC_16X = 5; + +/** Repeats texture in tiled mode */ +export const TEXTURE_WRAP_REPEAT = 0; +/** Clamps texture to edge pixel in tiled mode */ +export const TEXTURE_WRAP_CLAMP = 1; +/** Mirrors and repeats the texture in tiled mode */ +export const TEXTURE_WRAP_MIRROR_REPEAT = 2; +/** Mirrors and clamps to border the texture in tiled mode */ +export const TEXTURE_WRAP_MIRROR_CLAMP = 3; + +/** Automatically detect layout type */ +export const CUBEMAP_LAYOUT_AUTO_DETECT = 0; +/** Layout is defined by a vertical line with faces */ +export const CUBEMAP_LAYOUT_LINE_VERTICAL = 1; +/** Layout is defined by a horizontal line with faces */ +export const CUBEMAP_LAYOUT_LINE_HORIZONTAL = 2; +/** Layout is defined by a 3x4 cross with cubemap faces */ +export const CUBEMAP_LAYOUT_CROSS_THREE_BY_FOUR = 3; +/** Layout is defined by a 4x3 cross with cubemap faces */ +export const CUBEMAP_LAYOUT_CROSS_FOUR_BY_THREE = 4; + +/** Default font generation, anti-aliased */ +export const FONT_DEFAULT = 0; +/** Bitmap font generation, no anti-aliasing */ +export const FONT_BITMAP = 1; +/** SDF font generation, requires external shader */ +export const FONT_SDF = 2; + +/** Blend textures considering alpha (default) */ +export const BLEND_ALPHA = 0; +/** Blend textures adding colors */ +export const BLEND_ADDITIVE = 1; +/** Blend textures multiplying colors */ +export const BLEND_MULTIPLIED = 2; +/** Blend textures adding colors (alternative) */ +export const BLEND_ADD_COLORS = 3; +/** Blend textures subtracting colors (alternative) */ +export const BLEND_SUBTRACT_COLORS = 4; +/** Blend premultiplied textures considering alpha */ +export const BLEND_ALPHA_PREMULTIPLY = 5; +/** Blend textures using custom src/dst factors (use rlSetBlendFactors()) */ +export const BLEND_CUSTOM = 6; +/** Blend textures using custom rgb/alpha separate src/dst factors (use rlSetBlendFactorsSeparate()) */ +export const BLEND_CUSTOM_SEPARATE = 7; + +/** No gesture */ +export const GESTURE_NONE = 0; +/** Tap gesture */ +export const GESTURE_TAP = 1; +/** Double tap gesture */ +export const GESTURE_DOUBLETAP = 2; +/** Hold gesture */ +export const GESTURE_HOLD = 4; +/** Drag gesture */ +export const GESTURE_DRAG = 8; +/** Swipe right gesture */ +export const GESTURE_SWIPE_RIGHT = 16; +/** Swipe left gesture */ +export const GESTURE_SWIPE_LEFT = 32; +/** Swipe up gesture */ +export const GESTURE_SWIPE_UP = 64; +/** Swipe down gesture */ +export const GESTURE_SWIPE_DOWN = 128; +/** Pinch in gesture */ +export const GESTURE_PINCH_IN = 256; +/** Pinch out gesture */ +export const GESTURE_PINCH_OUT = 512; + +/** Camera custom, controlled by user (UpdateCamera() does nothing) */ +export const CAMERA_CUSTOM = 0; +/** Camera free mode */ +export const CAMERA_FREE = 1; +/** Camera orbital, around target, zoom supported */ +export const CAMERA_ORBITAL = 2; +/** Camera first person */ +export const CAMERA_FIRST_PERSON = 3; +/** Camera third person */ +export const CAMERA_THIRD_PERSON = 4; + +/** Perspective projection */ +export const CAMERA_PERSPECTIVE = 0; +/** Orthographic projection */ +export const CAMERA_ORTHOGRAPHIC = 1; + +/** Npatch layout: 3x3 tiles */ +export const NPATCH_NINE_PATCH = 0; +/** Npatch layout: 1x3 tiles */ +export const NPATCH_THREE_PATCH_VERTICAL = 1; +/** Npatch layout: 3x1 tiles */ +export const NPATCH_THREE_PATCH_HORIZONTAL = 2; + +export const RAYLIB_VERSION_MAJOR = 6; +export const RAYLIB_VERSION_MINOR = 0; +export const RAYLIB_VERSION_PATCH = 0; +export const RAYLIB_VERSION = "6.0"; +export const PI = 3.141592653589793; +export const DEG2RAD = PI / 180.0; +export const RAD2DEG = 180.0 / PI; +/** Light Gray */ +export const LIGHTGRAY = Color.create({ r: 200, g: 200, b: 200, a: 255 }); +/** Gray */ +export const GRAY = Color.create({ r: 130, g: 130, b: 130, a: 255 }); +/** Dark Gray */ +export const DARKGRAY = Color.create({ r: 80, g: 80, b: 80, a: 255 }); +/** Yellow */ +export const YELLOW = Color.create({ r: 253, g: 249, b: 0, a: 255 }); +/** Gold */ +export const GOLD = Color.create({ r: 255, g: 203, b: 0, a: 255 }); +/** Orange */ +export const ORANGE = Color.create({ r: 255, g: 161, b: 0, a: 255 }); +/** Pink */ +export const PINK = Color.create({ r: 255, g: 109, b: 194, a: 255 }); +/** Red */ +export const RED = Color.create({ r: 230, g: 41, b: 55, a: 255 }); +/** Maroon */ +export const MAROON = Color.create({ r: 190, g: 33, b: 55, a: 255 }); +/** Green */ +export const GREEN = Color.create({ r: 0, g: 228, b: 48, a: 255 }); +/** Lime */ +export const LIME = Color.create({ r: 0, g: 158, b: 47, a: 255 }); +/** Dark Green */ +export const DARKGREEN = Color.create({ r: 0, g: 117, b: 44, a: 255 }); +/** Sky Blue */ +export const SKYBLUE = Color.create({ r: 102, g: 191, b: 255, a: 255 }); +/** Blue */ +export const BLUE = Color.create({ r: 0, g: 121, b: 241, a: 255 }); +/** Dark Blue */ +export const DARKBLUE = Color.create({ r: 0, g: 82, b: 172, a: 255 }); +/** Purple */ +export const PURPLE = Color.create({ r: 200, g: 122, b: 255, a: 255 }); +/** Violet */ +export const VIOLET = Color.create({ r: 135, g: 60, b: 190, a: 255 }); +/** Dark Purple */ +export const DARKPURPLE = Color.create({ r: 112, g: 31, b: 126, a: 255 }); +/** Beige */ +export const BEIGE = Color.create({ r: 211, g: 176, b: 131, a: 255 }); +/** Brown */ +export const BROWN = Color.create({ r: 127, g: 106, b: 79, a: 255 }); +/** Dark Brown */ +export const DARKBROWN = Color.create({ r: 76, g: 63, b: 47, a: 255 }); +/** White */ +export const WHITE = Color.create({ r: 255, g: 255, b: 255, a: 255 }); +/** Black */ +export const BLACK = Color.create({ r: 0, g: 0, b: 0, a: 255 }); +/** Blank (Transparent) */ +export const BLANK = Color.create({ r: 0, g: 0, b: 0, a: 0 }); +/** Magenta */ +export const MAGENTA = Color.create({ r: 255, g: 0, b: 255, a: 255 }); +/** My own White (raylib logo) */ +export const RAYWHITE = Color.create({ r: 245, g: 245, b: 245, a: 255 }); + +/** Initialize window and OpenGL context */ +export const InitWindow = raylibLibrary.bind("InitWindow", { args: ["i32", "i32", "utf8string"], returns: "void" }); + +/** Close window and unload OpenGL context */ +export const CloseWindow = raylibLibrary.bind("CloseWindow", { args: [], returns: "void" }); + +/** Check if application should close (KEY_ESCAPE pressed or windows close icon clicked) */ +export const WindowShouldClose = raylibLibrary.bind("WindowShouldClose", { args: [], returns: "bool" }); + +/** Check if window has been initialized successfully */ +export const IsWindowReady = raylibLibrary.bind("IsWindowReady", { args: [], returns: "bool" }); + +/** Check if window is currently fullscreen */ +export const IsWindowFullscreen = raylibLibrary.bind("IsWindowFullscreen", { args: [], returns: "bool" }); + +/** Check if window is currently hidden */ +export const IsWindowHidden = raylibLibrary.bind("IsWindowHidden", { args: [], returns: "bool" }); + +/** Check if window is currently minimized */ +export const IsWindowMinimized = raylibLibrary.bind("IsWindowMinimized", { args: [], returns: "bool" }); + +/** Check if window is currently maximized */ +export const IsWindowMaximized = raylibLibrary.bind("IsWindowMaximized", { args: [], returns: "bool" }); + +/** Check if window is currently focused */ +export const IsWindowFocused = raylibLibrary.bind("IsWindowFocused", { args: [], returns: "bool" }); + +/** Check if window has been resized last frame */ +export const IsWindowResized = raylibLibrary.bind("IsWindowResized", { args: [], returns: "bool" }); + +/** Check if one specific window flag is enabled */ +export const IsWindowState = raylibLibrary.bind("IsWindowState", { args: ["u32"], returns: "bool" }); + +/** Set window configuration state using flags */ +export const SetWindowState = raylibLibrary.bind("SetWindowState", { args: ["u32"], returns: "void" }); + +/** Clear window configuration state flags */ +export const ClearWindowState = raylibLibrary.bind("ClearWindowState", { args: ["u32"], returns: "void" }); + +/** Toggle window state: fullscreen/windowed, resizes monitor to match window resolution */ +export const ToggleFullscreen = raylibLibrary.bind("ToggleFullscreen", { args: [], returns: "void" }); + +/** Toggle window state: borderless windowed, resizes window to match monitor resolution */ +export const ToggleBorderlessWindowed = raylibLibrary.bind("ToggleBorderlessWindowed", { args: [], returns: "void" }); + +/** Set window state: maximized, if resizable */ +export const MaximizeWindow = raylibLibrary.bind("MaximizeWindow", { args: [], returns: "void" }); + +/** Set window state: minimized, if resizable */ +export const MinimizeWindow = raylibLibrary.bind("MinimizeWindow", { args: [], returns: "void" }); + +/** Restore window from being minimized/maximized */ +export const RestoreWindow = raylibLibrary.bind("RestoreWindow", { args: [], returns: "void" }); + +/** Set icon for window (single image, RGBA 32bit) */ +export const SetWindowIcon = raylibLibrary.bind("SetWindowIcon", { args: [Image], returns: "void" }); + +/** Set icon for window (multiple images, RGBA 32bit) */ +export const SetWindowIcons = raylibLibrary.bind("SetWindowIcons", { args: ["pointer", "i32"], returns: "void" }); + +/** Set title for window */ +export const SetWindowTitle = raylibLibrary.bind("SetWindowTitle", { args: ["utf8string"], returns: "void" }); + +/** Set window position on screen */ +export const SetWindowPosition = raylibLibrary.bind("SetWindowPosition", { args: ["i32", "i32"], returns: "void" }); + +/** Set monitor for the current window */ +export const SetWindowMonitor = raylibLibrary.bind("SetWindowMonitor", { args: ["i32"], returns: "void" }); + +/** Set window minimum dimensions (for FLAG_WINDOW_RESIZABLE) */ +export const SetWindowMinSize = raylibLibrary.bind("SetWindowMinSize", { args: ["i32", "i32"], returns: "void" }); + +/** Set window maximum dimensions (for FLAG_WINDOW_RESIZABLE) */ +export const SetWindowMaxSize = raylibLibrary.bind("SetWindowMaxSize", { args: ["i32", "i32"], returns: "void" }); + +/** Set window dimensions */ +export const SetWindowSize = raylibLibrary.bind("SetWindowSize", { args: ["i32", "i32"], returns: "void" }); + +/** Set window opacity [0.0f..1.0f] */ +export const SetWindowOpacity = raylibLibrary.bind("SetWindowOpacity", { args: ["f32"], returns: "void" }); + +/** Set window focused */ +export const SetWindowFocused = raylibLibrary.bind("SetWindowFocused", { args: [], returns: "void" }); + +/** Get native window handle */ +export const GetWindowHandle = raylibLibrary.bind("GetWindowHandle", { args: [], returns: "pointer" }); + +/** Get current screen width */ +export const GetScreenWidth = raylibLibrary.bind("GetScreenWidth", { args: [], returns: "i32" }); + +/** Get current screen height */ +export const GetScreenHeight = raylibLibrary.bind("GetScreenHeight", { args: [], returns: "i32" }); + +/** Get current render width (it considers HiDPI) */ +export const GetRenderWidth = raylibLibrary.bind("GetRenderWidth", { args: [], returns: "i32" }); + +/** Get current render height (it considers HiDPI) */ +export const GetRenderHeight = raylibLibrary.bind("GetRenderHeight", { args: [], returns: "i32" }); + +/** Get number of connected monitors */ +export const GetMonitorCount = raylibLibrary.bind("GetMonitorCount", { args: [], returns: "i32" }); + +/** Get current monitor where window is placed */ +export const GetCurrentMonitor = raylibLibrary.bind("GetCurrentMonitor", { args: [], returns: "i32" }); + +/** Get specified monitor position */ +export const GetMonitorPosition = raylibLibrary.bind("GetMonitorPosition", { args: ["i32"], returns: Vector2 }); + +/** Get specified monitor width (current video mode used by monitor) */ +export const GetMonitorWidth = raylibLibrary.bind("GetMonitorWidth", { args: ["i32"], returns: "i32" }); + +/** Get specified monitor height (current video mode used by monitor) */ +export const GetMonitorHeight = raylibLibrary.bind("GetMonitorHeight", { args: ["i32"], returns: "i32" }); + +/** Get specified monitor physical width in millimetres */ +export const GetMonitorPhysicalWidth = raylibLibrary.bind("GetMonitorPhysicalWidth", { args: ["i32"], returns: "i32" }); + +/** Get specified monitor physical height in millimetres */ +export const GetMonitorPhysicalHeight = raylibLibrary.bind("GetMonitorPhysicalHeight", { args: ["i32"], returns: "i32" }); + +/** Get specified monitor refresh rate */ +export const GetMonitorRefreshRate = raylibLibrary.bind("GetMonitorRefreshRate", { args: ["i32"], returns: "i32" }); + +/** Get window position XY on monitor */ +export const GetWindowPosition = raylibLibrary.bind("GetWindowPosition", { args: [], returns: Vector2 }); + +/** Get window scale DPI factor */ +export const GetWindowScaleDPI = raylibLibrary.bind("GetWindowScaleDPI", { args: [], returns: Vector2 }); + +/** Get the human-readable, UTF-8 encoded name of the specified monitor */ +export const GetMonitorName = raylibLibrary.bind("GetMonitorName", { args: ["i32"], returns: "utf8string" }); + +/** Set clipboard text content */ +export const SetClipboardText = raylibLibrary.bind("SetClipboardText", { args: ["utf8string"], returns: "void" }); + +/** Get clipboard text content */ +export const GetClipboardText = raylibLibrary.bind("GetClipboardText", { args: [], returns: "utf8string" }); + +/** Get clipboard image content */ +export const GetClipboardImage = raylibLibrary.bind("GetClipboardImage", { args: [], returns: Image }); + +/** Enable waiting for events on EndDrawing(), no automatic event polling */ +export const EnableEventWaiting = raylibLibrary.bind("EnableEventWaiting", { args: [], returns: "void" }); + +/** Disable waiting for events on EndDrawing(), automatic events polling */ +export const DisableEventWaiting = raylibLibrary.bind("DisableEventWaiting", { args: [], returns: "void" }); + +/** Shows cursor */ +export const ShowCursor = raylibLibrary.bind("ShowCursor", { args: [], returns: "void" }); + +/** Hides cursor */ +export const HideCursor = raylibLibrary.bind("HideCursor", { args: [], returns: "void" }); + +/** Check if cursor is not visible */ +export const IsCursorHidden = raylibLibrary.bind("IsCursorHidden", { args: [], returns: "bool" }); + +/** Enables cursor (unlock cursor) */ +export const EnableCursor = raylibLibrary.bind("EnableCursor", { args: [], returns: "void" }); + +/** Disables cursor (lock cursor) */ +export const DisableCursor = raylibLibrary.bind("DisableCursor", { args: [], returns: "void" }); + +/** Check if cursor is on the screen */ +export const IsCursorOnScreen = raylibLibrary.bind("IsCursorOnScreen", { args: [], returns: "bool" }); + +/** Set background color (framebuffer clear color) */ +export const ClearBackground = raylibLibrary.bind("ClearBackground", { args: [Color], returns: "void" }); + +/** Setup canvas (framebuffer) to start drawing */ +export const BeginDrawing = raylibLibrary.bind("BeginDrawing", { args: [], returns: "void" }); + +/** End canvas drawing and swap buffers (double buffering) */ +export const EndDrawing = raylibLibrary.bind("EndDrawing", { args: [], returns: "void" }); + +/** Begin 2D mode with custom camera (2D) */ +export const BeginMode2D = raylibLibrary.bind("BeginMode2D", { args: [Camera2D], returns: "void" }); + +/** Ends 2D mode with custom camera */ +export const EndMode2D = raylibLibrary.bind("EndMode2D", { args: [], returns: "void" }); + +/** Begin 3D mode with custom camera (3D) */ +export const BeginMode3D = raylibLibrary.bind("BeginMode3D", { args: [Camera3D], returns: "void" }); + +/** Ends 3D mode and returns to default 2D orthographic mode */ +export const EndMode3D = raylibLibrary.bind("EndMode3D", { args: [], returns: "void" }); + +/** Begin drawing to render texture */ +export const BeginTextureMode = raylibLibrary.bind("BeginTextureMode", { args: [RenderTexture], returns: "void" }); + +/** Ends drawing to render texture */ +export const EndTextureMode = raylibLibrary.bind("EndTextureMode", { args: [], returns: "void" }); + +/** Begin custom shader drawing */ +export const BeginShaderMode = raylibLibrary.bind("BeginShaderMode", { args: [Shader], returns: "void" }); + +/** End custom shader drawing (use default shader) */ +export const EndShaderMode = raylibLibrary.bind("EndShaderMode", { args: [], returns: "void" }); + +/** Begin blending mode (alpha, additive, multiplied, subtract, custom) */ +export const BeginBlendMode = raylibLibrary.bind("BeginBlendMode", { args: ["i32"], returns: "void" }); + +/** End blending mode (reset to default: alpha blending) */ +export const EndBlendMode = raylibLibrary.bind("EndBlendMode", { args: [], returns: "void" }); + +/** Begin scissor mode (define screen area for following drawing) */ +export const BeginScissorMode = raylibLibrary.bind("BeginScissorMode", { args: ["i32", "i32", "i32", "i32"], returns: "void" }); + +/** End scissor mode */ +export const EndScissorMode = raylibLibrary.bind("EndScissorMode", { args: [], returns: "void" }); + +/** Begin stereo rendering (requires VR simulator) */ +export const BeginVrStereoMode = raylibLibrary.bind("BeginVrStereoMode", { args: [VrStereoConfig], returns: "void" }); + +/** End stereo rendering (requires VR simulator) */ +export const EndVrStereoMode = raylibLibrary.bind("EndVrStereoMode", { args: [], returns: "void" }); + +/** Load VR stereo config for VR simulator device parameters */ +export const LoadVrStereoConfig = raylibLibrary.bind("LoadVrStereoConfig", { args: [VrDeviceInfo], returns: VrStereoConfig }); + +/** Unload VR stereo config */ +export const UnloadVrStereoConfig = raylibLibrary.bind("UnloadVrStereoConfig", { args: [VrStereoConfig], returns: "void" }); + +/** Load shader from files and bind default locations */ +export const LoadShader = raylibLibrary.bind("LoadShader", { args: ["utf8string", "utf8string"], returns: Shader }); + +/** Raw-pointer variant for nullable C string parameters. */ +export const LoadShaderRaw = raylibLibrary.bind("LoadShader", { args: ["pointer", "pointer"], returns: Shader }); + +/** Load shader from code strings and bind default locations */ +export const LoadShaderFromMemory = raylibLibrary.bind("LoadShaderFromMemory", { args: ["utf8string", "utf8string"], returns: Shader }); + +/** Raw-pointer variant for nullable C string parameters. */ +export const LoadShaderFromMemoryRaw = raylibLibrary.bind("LoadShaderFromMemory", { args: ["pointer", "pointer"], returns: Shader }); + +/** Check if a shader is valid (loaded on GPU) */ +export const IsShaderValid = raylibLibrary.bind("IsShaderValid", { args: [Shader], returns: "bool" }); + +/** Get shader uniform location */ +export const GetShaderLocation = raylibLibrary.bind("GetShaderLocation", { args: [Shader, "utf8string"], returns: "i32" }); + +/** Get shader attribute location */ +export const GetShaderLocationAttrib = raylibLibrary.bind("GetShaderLocationAttrib", { args: [Shader, "utf8string"], returns: "i32" }); + +/** Set shader uniform value */ +export const SetShaderValue = raylibLibrary.bind("SetShaderValue", { args: [Shader, "i32", "pointer", "i32"], returns: "void" }); + +/** Set shader uniform value vector */ +export const SetShaderValueV = raylibLibrary.bind("SetShaderValueV", { args: [Shader, "i32", "pointer", "i32", "i32"], returns: "void" }); + +/** Set shader uniform value (matrix 4x4) */ +export const SetShaderValueMatrix = raylibLibrary.bind("SetShaderValueMatrix", { args: [Shader, "i32", Matrix], returns: "void" }); + +/** Set shader uniform value and bind the texture (sampler2d) */ +export const SetShaderValueTexture = raylibLibrary.bind("SetShaderValueTexture", { args: [Shader, "i32", Texture], returns: "void" }); + +/** Unload shader from GPU memory (VRAM) */ +export const UnloadShader = raylibLibrary.bind("UnloadShader", { args: [Shader], returns: "void" }); + +/** Get a ray trace from screen position (i.e mouse) */ +export const GetScreenToWorldRay = raylibLibrary.bind("GetScreenToWorldRay", { args: [Vector2, Camera3D], returns: Ray }); + +/** Get a ray trace from screen position (i.e mouse) in a viewport */ +export const GetScreenToWorldRayEx = raylibLibrary.bind("GetScreenToWorldRayEx", { args: [Vector2, Camera3D, "i32", "i32"], returns: Ray }); + +/** Get the screen space position for a 3d world space position */ +export const GetWorldToScreen = raylibLibrary.bind("GetWorldToScreen", { args: [Vector3, Camera3D], returns: Vector2 }); + +/** Get size position for a 3d world space position */ +export const GetWorldToScreenEx = raylibLibrary.bind("GetWorldToScreenEx", { args: [Vector3, Camera3D, "i32", "i32"], returns: Vector2 }); + +/** Get the screen space position for a 2d camera world space position */ +export const GetWorldToScreen2D = raylibLibrary.bind("GetWorldToScreen2D", { args: [Vector2, Camera2D], returns: Vector2 }); + +/** Get the world space position for a 2d camera screen space position */ +export const GetScreenToWorld2D = raylibLibrary.bind("GetScreenToWorld2D", { args: [Vector2, Camera2D], returns: Vector2 }); + +/** Get camera transform matrix (view matrix) */ +export const GetCameraMatrix = raylibLibrary.bind("GetCameraMatrix", { args: [Camera3D], returns: Matrix }); + +/** Get camera 2d transform matrix */ +export const GetCameraMatrix2D = raylibLibrary.bind("GetCameraMatrix2D", { args: [Camera2D], returns: Matrix }); + +/** Set target FPS (maximum) */ +export const SetTargetFPS = raylibLibrary.bind("SetTargetFPS", { args: ["i32"], returns: "void" }); + +/** Get time in seconds for last frame drawn (delta time) */ +export const GetFrameTime = raylibLibrary.bind("GetFrameTime", { args: [], returns: "f32" }); + +/** Get elapsed time in seconds since InitWindow() */ +export const GetTime = raylibLibrary.bind("GetTime", { args: [], returns: "f64" }); + +/** Get current FPS */ +export const GetFPS = raylibLibrary.bind("GetFPS", { args: [], returns: "i32" }); + +/** Swap back buffer with front buffer (screen drawing) */ +export const SwapScreenBuffer = raylibLibrary.bind("SwapScreenBuffer", { args: [], returns: "void" }); + +/** Register all input events */ +export const PollInputEvents = raylibLibrary.bind("PollInputEvents", { args: [], returns: "void" }); + +/** Wait for some time (halt program execution) */ +export const WaitTime = raylibLibrary.bind("WaitTime", { args: ["f64"], returns: "void" }); + +/** Set the seed for the random number generator */ +export const SetRandomSeed = raylibLibrary.bind("SetRandomSeed", { args: ["u32"], returns: "void" }); + +/** Get a random value between min and max (both included) */ +export const GetRandomValue = raylibLibrary.bind("GetRandomValue", { args: ["i32", "i32"], returns: "i32" }); + +/** Load random values sequence, no values repeated */ +export const LoadRandomSequence = raylibLibrary.bind("LoadRandomSequence", { args: ["u32", "i32", "i32"], returns: "pointer" }); + +/** Unload random values sequence */ +export const UnloadRandomSequence = raylibLibrary.bind("UnloadRandomSequence", { args: ["pointer"], returns: "void" }); + +/** Takes a screenshot of current screen (filename extension defines format) */ +export const TakeScreenshot = raylibLibrary.bind("TakeScreenshot", { args: ["utf8string"], returns: "void" }); + +/** Setup init configuration flags (view FLAGS) */ +export const SetConfigFlags = raylibLibrary.bind("SetConfigFlags", { args: ["u32"], returns: "void" }); + +/** Open URL with default system browser (if available) */ +export const OpenURL = raylibLibrary.bind("OpenURL", { args: ["utf8string"], returns: "void" }); + +/** Set the current threshold (minimum) log level */ +export const SetTraceLogLevel = raylibLibrary.bind("SetTraceLogLevel", { args: ["i32"], returns: "void" }); + +/** Set custom trace log */ +export const SetTraceLogCallback = raylibLibrary.bind("SetTraceLogCallback", { args: ["pointer"], returns: "void" }); + +/** Internal memory allocator */ +export const MemAlloc = raylibLibrary.bind("MemAlloc", { args: ["u32"], returns: "pointer" }); + +/** Internal memory reallocator */ +export const MemRealloc = raylibLibrary.bind("MemRealloc", { args: ["pointer", "u32"], returns: "pointer" }); + +/** Internal memory free */ +export const MemFree = raylibLibrary.bind("MemFree", { args: ["pointer"], returns: "void" }); + +/** Load file data as byte array (read) */ +export const LoadFileData = raylibLibrary.bind("LoadFileData", { args: ["utf8string", "pointer"], returns: "pointer" }); + +/** Unload file data allocated by LoadFileData() */ +export const UnloadFileData = raylibLibrary.bind("UnloadFileData", { args: ["pointer"], returns: "void" }); + +/** Save data to file from byte array (write), returns true on success */ +export const SaveFileData = raylibLibrary.bind("SaveFileData", { args: ["utf8string", "pointer", "i32"], returns: "bool" }); + +/** Export data to code (.h), returns true on success */ +export const ExportDataAsCode = raylibLibrary.bind("ExportDataAsCode", { args: ["pointer", "i32", "utf8string"], returns: "bool" }); + +/** Load text data from file (read), returns a '\0' terminated string */ +export const LoadFileText = raylibLibrary.bind("LoadFileText", { args: ["utf8string"], returns: "pointer" }); + +/** Unload file text data allocated by LoadFileText() */ +export const UnloadFileText = raylibLibrary.bind("UnloadFileText", { args: ["pointer"], returns: "void" }); + +/** Save text data to file (write), string must be '\0' terminated, returns true on success */ +export const SaveFileText = raylibLibrary.bind("SaveFileText", { args: ["utf8string", "utf8string"], returns: "bool" }); + +/** Set custom file binary data loader */ +export const SetLoadFileDataCallback = raylibLibrary.bind("SetLoadFileDataCallback", { args: ["pointer"], returns: "void" }); + +/** Set custom file binary data saver */ +export const SetSaveFileDataCallback = raylibLibrary.bind("SetSaveFileDataCallback", { args: ["pointer"], returns: "void" }); + +/** Set custom file text data loader */ +export const SetLoadFileTextCallback = raylibLibrary.bind("SetLoadFileTextCallback", { args: ["pointer"], returns: "void" }); + +/** Set custom file text data saver */ +export const SetSaveFileTextCallback = raylibLibrary.bind("SetSaveFileTextCallback", { args: ["pointer"], returns: "void" }); + +/** Rename file (if exists) */ +export const FileRename = raylibLibrary.bind("FileRename", { args: ["utf8string", "utf8string"], returns: "i32" }); + +/** Remove file (if exists) */ +export const FileRemove = raylibLibrary.bind("FileRemove", { args: ["utf8string"], returns: "i32" }); + +/** Copy file from one path to another, dstPath created if it doesn't exist */ +export const FileCopy = raylibLibrary.bind("FileCopy", { args: ["utf8string", "utf8string"], returns: "i32" }); + +/** Move file from one directory to another, dstPath created if it doesn't exist */ +export const FileMove = raylibLibrary.bind("FileMove", { args: ["utf8string", "utf8string"], returns: "i32" }); + +/** Replace text in an existing file */ +export const FileTextReplace = raylibLibrary.bind("FileTextReplace", { args: ["utf8string", "utf8string", "utf8string"], returns: "i32" }); + +/** Find text in existing file */ +export const FileTextFindIndex = raylibLibrary.bind("FileTextFindIndex", { args: ["utf8string", "utf8string"], returns: "i32" }); + +/** Check if file exists */ +export const FileExists = raylibLibrary.bind("FileExists", { args: ["utf8string"], returns: "bool" }); + +/** Check if a directory path exists */ +export const DirectoryExists = raylibLibrary.bind("DirectoryExists", { args: ["utf8string"], returns: "bool" }); + +/** Check file extension (recommended include point: .png, .wav) */ +export const IsFileExtension = raylibLibrary.bind("IsFileExtension", { args: ["utf8string", "utf8string"], returns: "bool" }); + +/** Get file length in bytes (NOTE: GetFileSize() conflicts with windows.h) */ +export const GetFileLength = raylibLibrary.bind("GetFileLength", { args: ["utf8string"], returns: "i32" }); + +/** Get file modification time (last write time) */ +export const GetFileModTime = raylibLibrary.bind("GetFileModTime", { args: ["utf8string"], returns: "i64" }); + +/** Get pointer to extension for a filename string (includes dot: '.png') */ +export const GetFileExtension = raylibLibrary.bind("GetFileExtension", { args: ["utf8string"], returns: "utf8string" }); + +/** Get pointer to filename for a path string */ +export const GetFileName = raylibLibrary.bind("GetFileName", { args: ["utf8string"], returns: "utf8string" }); + +/** Get filename string without extension (uses static string) */ +export const GetFileNameWithoutExt = raylibLibrary.bind("GetFileNameWithoutExt", { args: ["utf8string"], returns: "utf8string" }); + +/** Get full path for a given fileName with path (uses static string) */ +export const GetDirectoryPath = raylibLibrary.bind("GetDirectoryPath", { args: ["utf8string"], returns: "utf8string" }); + +/** Get previous directory path for a given path (uses static string) */ +export const GetPrevDirectoryPath = raylibLibrary.bind("GetPrevDirectoryPath", { args: ["utf8string"], returns: "utf8string" }); + +/** Get current working directory (uses static string) */ +export const GetWorkingDirectory = raylibLibrary.bind("GetWorkingDirectory", { args: [], returns: "utf8string" }); + +/** Get the directory of the running application (uses static string) */ +export const GetApplicationDirectory = raylibLibrary.bind("GetApplicationDirectory", { args: [], returns: "utf8string" }); + +/** Create directories (including full path requested), returns 0 on success */ +export const MakeDirectory = raylibLibrary.bind("MakeDirectory", { args: ["utf8string"], returns: "i32" }); + +/** Change working directory, return true on success */ +export const ChangeDirectory = raylibLibrary.bind("ChangeDirectory", { args: ["utf8string"], returns: "bool" }); + +/** Check if a given path is a file or a directory */ +export const IsPathFile = raylibLibrary.bind("IsPathFile", { args: ["utf8string"], returns: "bool" }); + +/** Check if fileName is valid for the platform/OS */ +export const IsFileNameValid = raylibLibrary.bind("IsFileNameValid", { args: ["utf8string"], returns: "bool" }); + +/** Load directory filepaths, files and directories, no subdirs scan */ +export const LoadDirectoryFiles = raylibLibrary.bind("LoadDirectoryFiles", { args: ["utf8string"], returns: FilePathList }); + +/** Load directory filepaths with extension filtering and subdir scan; some filters available: "*.*", "FILES*", "DIRS*" */ +export const LoadDirectoryFilesEx = raylibLibrary.bind("LoadDirectoryFilesEx", { args: ["utf8string", "utf8string", "bool"], returns: FilePathList }); + +/** Unload filepaths */ +export const UnloadDirectoryFiles = raylibLibrary.bind("UnloadDirectoryFiles", { args: [FilePathList], returns: "void" }); + +/** Check if a file has been dropped into window */ +export const IsFileDropped = raylibLibrary.bind("IsFileDropped", { args: [], returns: "bool" }); + +/** Load dropped filepaths */ +export const LoadDroppedFiles = raylibLibrary.bind("LoadDroppedFiles", { args: [], returns: FilePathList }); + +/** Unload dropped filepaths */ +export const UnloadDroppedFiles = raylibLibrary.bind("UnloadDroppedFiles", { args: [FilePathList], returns: "void" }); + +/** Get the file count in a directory */ +export const GetDirectoryFileCount = raylibLibrary.bind("GetDirectoryFileCount", { args: ["utf8string"], returns: "u32" }); + +/** Get the file count in a directory with extension filtering and recursive directory scan. Use 'DIR' in the filter string to include directories in the result */ +export const GetDirectoryFileCountEx = raylibLibrary.bind("GetDirectoryFileCountEx", { args: ["utf8string", "utf8string", "bool"], returns: "u32" }); + +/** Compress data (DEFLATE algorithm), memory must be MemFree() */ +export const CompressData = raylibLibrary.bind("CompressData", { args: ["pointer", "i32", "pointer"], returns: "pointer" }); + +/** Decompress data (DEFLATE algorithm), memory must be MemFree() */ +export const DecompressData = raylibLibrary.bind("DecompressData", { args: ["pointer", "i32", "pointer"], returns: "pointer" }); + +/** Encode data to Base64 string (includes NULL terminator), memory must be MemFree() */ +export const EncodeDataBase64 = raylibLibrary.bind("EncodeDataBase64", { args: ["pointer", "i32", "pointer"], returns: "pointer" }); + +/** Decode Base64 string (expected NULL terminated), memory must be MemFree() */ +export const DecodeDataBase64 = raylibLibrary.bind("DecodeDataBase64", { args: ["utf8string", "pointer"], returns: "pointer" }); + +/** Compute CRC32 hash code */ +export const ComputeCRC32 = raylibLibrary.bind("ComputeCRC32", { args: ["pointer", "i32"], returns: "u32" }); + +/** Compute MD5 hash code, returns static int[4] (16 bytes) */ +export const ComputeMD5 = raylibLibrary.bind("ComputeMD5", { args: ["pointer", "i32"], returns: "pointer" }); + +/** Compute SHA1 hash code, returns static int[5] (20 bytes) */ +export const ComputeSHA1 = raylibLibrary.bind("ComputeSHA1", { args: ["pointer", "i32"], returns: "pointer" }); + +/** Compute SHA256 hash code, returns static int[8] (32 bytes) */ +export const ComputeSHA256 = raylibLibrary.bind("ComputeSHA256", { args: ["pointer", "i32"], returns: "pointer" }); + +/** Load automation events list from file, NULL for empty list, capacity = MAX_AUTOMATION_EVENTS */ +export const LoadAutomationEventList = raylibLibrary.bind("LoadAutomationEventList", { args: ["utf8string"], returns: AutomationEventList }); + +/** Raw-pointer variant for nullable C string parameters. */ +export const LoadAutomationEventListRaw = raylibLibrary.bind("LoadAutomationEventList", { args: ["pointer"], returns: AutomationEventList }); + +/** Unload automation events list from file */ +export const UnloadAutomationEventList = raylibLibrary.bind("UnloadAutomationEventList", { args: [AutomationEventList], returns: "void" }); + +/** Export automation events list as text file */ +export const ExportAutomationEventList = raylibLibrary.bind("ExportAutomationEventList", { args: [AutomationEventList, "utf8string"], returns: "bool" }); + +/** Set automation event list to record to */ +export const SetAutomationEventList = raylibLibrary.bind("SetAutomationEventList", { args: ["pointer"], returns: "void" }); + +/** Set automation event internal base frame to start recording */ +export const SetAutomationEventBaseFrame = raylibLibrary.bind("SetAutomationEventBaseFrame", { args: ["i32"], returns: "void" }); + +/** Start recording automation events (AutomationEventList must be set) */ +export const StartAutomationEventRecording = raylibLibrary.bind("StartAutomationEventRecording", { args: [], returns: "void" }); + +/** Stop recording automation events */ +export const StopAutomationEventRecording = raylibLibrary.bind("StopAutomationEventRecording", { args: [], returns: "void" }); + +/** Play a recorded automation event */ +export const PlayAutomationEvent = raylibLibrary.bind("PlayAutomationEvent", { args: [AutomationEvent], returns: "void" }); + +/** Check if a key has been pressed once */ +export const IsKeyPressed = raylibLibrary.bind("IsKeyPressed", { args: ["i32"], returns: "bool" }); + +/** Check if a key has been pressed again */ +export const IsKeyPressedRepeat = raylibLibrary.bind("IsKeyPressedRepeat", { args: ["i32"], returns: "bool" }); + +/** Check if a key is being pressed */ +export const IsKeyDown = raylibLibrary.bind("IsKeyDown", { args: ["i32"], returns: "bool" }); + +/** Check if a key has been released once */ +export const IsKeyReleased = raylibLibrary.bind("IsKeyReleased", { args: ["i32"], returns: "bool" }); + +/** Check if a key is NOT being pressed */ +export const IsKeyUp = raylibLibrary.bind("IsKeyUp", { args: ["i32"], returns: "bool" }); + +/** Get key pressed (keycode), call it multiple times for keys queued, returns 0 when the queue is empty */ +export const GetKeyPressed = raylibLibrary.bind("GetKeyPressed", { args: [], returns: "i32" }); + +/** Get char pressed (unicode), call it multiple times for chars queued, returns 0 when the queue is empty */ +export const GetCharPressed = raylibLibrary.bind("GetCharPressed", { args: [], returns: "i32" }); + +/** Get name of a QWERTY key on the current keyboard layout (eg returns string 'q' for KEY_A on an AZERTY keyboard) */ +export const GetKeyName = raylibLibrary.bind("GetKeyName", { args: ["i32"], returns: "utf8string" }); + +/** Set a custom key to exit program (default is ESC) */ +export const SetExitKey = raylibLibrary.bind("SetExitKey", { args: ["i32"], returns: "void" }); + +/** Check if a gamepad is available */ +export const IsGamepadAvailable = raylibLibrary.bind("IsGamepadAvailable", { args: ["i32"], returns: "bool" }); + +/** Get gamepad internal name id */ +export const GetGamepadName = raylibLibrary.bind("GetGamepadName", { args: ["i32"], returns: "utf8string" }); + +/** Check if a gamepad button has been pressed once */ +export const IsGamepadButtonPressed = raylibLibrary.bind("IsGamepadButtonPressed", { args: ["i32", "i32"], returns: "bool" }); + +/** Check if a gamepad button is being pressed */ +export const IsGamepadButtonDown = raylibLibrary.bind("IsGamepadButtonDown", { args: ["i32", "i32"], returns: "bool" }); + +/** Check if a gamepad button has been released once */ +export const IsGamepadButtonReleased = raylibLibrary.bind("IsGamepadButtonReleased", { args: ["i32", "i32"], returns: "bool" }); + +/** Check if a gamepad button is NOT being pressed */ +export const IsGamepadButtonUp = raylibLibrary.bind("IsGamepadButtonUp", { args: ["i32", "i32"], returns: "bool" }); + +/** Get the last gamepad button pressed */ +export const GetGamepadButtonPressed = raylibLibrary.bind("GetGamepadButtonPressed", { args: [], returns: "i32" }); + +/** Get axis count for a gamepad */ +export const GetGamepadAxisCount = raylibLibrary.bind("GetGamepadAxisCount", { args: ["i32"], returns: "i32" }); + +/** Get movement value for a gamepad axis */ +export const GetGamepadAxisMovement = raylibLibrary.bind("GetGamepadAxisMovement", { args: ["i32", "i32"], returns: "f32" }); + +/** Set internal gamepad mappings (SDL_GameControllerDB) */ +export const SetGamepadMappings = raylibLibrary.bind("SetGamepadMappings", { args: ["utf8string"], returns: "i32" }); + +/** Check if a mouse button has been pressed once */ +export const IsMouseButtonPressed = raylibLibrary.bind("IsMouseButtonPressed", { args: ["i32"], returns: "bool" }); + +/** Check if a mouse button is being pressed */ +export const IsMouseButtonDown = raylibLibrary.bind("IsMouseButtonDown", { args: ["i32"], returns: "bool" }); + +/** Check if a mouse button has been released once */ +export const IsMouseButtonReleased = raylibLibrary.bind("IsMouseButtonReleased", { args: ["i32"], returns: "bool" }); + +/** Check if a mouse button is NOT being pressed */ +export const IsMouseButtonUp = raylibLibrary.bind("IsMouseButtonUp", { args: ["i32"], returns: "bool" }); + +/** Get mouse position X */ +export const GetMouseX = raylibLibrary.bind("GetMouseX", { args: [], returns: "i32" }); + +/** Get mouse position Y */ +export const GetMouseY = raylibLibrary.bind("GetMouseY", { args: [], returns: "i32" }); + +/** Get mouse position XY */ +export const GetMousePosition = raylibLibrary.bind("GetMousePosition", { args: [], returns: Vector2 }); + +/** Get mouse delta between frames */ +export const GetMouseDelta = raylibLibrary.bind("GetMouseDelta", { args: [], returns: Vector2 }); + +/** Set mouse position XY */ +export const SetMousePosition = raylibLibrary.bind("SetMousePosition", { args: ["i32", "i32"], returns: "void" }); + +/** Set mouse offset */ +export const SetMouseOffset = raylibLibrary.bind("SetMouseOffset", { args: ["i32", "i32"], returns: "void" }); + +/** Set mouse scaling */ +export const SetMouseScale = raylibLibrary.bind("SetMouseScale", { args: ["f32", "f32"], returns: "void" }); + +/** Get mouse wheel movement for X or Y, whichever is larger */ +export const GetMouseWheelMove = raylibLibrary.bind("GetMouseWheelMove", { args: [], returns: "f32" }); + +/** Get mouse wheel movement for both X and Y */ +export const GetMouseWheelMoveV = raylibLibrary.bind("GetMouseWheelMoveV", { args: [], returns: Vector2 }); + +/** Set mouse cursor */ +export const SetMouseCursor = raylibLibrary.bind("SetMouseCursor", { args: ["i32"], returns: "void" }); + +/** Get touch position X for touch point 0 (relative to screen size) */ +export const GetTouchX = raylibLibrary.bind("GetTouchX", { args: [], returns: "i32" }); + +/** Get touch position Y for touch point 0 (relative to screen size) */ +export const GetTouchY = raylibLibrary.bind("GetTouchY", { args: [], returns: "i32" }); + +/** Get touch position XY for a touch point index (relative to screen size) */ +export const GetTouchPosition = raylibLibrary.bind("GetTouchPosition", { args: ["i32"], returns: Vector2 }); + +/** Get touch point identifier for given index */ +export const GetTouchPointId = raylibLibrary.bind("GetTouchPointId", { args: ["i32"], returns: "i32" }); + +/** Get number of touch points */ +export const GetTouchPointCount = raylibLibrary.bind("GetTouchPointCount", { args: [], returns: "i32" }); + +/** Enable a set of gestures using flags */ +export const SetGesturesEnabled = raylibLibrary.bind("SetGesturesEnabled", { args: ["u32"], returns: "void" }); + +/** Check if a gesture have been detected */ +export const IsGestureDetected = raylibLibrary.bind("IsGestureDetected", { args: ["u32"], returns: "bool" }); + +/** Get latest detected gesture */ +export const GetGestureDetected = raylibLibrary.bind("GetGestureDetected", { args: [], returns: "i32" }); + +/** Get gesture hold time in seconds */ +export const GetGestureHoldDuration = raylibLibrary.bind("GetGestureHoldDuration", { args: [], returns: "f32" }); + +/** Get gesture drag vector */ +export const GetGestureDragVector = raylibLibrary.bind("GetGestureDragVector", { args: [], returns: Vector2 }); + +/** Get gesture drag angle */ +export const GetGestureDragAngle = raylibLibrary.bind("GetGestureDragAngle", { args: [], returns: "f32" }); + +/** Get gesture pinch delta */ +export const GetGesturePinchVector = raylibLibrary.bind("GetGesturePinchVector", { args: [], returns: Vector2 }); + +/** Get gesture pinch angle */ +export const GetGesturePinchAngle = raylibLibrary.bind("GetGesturePinchAngle", { args: [], returns: "f32" }); + +/** Update camera position for selected mode */ +export const UpdateCamera = raylibLibrary.bind("UpdateCamera", { args: ["pointer", "i32"], returns: "void" }); + +/** Set texture and rectangle to be used on shapes drawing */ +export const SetShapesTexture = raylibLibrary.bind("SetShapesTexture", { args: [Texture, Rectangle], returns: "void" }); + +/** Get texture that is used for shapes drawing */ +export const GetShapesTexture = raylibLibrary.bind("GetShapesTexture", { args: [], returns: Texture }); + +/** Get texture source rectangle that is used for shapes drawing */ +export const GetShapesTextureRectangle = raylibLibrary.bind("GetShapesTextureRectangle", { args: [], returns: Rectangle }); + +/** Draw a pixel using geometry [Can be slow, use with care] */ +export const DrawPixel = raylibLibrary.bind("DrawPixel", { args: ["i32", "i32", Color], returns: "void" }); + +/** Draw a pixel using geometry (Vector version) [Can be slow, use with care] */ +export const DrawPixelV = raylibLibrary.bind("DrawPixelV", { args: [Vector2, Color], returns: "void" }); + +/** Draw a line */ +export const DrawLine = raylibLibrary.bind("DrawLine", { args: ["i32", "i32", "i32", "i32", Color], returns: "void" }); + +/** Draw a line (using gl lines) */ +export const DrawLineV = raylibLibrary.bind("DrawLineV", { args: [Vector2, Vector2, Color], returns: "void" }); + +/** Draw lines sequence (using gl lines) */ +export const DrawLineStrip = raylibLibrary.bind("DrawLineStrip", { args: ["pointer", "i32", Color], returns: "void" }); + +/** Draw a dashed line */ +export const DrawLineDashed = raylibLibrary.bind("DrawLineDashed", { args: [Vector2, Vector2, "i32", "i32", Color], returns: "void" }); + +/** Draw a color-filled rectangle */ +export const DrawRectangle = raylibLibrary.bind("DrawRectangle", { args: ["i32", "i32", "i32", "i32", Color], returns: "void" }); + +/** Draw a color-filled rectangle (Vector version) */ +export const DrawRectangleV = raylibLibrary.bind("DrawRectangleV", { args: [Vector2, Vector2, Color], returns: "void" }); + +/** Draw a color-filled rectangle */ +export const DrawRectangleRec = raylibLibrary.bind("DrawRectangleRec", { args: [Rectangle, Color], returns: "void" }); + +/** Draw a vertical-gradient-filled rectangle */ +export const DrawRectangleGradientV = raylibLibrary.bind("DrawRectangleGradientV", { args: ["i32", "i32", "i32", "i32", Color, Color], returns: "void" }); + +/** Draw a horizontal-gradient-filled rectangle */ +export const DrawRectangleGradientH = raylibLibrary.bind("DrawRectangleGradientH", { args: ["i32", "i32", "i32", "i32", Color, Color], returns: "void" }); + +/** Draw a gradient-filled rectangle with custom vertex colors */ +export const DrawRectangleGradientEx = raylibLibrary.bind("DrawRectangleGradientEx", { args: [Rectangle, Color, Color, Color, Color], returns: "void" }); + +/** Draw rectangle outline */ +export const DrawRectangleLines = raylibLibrary.bind("DrawRectangleLines", { args: ["i32", "i32", "i32", "i32", Color], returns: "void" }); + +/** Draw a color-filled triangle (vertex in counter-clockwise order!) */ +export const DrawTriangle = raylibLibrary.bind("DrawTriangle", { args: [Vector2, Vector2, Vector2, Color], returns: "void" }); + +/** Draw triangle outline (vertex in counter-clockwise order!) */ +export const DrawTriangleLines = raylibLibrary.bind("DrawTriangleLines", { args: [Vector2, Vector2, Vector2, Color], returns: "void" }); + +/** Draw a triangle fan defined by points (first vertex is the center) */ +export const DrawTriangleFan = raylibLibrary.bind("DrawTriangleFan", { args: ["pointer", "i32", Color], returns: "void" }); + +/** Draw a triangle strip defined by points */ +export const DrawTriangleStrip = raylibLibrary.bind("DrawTriangleStrip", { args: ["pointer", "i32", Color], returns: "void" }); + +/** Check collision between two rectangles */ +export const CheckCollisionRecs = raylibLibrary.bind("CheckCollisionRecs", { args: [Rectangle, Rectangle], returns: "bool" }); + +/** Check if point is inside rectangle */ +export const CheckCollisionPointRec = raylibLibrary.bind("CheckCollisionPointRec", { args: [Vector2, Rectangle], returns: "bool" }); + +/** Check if point is inside a triangle */ +export const CheckCollisionPointTriangle = raylibLibrary.bind("CheckCollisionPointTriangle", { args: [Vector2, Vector2, Vector2, Vector2], returns: "bool" }); + +/** Check if point belongs to line created between two points [p1] and [p2] with defined margin in pixels [threshold] */ +export const CheckCollisionPointLine = raylibLibrary.bind("CheckCollisionPointLine", { args: [Vector2, Vector2, Vector2, "i32"], returns: "bool" }); + +/** Check if point is within a polygon described by array of vertices */ +export const CheckCollisionPointPoly = raylibLibrary.bind("CheckCollisionPointPoly", { args: [Vector2, "pointer", "i32"], returns: "bool" }); + +/** Check the collision between two lines defined by two points each, returns collision point by reference */ +export const CheckCollisionLines = raylibLibrary.bind("CheckCollisionLines", { args: [Vector2, Vector2, Vector2, Vector2, "pointer"], returns: "bool" }); + +/** Get collision rectangle for two rectangles collision */ +export const GetCollisionRec = raylibLibrary.bind("GetCollisionRec", { args: [Rectangle, Rectangle], returns: Rectangle }); + +/** Load image from file into CPU memory (RAM) */ +export const LoadImage = raylibLibrary.bind("LoadImage", { args: ["utf8string"], returns: Image }); + +/** Load image from RAW file data */ +export const LoadImageRaw = raylibLibrary.bind("LoadImageRaw", { args: ["utf8string", "i32", "i32", "i32", "i32"], returns: Image }); + +/** Load image sequence from file (frames appended to image.data) */ +export const LoadImageAnim = raylibLibrary.bind("LoadImageAnim", { args: ["utf8string", "pointer"], returns: Image }); + +/** Load image sequence from memory buffer */ +export const LoadImageAnimFromMemory = raylibLibrary.bind("LoadImageAnimFromMemory", { args: ["utf8string", "pointer", "i32", "pointer"], returns: Image }); + +/** Load image from memory buffer, fileType refers to extension: i.e. '.png' */ +export const LoadImageFromMemory = raylibLibrary.bind("LoadImageFromMemory", { args: ["utf8string", "pointer", "i32"], returns: Image }); + +/** Load image from GPU texture data */ +export const LoadImageFromTexture = raylibLibrary.bind("LoadImageFromTexture", { args: [Texture], returns: Image }); + +/** Load image from screen buffer and (screenshot) */ +export const LoadImageFromScreen = raylibLibrary.bind("LoadImageFromScreen", { args: [], returns: Image }); + +/** Check if an image is valid (data and parameters) */ +export const IsImageValid = raylibLibrary.bind("IsImageValid", { args: [Image], returns: "bool" }); + +/** Unload image from CPU memory (RAM) */ +export const UnloadImage = raylibLibrary.bind("UnloadImage", { args: [Image], returns: "void" }); + +/** Export image data to file, returns true on success */ +export const ExportImage = raylibLibrary.bind("ExportImage", { args: [Image, "utf8string"], returns: "bool" }); + +/** Export image to memory buffer, memory must be MemFree() */ +export const ExportImageToMemory = raylibLibrary.bind("ExportImageToMemory", { args: [Image, "utf8string", "pointer"], returns: "pointer" }); + +/** Export image as code file defining an array of bytes, returns true on success */ +export const ExportImageAsCode = raylibLibrary.bind("ExportImageAsCode", { args: [Image, "utf8string"], returns: "bool" }); + +/** Generate image: plain color */ +export const GenImageColor = raylibLibrary.bind("GenImageColor", { args: ["i32", "i32", Color], returns: Image }); + +/** Generate image: linear gradient, direction in degrees [0..360], 0=Vertical gradient */ +export const GenImageGradientLinear = raylibLibrary.bind("GenImageGradientLinear", { args: ["i32", "i32", "i32", Color, Color], returns: Image }); + +/** Generate image: checked */ +export const GenImageChecked = raylibLibrary.bind("GenImageChecked", { args: ["i32", "i32", "i32", "i32", Color, Color], returns: Image }); + +/** Generate image: cellular algorithm, bigger tileSize means bigger cells */ +export const GenImageCellular = raylibLibrary.bind("GenImageCellular", { args: ["i32", "i32", "i32"], returns: Image }); + +/** Generate image: grayscale image from text data */ +export const GenImageText = raylibLibrary.bind("GenImageText", { args: ["i32", "i32", "utf8string"], returns: Image }); + +/** Create an image duplicate (useful for transformations) */ +export const ImageCopy = raylibLibrary.bind("ImageCopy", { args: [Image], returns: Image }); + +/** Create an image from another image piece */ +export const ImageFromImage = raylibLibrary.bind("ImageFromImage", { args: [Image, Rectangle], returns: Image }); + +/** Create an image from a selected channel of another image (GRAYSCALE) */ +export const ImageFromChannel = raylibLibrary.bind("ImageFromChannel", { args: [Image, "i32"], returns: Image }); + +/** Create an image from text (default font) */ +export const ImageText = raylibLibrary.bind("ImageText", { args: ["utf8string", "i32", Color], returns: Image }); + +/** Convert image data to desired format */ +export const ImageFormat = raylibLibrary.bind("ImageFormat", { args: ["pointer", "i32"], returns: "void" }); + +/** Convert image to POT (power-of-two) */ +export const ImageToPOT = raylibLibrary.bind("ImageToPOT", { args: ["pointer", Color], returns: "void" }); + +/** Crop an image to a defined rectangle */ +export const ImageCrop = raylibLibrary.bind("ImageCrop", { args: ["pointer", Rectangle], returns: "void" }); + +/** Apply alpha mask to image */ +export const ImageAlphaMask = raylibLibrary.bind("ImageAlphaMask", { args: ["pointer", Image], returns: "void" }); + +/** Premultiply alpha channel */ +export const ImageAlphaPremultiply = raylibLibrary.bind("ImageAlphaPremultiply", { args: ["pointer"], returns: "void" }); + +/** Apply Gaussian blur using a box blur approximation */ +export const ImageBlurGaussian = raylibLibrary.bind("ImageBlurGaussian", { args: ["pointer", "i32"], returns: "void" }); + +/** Apply custom square convolution kernel to image */ +export const ImageKernelConvolution = raylibLibrary.bind("ImageKernelConvolution", { args: ["pointer", "pointer", "i32"], returns: "void" }); + +/** Resize image (Bicubic scaling algorithm) */ +export const ImageResize = raylibLibrary.bind("ImageResize", { args: ["pointer", "i32", "i32"], returns: "void" }); + +/** Resize image (Nearest-Neighbor scaling algorithm) */ +export const ImageResizeNN = raylibLibrary.bind("ImageResizeNN", { args: ["pointer", "i32", "i32"], returns: "void" }); + +/** Resize canvas and fill with color */ +export const ImageResizeCanvas = raylibLibrary.bind("ImageResizeCanvas", { args: ["pointer", "i32", "i32", "i32", "i32", Color], returns: "void" }); + +/** Compute all mipmap levels for a provided image */ +export const ImageMipmaps = raylibLibrary.bind("ImageMipmaps", { args: ["pointer"], returns: "void" }); + +/** Dither image data to 16bpp or lower (Floyd-Steinberg dithering) */ +export const ImageDither = raylibLibrary.bind("ImageDither", { args: ["pointer", "i32", "i32", "i32", "i32"], returns: "void" }); + +/** Flip image vertically */ +export const ImageFlipVertical = raylibLibrary.bind("ImageFlipVertical", { args: ["pointer"], returns: "void" }); + +/** Flip image horizontally */ +export const ImageFlipHorizontal = raylibLibrary.bind("ImageFlipHorizontal", { args: ["pointer"], returns: "void" }); + +/** Rotate image by input angle in degrees (-359 to 359) */ +export const ImageRotate = raylibLibrary.bind("ImageRotate", { args: ["pointer", "i32"], returns: "void" }); + +/** Rotate image clockwise 90deg */ +export const ImageRotateCW = raylibLibrary.bind("ImageRotateCW", { args: ["pointer"], returns: "void" }); + +/** Rotate image counter-clockwise 90deg */ +export const ImageRotateCCW = raylibLibrary.bind("ImageRotateCCW", { args: ["pointer"], returns: "void" }); + +/** Modify image color: tint */ +export const ImageColorTint = raylibLibrary.bind("ImageColorTint", { args: ["pointer", Color], returns: "void" }); + +/** Modify image color: invert */ +export const ImageColorInvert = raylibLibrary.bind("ImageColorInvert", { args: ["pointer"], returns: "void" }); + +/** Modify image color: grayscale */ +export const ImageColorGrayscale = raylibLibrary.bind("ImageColorGrayscale", { args: ["pointer"], returns: "void" }); + +/** Modify image color: brightness (-255 to 255) */ +export const ImageColorBrightness = raylibLibrary.bind("ImageColorBrightness", { args: ["pointer", "i32"], returns: "void" }); + +/** Modify image color: replace color */ +export const ImageColorReplace = raylibLibrary.bind("ImageColorReplace", { args: ["pointer", Color, Color], returns: "void" }); + +/** Load color data from image as a Color array (RGBA - 32bit) */ +export const LoadImageColors = raylibLibrary.bind("LoadImageColors", { args: [Image], returns: "pointer" }); + +/** Load colors palette from image as a Color array (RGBA - 32bit) */ +export const LoadImagePalette = raylibLibrary.bind("LoadImagePalette", { args: [Image, "i32", "pointer"], returns: "pointer" }); + +/** Unload color data loaded with LoadImageColors() */ +export const UnloadImageColors = raylibLibrary.bind("UnloadImageColors", { args: ["pointer"], returns: "void" }); + +/** Unload colors palette loaded with LoadImagePalette() */ +export const UnloadImagePalette = raylibLibrary.bind("UnloadImagePalette", { args: ["pointer"], returns: "void" }); + +/** Get image pixel color at (x, y) position */ +export const GetImageColor = raylibLibrary.bind("GetImageColor", { args: [Image, "i32", "i32"], returns: Color }); + +/** Clear image background with given color */ +export const ImageClearBackground = raylibLibrary.bind("ImageClearBackground", { args: ["pointer", Color], returns: "void" }); + +/** Draw pixel within an image */ +export const ImageDrawPixel = raylibLibrary.bind("ImageDrawPixel", { args: ["pointer", "i32", "i32", Color], returns: "void" }); + +/** Draw pixel within an image (Vector version) */ +export const ImageDrawPixelV = raylibLibrary.bind("ImageDrawPixelV", { args: ["pointer", Vector2, Color], returns: "void" }); + +/** Draw line within an image */ +export const ImageDrawLine = raylibLibrary.bind("ImageDrawLine", { args: ["pointer", "i32", "i32", "i32", "i32", Color], returns: "void" }); + +/** Draw line within an image (Vector version) */ +export const ImageDrawLineV = raylibLibrary.bind("ImageDrawLineV", { args: ["pointer", Vector2, Vector2, Color], returns: "void" }); + +/** Draw a line defining thickness within an image */ +export const ImageDrawLineEx = raylibLibrary.bind("ImageDrawLineEx", { args: ["pointer", Vector2, Vector2, "i32", Color], returns: "void" }); + +/** Draw a filled circle within an image */ +export const ImageDrawCircle = raylibLibrary.bind("ImageDrawCircle", { args: ["pointer", "i32", "i32", "i32", Color], returns: "void" }); + +/** Draw a filled circle within an image (Vector version) */ +export const ImageDrawCircleV = raylibLibrary.bind("ImageDrawCircleV", { args: ["pointer", Vector2, "i32", Color], returns: "void" }); + +/** Draw circle outline within an image */ +export const ImageDrawCircleLines = raylibLibrary.bind("ImageDrawCircleLines", { args: ["pointer", "i32", "i32", "i32", Color], returns: "void" }); + +/** Draw circle outline within an image (Vector version) */ +export const ImageDrawCircleLinesV = raylibLibrary.bind("ImageDrawCircleLinesV", { args: ["pointer", Vector2, "i32", Color], returns: "void" }); + +/** Draw rectangle within an image */ +export const ImageDrawRectangle = raylibLibrary.bind("ImageDrawRectangle", { args: ["pointer", "i32", "i32", "i32", "i32", Color], returns: "void" }); + +/** Draw rectangle within an image (Vector version) */ +export const ImageDrawRectangleV = raylibLibrary.bind("ImageDrawRectangleV", { args: ["pointer", Vector2, Vector2, Color], returns: "void" }); + +/** Draw rectangle within an image */ +export const ImageDrawRectangleRec = raylibLibrary.bind("ImageDrawRectangleRec", { args: ["pointer", Rectangle, Color], returns: "void" }); + +/** Draw rectangle lines within an image */ +export const ImageDrawRectangleLines = raylibLibrary.bind("ImageDrawRectangleLines", { args: ["pointer", Rectangle, "i32", Color], returns: "void" }); + +/** Draw triangle within an image */ +export const ImageDrawTriangle = raylibLibrary.bind("ImageDrawTriangle", { args: ["pointer", Vector2, Vector2, Vector2, Color], returns: "void" }); + +/** Draw triangle with interpolated colors within an image */ +export const ImageDrawTriangleEx = raylibLibrary.bind("ImageDrawTriangleEx", { args: ["pointer", Vector2, Vector2, Vector2, Color, Color, Color], returns: "void" }); + +/** Draw triangle outline within an image */ +export const ImageDrawTriangleLines = raylibLibrary.bind("ImageDrawTriangleLines", { args: ["pointer", Vector2, Vector2, Vector2, Color], returns: "void" }); + +/** Draw a triangle fan defined by points within an image (first vertex is the center) */ +export const ImageDrawTriangleFan = raylibLibrary.bind("ImageDrawTriangleFan", { args: ["pointer", "pointer", "i32", Color], returns: "void" }); + +/** Draw a triangle strip defined by points within an image */ +export const ImageDrawTriangleStrip = raylibLibrary.bind("ImageDrawTriangleStrip", { args: ["pointer", "pointer", "i32", Color], returns: "void" }); + +/** Draw a source image within a destination image (tint applied to source) */ +export const ImageDraw = raylibLibrary.bind("ImageDraw", { args: ["pointer", Image, Rectangle, Rectangle, Color], returns: "void" }); + +/** Draw text (using default font) within an image (destination) */ +export const ImageDrawText = raylibLibrary.bind("ImageDrawText", { args: ["pointer", "utf8string", "i32", "i32", "i32", Color], returns: "void" }); + +/** Load texture from file into GPU memory (VRAM) */ +export const LoadTexture = raylibLibrary.bind("LoadTexture", { args: ["utf8string"], returns: Texture }); + +/** Load texture from image data */ +export const LoadTextureFromImage = raylibLibrary.bind("LoadTextureFromImage", { args: [Image], returns: Texture }); + +/** Load cubemap from image, multiple image cubemap layouts supported */ +export const LoadTextureCubemap = raylibLibrary.bind("LoadTextureCubemap", { args: [Image, "i32"], returns: Texture }); + +/** Load texture for rendering (framebuffer) */ +export const LoadRenderTexture = raylibLibrary.bind("LoadRenderTexture", { args: ["i32", "i32"], returns: RenderTexture }); + +/** Check if a texture is valid (loaded in GPU) */ +export const IsTextureValid = raylibLibrary.bind("IsTextureValid", { args: [Texture], returns: "bool" }); + +/** Unload texture from GPU memory (VRAM) */ +export const UnloadTexture = raylibLibrary.bind("UnloadTexture", { args: [Texture], returns: "void" }); + +/** Check if a render texture is valid (loaded in GPU) */ +export const IsRenderTextureValid = raylibLibrary.bind("IsRenderTextureValid", { args: [RenderTexture], returns: "bool" }); + +/** Unload render texture from GPU memory (VRAM) */ +export const UnloadRenderTexture = raylibLibrary.bind("UnloadRenderTexture", { args: [RenderTexture], returns: "void" }); + +/** Update GPU texture with new data (pixels should be able to fill texture) */ +export const UpdateTexture = raylibLibrary.bind("UpdateTexture", { args: [Texture, "pointer"], returns: "void" }); + +/** Update GPU texture rectangle with new data (pixels and rec should fit in texture) */ +export const UpdateTextureRec = raylibLibrary.bind("UpdateTextureRec", { args: [Texture, Rectangle, "pointer"], returns: "void" }); + +/** Generate GPU mipmaps for a texture */ +export const GenTextureMipmaps = raylibLibrary.bind("GenTextureMipmaps", { args: ["pointer"], returns: "void" }); + +/** Set texture scaling filter mode */ +export const SetTextureFilter = raylibLibrary.bind("SetTextureFilter", { args: [Texture, "i32"], returns: "void" }); + +/** Set texture wrapping mode */ +export const SetTextureWrap = raylibLibrary.bind("SetTextureWrap", { args: [Texture, "i32"], returns: "void" }); + +/** Draw a Texture2D */ +export const DrawTexture = raylibLibrary.bind("DrawTexture", { args: [Texture, "i32", "i32", Color], returns: "void" }); + +/** Draw a Texture2D with position defined as Vector2 */ +export const DrawTextureV = raylibLibrary.bind("DrawTextureV", { args: [Texture, Vector2, Color], returns: "void" }); + +/** Draw a part of a texture defined by a rectangle */ +export const DrawTextureRec = raylibLibrary.bind("DrawTextureRec", { args: [Texture, Rectangle, Vector2, Color], returns: "void" }); + +/** Check if two colors are equal */ +export const ColorIsEqual = raylibLibrary.bind("ColorIsEqual", { args: [Color, Color], returns: "bool" }); + +/** Get hexadecimal value for a Color (0xRRGGBBAA) */ +export const ColorToInt = raylibLibrary.bind("ColorToInt", { args: [Color], returns: "i32" }); + +/** Get Color normalized as float [0..1] */ +export const ColorNormalize = raylibLibrary.bind("ColorNormalize", { args: [Color], returns: Vector4 }); + +/** Get Color from normalized values [0..1] */ +export const ColorFromNormalized = raylibLibrary.bind("ColorFromNormalized", { args: [Vector4], returns: Color }); + +/** Get HSV values for a Color, hue [0..360], saturation/value [0..1] */ +export const ColorToHSV = raylibLibrary.bind("ColorToHSV", { args: [Color], returns: Vector3 }); + +/** Get a Color from HSV values, hue [0..360], saturation/value [0..1] */ +export const ColorFromHSV = raylibLibrary.bind("ColorFromHSV", { args: ["f32", "f32", "f32"], returns: Color }); + +/** Get color multiplied with another color */ +export const ColorTint = raylibLibrary.bind("ColorTint", { args: [Color, Color], returns: Color }); + +/** Get src alpha-blended into dst color with tint */ +export const ColorAlphaBlend = raylibLibrary.bind("ColorAlphaBlend", { args: [Color, Color, Color], returns: Color }); + +/** Get Color structure from hexadecimal value */ +export const GetColor = raylibLibrary.bind("GetColor", { args: ["u32"], returns: Color }); + +/** Get Color from a source pixel pointer of certain format */ +export const GetPixelColor = raylibLibrary.bind("GetPixelColor", { args: ["pointer", "i32"], returns: Color }); + +/** Set color formatted into destination pixel pointer */ +export const SetPixelColor = raylibLibrary.bind("SetPixelColor", { args: ["pointer", Color, "i32"], returns: "void" }); + +/** Get pixel data size in bytes for certain format */ +export const GetPixelDataSize = raylibLibrary.bind("GetPixelDataSize", { args: ["i32", "i32", "i32"], returns: "i32" }); + +/** Get the default Font */ +export const GetFontDefault = raylibLibrary.bind("GetFontDefault", { args: [], returns: Font }); + +/** Load font from file into GPU memory (VRAM) */ +export const LoadFont = raylibLibrary.bind("LoadFont", { args: ["utf8string"], returns: Font }); + +/** Load font from file with extended parameters, use NULL for codepoints and 0 for codepointCount to load the default character set, font size is provided in pixels height */ +export const LoadFontEx = raylibLibrary.bind("LoadFontEx", { args: ["utf8string", "i32", "pointer", "i32"], returns: Font }); + +/** Load font from Image (XNA style) */ +export const LoadFontFromImage = raylibLibrary.bind("LoadFontFromImage", { args: [Image, Color, "i32"], returns: Font }); + +/** Load font from memory buffer, fileType refers to extension: i.e. '.ttf' */ +export const LoadFontFromMemory = raylibLibrary.bind("LoadFontFromMemory", { args: ["utf8string", "pointer", "i32", "i32", "pointer", "i32"], returns: Font }); + +/** Check if a font is valid (font data loaded, WARNING: GPU texture not checked) */ +export const IsFontValid = raylibLibrary.bind("IsFontValid", { args: [Font], returns: "bool" }); + +/** Load font data for further use */ +export const LoadFontData = raylibLibrary.bind("LoadFontData", { args: ["pointer", "i32", "i32", "pointer", "i32", "i32", "pointer"], returns: "pointer" }); + +/** Generate image font atlas using chars info */ +export const GenImageFontAtlas = raylibLibrary.bind("GenImageFontAtlas", { args: ["pointer", "pointer", "i32", "i32", "i32", "i32"], returns: Image }); + +/** Unload font chars info data (RAM) */ +export const UnloadFontData = raylibLibrary.bind("UnloadFontData", { args: ["pointer", "i32"], returns: "void" }); + +/** Unload font from GPU memory (VRAM) */ +export const UnloadFont = raylibLibrary.bind("UnloadFont", { args: [Font], returns: "void" }); + +/** Export font as code file, returns true on success */ +export const ExportFontAsCode = raylibLibrary.bind("ExportFontAsCode", { args: [Font, "utf8string"], returns: "bool" }); + +/** Draw current FPS */ +export const DrawFPS = raylibLibrary.bind("DrawFPS", { args: ["i32", "i32"], returns: "void" }); + +/** Draw text (using default font) */ +export const DrawText = raylibLibrary.bind("DrawText", { args: ["utf8string", "i32", "i32", "i32", Color], returns: "void" }); + +/** Set vertical line spacing when drawing with line-breaks */ +export const SetTextLineSpacing = raylibLibrary.bind("SetTextLineSpacing", { args: ["i32"], returns: "void" }); + +/** Measure string width for default font */ +export const MeasureText = raylibLibrary.bind("MeasureText", { args: ["utf8string", "i32"], returns: "i32" }); + +/** Get glyph index position in font for a codepoint (unicode character), fallback to '?' if not found */ +export const GetGlyphIndex = raylibLibrary.bind("GetGlyphIndex", { args: [Font, "i32"], returns: "i32" }); + +/** Get glyph font info data for a codepoint (unicode character), fallback to '?' if not found */ +export const GetGlyphInfo = raylibLibrary.bind("GetGlyphInfo", { args: [Font, "i32"], returns: GlyphInfo }); + +/** Get glyph rectangle in font atlas for a codepoint (unicode character), fallback to '?' if not found */ +export const GetGlyphAtlasRec = raylibLibrary.bind("GetGlyphAtlasRec", { args: [Font, "i32"], returns: Rectangle }); + +/** Load UTF-8 text encoded from codepoints array */ +export const LoadUTF8 = raylibLibrary.bind("LoadUTF8", { args: ["pointer", "i32"], returns: "pointer" }); + +/** Unload UTF-8 text encoded from codepoints array */ +export const UnloadUTF8 = raylibLibrary.bind("UnloadUTF8", { args: ["pointer"], returns: "void" }); + +/** Load all codepoints from a UTF-8 text string, codepoints count returned by parameter */ +export const LoadCodepoints = raylibLibrary.bind("LoadCodepoints", { args: ["utf8string", "pointer"], returns: "pointer" }); + +/** Unload codepoints data from memory */ +export const UnloadCodepoints = raylibLibrary.bind("UnloadCodepoints", { args: ["pointer"], returns: "void" }); + +/** Get total number of codepoints in a UTF-8 encoded string */ +export const GetCodepointCount = raylibLibrary.bind("GetCodepointCount", { args: ["utf8string"], returns: "i32" }); + +/** Get next codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure */ +export const GetCodepoint = raylibLibrary.bind("GetCodepoint", { args: ["utf8string", "pointer"], returns: "i32" }); + +/** Get next codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure */ +export const GetCodepointNext = raylibLibrary.bind("GetCodepointNext", { args: ["utf8string", "pointer"], returns: "i32" }); + +/** Get previous codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure */ +export const GetCodepointPrevious = raylibLibrary.bind("GetCodepointPrevious", { args: ["utf8string", "pointer"], returns: "i32" }); + +/** Encode one codepoint into UTF-8 byte array (array length returned as parameter) */ +export const CodepointToUTF8 = raylibLibrary.bind("CodepointToUTF8", { args: ["i32", "pointer"], returns: "utf8string" }); + +/** Load text as separate lines ('\n') */ +export const LoadTextLines = raylibLibrary.bind("LoadTextLines", { args: ["utf8string", "pointer"], returns: "pointer" }); + +/** Unload text lines */ +export const UnloadTextLines = raylibLibrary.bind("UnloadTextLines", { args: ["pointer", "i32"], returns: "void" }); + +/** Copy one string to another, returns bytes copied */ +export const TextCopy = raylibLibrary.bind("TextCopy", { args: ["pointer", "utf8string"], returns: "i32" }); + +/** Check if two text string are equal */ +export const TextIsEqual = raylibLibrary.bind("TextIsEqual", { args: ["utf8string", "utf8string"], returns: "bool" }); + +/** Get text length, checks for '\0' ending */ +export const TextLength = raylibLibrary.bind("TextLength", { args: ["utf8string"], returns: "u32" }); + +/** Get a piece of a text string */ +export const TextSubtext = raylibLibrary.bind("TextSubtext", { args: ["utf8string", "i32", "i32"], returns: "utf8string" }); + +/** Remove text spaces, concat words */ +export const TextRemoveSpaces = raylibLibrary.bind("TextRemoveSpaces", { args: ["utf8string"], returns: "utf8string" }); + +/** Get text between two strings */ +export const GetTextBetween = raylibLibrary.bind("GetTextBetween", { args: ["utf8string", "utf8string", "utf8string"], returns: "utf8string" }); + +/** Replace text string with new string */ +export const TextReplace = raylibLibrary.bind("TextReplace", { args: ["utf8string", "utf8string", "utf8string"], returns: "utf8string" }); + +/** Raw-pointer variant for nullable C string parameters. */ +export const TextReplaceRaw = raylibLibrary.bind("TextReplace", { args: ["utf8string", "utf8string", "pointer"], returns: "utf8string" }); + +/** Replace text string with new string, memory must be MemFree() */ +export const TextReplaceAlloc = raylibLibrary.bind("TextReplaceAlloc", { args: ["utf8string", "utf8string", "utf8string"], returns: "pointer" }); + +/** Raw-pointer variant for nullable C string parameters. */ +export const TextReplaceAllocRaw = raylibLibrary.bind("TextReplaceAlloc", { args: ["utf8string", "utf8string", "pointer"], returns: "pointer" }); + +/** Replace text between two specific strings */ +export const TextReplaceBetween = raylibLibrary.bind("TextReplaceBetween", { args: ["utf8string", "utf8string", "utf8string", "utf8string"], returns: "utf8string" }); + +/** Raw-pointer variant for nullable C string parameters. */ +export const TextReplaceBetweenRaw = raylibLibrary.bind("TextReplaceBetween", { args: ["utf8string", "utf8string", "utf8string", "pointer"], returns: "utf8string" }); + +/** Replace text between two specific strings, memory must be MemFree() */ +export const TextReplaceBetweenAlloc = raylibLibrary.bind("TextReplaceBetweenAlloc", { args: ["utf8string", "utf8string", "utf8string", "utf8string"], returns: "pointer" }); + +/** Raw-pointer variant for nullable C string parameters. */ +export const TextReplaceBetweenAllocRaw = raylibLibrary.bind("TextReplaceBetweenAlloc", { args: ["utf8string", "utf8string", "utf8string", "pointer"], returns: "pointer" }); + +/** Insert text in a defined byte position */ +export const TextInsert = raylibLibrary.bind("TextInsert", { args: ["utf8string", "utf8string", "i32"], returns: "utf8string" }); + +/** Insert text in a defined byte position, memory must be MemFree() */ +export const TextInsertAlloc = raylibLibrary.bind("TextInsertAlloc", { args: ["utf8string", "utf8string", "i32"], returns: "pointer" }); + +/** Join text strings with delimiter */ +export const TextJoin = raylibLibrary.bind("TextJoin", { args: ["pointer", "i32", "utf8string"], returns: "utf8string" }); + +/** Split text into multiple strings, using MAX_TEXTSPLIT_COUNT static strings */ +export const TextSplit = raylibLibrary.bind("TextSplit", { args: ["utf8string", "i8", "pointer"], returns: "pointer" }); + +/** Append text at specific position and move cursor */ +export const TextAppend = raylibLibrary.bind("TextAppend", { args: ["pointer", "utf8string", "pointer"], returns: "void" }); + +/** Find first text occurrence within a string, -1 if not found */ +export const TextFindIndex = raylibLibrary.bind("TextFindIndex", { args: ["utf8string", "utf8string"], returns: "i32" }); + +/** Get upper case version of provided string */ +export const TextToUpper = raylibLibrary.bind("TextToUpper", { args: ["utf8string"], returns: "utf8string" }); + +/** Get lower case version of provided string */ +export const TextToLower = raylibLibrary.bind("TextToLower", { args: ["utf8string"], returns: "utf8string" }); + +/** Get Pascal case notation version of provided string */ +export const TextToPascal = raylibLibrary.bind("TextToPascal", { args: ["utf8string"], returns: "utf8string" }); + +/** Get Snake case notation version of provided string */ +export const TextToSnake = raylibLibrary.bind("TextToSnake", { args: ["utf8string"], returns: "utf8string" }); + +/** Get Camel case notation version of provided string */ +export const TextToCamel = raylibLibrary.bind("TextToCamel", { args: ["utf8string"], returns: "utf8string" }); + +/** Get integer value from text */ +export const TextToInteger = raylibLibrary.bind("TextToInteger", { args: ["utf8string"], returns: "i32" }); + +/** Get float value from text */ +export const TextToFloat = raylibLibrary.bind("TextToFloat", { args: ["utf8string"], returns: "f32" }); + +/** Draw a line in 3D world space */ +export const DrawLine3D = raylibLibrary.bind("DrawLine3D", { args: [Vector3, Vector3, Color], returns: "void" }); + +/** Draw a point in 3D space, actually a small line */ +export const DrawPoint3D = raylibLibrary.bind("DrawPoint3D", { args: [Vector3, Color], returns: "void" }); + +/** Draw a color-filled triangle (vertex in counter-clockwise order!) */ +export const DrawTriangle3D = raylibLibrary.bind("DrawTriangle3D", { args: [Vector3, Vector3, Vector3, Color], returns: "void" }); + +/** Draw a triangle strip defined by points */ +export const DrawTriangleStrip3D = raylibLibrary.bind("DrawTriangleStrip3D", { args: ["pointer", "i32", Color], returns: "void" }); + +/** Draw cube (Vector version) */ +export const DrawCubeV = raylibLibrary.bind("DrawCubeV", { args: [Vector3, Vector3, Color], returns: "void" }); + +/** Draw cube wires (Vector version) */ +export const DrawCubeWiresV = raylibLibrary.bind("DrawCubeWiresV", { args: [Vector3, Vector3, Color], returns: "void" }); + +/** Draw a plane XZ */ +export const DrawPlane = raylibLibrary.bind("DrawPlane", { args: [Vector3, Vector2, Color], returns: "void" }); + +/** Draw a ray line */ +export const DrawRay = raylibLibrary.bind("DrawRay", { args: [Ray, Color], returns: "void" }); + +/** Load model from files (meshes and materials) */ +export const LoadModel = raylibLibrary.bind("LoadModel", { args: ["utf8string"], returns: Model }); + +/** Load model from generated mesh (default material) */ +export const LoadModelFromMesh = raylibLibrary.bind("LoadModelFromMesh", { args: [Mesh], returns: Model }); + +/** Check if a model is valid (loaded in GPU, VAO/VBOs) */ +export const IsModelValid = raylibLibrary.bind("IsModelValid", { args: [Model], returns: "bool" }); + +/** Unload model (including meshes) from memory (RAM and/or VRAM) */ +export const UnloadModel = raylibLibrary.bind("UnloadModel", { args: [Model], returns: "void" }); + +/** Compute model bounding box limits (considers all meshes) */ +export const GetModelBoundingBox = raylibLibrary.bind("GetModelBoundingBox", { args: [Model], returns: BoundingBox }); + +/** Draw bounding box (wires) */ +export const DrawBoundingBox = raylibLibrary.bind("DrawBoundingBox", { args: [BoundingBox, Color], returns: "void" }); + +/** Draw a billboard texture defined by source */ +export const DrawBillboardRec = raylibLibrary.bind("DrawBillboardRec", { args: [Camera3D, Texture, Rectangle, Vector3, Vector2, Color], returns: "void" }); + +/** Upload mesh vertex data in GPU and provide VAO/VBO ids */ +export const UploadMesh = raylibLibrary.bind("UploadMesh", { args: ["pointer", "bool"], returns: "void" }); + +/** Update mesh vertex data in GPU for a specific buffer index */ +export const UpdateMeshBuffer = raylibLibrary.bind("UpdateMeshBuffer", { args: [Mesh, "i32", "pointer", "i32", "i32"], returns: "void" }); + +/** Unload mesh data from CPU and GPU */ +export const UnloadMesh = raylibLibrary.bind("UnloadMesh", { args: [Mesh], returns: "void" }); + +/** Draw a 3d mesh with material and transform */ +export const DrawMesh = raylibLibrary.bind("DrawMesh", { args: [Mesh, Material, Matrix], returns: "void" }); + +/** Draw multiple mesh instances with material and different transforms */ +export const DrawMeshInstanced = raylibLibrary.bind("DrawMeshInstanced", { args: [Mesh, Material, "pointer", "i32"], returns: "void" }); + +/** Compute mesh bounding box limits */ +export const GetMeshBoundingBox = raylibLibrary.bind("GetMeshBoundingBox", { args: [Mesh], returns: BoundingBox }); + +/** Compute mesh tangents */ +export const GenMeshTangents = raylibLibrary.bind("GenMeshTangents", { args: ["pointer"], returns: "void" }); + +/** Export mesh data to file, returns true on success */ +export const ExportMesh = raylibLibrary.bind("ExportMesh", { args: [Mesh, "utf8string"], returns: "bool" }); + +/** Export mesh as code file (.h) defining multiple arrays of vertex attributes */ +export const ExportMeshAsCode = raylibLibrary.bind("ExportMeshAsCode", { args: [Mesh, "utf8string"], returns: "bool" }); + +/** Generate cuboid mesh */ +export const GenMeshCube = raylibLibrary.bind("GenMeshCube", { args: ["f32", "f32", "f32"], returns: Mesh }); + +/** Generate heightmap mesh from image data */ +export const GenMeshHeightmap = raylibLibrary.bind("GenMeshHeightmap", { args: [Image, Vector3], returns: Mesh }); + +/** Generate cubes-based map mesh from image data */ +export const GenMeshCubicmap = raylibLibrary.bind("GenMeshCubicmap", { args: [Image, Vector3], returns: Mesh }); + +/** Load materials from model file */ +export const LoadMaterials = raylibLibrary.bind("LoadMaterials", { args: ["utf8string", "pointer"], returns: "pointer" }); + +/** Load default material (Supports: DIFFUSE, SPECULAR, NORMAL maps) */ +export const LoadMaterialDefault = raylibLibrary.bind("LoadMaterialDefault", { args: [], returns: Material }); + +/** Check if a material is valid (shader assigned, map textures loaded in GPU) */ +export const IsMaterialValid = raylibLibrary.bind("IsMaterialValid", { args: [Material], returns: "bool" }); + +/** Unload material from GPU memory (VRAM) */ +export const UnloadMaterial = raylibLibrary.bind("UnloadMaterial", { args: [Material], returns: "void" }); + +/** Set texture for a material map type (MATERIAL_MAP_DIFFUSE, MATERIAL_MAP_SPECULAR...) */ +export const SetMaterialTexture = raylibLibrary.bind("SetMaterialTexture", { args: ["pointer", "i32", Texture], returns: "void" }); + +/** Set material for a mesh */ +export const SetModelMeshMaterial = raylibLibrary.bind("SetModelMeshMaterial", { args: ["pointer", "i32", "i32"], returns: "void" }); + +/** Load model animations from file */ +export const LoadModelAnimations = raylibLibrary.bind("LoadModelAnimations", { args: ["utf8string", "pointer"], returns: "pointer" }); + +/** Unload animation array data */ +export const UnloadModelAnimations = raylibLibrary.bind("UnloadModelAnimations", { args: ["pointer", "i32"], returns: "void" }); + +/** Check model animation skeleton match */ +export const IsModelAnimationValid = raylibLibrary.bind("IsModelAnimationValid", { args: [Model, ModelAnimation], returns: "bool" }); + +/** Check collision between two bounding boxes */ +export const CheckCollisionBoxes = raylibLibrary.bind("CheckCollisionBoxes", { args: [BoundingBox, BoundingBox], returns: "bool" }); + +/** Get collision info between ray and box */ +export const GetRayCollisionBox = raylibLibrary.bind("GetRayCollisionBox", { args: [Ray, BoundingBox], returns: RayCollision }); + +/** Get collision info between ray and mesh */ +export const GetRayCollisionMesh = raylibLibrary.bind("GetRayCollisionMesh", { args: [Ray, Mesh, Matrix], returns: RayCollision }); + +/** Get collision info between ray and triangle */ +export const GetRayCollisionTriangle = raylibLibrary.bind("GetRayCollisionTriangle", { args: [Ray, Vector3, Vector3, Vector3], returns: RayCollision }); + +/** Get collision info between ray and quad */ +export const GetRayCollisionQuad = raylibLibrary.bind("GetRayCollisionQuad", { args: [Ray, Vector3, Vector3, Vector3, Vector3], returns: RayCollision }); + +/** Initialize audio device and context */ +export const InitAudioDevice = raylibLibrary.bind("InitAudioDevice", { args: [], returns: "void" }); + +/** Close the audio device and context */ +export const CloseAudioDevice = raylibLibrary.bind("CloseAudioDevice", { args: [], returns: "void" }); + +/** Check if audio device has been initialized successfully */ +export const IsAudioDeviceReady = raylibLibrary.bind("IsAudioDeviceReady", { args: [], returns: "bool" }); + +/** Set master volume (listener) */ +export const SetMasterVolume = raylibLibrary.bind("SetMasterVolume", { args: ["f32"], returns: "void" }); + +/** Get master volume (listener) */ +export const GetMasterVolume = raylibLibrary.bind("GetMasterVolume", { args: [], returns: "f32" }); + +/** Load wave data from file */ +export const LoadWave = raylibLibrary.bind("LoadWave", { args: ["utf8string"], returns: Wave }); + +/** Load wave from memory buffer, fileType refers to extension: i.e. '.wav' */ +export const LoadWaveFromMemory = raylibLibrary.bind("LoadWaveFromMemory", { args: ["utf8string", "pointer", "i32"], returns: Wave }); + +/** Checks if wave data is valid (data loaded and parameters) */ +export const IsWaveValid = raylibLibrary.bind("IsWaveValid", { args: [Wave], returns: "bool" }); + +/** Load sound from file */ +export const LoadSound = raylibLibrary.bind("LoadSound", { args: ["utf8string"], returns: Sound }); + +/** Load sound from wave data */ +export const LoadSoundFromWave = raylibLibrary.bind("LoadSoundFromWave", { args: [Wave], returns: Sound }); + +/** Create a new sound that shares the same sample data as the source sound, does not own the sound data */ +export const LoadSoundAlias = raylibLibrary.bind("LoadSoundAlias", { args: [Sound], returns: Sound }); + +/** Checks if a sound is valid (data loaded and buffers initialized) */ +export const IsSoundValid = raylibLibrary.bind("IsSoundValid", { args: [Sound], returns: "bool" }); + +/** Update sound buffer with new data (default data format: 32 bit float, stereo) */ +export const UpdateSound = raylibLibrary.bind("UpdateSound", { args: [Sound, "pointer", "i32"], returns: "void" }); + +/** Unload wave data */ +export const UnloadWave = raylibLibrary.bind("UnloadWave", { args: [Wave], returns: "void" }); + +/** Unload sound */ +export const UnloadSound = raylibLibrary.bind("UnloadSound", { args: [Sound], returns: "void" }); + +/** Unload a sound alias (does not deallocate sample data) */ +export const UnloadSoundAlias = raylibLibrary.bind("UnloadSoundAlias", { args: [Sound], returns: "void" }); + +/** Export wave data to file, returns true on success */ +export const ExportWave = raylibLibrary.bind("ExportWave", { args: [Wave, "utf8string"], returns: "bool" }); + +/** Export wave sample data to code (.h), returns true on success */ +export const ExportWaveAsCode = raylibLibrary.bind("ExportWaveAsCode", { args: [Wave, "utf8string"], returns: "bool" }); + +/** Play a sound */ +export const PlaySound = raylibLibrary.bind("PlaySound", { args: [Sound], returns: "void" }); + +/** Stop playing a sound */ +export const StopSound = raylibLibrary.bind("StopSound", { args: [Sound], returns: "void" }); + +/** Pause a sound */ +export const PauseSound = raylibLibrary.bind("PauseSound", { args: [Sound], returns: "void" }); + +/** Resume a paused sound */ +export const ResumeSound = raylibLibrary.bind("ResumeSound", { args: [Sound], returns: "void" }); + +/** Check if a sound is currently playing */ +export const IsSoundPlaying = raylibLibrary.bind("IsSoundPlaying", { args: [Sound], returns: "bool" }); + +/** Copy a wave to a new wave */ +export const WaveCopy = raylibLibrary.bind("WaveCopy", { args: [Wave], returns: Wave }); + +/** Crop a wave to defined frames range */ +export const WaveCrop = raylibLibrary.bind("WaveCrop", { args: ["pointer", "i32", "i32"], returns: "void" }); + +/** Convert wave data to desired format */ +export const WaveFormat = raylibLibrary.bind("WaveFormat", { args: ["pointer", "i32", "i32", "i32"], returns: "void" }); + +/** Load samples data from wave as a 32bit float data array */ +export const LoadWaveSamples = raylibLibrary.bind("LoadWaveSamples", { args: [Wave], returns: "pointer" }); + +/** Unload samples data loaded with LoadWaveSamples() */ +export const UnloadWaveSamples = raylibLibrary.bind("UnloadWaveSamples", { args: ["pointer"], returns: "void" }); + +/** Load music stream from file */ +export const LoadMusicStream = raylibLibrary.bind("LoadMusicStream", { args: ["utf8string"], returns: Music }); + +/** Load music stream from data */ +export const LoadMusicStreamFromMemory = raylibLibrary.bind("LoadMusicStreamFromMemory", { args: ["utf8string", "pointer", "i32"], returns: Music }); + +/** Checks if a music stream is valid (context and buffers initialized) */ +export const IsMusicValid = raylibLibrary.bind("IsMusicValid", { args: [Music], returns: "bool" }); + +/** Unload music stream */ +export const UnloadMusicStream = raylibLibrary.bind("UnloadMusicStream", { args: [Music], returns: "void" }); + +/** Start music playing */ +export const PlayMusicStream = raylibLibrary.bind("PlayMusicStream", { args: [Music], returns: "void" }); + +/** Check if music is playing */ +export const IsMusicStreamPlaying = raylibLibrary.bind("IsMusicStreamPlaying", { args: [Music], returns: "bool" }); + +/** Updates buffers for music streaming */ +export const UpdateMusicStream = raylibLibrary.bind("UpdateMusicStream", { args: [Music], returns: "void" }); + +/** Stop music playing */ +export const StopMusicStream = raylibLibrary.bind("StopMusicStream", { args: [Music], returns: "void" }); + +/** Pause music playing */ +export const PauseMusicStream = raylibLibrary.bind("PauseMusicStream", { args: [Music], returns: "void" }); + +/** Resume playing paused music */ +export const ResumeMusicStream = raylibLibrary.bind("ResumeMusicStream", { args: [Music], returns: "void" }); + +/** Get music time length (in seconds) */ +export const GetMusicTimeLength = raylibLibrary.bind("GetMusicTimeLength", { args: [Music], returns: "f32" }); + +/** Get current music time played (in seconds) */ +export const GetMusicTimePlayed = raylibLibrary.bind("GetMusicTimePlayed", { args: [Music], returns: "f32" }); + +/** Load audio stream (to stream raw audio pcm data) */ +export const LoadAudioStream = raylibLibrary.bind("LoadAudioStream", { args: ["u32", "u32", "u32"], returns: AudioStream }); + +/** Checks if an audio stream is valid (buffers initialized) */ +export const IsAudioStreamValid = raylibLibrary.bind("IsAudioStreamValid", { args: [AudioStream], returns: "bool" }); + +/** Unload audio stream and free memory */ +export const UnloadAudioStream = raylibLibrary.bind("UnloadAudioStream", { args: [AudioStream], returns: "void" }); + +/** Update audio stream buffers with data */ +export const UpdateAudioStream = raylibLibrary.bind("UpdateAudioStream", { args: [AudioStream, "pointer", "i32"], returns: "void" }); + +/** Check if any audio stream buffers requires refill */ +export const IsAudioStreamProcessed = raylibLibrary.bind("IsAudioStreamProcessed", { args: [AudioStream], returns: "bool" }); + +/** Play audio stream */ +export const PlayAudioStream = raylibLibrary.bind("PlayAudioStream", { args: [AudioStream], returns: "void" }); + +/** Pause audio stream */ +export const PauseAudioStream = raylibLibrary.bind("PauseAudioStream", { args: [AudioStream], returns: "void" }); + +/** Resume audio stream */ +export const ResumeAudioStream = raylibLibrary.bind("ResumeAudioStream", { args: [AudioStream], returns: "void" }); + +/** Check if audio stream is playing */ +export const IsAudioStreamPlaying = raylibLibrary.bind("IsAudioStreamPlaying", { args: [AudioStream], returns: "bool" }); + +/** Stop audio stream */ +export const StopAudioStream = raylibLibrary.bind("StopAudioStream", { args: [AudioStream], returns: "void" }); + +/** Default size for new audio streams */ +export const SetAudioStreamBufferSizeDefault = raylibLibrary.bind("SetAudioStreamBufferSizeDefault", { args: ["i32"], returns: "void" }); + +/** Audio thread callback to request new data */ +export const SetAudioStreamCallback = raylibLibrary.bind("SetAudioStreamCallback", { args: [AudioStream, "pointer"], returns: "void" }); + +/** Attach audio stream processor to stream, receives frames x 2 samples as 'float' (stereo) */ +export const AttachAudioStreamProcessor = raylibLibrary.bind("AttachAudioStreamProcessor", { args: [AudioStream, "pointer"], returns: "void" }); + +/** Detach audio stream processor from stream */ +export const DetachAudioStreamProcessor = raylibLibrary.bind("DetachAudioStreamProcessor", { args: [AudioStream, "pointer"], returns: "void" }); + +/** Attach audio stream processor to the entire audio pipeline, receives frames x 2 samples as 'float' (stereo) */ +export const AttachAudioMixedProcessor = raylibLibrary.bind("AttachAudioMixedProcessor", { args: ["pointer"], returns: "void" }); + +/** Detach audio stream processor from the entire audio pipeline */ +export const DetachAudioMixedProcessor = raylibLibrary.bind("DetachAudioMixedProcessor", { args: ["pointer"], returns: "void" }); + +export const MOUSE_LEFT_BUTTON = MOUSE_BUTTON_LEFT; +export const MOUSE_RIGHT_BUTTON = MOUSE_BUTTON_RIGHT; +export const MOUSE_MIDDLE_BUTTON = MOUSE_BUTTON_MIDDLE; +export const MATERIAL_MAP_DIFFUSE = MATERIAL_MAP_ALBEDO; +export const MATERIAL_MAP_SPECULAR = MATERIAL_MAP_METALNESS; +export const SHADER_LOC_MAP_DIFFUSE = SHADER_LOC_MAP_ALBEDO; +export const SHADER_LOC_MAP_SPECULAR = SHADER_LOC_MAP_METALNESS; +/** Compatibility hack for previous raylib versions */ +export const GetMouseRay = GetScreenToWorldRay; diff --git a/examples/assets/raybunny.png b/examples/assets/raybunny.png new file mode 100644 index 0000000..b608147 Binary files /dev/null and b/examples/assets/raybunny.png differ diff --git a/examples/basic-input.ts b/examples/basic-input.ts new file mode 100644 index 0000000..74f6554 --- /dev/null +++ b/examples/basic-input.ts @@ -0,0 +1,64 @@ +import { + BLACK, + BLUE, + BeginDrawing, + ClearBackground, + CloseWindow, + DrawFPS, + DrawRectangle, + DrawText, + EndDrawing, + GetFrameTime, + InitWindow, + IsKeyDown, + KEY_A, + KEY_D, + KEY_DOWN, + KEY_LEFT, + KEY_RIGHT, + KEY_S, + KEY_UP, + KEY_W, + RAYWHITE, + SetTargetFPS, + WindowShouldClose, + closeRaylib, +} from "../bindings/raylib.ts"; +import { frameNumbers } from "./lib/frames.ts"; + +const screenWidth: number = 960; +const screenHeight: number = 540; +const size: number = 48; +const speed: number = 260; +let x: number = screenWidth / 2 - size / 2; +let y: number = screenHeight / 2 - size / 2; +const maximumFrames: number = + typeof globalThis.RAYLIB_EXAMPLE_MAX_FRAMES === "number" + ? globalThis.RAYLIB_EXAMPLE_MAX_FRAMES + : Infinity; +InitWindow(screenWidth, screenHeight, "GocciaScript + raylib: keyboard input"); +SetTargetFPS(60); + +try { + for (const _frame of frameNumbers(maximumFrames)) { + if (WindowShouldClose()) break; + const delta = GetFrameTime(); + if (IsKeyDown(KEY_W) || IsKeyDown(KEY_UP)) y -= speed * delta; + if (IsKeyDown(KEY_S) || IsKeyDown(KEY_DOWN)) y += speed * delta; + if (IsKeyDown(KEY_A) || IsKeyDown(KEY_LEFT)) x -= speed * delta; + if (IsKeyDown(KEY_D) || IsKeyDown(KEY_RIGHT)) x += speed * delta; + + x = Math.max(0, Math.min(screenWidth - size, x)); + y = Math.max(0, Math.min(screenHeight - size, y)); + + BeginDrawing(); + ClearBackground(BLACK); + DrawText("Move with WASD or the arrow keys", 24, 22, 24, RAYWHITE); + DrawRectangle(Math.floor(x), Math.floor(y), size, size, BLUE); + DrawFPS(screenWidth - 100, 10); + EndDrawing(); + } +} finally { + CloseWindow(); + closeRaylib(); +} diff --git a/examples/basic-window.ts b/examples/basic-window.ts new file mode 100644 index 0000000..b4802f0 --- /dev/null +++ b/examples/basic-window.ts @@ -0,0 +1,36 @@ +import { + BLACK, + CloseWindow, + ClearBackground, + DrawFPS, + DrawText, + EndDrawing, + BeginDrawing, + InitWindow, + RAYWHITE, + SetTargetFPS, + WindowShouldClose, + closeRaylib, +} from "../bindings/raylib.ts"; +import { frameNumbers } from "./lib/frames.ts"; + +const maximumFrames: number = + typeof globalThis.RAYLIB_EXAMPLE_MAX_FRAMES === "number" + ? globalThis.RAYLIB_EXAMPLE_MAX_FRAMES + : Infinity; +InitWindow(960, 540, "GocciaScript + raylib: basic window"); +SetTargetFPS(60); + +try { + for (const _frame of frameNumbers(maximumFrames)) { + if (WindowShouldClose()) break; + BeginDrawing(); + ClearBackground(BLACK); + DrawText("Hello from GocciaScript and raylib 6.0", 180, 245, 28, RAYWHITE); + DrawFPS(12, 12); + EndDrawing(); + } +} finally { + CloseWindow(); + closeRaylib(); +} diff --git a/examples/bunnymark.ts b/examples/bunnymark.ts new file mode 100644 index 0000000..ee22e3b --- /dev/null +++ b/examples/bunnymark.ts @@ -0,0 +1,4 @@ +import bunnyBytes from "./assets/raybunny.png" with { type: "bytes" }; +import { runBunnymark } from "./lib/run-bunnymark.ts"; + +runBunnymark(bunnyBytes, Infinity); diff --git a/examples/doom-clone.ts b/examples/doom-clone.ts new file mode 100644 index 0000000..f05eab6 --- /dev/null +++ b/examples/doom-clone.ts @@ -0,0 +1,396 @@ +import { + BLACK, + BLUE, + BeginDrawing, + ClearBackground, + CloseWindow, + Color, + DARKGRAY, + DrawFPS, + DrawLine, + DrawRectangle, + DrawText, + EndDrawing, + GetFrameTime, + InitWindow, + IsKeyDown, + IsKeyPressed, + KEY_A, + KEY_D, + KEY_DOWN, + KEY_LEFT, + KEY_R, + KEY_RIGHT, + KEY_S, + KEY_SPACE, + KEY_UP, + KEY_W, + MAROON, + RAYWHITE, + RED, + SetTargetFPS, + TakeScreenshot, + WindowShouldClose, + YELLOW, + closeRaylib, +} from "../bindings/raylib.ts"; +import { frameNumbers } from "./lib/frames.ts"; + +type Player = { + x: number; + y: number; + angle: number; + health: number; +}; + +type Enemy = { + x: number; + y: number; + health: number; + alive: boolean; + attackTimer: number; +}; + +const screenWidth: number = 960; +const screenHeight: number = 600; +const rayWidth: number = 2; +const rayCount: number = screenWidth / rayWidth; +const fieldOfView: number = Math.PI / 3; +const moveSpeed: number = 3.1; +const turnSpeed: number = 2.2; +const collisionRadius: number = 0.18; + +const level = [ + "1111111111111111", + "1000000000000001", + "1011100111011101", + "1000100001000001", + "1010101101011101", + "1010001001000001", + "1011101001110101", + "1000000000000101", + "1011011110110101", + "1001000000010001", + "1000011100000001", + "1111111111111111", +]; + +const wallColors = [ + Color.create({ r: 164, g: 39, b: 37, a: 255 }), + Color.create({ r: 148, g: 35, b: 34, a: 255 }), + Color.create({ r: 128, g: 31, b: 30, a: 255 }), + Color.create({ r: 108, g: 27, b: 27, a: 255 }), + Color.create({ r: 88, g: 24, b: 24, a: 255 }), + Color.create({ r: 70, g: 21, b: 21, a: 255 }), +]; +const ceilingColor = Color.create({ r: 28, g: 30, b: 38, a: 255 }); +const floorColor = Color.create({ r: 54, g: 48, b: 42, a: 255 }); +const enemyColor = Color.create({ r: 48, g: 170, b: 62, a: 255 }); +const enemyDark = Color.create({ r: 25, g: 92, b: 35, a: 255 }); +const gunColor = Color.create({ r: 92, g: 96, b: 104, a: 255 }); + +let player: Player = { x: 2.5, y: 1.5, angle: 0, health: 100 }; +let enemies: Enemy[] = []; +let muzzleFrames: number = 0; +const depthBuffer: number[] = []; +const maximumFrames: number = + typeof globalThis.RAYLIB_EXAMPLE_MAX_FRAMES === "number" + ? globalThis.RAYLIB_EXAMPLE_MAX_FRAMES + : Infinity; +const screenshotPath: string = + typeof globalThis.RAYLIB_EXAMPLE_SCREENSHOT === "string" + ? globalThis.RAYLIB_EXAMPLE_SCREENSHOT + : ""; +const resetGame = (): void => { + player = { x: 2.5, y: 1.5, angle: 0, health: 100 }; + enemies = [ + { x: 7.5, y: 1.5, health: 3, alive: true, attackTimer: 0 }, + { x: 12.5, y: 3.5, health: 3, alive: true, attackTimer: 0 }, + { x: 6.5, y: 7.5, health: 3, alive: true, attackTimer: 0 }, + { x: 13.5, y: 9.5, health: 3, alive: true, attackTimer: 0 }, + ]; +}; + +const cellAt = (x: number, y: number): string => { + const mapX = Math.floor(x); + const mapY = Math.floor(y); + if (mapY < 0 || mapY >= level.length) return "1"; + if (mapX < 0 || mapX >= level[mapY].length) return "1"; + return level[mapY][mapX]; +}; + +const canStand = (x: number, y: number): boolean => { + return ( + cellAt(x - collisionRadius, y - collisionRadius) === "0" && + cellAt(x + collisionRadius, y - collisionRadius) === "0" && + cellAt(x - collisionRadius, y + collisionRadius) === "0" && + cellAt(x + collisionRadius, y + collisionRadius) === "0" + ); +}; + +const normalizeAngle = (angle: number): number => { + const fullTurn = Math.PI * 2; + return ((angle + Math.PI) % fullTurn + fullTurn) % fullTurn - Math.PI; +}; + +const clearLine = ( + x0: number, + y0: number, + x1: number, + y1: number, +): boolean => { + const distance = Math.hypot(x1 - x0, y1 - y0); + const steps = Math.max(1, Math.floor(distance * 12)); + for (const offset of frameNumbers(steps - 1)) { + const step = offset + 1; + const amount = step / steps; + if (cellAt(x0 + (x1 - x0) * amount, y0 + (y1 - y0) * amount) !== "0") { + return false; + } + } + return true; +}; + +const movePlayer = (amount: number): void => { + const nextX = player.x + Math.cos(player.angle) * amount; + const nextY = player.y + Math.sin(player.angle) * amount; + if (canStand(nextX, player.y)) player.x = nextX; + if (canStand(player.x, nextY)) player.y = nextY; +}; + +const strafePlayer = (amount: number): void => { + const nextX = player.x + Math.cos(player.angle + Math.PI / 2) * amount; + const nextY = player.y + Math.sin(player.angle + Math.PI / 2) * amount; + if (canStand(nextX, player.y)) player.x = nextX; + if (canStand(player.x, nextY)) player.y = nextY; +}; + +const shoot = (): void => { + let target: Enemy | null = null; + let targetDistance = Infinity; + for (const enemy of enemies) { + if (!enemy.alive) continue; + const dx = enemy.x - player.x; + const dy = enemy.y - player.y; + const distance = Math.hypot(dx, dy); + const angle = Math.abs(normalizeAngle(Math.atan2(dy, dx) - player.angle)); + if ( + angle < 0.075 && + distance < targetDistance && + clearLine(player.x, player.y, enemy.x, enemy.y) + ) { + target = enemy; + targetDistance = distance; + } + } + if (target !== null) { + target.health -= 1; + if (target.health <= 0) target.alive = false; + } + muzzleFrames = 5; +}; + +const updateEnemies = (delta: number): void => { + for (const enemy of enemies) { + if (!enemy.alive) continue; + const dx = player.x - enemy.x; + const dy = player.y - enemy.y; + const distance = Math.hypot(dx, dy); + enemy.attackTimer -= delta; + if ( + distance < 0.72 && + clearLine(enemy.x, enemy.y, player.x, player.y) && + enemy.attackTimer <= 0 + ) { + player.health = Math.max(0, player.health - 8); + enemy.attackTimer = 0.65; + } else if ( + distance < 7 && + distance > 0.8 && + clearLine(enemy.x, enemy.y, player.x, player.y) + ) { + const speed = delta * 0.7; + const nextX = enemy.x + (dx / distance) * speed; + const nextY = enemy.y + (dy / distance) * speed; + if (cellAt(nextX, enemy.y) === "0") enemy.x = nextX; + if (cellAt(enemy.x, nextY) === "0") enemy.y = nextY; + } + } +}; + +const castScene = (): void => { + DrawRectangle(0, 0, screenWidth, screenHeight / 2, ceilingColor); + DrawRectangle(0, screenHeight / 2, screenWidth, screenHeight / 2, floorColor); + + for (const ray of frameNumbers(rayCount)) { + const camera = (2 * ray) / rayCount - 1; + const rayAngle = player.angle + Math.atan(camera * Math.tan(fieldOfView / 2)); + const rayX = Math.cos(rayAngle); + const rayY = Math.sin(rayAngle); + let mapX = Math.floor(player.x); + let mapY = Math.floor(player.y); + const deltaX = Math.abs(1 / rayX); + const deltaY = Math.abs(1 / rayY); + const stepX = rayX < 0 ? -1 : 1; + const stepY = rayY < 0 ? -1 : 1; + let sideX = + rayX < 0 ? (player.x - mapX) * deltaX : (mapX + 1 - player.x) * deltaX; + let sideY = + rayY < 0 ? (player.y - mapY) * deltaY : (mapY + 1 - player.y) * deltaY; + let side = 0; + + const maximumRaySteps = level.length * level[0].length; + for (const _step of frameNumbers(maximumRaySteps)) { + if (cellAt(mapX, mapY) !== "0") break; + if (sideX < sideY) { + sideX += deltaX; + mapX += stepX; + side = 0; + } else { + sideY += deltaY; + mapY += stepY; + side = 1; + } + } + + let distance; + if (side === 0) { + distance = (mapX - player.x + (1 - stepX) / 2) / rayX; + } else { + distance = (mapY - player.y + (1 - stepY) / 2) / rayY; + } + distance = Math.max(0.05, distance); + depthBuffer[ray] = distance; + const wallHeight = Math.min( + screenHeight, + Math.floor(screenHeight / distance), + ); + const wallTop = Math.floor((screenHeight - wallHeight) / 2); + const shade = Math.min( + wallColors.length - 1, + Math.floor(distance / 1.8) + side, + ); + DrawRectangle(ray * rayWidth, wallTop, rayWidth + 1, wallHeight, wallColors[shade]); + } +}; + +const drawEnemies = (): void => { + for (const enemy of enemies) { + if (!enemy.alive) continue; + const dx = enemy.x - player.x; + const dy = enemy.y - player.y; + const distance = Math.hypot(dx, dy); + const relative = normalizeAngle(Math.atan2(dy, dx) - player.angle); + if (Math.abs(relative) >= fieldOfView / 1.7) continue; + const screenX = Math.floor( + screenWidth / 2 + Math.tan(relative) * (screenWidth / 2) / Math.tan(fieldOfView / 2), + ); + const rayIndex = Math.max( + 0, + Math.min(rayCount - 1, Math.floor(screenX / rayWidth)), + ); + if (distance >= depthBuffer[rayIndex]) continue; + + const size = Math.min(screenHeight, Math.floor(screenHeight / distance)); + const left = Math.floor(screenX - size / 4); + const top = Math.floor(screenHeight / 2 - size / 2); + DrawRectangle(left, top + Math.floor(size * 0.24), Math.floor(size / 2), Math.floor(size * 0.7), enemyColor); + DrawRectangle(left + Math.floor(size * 0.1), top, Math.floor(size * 0.3), Math.floor(size * 0.32), enemyDark); + DrawRectangle(left + Math.floor(size * 0.15), top + Math.floor(size * 0.1), Math.max(2, Math.floor(size * 0.05)), Math.max(2, Math.floor(size * 0.05)), RED); + DrawRectangle(left + Math.floor(size * 0.3), top + Math.floor(size * 0.1), Math.max(2, Math.floor(size * 0.05)), Math.max(2, Math.floor(size * 0.05)), RED); + } +}; + +const drawWeapon = (): void => { + const gunWidth = 150; + const left = screenWidth / 2 - gunWidth / 2; + DrawRectangle(left, screenHeight - 105, gunWidth, 105, gunColor); + DrawRectangle(left + 48, screenHeight - 145, 54, 65, DARKGRAY); + if (muzzleFrames > 0) { + DrawRectangle(screenWidth / 2 - 16, screenHeight - 180, 32, 40, YELLOW); + muzzleFrames -= 1; + } + DrawRectangle(screenWidth / 2 - 8, screenHeight / 2, 16, 2, RAYWHITE); + DrawRectangle(screenWidth / 2, screenHeight / 2 - 8, 2, 16, RAYWHITE); +}; + +const drawMinimap = (): void => { + const cellSize = 8; + const originX = 12; + const originY = 48; + for (const [y, row] of level.entries()) { + for (const [x, cell] of row.split("").entries()) { + if (cell === "1") { + DrawRectangle(originX + x * cellSize, originY + y * cellSize, cellSize, cellSize, MAROON); + } + } + } + for (const enemy of enemies) { + if (enemy.alive) { + DrawRectangle( + originX + Math.floor(enemy.x * cellSize) - 2, + originY + Math.floor(enemy.y * cellSize) - 2, + 4, + 4, + enemyColor, + ); + } + } + const playerX = originX + Math.floor(player.x * cellSize); + const playerY = originY + Math.floor(player.y * cellSize); + DrawRectangle(playerX - 2, playerY - 2, 5, 5, BLUE); + DrawLine( + playerX, + playerY, + playerX + Math.floor(Math.cos(player.angle) * 10), + playerY + Math.floor(Math.sin(player.angle) * 10), + RAYWHITE, + ); +}; + +resetGame(); +InitWindow(screenWidth, screenHeight, "GocciaScript raycaster: Drop of Doom"); +SetTargetFPS(60); + +try { + for (const renderedFrame of frameNumbers(maximumFrames)) { + if (WindowShouldClose()) break; + const delta = Math.min(GetFrameTime(), 0.05); + if (player.health > 0) { + if (IsKeyDown(KEY_W) || IsKeyDown(KEY_UP)) movePlayer(moveSpeed * delta); + if (IsKeyDown(KEY_S) || IsKeyDown(KEY_DOWN)) movePlayer(-moveSpeed * delta); + if (IsKeyDown(KEY_A)) strafePlayer(-moveSpeed * delta); + if (IsKeyDown(KEY_D)) strafePlayer(moveSpeed * delta); + if (IsKeyDown(KEY_LEFT)) player.angle -= turnSpeed * delta; + if (IsKeyDown(KEY_RIGHT)) player.angle += turnSpeed * delta; + player.angle = normalizeAngle(player.angle); + if (IsKeyPressed(KEY_SPACE)) shoot(); + updateEnemies(delta); + } else if (IsKeyPressed(KEY_R)) { + resetGame(); + } + + BeginDrawing(); + ClearBackground(BLACK); + castScene(); + drawEnemies(); + drawWeapon(); + drawMinimap(); + DrawText("DROP OF DOOM", 12, 12, 24, RAYWHITE); + DrawText("HEALTH " + player.health, screenWidth - 170, 16, 22, player.health > 25 ? RAYWHITE : RED); + DrawText("WASD move arrows turn Space fire", 250, 16, 18, RAYWHITE); + DrawFPS(screenWidth - 100, 48); + if (player.health <= 0) { + DrawRectangle(220, 220, 520, 120, BLACK); + DrawText("YOU DIED", 365, 235, 42, RED); + DrawText("Press R to restart", 365, 292, 22, RAYWHITE); + } + EndDrawing(); + if (screenshotPath.length > 0 && renderedFrame === 1) { + TakeScreenshot(screenshotPath); + } + } +} finally { + CloseWindow(); + closeRaylib(); +} diff --git a/examples/doom-gpl/.gitignore b/examples/doom-gpl/.gitignore new file mode 100644 index 0000000..f845d4a --- /dev/null +++ b/examples/doom-gpl/.gitignore @@ -0,0 +1,4 @@ +/.cache/ +*.dylib +*.so +*.wad diff --git a/examples/doom-gpl/LICENSE b/examples/doom-gpl/LICENSE new file mode 100644 index 0000000..e90dfed --- /dev/null +++ b/examples/doom-gpl/LICENSE @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/examples/doom-gpl/Makefile b/examples/doom-gpl/Makefile new file mode 100644 index 0000000..fc37aa8 --- /dev/null +++ b/examples/doom-gpl/Makefile @@ -0,0 +1,94 @@ +SHELL := /bin/sh + +PROJECT_ROOT := $(abspath ../..) +CACHE_DIR := $(CURDIR)/.cache +UPSTREAM_DIR := $(CACHE_DIR)/tsvm-doom +GENERATED_DIR := $(CACHE_DIR)/goccia-engine +UPSTREAM_REPOSITORY := https://github.com/curioustorvald/tsvm-doom.git +UPSTREAM_COMMIT := ed6b4b2d44314d947fd0d878554d4c029e5617e3 +UPSTREAM_TREE := d053c491e65abfa0c6c8e1c010fd7bfa14210b59 +UPSTREAM_STAMP := $(UPSTREAM_DIR)/.goccia-raylib-pinned +GENERATED_STAMP := $(GENERATED_DIR)/.prepared + +FREEDOOM_VERSION := 0.13.0 +FREEDOOM_ARCHIVE := $(CACHE_DIR)/freedoom-$(FREEDOOM_VERSION).zip +FREEDOOM_URL := https://github.com/freedoom/freedoom/releases/download/v$(FREEDOOM_VERSION)/freedoom-$(FREEDOOM_VERSION).zip +FREEDOOM_SHA256 := 3f9b264f3e3ce503b4fb7f6bdcb1f419d93c7b546f4df3e874dd878db9688f59 +FREEDOOM_WAD := $(CACHE_DIR)/freedoom-$(FREEDOOM_VERSION)/freedoom1.wad +CACHED_IWAD := $(CACHE_DIR)/iwad.wad + +GOCCIA_LOADER ?= GocciaScriptLoader +GOCCIA_CONFIG := examples/doom-gpl/goccia.json + +.PHONY: all clean fetch freedoom prepare run run-freedoom smoke verify-source + +all: prepare + +fetch: $(UPSTREAM_STAMP) + +$(UPSTREAM_STAMP): + mkdir -p "$(CACHE_DIR)" + @if [ ! -d "$(UPSTREAM_DIR)/.git" ]; then \ + git init -q "$(UPSTREAM_DIR)"; \ + git -C "$(UPSTREAM_DIR)" remote add origin "$(UPSTREAM_REPOSITORY)"; \ + git -C "$(UPSTREAM_DIR)" sparse-checkout init --no-cone; \ + git -C "$(UPSTREAM_DIR)" sparse-checkout set '/*.mjs' '/COPYING' '/GPL2' '/README.md'; \ + fi + git -C "$(UPSTREAM_DIR)" fetch --filter=blob:none --depth=1 origin "$(UPSTREAM_COMMIT)" + git -C "$(UPSTREAM_DIR)" checkout --detach --force FETCH_HEAD + @test "$$(git -C "$(UPSTREAM_DIR)" rev-parse HEAD)" = "$(UPSTREAM_COMMIT)" + @test "$$(git -C "$(UPSTREAM_DIR)" rev-parse 'HEAD^{tree}')" = "$(UPSTREAM_TREE)" + @test ! -e "$(UPSTREAM_DIR)/DOOM-SHAREWARE.WAD" + touch "$(UPSTREAM_STAMP)" + +verify-source: fetch + @test "$$(git -C "$(UPSTREAM_DIR)" rev-parse HEAD)" = "$(UPSTREAM_COMMIT)" + @test "$$(git -C "$(UPSTREAM_DIR)" rev-parse 'HEAD^{tree}')" = "$(UPSTREAM_TREE)" + @grep -q "GNU General Public License as published by" "$(UPSTREAM_DIR)/COPYING" + @grep -q "version 2" "$(UPSTREAM_DIR)/COPYING" + @test ! -e "$(UPSTREAM_DIR)/DOOM-SHAREWARE.WAD" + @echo "Pure-JavaScript LinuxDoom source pin and GPL boundary verified." + +$(GENERATED_STAMP): verify-source prepare-port.mjs src/i_input.ts src/i_sound.ts src/i_video.ts + node prepare-port.mjs "$(UPSTREAM_DIR)" "$(GENERATED_DIR)" + touch "$@" + +prepare: $(GENERATED_STAMP) + +$(FREEDOOM_ARCHIVE): + mkdir -p "$(CACHE_DIR)" + curl --fail --location "$(FREEDOOM_URL)" --output "$@" + @echo "$(FREEDOOM_SHA256) $@" | shasum -a 256 -c - + +$(FREEDOOM_WAD): $(FREEDOOM_ARCHIVE) + unzip -oq "$(FREEDOOM_ARCHIVE)" -d "$(CACHE_DIR)" + @test -s "$@" + +freedoom: $(FREEDOOM_WAD) + @echo "Freedoom $(FREEDOOM_VERSION) is available at $(FREEDOOM_WAD)" + +run: prepare + @if [ -z "$(IWAD)" ]; then \ + echo "Set IWAD=/absolute/path/to/doom.wad (or use make run-freedoom)." >&2; \ + exit 2; \ + fi + @test -s "$(IWAD)" + cp "$(IWAD)" "$(CACHED_IWAD)" + cd "$(PROJECT_ROOT)" && "$(GOCCIA_LOADER)" examples/doom-gpl/run.ts --config="$(GOCCIA_CONFIG)" + +run-freedoom: prepare freedoom + cp "$(FREEDOOM_WAD)" "$(CACHED_IWAD)" + cd "$(PROJECT_ROOT)" && "$(GOCCIA_LOADER)" examples/doom-gpl/run.ts --config="$(GOCCIA_CONFIG)" + +smoke: prepare freedoom + cp "$(FREEDOOM_WAD)" "$(CACHED_IWAD)" + cd "$(PROJECT_ROOT)" && "$(GOCCIA_LOADER)" examples/doom-gpl/smoke.ts --config="$(GOCCIA_CONFIG)" + @test -s "$(CACHE_DIR)/doom-goccia-smoke.png" + +clean: + @if [ "$(CACHE_DIR)" = "$(CURDIR)/.cache" ]; then \ + rm -rf "$(CACHE_DIR)"; \ + else \ + echo "Refusing to clean unexpected cache path: $(CACHE_DIR)" >&2; \ + exit 2; \ + fi diff --git a/examples/doom-gpl/NOTICE.md b/examples/doom-gpl/NOTICE.md new file mode 100644 index 0000000..3f69c58 --- /dev/null +++ b/examples/doom-gpl/NOTICE.md @@ -0,0 +1,21 @@ +# Notices + +This directory is a separately licensed GPL-2.0-only subproject. It is not +part of the root MIT npm package. + +The engine modules are adapted from +[curioustorvald/tsvm-doom](https://github.com/curioustorvald/tsvm-doom), pinned +to commit `ed6b4b2d44314d947fd0d878554d4c029e5617e3`. That project is a +JavaScript derivative of id Software's GPL LinuxDoom source. Copyright and +license notices are preserved in the generated runtime modules. + +The build uses a sparse checkout. It deliberately does not fetch or distribute +the upstream repository's DOOM shareware WAD or music pack. + +raylib is loaded dynamically through the separately distributed MIT +GocciaScript bindings and remains under its upstream zlib license. No native +DOOM engine library or WebAssembly module is loaded. + +The optional run and smoke targets download checksummed Freedoom 0.13.0 into +ignored cache storage. Its license and credits remain in that downloaded +archive. diff --git a/examples/doom-gpl/README.md b/examples/doom-gpl/README.md new file mode 100644 index 0000000..9823a6c --- /dev/null +++ b/examples/doom-gpl/README.md @@ -0,0 +1,94 @@ +# DOOM executing in GocciaScript + +This is the meme-accurate example: DOOM's WAD parser, level setup, thinkers, +game logic, AI, fixed-point math, BSP traversal, and 320x200 software renderer +execute as JavaScript/TypeScript inside GocciaScript's bytecode VM. + +There is no native DOOM engine library and no WebAssembly engine. The only +native boundary is the repository's dynamic raylib binding, used for the +window, keyboard polling, one framebuffer upload per frame, and the FPS +overlay. + +The GPL engine seed is the pinned pure-JavaScript LinuxDoom port +[`curioustorvald/tsvm-doom`](https://github.com/curioustorvald/tsvm-doom). +The preparation step converts its custom module exports into static +GocciaScript TypeScript modules and substitutes raylib platform modules. +`UPSTREAM.json` records the exact commit and tree. + +## License boundary + +The root package remains MIT. Everything in this directory is GPL-2.0-only and +is deliberately excluded from the npm package. + +No id Software game data is committed or packaged. Supply a lawfully obtained +IWAD or use the optional checksummed Freedoom download. The sparse upstream +checkout explicitly excludes its bundled shareware WAD and music pack. + +## Launch + +Requirements: + +- GocciaScript 0.10.0 +- raylib 6.0 as a dynamic library +- Node.js, Git, Make, curl, shasum, and unzip + +From the repository root: + +```sh +make -C examples/doom-gpl run-freedoom +``` + +From this directory: + +```sh +make run-freedoom +``` + +With an owned IWAD: + +```sh +make run IWAD=/actual/absolute/path/to/doom.wad +``` + +The Freedoom target downloads version 0.13.0 into ignored `.cache` storage, +verifies its SHA-256 digest, and imports `freedoom1.wad` as immutable bytes. + +Controls: + +- arrows or WASD: move and turn +- Control: fire +- Space: use +- Shift: run +- Alt: strafe modifier +- 1-7: weapons +- Tab: automap + +## Runtime syntax and performance + +The engine uses classic `for`, `while`, and `do...while` loops extensively. +Those compatibility features are enabled only by this subproject's +`goccia.json`; the MIT bindings and smaller examples continue to use the +default syntax. + +On an Apple M1 Max with GocciaScript 0.10.0 bytecode, the first working +320x200 build renders Freedoom E1M1 at roughly 3 FPS. This is a real engine +port, but it is not yet a real-time port. Stable 0.10.0 spends most of its time +in the software renderer and indexed-to-RGBA pixel loops. + +Audio, menus, save files, and full Doom II parity are not wired into this first +GocciaScript host. The imported engine surface is strongest for single-player +Doom 1. + +## Validation + +```sh +make verify-source +make prepare +make smoke +``` + +`make smoke` runs deterministic engine frames against cached Freedoom data and +writes `.cache/doom-goccia-smoke.png`. The current upstream port claims vanilla +demo synchronization, but its published repository does not contain the +claimed test corpus or reference goldens; this project therefore does not +repeat that fidelity claim without adding its own oracle tests. diff --git a/examples/doom-gpl/UPSTREAM.json b/examples/doom-gpl/UPSTREAM.json new file mode 100644 index 0000000..e242fdf --- /dev/null +++ b/examples/doom-gpl/UPSTREAM.json @@ -0,0 +1,13 @@ +{ + "engine": { + "repository": "https://github.com/curioustorvald/tsvm-doom.git", + "commit": "ed6b4b2d44314d947fd0d878554d4c029e5617e3", + "tree": "d053c491e65abfa0c6c8e1c010fd7bfa14210b59", + "license": "GPL-2.0-only" + }, + "freedoom": { + "version": "0.13.0", + "url": "https://github.com/freedoom/freedoom/releases/download/v0.13.0/freedoom-0.13.0.zip", + "sha256": "3f9b264f3e3ce503b4fb7f6bdcb1f419d93c7b546f4df3e874dd878db9688f59" + } +} diff --git a/examples/doom-gpl/goccia.json b/examples/doom-gpl/goccia.json new file mode 100644 index 0000000..d94520d --- /dev/null +++ b/examples/doom-gpl/goccia.json @@ -0,0 +1,14 @@ +{ + "source-type": "module", + "mode": "bytecode", + "unsafe-ffi": true, + "compat-asi": true, + "compat-function": true, + "compat-traditional-for-loop": true, + "compat-while-loops": true, + "compat-loose-equality": true, + "compat-var": true, + "compat-for-in-loop": true, + "compat-arguments-object": true, + "compat-label": true +} diff --git a/examples/doom-gpl/prepare-port.mjs b/examples/doom-gpl/prepare-port.mjs new file mode 100644 index 0000000..e37bd77 --- /dev/null +++ b/examples/doom-gpl/prepare-port.mjs @@ -0,0 +1,123 @@ +// SPDX-License-Identifier: GPL-2.0-only + +import { mkdir, readFile, rm, writeFile } from "node:fs/promises"; +import path from "node:path"; + +const [, , upstreamDirectory, outputDirectory] = process.argv; + +if (!upstreamDirectory || !outputDirectory) { + throw new Error("Usage: node prepare-port.mjs UPSTREAM_DIR OUTPUT_DIR"); +} + +const moduleNames = [ + "defs", + "tables", + "m_random", + "info", + "sounds", + "w_wad", + "v_video", + "i_video", + "r_data", + "p_setup", + "am_map", + "r_draw", + "r_main", + "r_plane", + "r_bsp", + "r_segs", + "r_things", + "g_game", + "p_tick", + "p_mobj", + "p_maputl", + "p_map", + "p_inter", + "p_movers", + "p_spec", + "p_enemy", + "p_pspr", + "i_input", + "st_stuff", + "hu_stuff", + "wi_stuff", + "f_finale", + "m_menu", + "m_config", + "p_saveg", + "i_sound", + "s_sound", +]; + +const platformModules = new Set(["i_input", "i_sound", "i_video"]); +const generatedHeader = `// Generated from the pinned tsvm-doom source. +// The game logic in this file executes inside GocciaScript. +// SPDX-License-Identifier: GPL-2.0-only + +const _G = globalThis; +if (_G.DOOM === undefined) { + _G.DOOM = { + SCREENWIDTH: 320, + SCREENHEIGHT: 200, + SCREENGAMMA: 0.72, + MOUSE: { + ENABLE: false, + CENTREWIDTH: 0.45, + MAXTURNSPEED: 1800, + TURNGAMMA: 2.5, + HANDFOLLOW: 0.707, + }, + }; +} + +`; + +await rm(outputDirectory, { recursive: true, force: true }); +await mkdir(outputDirectory, { recursive: true }); + +for (const moduleName of moduleNames) { + if (platformModules.has(moduleName)) continue; + + const sourcePath = path.join(upstreamDirectory, `${moduleName}.mjs`); + const destinationPath = path.join(outputDirectory, `${moduleName}.ts`); + const source = await readFile(sourcePath, "utf8"); + const matches = source.match(/^exports = \{/gm) ?? []; + if (matches.length !== 1) { + throw new Error(`${moduleName}.mjs has ${matches.length} export assignments`); + } + + const transformed = source.replace(/^exports = \{/m, "export default {"); + await writeFile(destinationPath, generatedHeader + transformed); +} + +const imports = moduleNames + .map((moduleName) => { + const source = platformModules.has(moduleName) + ? `../../src/${moduleName}.ts` + : `./${moduleName}.ts`; + return `import ${moduleName} from "${source}";`; + }) + .join("\n"); + +const registryEntries = moduleNames + .map((moduleName) => ` ${moduleName},`) + .join("\n"); + +const registry = `// Generated module registry for the GocciaScript DOOM port. +// SPDX-License-Identifier: GPL-2.0-only + +${imports} + +const modules = { +${registryEntries} +}; + +for (const moduleName of Object.keys(modules)) { + modules[moduleName].init(modules); +} + +export default modules; +`; + +await writeFile(path.join(outputDirectory, "registry.ts"), registry); +console.log(`Prepared ${moduleNames.length} GPL DOOM modules for GocciaScript.`); diff --git a/examples/doom-gpl/run.ts b/examples/doom-gpl/run.ts new file mode 100644 index 0000000..935d93b --- /dev/null +++ b/examples/doom-gpl/run.ts @@ -0,0 +1,111 @@ +// SPDX-License-Identifier: GPL-2.0-only + +import engine from "./.cache/goccia-engine/registry.ts"; +import iwad from "./.cache/iwad.wad" with { type: "bytes" }; +import { + TakeScreenshot, + WindowShouldClose, +} from "../../bindings/raylib.ts"; + +const maximumFrames = + typeof globalThis.DOOM_EXAMPLE_MAX_FRAMES === "number" + ? globalThis.DOOM_EXAMPLE_MAX_FRAMES + : Infinity; +const screenshotPath = + typeof globalThis.DOOM_EXAMPLE_SCREENSHOT === "string" + ? globalThis.DOOM_EXAMPLE_SCREENSHOT + : ""; +const screenshotFrame = + typeof globalThis.DOOM_EXAMPLE_SCREENSHOT_FRAME === "number" + ? globalThis.DOOM_EXAMPLE_SCREENSHOT_FRAME + : 30; + +const definitions = engine.defs; +const game = engine.g_game; +const renderer = engine.r_main; +const video = engine.v_video; +const platformVideo = engine.i_video; +const platformInput = engine.i_input; +const statusBar = engine.st_stuff; +const headsUp = engine.hu_stuff; + +engine.w_wad.W_AddFile(iwad); + +const gameMode = (() => { + if (engine.w_wad.W_CheckNumForName("MAP01") >= 0) { + return definitions.GameMode.commercial; + } + if (engine.w_wad.W_CheckNumForName("E4M1") >= 0) { + return definitions.GameMode.retail; + } + if (engine.w_wad.W_CheckNumForName("E2M1") >= 0) { + return definitions.GameMode.registered; + } + return definitions.GameMode.shareware; +})(); + +game.state.gamemode = gameMode; +engine.p_setup.P_SetGameMode(gameMode); +engine.r_data.R_InitData(); +engine.r_draw.bindColormaps(); +engine.r_things.R_InitSpriteDefs(); +renderer.R_InitLightTables(); +renderer.R_InitSkyMap(); +engine.p_spec.P_InitPicAnims(); +engine.p_spec.P_InitSwitchList(); +headsUp.HU_LoadFont(); +renderer.R_ExecuteSetViewSize(10); + +const player = () => game.state.players[game.state.consoleplayer]; +game.setShellHooks({ + amStop: engine.am_map.AM_Stop, + stTicker: statusBar.ST_Ticker, + huTicker: headsUp.HU_Ticker, + sStart: (): void => {}, +}); +engine.p_mobj.setStStart((): void => statusBar.ST_Start(player())); +engine.p_mobj.setHuStart((): void => headsUp.HU_Start(player())); + +platformVideo.I_InitGraphics(); +platformVideo.I_RegisterPlaypal( + engine.w_wad.W_CacheLumpName("PLAYPAL"), +); +platformVideo.I_SetPalette(0); +platformVideo.setTitle("DOOM executing in GocciaScript + dynamic raylib"); + +game.G_InitNew(definitions.Skill.medium, 1, 1); + +let frame = 0; +try { + while (!WindowShouldClose() && frame < maximumFrames) { + platformInput.I_PollKeys(); + let event = platformInput.I_NextEvent(); + while (event !== null) { + if (game.state.gamestate === definitions.GS.LEVEL) { + statusBar.ST_Responder(event); + engine.am_map.AM_Responder(event); + } + event = platformInput.I_NextEvent(); + } + + game.G_Ticker((): void => game.G_BuildTiccmd(player().cmd)); + + if (game.state.automapactive) { + engine.am_map.AM_Drawer(); + } else { + renderer.R_RenderPlayerView(player()); + } + statusBar.ST_Drawer(); + headsUp.HU_Drawer(); + statusBar.ST_doPaletteStuff(); + platformVideo.I_FinishUpdate(); + + if (screenshotPath.length > 0 && frame === screenshotFrame) { + TakeScreenshot(screenshotPath); + } + frame += 1; + if (frame % 10 === 0) Goccia.gc(); + } +} finally { + platformVideo.I_ShutdownGraphics(); +} diff --git a/examples/doom-gpl/smoke.ts b/examples/doom-gpl/smoke.ts new file mode 100644 index 0000000..7853a00 --- /dev/null +++ b/examples/doom-gpl/smoke.ts @@ -0,0 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-only + +globalThis.DOOM_EXAMPLE_MAX_FRAMES = 12; +globalThis.DOOM_EXAMPLE_SCREENSHOT = + "./examples/doom-gpl/.cache/doom-goccia-smoke.png"; +globalThis.DOOM_EXAMPLE_SCREENSHOT_FRAME = 8; + +await import("./run.ts"); +console.log("DOOM game logic executed in GocciaScript"); diff --git a/examples/doom-gpl/src/i_input.ts b/examples/doom-gpl/src/i_input.ts new file mode 100644 index 0000000..7e4411c --- /dev/null +++ b/examples/doom-gpl/src/i_input.ts @@ -0,0 +1,117 @@ +// SPDX-License-Identifier: GPL-2.0-only + +import { + IsKeyDown, + IsKeyPressed, + IsKeyReleased, + KEY_A, + KEY_BACKSPACE, + KEY_D, + KEY_DOWN, + KEY_EIGHT, + KEY_ENTER, + KEY_ESCAPE, + KEY_FIVE, + KEY_FOUR, + KEY_LEFT, + KEY_LEFT_ALT, + KEY_LEFT_CONTROL, + KEY_LEFT_SHIFT, + KEY_NINE, + KEY_ONE, + KEY_RIGHT, + KEY_RIGHT_ALT, + KEY_RIGHT_CONTROL, + KEY_RIGHT_SHIFT, + KEY_S, + KEY_SEVEN, + KEY_SIX, + KEY_SPACE, + KEY_TAB, + KEY_THREE, + KEY_TWO, + KEY_UP, + KEY_W, + KEY_ZERO, +} from "../../../bindings/raylib.ts"; + +let game = null; +let definitions = null; +const eventQueue = []; + +// Preserve tsvm-doom's raw-key indices so its tick-exact input builder remains +// unchanged. Each entry is [raylib key, engine raw key, Doom event key]. +const keyMappings = [ + [KEY_UP, 19, 0xad], + [KEY_DOWN, 20, 0xaf], + [KEY_LEFT, 21, 0xac], + [KEY_RIGHT, 22, 0xae], + [KEY_W, 51, 119], + [KEY_A, 29, 97], + [KEY_S, 47, 115], + [KEY_D, 32, 100], + [KEY_LEFT_CONTROL, 129, 0x80 + 0x1d], + [KEY_RIGHT_CONTROL, 130, 0x80 + 0x1d], + [KEY_LEFT_SHIFT, 59, 0x80 + 0x36], + [KEY_RIGHT_SHIFT, 60, 0x80 + 0x36], + [KEY_LEFT_ALT, 57, 0x80 + 0x38], + [KEY_RIGHT_ALT, 58, 0x80 + 0x38], + [KEY_SPACE, 62, 32], + [KEY_TAB, 61, 9], + [KEY_ENTER, 66, 13], + [KEY_ESCAPE, 111, 27], + [KEY_BACKSPACE, 67, 127], + [KEY_ZERO, 7, 48], + [KEY_ONE, 8, 49], + [KEY_TWO, 9, 50], + [KEY_THREE, 10, 51], + [KEY_FOUR, 11, 52], + [KEY_FIVE, 12, 53], + [KEY_SIX, 13, 54], + [KEY_SEVEN, 14, 55], + [KEY_EIGHT, 15, 56], + [KEY_NINE, 16, 57], +]; + +const I_PollKeys = (): void => { + const gameKeyDown = game.gamekeydown; + for (const [raylibKey, rawKey, doomKey] of keyMappings) { + gameKeyDown[rawKey] = IsKeyDown(raylibKey) ? 1 : 0; + if (IsKeyPressed(raylibKey)) { + eventQueue.push({ + type: definitions.Ev.keydown, + data1: doomKey, + }); + } + if (IsKeyReleased(raylibKey)) { + eventQueue.push({ + type: definitions.Ev.keyup, + data1: doomKey, + }); + } + } +}; + +const I_NextEvent = () => { + return eventQueue.length > 0 ? eventQueue.shift() : null; +}; + +const I_ClearEvents = (): void => { + eventQueue.length = 0; + game.gamekeydown.fill(0); +}; + +const I_AnyKeyDown = (code: number): boolean => { + return game.gamekeydown[code] !== 0; +}; + +export default { + I_PollKeys, + I_NextEvent, + I_ClearEvents, + I_AnyKeyDown, + init: (modules): void => { + game = modules.g_game; + definitions = modules.defs; + }, +}; diff --git a/examples/doom-gpl/src/i_sound.ts b/examples/doom-gpl/src/i_sound.ts new file mode 100644 index 0000000..9ce46e3 --- /dev/null +++ b/examples/doom-gpl/src/i_sound.ts @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: GPL-2.0-only + +const noOperation = (): void => {}; + +export default { + I_InitSound: noOperation, + I_ShutdownSound: noOperation, + I_UpdateSound: noOperation, + I_StartSound: (): number => 0, + I_StopSound: noOperation, + I_SoundIsPlaying: (): boolean => false, + I_UpdateSoundParams: noOperation, + I_SetSfxVolume: noOperation, + I_SetMusicVolume: noOperation, + I_InitMusic: noOperation, + I_PlaySong: noOperation, + I_StopSong: noOperation, + init: (): void => {}, +}; diff --git a/examples/doom-gpl/src/i_video.ts b/examples/doom-gpl/src/i_video.ts new file mode 100644 index 0000000..8d60da6 --- /dev/null +++ b/examples/doom-gpl/src/i_video.ts @@ -0,0 +1,120 @@ +// SPDX-License-Identifier: GPL-2.0-only + +import { + BLACK, + BeginDrawing, + BeginMode2D, + Camera2D, + ClearBackground, + CloseWindow, + DrawFPS, + DrawTexture, + EndDrawing, + EndMode2D, + GenImageColor, + InitWindow, + LoadTextureFromImage, + RAYWHITE, + SetExitKey, + SetTargetFPS, + SetTextureFilter, + SetWindowTitle, + TEXTURE_FILTER_POINT, + UnloadImage, + UnloadTexture, + UpdateTexture, + Vector2, + closeRaylib, +} from "../../../bindings/raylib.ts"; + +const sourceWidth = 320; +const sourceHeight = 200; +const scale = 2; +const rgba = new Uint8Array(sourceWidth * sourceHeight * 4); +const camera = Camera2D.create({ + offset: Vector2.create({ x: 0, y: 0 }), + target: Vector2.create({ x: 0, y: 0 }), + rotation: 0, + zoom: scale, +}); + +let video = null; +let playpal = null; +let paletteIndex = 0; +let image = null; +let texture = null; +let initialized = false; + +const I_InitGraphics = (): void => { + if (initialized) return; + InitWindow( + sourceWidth * scale, + sourceHeight * scale, + "DOOM executing in GocciaScript", + ); + SetExitKey(0); + SetTargetFPS(35); + image = GenImageColor(sourceWidth, sourceHeight, BLACK); + texture = LoadTextureFromImage(image); + UnloadImage(image); + image = null; + SetTextureFilter(texture, TEXTURE_FILTER_POINT); + initialized = true; +}; + +const I_RegisterPlaypal = (paletteBytes: Uint8Array): void => { + playpal = paletteBytes; +}; + +const I_SetPalette = (nextPalette: number): void => { + paletteIndex = nextPalette; +}; + +const I_FinishUpdate = (): void => { + const indexed = video.screens[0]; + const paletteOffset = paletteIndex * 768; + + for (let index = 0; index < indexed.length; index += 1) { + const colourOffset = paletteOffset + indexed[index] * 3; + const pixelOffset = index * 4; + rgba[pixelOffset] = playpal[colourOffset]; + rgba[pixelOffset + 1] = playpal[colourOffset + 1]; + rgba[pixelOffset + 2] = playpal[colourOffset + 2]; + rgba[pixelOffset + 3] = 255; + } + + UpdateTexture(texture, rgba); + BeginDrawing(); + ClearBackground(BLACK); + BeginMode2D(camera); + DrawTexture(texture, 0, 0, RAYWHITE); + EndMode2D(); + DrawFPS(8, 8); + EndDrawing(); +}; + +const I_ShutdownGraphics = (): void => { + if (!initialized) return; + UnloadTexture(texture); + texture = null; + CloseWindow(); + closeRaylib(); + initialized = false; +}; + +const I_RestoreDefaultPalette = (): void => { + paletteIndex = 0; +}; + +export default { + I_InitGraphics, + I_RegisterPlaypal, + I_SetPalette, + I_FinishUpdate, + I_ShutdownGraphics, + I_RestoreDefaultPalette, + setTitle: (title: string): void => SetWindowTitle(title), + init: (modules): void => { + video = modules.v_video; + }, +}; diff --git a/examples/image-loading.ts b/examples/image-loading.ts new file mode 100644 index 0000000..d92cf60 --- /dev/null +++ b/examples/image-loading.ts @@ -0,0 +1,58 @@ +import bunnyBytes from "./assets/raybunny.png" with { type: "bytes" }; +import { + BLACK, + BeginDrawing, + ClearBackground, + CloseWindow, + DrawFPS, + DrawText, + DrawTextureV, + EndDrawing, + InitWindow, + LoadImageFromMemory, + LoadTextureFromImage, + RAYWHITE, + SetTargetFPS, + UnloadImage, + UnloadTexture, + Vector2, + WindowShouldClose, + closeRaylib, +} from "../bindings/raylib.ts"; +import { frameNumbers } from "./lib/frames.ts"; + +const image = LoadImageFromMemory(".png", bunnyBytes, bunnyBytes.length); +if (image.width !== 32 || image.height !== 32) { + throw new Error("The embedded raybunny PNG did not decode as 32x32 RGBA"); +} + +InitWindow(960, 540, "GocciaScript + raylib: ESM byte image"); +const texture = LoadTextureFromImage(image); +UnloadImage(image); +SetTargetFPS(60); +const position = Vector2.create({ x: 464, y: 254 }); +const maximumFrames: number = + typeof globalThis.RAYLIB_EXAMPLE_MAX_FRAMES === "number" + ? globalThis.RAYLIB_EXAMPLE_MAX_FRAMES + : Infinity; +try { + for (const _frame of frameNumbers(maximumFrames)) { + if (WindowShouldClose()) break; + BeginDrawing(); + ClearBackground(BLACK); + DrawText( + 'Loaded with: import image from "./raybunny.png" with { type: "bytes" }', + 90, + 110, + 20, + RAYWHITE, + ); + DrawTextureV(texture, position, RAYWHITE); + DrawFPS(12, 12); + EndDrawing(); + } +} finally { + UnloadTexture(texture); + CloseWindow(); + closeRaylib(); +} diff --git a/examples/lib/frames.ts b/examples/lib/frames.ts new file mode 100644 index 0000000..e7185d5 --- /dev/null +++ b/examples/lib/frames.ts @@ -0,0 +1,17 @@ +export const frameNumbers = (maximum: number) => { + let nextFrame = 0; + + return { + [Symbol.iterator]: () => ({ + next: () => { + if (nextFrame >= maximum) { + return { done: true, value: undefined }; + } + + const value = nextFrame; + nextFrame += 1; + return { done: false, value }; + }, + }), + }; +}; diff --git a/examples/lib/run-bunnymark.ts b/examples/lib/run-bunnymark.ts new file mode 100644 index 0000000..eae735a --- /dev/null +++ b/examples/lib/run-bunnymark.ts @@ -0,0 +1,155 @@ +import { + BLACK, + BeginDrawing, + ClearBackground, + CloseWindow, + Color, + DrawFPS, + DrawText, + DrawTextureV, + EndDrawing, + GetFrameTime, + GetRandomValue, + InitWindow, + IsMouseButtonDown, + IsKeyDown, + KEY_SPACE, + LoadImageFromMemory, + LoadTextureFromImage, + MOUSE_BUTTON_LEFT, + RAYWHITE, + SetTargetFPS, + UnloadImage, + UnloadTexture, + Vector2, + WindowShouldClose, + closeRaylib, +} from "../../bindings/raylib.ts"; +import { frameNumbers } from "./frames.ts"; + +type Bunny = { + position: { x: number; y: number }; + speed: { x: number; y: number }; + color: unknown; +}; + +const screenWidth: number = 1280; +const screenHeight: number = 720; +const maxBunnies: number = 50000; + +const randomColor = () => { + return Color.create({ + r: GetRandomValue(50, 240), + g: GetRandomValue(50, 240), + b: GetRandomValue(50, 240), + a: 255, + }); +}; + +const addBunnies = (bunnies: Bunny[], count: number): void => { + for (const _index of frameNumbers(count)) { + if (bunnies.length >= maxBunnies) break; + bunnies.push({ + position: Vector2.create({ + x: screenWidth / 2, + y: screenHeight / 2, + }), + speed: Vector2.create({ + x: GetRandomValue(-250, 250) / 60, + y: GetRandomValue(-250, 250) / 60, + }), + color: randomColor(), + }); + } +}; + +export const runBunnymark = ( + bunnyBytes: Uint8Array, + maxFrames: number, +): void => { + const startedAt = Date.now(); + const image = LoadImageFromMemory(".png", bunnyBytes, bunnyBytes.length); + if (image.width !== 32 || image.height !== 32) { + throw new Error("raybunny PNG failed to decode"); + } + + InitWindow(screenWidth, screenHeight, "GocciaScript + raylib: Bunnymark"); + const texture = LoadTextureFromImage(image); + UnloadImage(image); + SetTargetFPS(60); + + const bunnies: Bunny[] = []; + addBunnies(bunnies, 1000); + const startupMilliseconds = Date.now() - startedAt; + console.log( + "Bunnymark startup_ms=" + + startupMilliseconds + + " initial_sprites=" + + bunnies.length, + ); + + let framesSinceReport = 0; + let reportStartedAt = Date.now(); + + try { + for (const _frame of frameNumbers(maxFrames)) { + if (WindowShouldClose()) break; + const deltaScale = GetFrameTime() * 60; + if ( + IsMouseButtonDown(MOUSE_BUTTON_LEFT) || + IsKeyDown(KEY_SPACE) + ) { + addBunnies(bunnies, 100); + } + + for (const bunny of bunnies) { + bunny.position.x += bunny.speed.x * deltaScale; + bunny.position.y += bunny.speed.y * deltaScale; + + if ( + bunny.position.x + texture.width / 2 > screenWidth || + bunny.position.x + texture.width / 2 < 0 + ) { + bunny.speed.x *= -1; + } + if ( + bunny.position.y + texture.height / 2 > screenHeight || + bunny.position.y + texture.height / 2 - 40 < 0 + ) { + bunny.speed.y *= -1; + } + } + + BeginDrawing(); + ClearBackground(BLACK); + for (const bunny of bunnies) { + DrawTextureV(texture, bunny.position, bunny.color); + } + DrawText("bunnies: " + bunnies.length, 12, 10, 20, RAYWHITE); + DrawText("hold mouse-left or Space to add 100", 12, 34, 20, RAYWHITE); + DrawFPS(screenWidth - 100, 10); + EndDrawing(); + + framesSinceReport += 1; + const now = Date.now(); + if (now - reportStartedAt >= 5000) { + const measuredFps = + (framesSinceReport * 1000) / (now - reportStartedAt); + console.log( + "Bunnymark frames=" + + framesSinceReport + + " sprites=" + + bunnies.length + + " observed_fps=" + + measuredFps.toFixed(1), + ); + framesSinceReport = 0; + reportStartedAt = now; + } + } + } finally { + UnloadTexture(texture); + CloseWindow(); + closeRaylib(); + } +}; diff --git a/examples/smoke.ts b/examples/smoke.ts new file mode 100644 index 0000000..9486c2c --- /dev/null +++ b/examples/smoke.ts @@ -0,0 +1,5 @@ +import bunnyBytes from "./assets/raybunny.png" with { type: "bytes" }; +import { runBunnymark } from "./lib/run-bunnymark.ts"; + +runBunnymark(bunnyBytes, 3); +console.log("bunnymark startup smoke ok"); diff --git a/goccia.json b/goccia.json new file mode 100644 index 0000000..886149b --- /dev/null +++ b/goccia.json @@ -0,0 +1,5 @@ +{ + "source-type": "module", + "mode": "bytecode", + "unsafe-ffi": true +} diff --git a/metadata/gocciascript.json b/metadata/gocciascript.json new file mode 100644 index 0000000..d7bc310 --- /dev/null +++ b/metadata/gocciascript.json @@ -0,0 +1,10 @@ +{ + "version": "0.10.0", + "commit": "c477011ed305be05b371ff5f54ad0b54de9ac0cc", + "tagObject": "776d31393b625ef24c190c9b7d5fba5bad100a8f", + "release": "https://github.com/frostney/GocciaScript/releases/tag/0.10.0", + "ffi": { + "maxArguments": 8, + "mixedTopLevelF32": false + } +} diff --git a/metadata/raylib.json b/metadata/raylib.json new file mode 100644 index 0000000..f13b4e9 --- /dev/null +++ b/metadata/raylib.json @@ -0,0 +1,21 @@ +{ + "version": "6.0", + "commit": "dbc56a87da87d973a9c5baa4e7438a9d20121d28", + "repository": "https://github.com/raysan5/raylib", + "api": { + "path": "tools/rlparser/output/raylib_api.json", + "blob": "06abbb7f74d1817217b21454ce463ba1b2f1e612", + "sha256": "d4e2dd0727a8edf4d4f828e23f86e3bb74e373861edd0eabef4a634ae74936d6" + }, + "bunny": { + "path": "examples/textures/resources/raybunny.png", + "blob": "b608147bcb6b1a3d8413739d52106eea2ecd565a", + "sha256": "d3e0850e9cae2210a6d3aa7c3f6024907ba79ee1d4ba4ab841666810cf7c2238" + }, + "expectedInventory": { + "functions": 600, + "structs": 35, + "aliases": 6, + "callbacks": 6 + } +} diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..28c9a8d --- /dev/null +++ b/package-lock.json @@ -0,0 +1,33 @@ +{ + "name": "@frostney/gocciascript-raylib", + "version": "0.1.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "@frostney/gocciascript-raylib", + "version": "0.1.0", + "license": "MIT", + "devDependencies": { + "typescript": "5.9.3" + }, + "engines": { + "node": ">=24" + } + }, + "node_modules/typescript": { + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..eaa0674 --- /dev/null +++ b/package.json @@ -0,0 +1,43 @@ +{ + "name": "@frostney/gocciascript-raylib", + "version": "0.1.0", + "description": "Generated raylib 6.0 dynamic-library bindings for GocciaScript 0.10.0", + "type": "module", + "license": "MIT", + "engines": { + "node": ">=24" + }, + "files": [ + "bindings/", + "examples/assets/", + "examples/basic-input.ts", + "examples/basic-window.ts", + "examples/bunnymark.ts", + "examples/doom-clone.ts", + "examples/image-loading.ts", + "examples/lib/", + "examples/smoke.ts", + "metadata/", + "vendor/raylib-6.0.normalized.json", + "goccia.json", + "SKIPPED.md", + "SKIPPED.json", + "README.md", + "LICENSE" + ], + "scripts": { + "vendor:update": "node scripts/fetch-pinned-assets.mjs", + "generate": "node scripts/normalize-api.mjs && node scripts/generate-bindings.mjs && node scripts/generate-abi.mjs", + "check:generated": "node scripts/check-generated.mjs", + "test": "npm run test:goccia:interpreter && npm run test:goccia:bytecode", + "test:goccia:interpreter": "\"${GOCCIA_TEST_RUNNER:-GocciaTestRunner}\" tests/unit", + "test:goccia:bytecode": "\"${GOCCIA_TEST_RUNNER:-GocciaTestRunner}\" tests/unit --mode=bytecode", + "test:types": "tsc --noEmit --strict --skipLibCheck false --lib ES2022 bindings/raylib.d.ts", + "test:abi": "node tests/integration/abi.test.mjs", + "test:ffi": "node tests/integration/ffi.test.mjs", + "pack:check": "node scripts/validate-package.mjs" + }, + "devDependencies": { + "typescript": "5.9.3" + } +} diff --git a/scripts/check-generated.mjs b/scripts/check-generated.mjs new file mode 100644 index 0000000..5fd9d85 --- /dev/null +++ b/scripts/check-generated.mjs @@ -0,0 +1,41 @@ +import { buildNormalizedApi } from "./lib/api.mjs"; +import { + readGeneratedArtifacts, + renderBindingArtifacts, +} from "./lib/bindings.mjs"; +import { readFile } from "node:fs/promises"; +import { fromRoot, stableJson } from "./lib/project.mjs"; +import { renderAbiArtifacts } from "./lib/abi.mjs"; + +const expectedNormalized = stableJson(await buildNormalizedApi()); +const actualNormalized = await readFile( + fromRoot("vendor/raylib-6.0.normalized.json"), + "utf8", +); +if (actualNormalized !== expectedNormalized) { + throw new Error("Normalized IR is stale; run npm run generate"); +} + +const expected = await renderBindingArtifacts(); +const actual = await readGeneratedArtifacts(); +for (const key of Object.keys(actual)) { + if (actual[key] !== expected[key]) { + throw new Error(`${key} is stale; run npm run generate`); + } +} + +const expectedAbi = await renderAbiArtifacts(); +const actualAbi = { + oracleC: await readFile(fromRoot("tests/abi/oracle.c"), "utf8"), + layoutProbeTs: await readFile( + fromRoot("tests/abi/layout-probe.ts"), + "utf8", + ), +}; +for (const key of Object.keys(actualAbi)) { + if (actualAbi[key] !== expectedAbi[key]) { + throw new Error(`${key} is stale; run npm run generate`); + } +} + +console.log("Normalized IR and generated artifacts are deterministic and current."); diff --git a/scripts/fetch-pinned-assets.mjs b/scripts/fetch-pinned-assets.mjs new file mode 100644 index 0000000..4f39344 --- /dev/null +++ b/scripts/fetch-pinned-assets.mjs @@ -0,0 +1,36 @@ +import { mkdir, writeFile } from "node:fs/promises"; +import { fromRoot, readJson, sha256 } from "./lib/project.mjs"; + +const metadata = await readJson(fromRoot("metadata/raylib.json")); +const rawBase = `${metadata.repository}/raw/${metadata.commit}`; + +async function fetchPinned(path, expectedSha256) { + const response = await fetch(`${rawBase}/${path}`); + if (!response.ok) { + throw new Error(`Failed to fetch ${path}: HTTP ${response.status}`); + } + const bytes = Buffer.from(await response.arrayBuffer()); + const actualSha256 = sha256(bytes); + if (actualSha256 !== expectedSha256) { + throw new Error( + `Checksum mismatch for ${path}: expected ${expectedSha256}, got ${actualSha256}`, + ); + } + return bytes; +} + +const [api, bunny] = await Promise.all([ + fetchPinned(metadata.api.path, metadata.api.sha256), + fetchPinned(metadata.bunny.path, metadata.bunny.sha256), +]); + +await Promise.all([ + mkdir(fromRoot("vendor"), { recursive: true }), + mkdir(fromRoot("examples/assets"), { recursive: true }), +]); +await Promise.all([ + writeFile(fromRoot("vendor/raylib-6.0-api.raw.json"), api), + writeFile(fromRoot("examples/assets/raybunny.png"), bunny), +]); + +console.log(`Pinned raylib ${metadata.version} inputs verified and written.`); diff --git a/scripts/generate-abi.mjs b/scripts/generate-abi.mjs new file mode 100644 index 0000000..5f073e7 --- /dev/null +++ b/scripts/generate-abi.mjs @@ -0,0 +1,11 @@ +import { mkdir, writeFile } from "node:fs/promises"; +import { renderAbiArtifacts } from "./lib/abi.mjs"; +import { fromRoot } from "./lib/project.mjs"; + +const artifacts = await renderAbiArtifacts(); +await mkdir(fromRoot("tests/abi"), { recursive: true }); +await Promise.all([ + writeFile(fromRoot("tests/abi/oracle.c"), artifacts.oracleC), + writeFile(fromRoot("tests/abi/layout-probe.ts"), artifacts.layoutProbeTs), +]); +console.log("Generated the 35-struct native ABI oracle and GocciaScript probe."); diff --git a/scripts/generate-bindings.mjs b/scripts/generate-bindings.mjs new file mode 100644 index 0000000..18b68db --- /dev/null +++ b/scripts/generate-bindings.mjs @@ -0,0 +1,17 @@ +import { mkdir, writeFile } from "node:fs/promises"; +import { renderBindingArtifacts } from "./lib/bindings.mjs"; +import { fromRoot } from "./lib/project.mjs"; + +const artifacts = await renderBindingArtifacts(); +await mkdir(fromRoot("bindings"), { recursive: true }); +await Promise.all([ + writeFile(fromRoot("bindings/raylib.ts"), artifacts.raylibTs), + writeFile(fromRoot("bindings/raylib.d.ts"), artifacts.raylibDts), + writeFile(fromRoot("SKIPPED.json"), artifacts.skippedJson), + writeFile(fromRoot("SKIPPED.md"), artifacts.skippedMarkdown), +]); + +console.log( + `Generated ${artifacts.stats.generated} raylib functions; ` + + `skipped ${artifacts.stats.skipped}; post-upstream target ${artifacts.stats.target}.`, +); diff --git a/scripts/lib/abi.mjs b/scripts/lib/abi.mjs new file mode 100644 index 0000000..ab7ea7a --- /dev/null +++ b/scripts/lib/abi.mjs @@ -0,0 +1,177 @@ +import { ffiFieldName, renderBindingArtifacts } from "./bindings.mjs"; + +function cString(value) { + return JSON.stringify(value); +} + +function renderOracle(api, orderedStructs) { + let source = `// Generated from official raylib ${api.source.version}. Do not edit. +#include +#include +#include "raylib.h" + +int main(void) { +`; + for (const struct of orderedStructs) { + source += ` printf("STRUCT\\t${struct.name}\\t%zu\\t%zu\\n", sizeof(${struct.name}), _Alignof(${struct.name}));\n`; + for (const field of struct.fields) { + source += ` printf("FIELD\\t${struct.name}\\t${field.name}\\t%zu\\n", offsetof(${struct.name}, ${field.name}));\n`; + } + } + source += ` return 0; +} +`; + return source; +} + +function probeKind(resolved) { + if (resolved.kind === "array" || resolved.kind === "struct") return "aggregate"; + if (resolved.kind === "pointer") return "pointer"; + if ( + [ + "bool", + "i8", + "u8", + "i16", + "u16", + "i32", + "u32", + "i64", + "u64", + "f32", + "f64", + ].includes(resolved.kind) + ) { + return resolved.kind; + } + throw new Error(`Cannot probe ABI offset for ${resolved.kind}`); +} + +function renderProbe(api, orderedStructs, resolveType) { + const names = orderedStructs.map((struct) => struct.name); + let source = `// Generated ABI probe for raylib ${api.source.version} bindings. +import { + ${names.join(",\n ")}, + raylibLibrary, +} from "../../bindings/raylib.ts"; + +const bytesFor = (kind: string) => { + let buffer; + let value; + if (kind === "bool") { + return { value: true, bytes: new Uint8Array([1]) }; + } + if (kind === "i8") { + buffer = new ArrayBuffer(1); + value = -37; + new Int8Array(buffer)[0] = value; + } else if (kind === "u8") { + buffer = new ArrayBuffer(1); + value = 173; + new Uint8Array(buffer)[0] = value; + } else if (kind === "i16") { + buffer = new ArrayBuffer(2); + value = 12345; + new Int16Array(buffer)[0] = value; + } else if (kind === "u16") { + buffer = new ArrayBuffer(2); + value = 45678; + new Uint16Array(buffer)[0] = value; + } else if (kind === "i32") { + buffer = new ArrayBuffer(4); + value = 305419896; + new Int32Array(buffer)[0] = value; + } else if (kind === "u32") { + buffer = new ArrayBuffer(4); + value = 2309737967; + new Uint32Array(buffer)[0] = value; + } else if (kind === "i64" || kind === "u64") { + buffer = new ArrayBuffer(8); + value = 12345; + const bytes = new Uint8Array(buffer); + bytes[0] = 57; + bytes[1] = 48; + } else if (kind === "f32") { + buffer = new ArrayBuffer(4); + value = 123.25; + new Float32Array(buffer)[0] = value; + } else if (kind === "f64") { + buffer = new ArrayBuffer(8); + value = 9876.5; + new Float64Array(buffer)[0] = value; + } else { + throw new TypeError("Unknown scalar probe kind: " + kind); + } + return { value, bytes: new Uint8Array(buffer) }; +}; + +const pointerBytes = (pointer) => { + const bytes = new Uint8Array(8); + let address = pointer.address; + for (const [i] of bytes.entries()) { + bytes[i] = address % 256; + address = Math.floor(address / 256); + } + return bytes; +}; + +const findBytes = (haystack, needle) => { + const starts = Array.from( + { length: haystack.length - needle.length + 1 }, + (_unused, start) => start, + ); + for (const start of starts) { + let matches = true; + for (const [index] of needle.entries()) { + if (haystack[start + index] !== needle[index]) { + matches = false; + break; + } + } + if (matches) return start; + } + throw new Error("Unable to locate field sentinel bytes"); +}; + +const probePointer = raylibLibrary.symbol("InitWindow"); + +const fieldOffset = (Type, field, kind) => { + const value = Type.create(); + if (kind === "aggregate") return value[field].byteOffset; + if (kind === "pointer") { + value[field] = probePointer; + const width = Type.size > 4 ? 8 : 4; + return findBytes( + new Uint8Array(value.buffer), + pointerBytes(probePointer).subarray(0, width), + ); + } + const probe = bytesFor(kind); + value[field] = probe.value; + return findBytes(new Uint8Array(value.buffer), probe.bytes); +}; + +`; + + for (const struct of orderedStructs) { + source += `console.log("STRUCT\\t${struct.name}\\t" + ${struct.name}.size + "\\t" + ${struct.name}.alignment);\n`; + for (const field of struct.fields) { + const resolved = resolveType(field.type, "field"); + source += `console.log("FIELD\\t${struct.name}\\t${field.name}\\t" + fieldOffset(${struct.name}, ${cString(ffiFieldName(field.name))}, ${cString(probeKind(resolved))}));\n`; + } + } + + return source; +} + +export async function renderAbiArtifacts() { + const artifacts = await renderBindingArtifacts(); + return { + oracleC: renderOracle(artifacts.api, artifacts.orderedStructs), + layoutProbeTs: renderProbe( + artifacts.api, + artifacts.orderedStructs, + artifacts.resolveType, + ), + }; +} diff --git a/scripts/lib/api-core.ts b/scripts/lib/api-core.ts new file mode 100644 index 0000000..6d88c0e --- /dev/null +++ b/scripts/lib/api-core.ts @@ -0,0 +1,153 @@ +const malformedDescription: string = + 'some filters available: "*.*", "FILES*", "DIRS*"'; +const repairedDescription: string = + 'some filters available: \\"*.*\\", \\"FILES*\\", \\"DIRS*\\"'; + +const countOccurrences = (value: string, needle: string): number => + value.split(needle).length - 1; + +const normalizeAlias = (alias) => { + const pointerDepth = alias.name.startsWith("*") ? 1 : 0; + return { + name: pointerDepth ? alias.name.slice(1) : alias.name, + type: alias.type, + pointerDepth, + description: alias.description ?? "", + }; +}; + +const normalizeParams = (params = []) => + params.map(({ name, type, description = "" }) => ({ + name, + type, + description, + })); + +const assertUnique = (items, label: string): void => { + const seen = new Set(); + for (const item of items) { + if (seen.has(item.name)) { + throw new Error(`Duplicate ${label} name: ${item.name}`); + } + seen.add(item.name); + } +}; + +export const repairOfficialJson = (raw: string): string => { + const repairCount = countOccurrences(raw, malformedDescription); + if (repairCount !== 1) { + throw new Error( + `Expected exactly one LoadDirectoryFilesEx repair site, found ${repairCount}`, + ); + } + return raw.replace(malformedDescription, repairedDescription); +}; + +export const normalizeApiDocument = ( + parsed, + metadata, + sourceSha256: string, +) => { + const normalized = { + schemaVersion: 1, + source: { + repository: metadata.repository, + version: metadata.version, + commit: metadata.commit, + path: metadata.api.path, + blob: metadata.api.blob, + sha256: sourceSha256, + repairs: [ + { + function: "LoadDirectoryFilesEx", + field: "description", + reason: "Escape three unescaped quoted glob examples", + count: 1, + }, + ], + }, + inventory: { + defines: parsed.defines.length, + structs: parsed.structs.length, + aliases: parsed.aliases.length, + enums: parsed.enums.length, + callbacks: parsed.callbacks.length, + functions: parsed.functions.length, + }, + defines: parsed.defines.map( + ({ name, type, value, description = "" }) => ({ + name, + type, + value, + description, + }), + ), + structs: parsed.structs.map( + ({ name, description = "", fields = [] }) => ({ + name, + description, + fields: fields.map( + ({ + name: fieldName, + type, + description: fieldDescription = "", + }) => ({ + name: fieldName, + type, + description: fieldDescription, + }), + ), + }), + ), + aliases: parsed.aliases.map(normalizeAlias), + enums: parsed.enums.map( + ({ name, description = "", values = [] }) => ({ + name, + description, + values: values.map( + ({ + name: valueName, + value, + description: valueDescription = "", + }) => ({ + name: valueName, + value, + description: valueDescription, + }), + ), + }), + ), + callbacks: parsed.callbacks.map( + ({ name, description = "", returnType, params = [] }) => ({ + name, + description, + returnType, + params: normalizeParams(params), + }), + ), + functions: parsed.functions.map( + ({ name, description = "", returnType, params = [] }) => ({ + name, + description, + returnType, + params: normalizeParams(params), + }), + ), + }; + + for (const [key, expected] of Object.entries(metadata.expectedInventory)) { + if (normalized.inventory[key] !== expected) { + throw new Error( + `raylib inventory drift for ${key}: expected ${expected}, got ${normalized.inventory[key]}`, + ); + } + } + + assertUnique(normalized.structs, "struct"); + assertUnique(normalized.aliases, "alias"); + assertUnique(normalized.enums, "enum"); + assertUnique(normalized.callbacks, "callback"); + assertUnique(normalized.functions, "function"); + + return normalized; +}; diff --git a/scripts/lib/api.mjs b/scripts/lib/api.mjs new file mode 100644 index 0000000..af8eb7f --- /dev/null +++ b/scripts/lib/api.mjs @@ -0,0 +1,30 @@ +import { readFile } from "node:fs/promises"; +import { fromRoot, readJson, sha256 } from "./project.mjs"; +import { + normalizeApiDocument, + repairOfficialJson, +} from "./api-core.ts"; + +export { + normalizeApiDocument, + repairOfficialJson, +} from "./api-core.ts"; + +export const rawApiPath = fromRoot("vendor/raylib-6.0-api.raw.json"); +export const normalizedApiPath = fromRoot("vendor/raylib-6.0.normalized.json"); +export const raylibMetadataPath = fromRoot("metadata/raylib.json"); + +export async function buildNormalizedApi() { + const [metadata, raw] = await Promise.all([ + readJson(raylibMetadataPath), + readFile(rawApiPath, "utf8"), + ]); + const actualSha256 = sha256(raw); + if (actualSha256 !== metadata.api.sha256) { + throw new Error( + `Pinned API checksum mismatch: expected ${metadata.api.sha256}, got ${actualSha256}`, + ); + } + const parsed = JSON.parse(repairOfficialJson(raw)); + return normalizeApiDocument(parsed, metadata, actualSha256); +} diff --git a/scripts/lib/bindings.mjs b/scripts/lib/bindings.mjs new file mode 100644 index 0000000..604e521 --- /dev/null +++ b/scripts/lib/bindings.mjs @@ -0,0 +1,678 @@ +import { readFile } from "node:fs/promises"; +import { fromRoot, readJson, stableJson } from "./project.mjs"; + +const scalarTypes = new Map([ + ["bool", "bool"], + ["char", "i8"], + ["signed char", "i8"], + ["unsigned char", "u8"], + ["short", "i16"], + ["short int", "i16"], + ["signed short", "i16"], + ["unsigned short", "u16"], + ["unsigned short int", "u16"], + ["int", "i32"], + ["signed int", "i32"], + ["unsigned", "u32"], + ["unsigned int", "u32"], + ["long", "i64"], + ["long int", "i64"], + ["unsigned long", "u64"], + ["unsigned long int", "u64"], + ["long long", "i64"], + ["long long int", "i64"], + ["unsigned long long", "u64"], + ["unsigned long long int", "u64"], + ["float", "f32"], + ["double", "f64"], + ["void", "void"], +]); + +const intentionalSkips = new Map([ + ["TraceLog", "varargs"], + ["TextFormat", "varargs"], + ["DrawBillboardPro", "more-than-8-arguments"], +]); + +const nullableStringParameters = new Map([ + ["LoadShader", [0, 1]], + ["LoadShaderFromMemory", [0, 1]], + ["LoadAutomationEventList", [0]], + ["TextReplace", [2]], + ["TextReplaceAlloc", [2]], + ["TextReplaceBetween", [3]], + ["TextReplaceBetweenAlloc", [3]], +]); + +const ownedTextReturns = new Set([ + "LoadFileText", + "EncodeDataBase64", + "LoadUTF8", + "TextReplaceAlloc", + "TextReplaceBetweenAlloc", + "TextInsertAlloc", +]); + +export function ffiFieldName(name) { + if (name === "buffer") return "nativeBuffer"; + if (name === "byteOffset") return "nativeByteOffset"; + return name; +} + +function cleanType(type) { + return type + .trim() + .replace(/\s+/g, " ") + .replace(/\s*\*\s*/g, " *") + .trim(); +} + +function stripConst(type) { + return type.replace(/^const\s+/, "").trim(); +} + +function parseArray(type) { + const match = cleanType(type).match(/^(.*)\[(\d+)\]$/); + return match ? { element: match[1].trim(), length: Number(match[2]) } : null; +} + +function parsePointer(type) { + let remaining = cleanType(type); + let depth = 0; + while (remaining.endsWith("*")) { + depth += 1; + remaining = remaining.slice(0, -1).trim(); + } + return { + base: stripConst(remaining), + depth, + isConst: remaining.startsWith("const "), + }; +} + +const pointerTs = (context) => + context === "argument" ? "FFIPointerInput" : "FFIPointer"; + +function createEnvironment(api) { + return { + structs: new Map(api.structs.map((item) => [item.name, item])), + aliases: new Map(api.aliases.map((item) => [item.name, item])), + enums: new Set(api.enums.map((item) => item.name)), + callbacks: new Set(api.callbacks.map((item) => item.name)), + }; +} + +function resolveType(type, env, context = "argument", stack = []) { + const original = cleanType(type); + const array = parseArray(original); + if (array) { + const element = resolveType(array.element, env, "field", stack); + return { + kind: "array", + descriptor: `FFI.array(${element.descriptor}, ${array.length})`, + ts: `FFIArrayValue<${element.ts}>`, + length: array.length, + element, + }; + } + + const pointer = parsePointer(original); + if (pointer.depth > 0) { + const cString = + pointer.depth === 1 && + pointer.base === "char" && + (pointer.isConst || context === "return") && + context !== "field"; + if (cString) { + return { kind: "utf8string", descriptor: '"utf8string"', ts: "string" }; + } + return { + kind: "pointer", + descriptor: '"pointer"', + ts: pointerTs(context), + }; + } + + const name = pointer.base; + const scalar = scalarTypes.get(name); + if (scalar) { + return { + kind: scalar, + descriptor: `"${scalar}"`, + ts: scalar === "bool" ? "boolean" : scalar === "void" ? "void" : "number", + }; + } + + if (env.callbacks.has(name)) { + return { + kind: "pointer", + descriptor: '"pointer"', + ts: pointerTs(context), + }; + } + if (env.enums.has(name)) { + return { kind: "i32", descriptor: '"i32"', ts: "number" }; + } + if (env.structs.has(name)) { + return { kind: "struct", descriptor: name, ts: `${name}Value`, name }; + } + if (env.aliases.has(name)) { + if (stack.includes(name)) { + throw new Error(`Cyclic alias: ${[...stack, name].join(" -> ")}`); + } + const alias = env.aliases.get(name); + if (alias.pointerDepth > 0) { + return { + kind: "pointer", + descriptor: '"pointer"', + ts: pointerTs(context), + }; + } + const resolved = resolveType(alias.type, env, context, [...stack, name]); + return { + ...resolved, + // Use the underlying descriptor at call/layout sites so aliases never + // create a JavaScript declaration-order dependency. + descriptor: resolved.descriptor, + ts: `${name}Value`, + aliasTarget: resolved, + }; + } + if (name === "...") { + throw new Error("varargs are unsupported"); + } + throw new Error(`Unsupported C type: ${type}`); +} + +function structDependencies(struct, env) { + const dependencies = new Set(); + + function visit(type) { + const array = parseArray(type); + if (array) { + visit(array.element); + return; + } + const pointer = parsePointer(type); + if (pointer.depth > 0) return; + const name = pointer.base; + const alias = env.aliases.get(name); + if (alias) { + if (alias.pointerDepth === 0) visit(alias.type); + return; + } + if (env.structs.has(name) && name !== struct.name) dependencies.add(name); + } + + for (const field of struct.fields) visit(field.type); + return dependencies; +} + +function sortStructs(api, env) { + const ordered = []; + const visited = new Set(); + const visiting = new Set(); + + function visit(name) { + if (visited.has(name)) return; + if (visiting.has(name)) throw new Error(`Cyclic by-value struct dependency: ${name}`); + visiting.add(name); + const struct = env.structs.get(name); + for (const dependency of structDependencies(struct, env)) visit(dependency); + visiting.delete(name); + visited.add(name); + ordered.push(struct); + } + + for (const struct of api.structs) visit(struct.name); + return ordered; +} + +function docComment(description) { + return description + ? `/** ${description.replaceAll("*/", "* /")} */\n` + : ""; +} + +function renderRuntimePrelude(raylib, goccia) { + return `// Generated from official raylib ${raylib.version} (${raylib.commit}). +// Do not edit by hand; run npm run generate. + +export const RAYLIB_BINDING_INFO = { + raylibVersion: "${raylib.version}", + raylibCommit: "${raylib.commit}", + gocciaScriptVersion: "${goccia.version}", + linkage: "dynamic", +}; +export const RAYLIB_FIELD_ALIASES = { + AudioStream: { buffer: "nativeBuffer" }, +}; + +const raylibCandidates = (): string[] => { + const suffix = FFI.suffix; + const override = globalThis.RAYLIB_LIBRARY_PATH; + let candidates: string[]; + if (suffix === ".dylib") { + candidates = [ + "./libraylib.dylib", + "/opt/homebrew/lib/libraylib.dylib", + "/usr/local/lib/libraylib.dylib", + "libraylib.dylib", + ]; + } else if (suffix === ".so") { + candidates = [ + "./libraylib.so", + "/usr/local/lib/libraylib.so", + "/usr/lib/libraylib.so", + "/usr/lib/x86_64-linux-gnu/libraylib.so", + "/usr/lib/aarch64-linux-gnu/libraylib.so", + "libraylib.so", + ]; + } else { + candidates = ["./raylib.dll", "raylib.dll"]; + } + if (typeof override === "string" && override.length > 0) { + candidates.unshift(override); + } + return candidates; +}; + +const openRaylib = () => { + const candidates = raylibCandidates(); + let lastError: string = ""; + for (const candidate of candidates) { + try { + return FFI.open(candidate); + } catch (error) { + lastError = String(error); + } + } + throw new TypeError( + "Unable to load the raylib ${raylib.version} dynamic library. Tried: " + + candidates.join(", ") + + ". Last error: " + + lastError, + ); +}; + +export const raylibLibrary = openRaylib(); +export const closeRaylib = (): void => { + if (!raylibLibrary.closed) raylibLibrary.close(); +}; + +`; +} + +function renderDefinitions(api, env, orderedStructs) { + let js = ""; + let dts = `// Generated from official raylib ${api.source.version}. Do not edit. + +export interface FFIPointer { + readonly address: number; + readonly isNull: boolean; +} +/** Structural fallback for GocciaScript's Float16Array on TypeScript lib targets before ES2025. */ +export interface FFIFloat16Array { + readonly buffer: ArrayBufferLike; + readonly byteOffset: number; + readonly byteLength: number; + readonly length: number; + readonly BYTES_PER_ELEMENT: number; + readonly [index: number]: number; +} +export type FFITypedArray = + | Int8Array + | Uint8Array + | Uint8ClampedArray + | Int16Array + | Uint16Array + | Int32Array + | Uint32Array + | FFIFloat16Array + | Float32Array + | Float64Array + | BigInt64Array + | BigUint64Array; +export type FFIPointerInput = + | FFIPointer + | ArrayBuffer + | SharedArrayBuffer + | FFITypedArray + | FFIAggregateValue + | null; +export interface FFIAggregateValue { + readonly buffer: ArrayBuffer; + readonly byteOffset: number; + readonly size: number; +} +export interface FFIArrayValue extends FFIAggregateValue { + readonly length: number; + [index: number]: T; +} +export interface FFIStructDescriptor { + readonly kind: "struct"; + readonly size: number; + readonly alignment: number; + create(initializer?: Partial): T; +} +export interface FFILibrary { + readonly path: string; + readonly closed: boolean; + bind( + name: string, + signature: { args: readonly unknown[]; returns: unknown }, + ): (...args: unknown[]) => unknown; + symbol(name: string): FFIPointer; + close(): void; +} +export declare const RAYLIB_BINDING_INFO: { + raylibVersion: "${api.source.version}"; + raylibCommit: "${api.source.commit}"; + gocciaScriptVersion: string; + linkage: "dynamic"; +}; +export declare const RAYLIB_FIELD_ALIASES: { + AudioStream: { buffer: "nativeBuffer" }; +}; +export declare const raylibLibrary: FFILibrary; +export declare function closeRaylib(): void; + +`; + + for (const struct of orderedStructs) { + const fields = struct.fields.map((field) => { + const resolved = resolveType(field.type, env, "field"); + return { + ...field, + resolved, + }; + }); + js += docComment(struct.description); + js += `export const ${struct.name} = FFI.struct({\n`; + for (const field of fields) { + js += ` ${JSON.stringify(ffiFieldName(field.name))}: ${field.resolved.descriptor},\n`; + } + js += "});\n\n"; + + dts += docComment(struct.description); + dts += `export interface ${struct.name}Value extends FFIAggregateValue {\n`; + for (const field of fields) { + if (ffiFieldName(field.name) !== field.name) { + dts += ` /** Native C field: ${field.name}. */\n`; + } + dts += ` ${JSON.stringify(ffiFieldName(field.name))}: ${field.resolved.ts};\n`; + } + dts += "}\n"; + dts += `export declare const ${struct.name}: FFIStructDescriptor<${struct.name}Value>;\n\n`; + } + + for (const alias of api.aliases) { + if (alias.pointerDepth > 0) { + js += `${docComment(alias.description)}export const ${alias.name} = "pointer";\n\n`; + dts += `${docComment(alias.description)}export type ${alias.name}Value = FFIPointer;\n`; + dts += `export declare const ${alias.name}: "pointer";\n\n`; + } else { + const target = resolveType(alias.type, env, "field"); + js += `${docComment(alias.description)}export const ${alias.name} = ${target.descriptor};\n\n`; + dts += `${docComment(alias.description)}export type ${alias.name}Value = ${target.ts};\n`; + dts += `export declare const ${alias.name}: typeof ${target.descriptor};\n\n`; + } + } + + for (const callback of api.callbacks) { + js += `${docComment(callback.description)}export const ${callback.name} = "pointer";\n\n`; + dts += `${docComment(callback.description)}export type ${callback.name}Value = FFIPointer;\n`; + dts += `export declare const ${callback.name}: "pointer";\n\n`; + } + + for (const enumType of api.enums) { + for (const value of enumType.values) { + js += `${docComment(value.description)}export const ${value.name} = ${JSON.stringify(value.value)};\n`; + dts += `${docComment(value.description)}export declare const ${value.name}: ${JSON.stringify(value.value)};\n`; + } + js += "\n"; + dts += "\n"; + } + + const deferredDefines = []; + for (const define of api.defines) { + if (define.type === "INT" || define.type === "FLOAT" || define.type === "STRING") { + js += `${docComment(define.description)}export const ${define.name} = ${JSON.stringify(define.value)};\n`; + dts += `${docComment(define.description)}export declare const ${define.name}: ${JSON.stringify(define.value)};\n`; + } else if (define.type === "FLOAT_MATH" && define.name === "DEG2RAD") { + js += "export const DEG2RAD = PI / 180.0;\n"; + dts += "export declare const DEG2RAD: number;\n"; + } else if (define.type === "FLOAT_MATH" && define.name === "RAD2DEG") { + js += "export const RAD2DEG = 180.0 / PI;\n"; + dts += "export declare const RAD2DEG: number;\n"; + } else if (define.type === "COLOR") { + const values = [...String(define.value).matchAll(/\d+/g)].map((match) => + Number(match[0]), + ); + if (values.length !== 4) { + throw new Error(`Unable to parse color define ${define.name}`); + } + js += `${docComment(define.description)}export const ${define.name} = Color.create({ r: ${values[0]}, g: ${values[1]}, b: ${values[2]}, a: ${values[3]} });\n`; + dts += `${docComment(define.description)}export declare const ${define.name}: ColorValue;\n`; + } else if ( + define.type === "UNKNOWN" && + /^[A-Za-z_$][A-Za-z0-9_$]*$/.test(define.name) && + /^[A-Za-z_$][A-Za-z0-9_$]*$/.test(String(define.value)) + ) { + deferredDefines.push(define); + } + } + js += "\n"; + dts += "\n"; + + return { js, dts, deferredDefines }; +} + +function classifyFunction(fn, env, goccia) { + if (intentionalSkips.has(fn.name)) { + return { + supported: false, + reason: intentionalSkips.get(fn.name), + category: "intentional-0.1-scope", + }; + } + if (fn.params.length > goccia.ffi.maxArguments) { + return { + supported: false, + reason: "more-than-8-arguments", + category: "stable-runtime-limit", + }; + } + + try { + const args = fn.params.map((param) => resolveType(param.type, env, "argument")); + let returns = resolveType(fn.returnType, env, "return"); + if (ownedTextReturns.has(fn.name)) { + returns = { + kind: "pointer", + descriptor: '"pointer"', + ts: "FFIPointer", + }; + } + const hasF32 = args.some((arg) => arg.kind === "f32"); + const hasOther = args.some((arg) => arg.kind !== "f32"); + if (!goccia.ffi.mixedTopLevelF32 && hasF32 && hasOther) { + return { + supported: false, + reason: "mixed-top-level-f32", + category: "stable-runtime-limit", + args, + returns, + }; + } + return { supported: true, args, returns }; + } catch (error) { + return { + supported: false, + reason: "unsupported-c-type", + category: "generator-limit", + detail: error.message, + }; + } +} + +function renderFunctions(api, env, goccia, deferredDefines) { + let js = ""; + let dts = ""; + const generated = []; + const skipped = []; + + for (const fn of api.functions) { + const classification = classifyFunction(fn, env, goccia); + if (!classification.supported) { + skipped.push({ + name: fn.name, + reason: classification.reason, + category: classification.category, + signature: `${fn.returnType} ${fn.name}(${fn.params.map((param) => param.type).join(", ")})`, + ...(classification.detail ? { detail: classification.detail } : {}), + }); + continue; + } + + generated.push(fn.name); + const args = classification.args.map((arg) => arg.descriptor).join(", "); + js += docComment(fn.description); + js += `export const ${fn.name} = raylibLibrary.bind("${fn.name}", { args: [${args}], returns: ${classification.returns.descriptor} });\n\n`; + + dts += docComment(fn.description); + dts += `export declare function ${fn.name}(${fn.params + .map((param, index) => `${param.name || `arg${index}`}: ${classification.args[index].ts}`) + .join(", ")}): ${classification.returns.ts};\n\n`; + + const nullableParameters = nullableStringParameters.get(fn.name); + if (nullableParameters) { + const rawArgs = classification.args.map((arg, index) => + nullableParameters.includes(index) + ? { descriptor: '"pointer"', ts: "FFIPointerInput" } + : arg, + ); + js += `/** Raw-pointer variant for nullable C string parameters. */\n`; + js += `export const ${fn.name}Raw = raylibLibrary.bind("${fn.name}", { args: [${rawArgs.map((arg) => arg.descriptor).join(", ")}], returns: ${classification.returns.descriptor} });\n\n`; + dts += `/** Raw-pointer variant for nullable C string parameters. */\n`; + dts += `export declare function ${fn.name}Raw(${fn.params + .map((param, index) => `${param.name || `arg${index}`}: ${rawArgs[index].ts}`) + .join(", ")}): ${classification.returns.ts};\n\n`; + } + } + + for (const define of deferredDefines) { + js += `${docComment(define.description)}export const ${define.name} = ${define.value};\n`; + dts += `${docComment(define.description)}export declare const ${define.name}: typeof ${define.value};\n`; + } + + return { js, dts, generated, skipped }; +} + +function renderSkipped(api, goccia, generated, skipped) { + const intentionalCount = skipped.filter( + (item) => item.category === "intentional-0.1-scope", + ).length; + const report = { + schemaVersion: 1, + raylibVersion: api.source.version, + raylibCommit: api.source.commit, + gocciaScriptVersion: goccia.version, + apiFunctions: api.inventory.functions, + callableTargetAfterUpstreamSupport: api.inventory.functions - intentionalCount, + generatedFunctions: generated.length, + skippedFunctions: skipped.length, + skipped, + }; + + const groups = new Map(); + for (const item of skipped) { + const key = `${item.category}:${item.reason}`; + if (!groups.has(key)) groups.set(key, []); + groups.get(key).push(item); + } + + let markdown = `# Skipped raylib functions + +Generated against raylib ${api.source.version} at \`${api.source.commit}\` and +GocciaScript ${goccia.version}. + +- Official API functions: ${report.apiFunctions} +- Generated and callable on the pinned stable runtime: ${report.generatedFunctions} +- Deterministically skipped: ${report.skippedFunctions} +- Target after mixed-top-level-\`f32\` support: ${report.callableTargetAfterUpstreamSupport} + +The report is a compatibility boundary, not a claim that skipped functions are +implemented. Re-run the generator after the upstream FFI restriction is removed. +The three intentional 0.1 exclusions remain out of scope. +`; + + for (const [key, items] of groups) { + const [category, reason] = key.split(":"); + markdown += `\n## ${category}: ${reason} (${items.length})\n\n`; + for (const item of items) { + markdown += `- \`${item.signature}\``; + if (item.detail) markdown += ` — ${item.detail}`; + markdown += "\n"; + } + } + + return { report, markdown }; +} + +export async function renderBindingArtifacts() { + const [api, raylib, goccia] = await Promise.all([ + readJson(fromRoot("vendor/raylib-6.0.normalized.json")), + readJson(fromRoot("metadata/raylib.json")), + readJson(fromRoot("metadata/gocciascript.json")), + ]); + const env = createEnvironment(api); + const orderedStructs = sortStructs(api, env); + const prelude = renderRuntimePrelude(raylib, goccia); + const definitions = renderDefinitions(api, env, orderedStructs); + const functions = renderFunctions( + api, + env, + goccia, + definitions.deferredDefines, + ); + const skipped = renderSkipped( + api, + goccia, + functions.generated, + functions.skipped, + ); + + return { + raylibTs: `${prelude}${definitions.js}${functions.js}`, + raylibDts: `${definitions.dts}${functions.dts}`, + skippedJson: stableJson(skipped.report), + skippedMarkdown: skipped.markdown, + stats: { + generated: functions.generated.length, + skipped: functions.skipped.length, + target: skipped.report.callableTargetAfterUpstreamSupport, + }, + api, + env, + orderedStructs, + resolveType: (type, context) => resolveType(type, env, context), + }; +} + +export async function readGeneratedArtifacts() { + const entries = [ + ["raylibTs", "bindings/raylib.ts"], + ["raylibDts", "bindings/raylib.d.ts"], + ["skippedJson", "SKIPPED.json"], + ["skippedMarkdown", "SKIPPED.md"], + ]; + return Object.fromEntries( + await Promise.all( + entries.map(async ([key, path]) => [ + key, + await readFile(fromRoot(path), "utf8"), + ]), + ), + ); +} diff --git a/scripts/lib/project.mjs b/scripts/lib/project.mjs new file mode 100644 index 0000000..ec6b999 --- /dev/null +++ b/scripts/lib/project.mjs @@ -0,0 +1,22 @@ +import { createHash } from "node:crypto"; +import { readFile } from "node:fs/promises"; +import { dirname, resolve } from "node:path"; +import { fileURLToPath } from "node:url"; + +export const projectRoot = resolve(dirname(fileURLToPath(import.meta.url)), "../.."); + +export function fromRoot(...parts) { + return resolve(projectRoot, ...parts); +} + +export async function readJson(path) { + return JSON.parse(await readFile(path, "utf8")); +} + +export function sha256(value) { + return createHash("sha256").update(value).digest("hex"); +} + +export function stableJson(value) { + return `${JSON.stringify(value, null, 2)}\n`; +} diff --git a/scripts/normalize-api.mjs b/scripts/normalize-api.mjs new file mode 100644 index 0000000..15e307a --- /dev/null +++ b/scripts/normalize-api.mjs @@ -0,0 +1,13 @@ +import { writeFile } from "node:fs/promises"; +import { buildNormalizedApi, normalizedApiPath } from "./lib/api.mjs"; +import { stableJson } from "./lib/project.mjs"; + +const normalized = await buildNormalizedApi(); +await writeFile(normalizedApiPath, stableJson(normalized)); +console.log( + `Normalized raylib ${normalized.source.version}: ` + + `${normalized.inventory.functions} functions, ` + + `${normalized.inventory.structs} structs, ` + + `${normalized.inventory.aliases} aliases, ` + + `${normalized.inventory.callbacks} callbacks.`, +); diff --git a/scripts/validate-package.mjs b/scripts/validate-package.mjs new file mode 100644 index 0000000..ff7feee --- /dev/null +++ b/scripts/validate-package.mjs @@ -0,0 +1,55 @@ +import assert from "node:assert/strict"; +import { spawnSync } from "node:child_process"; +import { fromRoot } from "./lib/project.mjs"; + +const result = spawnSync("npm", ["pack", "--dry-run", "--json"], { + cwd: fromRoot(), + encoding: "utf8", +}); +assert.equal( + result.status, + 0, + `npm package validation failed:\n${result.stdout}\n${result.stderr}`, +); +const [manifest] = JSON.parse(result.stdout); +const files = new Set(manifest.files.map((file) => file.path)); +const expectedFiles = new Set([ + "LICENSE", + "README.md", + "package.json", + "bindings/raylib.ts", + "bindings/raylib.d.ts", + "metadata/raylib.json", + "metadata/gocciascript.json", + "vendor/raylib-6.0.normalized.json", + "goccia.json", + "SKIPPED.md", + "SKIPPED.json", + "examples/assets/raybunny.png", + "examples/basic-window.ts", + "examples/basic-input.ts", + "examples/image-loading.ts", + "examples/bunnymark.ts", + "examples/doom-clone.ts", + "examples/lib/frames.ts", + "examples/lib/run-bunnymark.ts", + "examples/smoke.ts", +]); +for (const required of expectedFiles) { + assert.ok(files.has(required), `Package is missing ${required}`); +} +assert.deepEqual( + [...files].sort(), + [...expectedFiles].sort(), + "npm package contents drifted from the exact MIT allowlist", +); +assert.ok(!files.has("vendor/raylib-6.0-api.raw.json"), "Raw malformed API should not ship"); +assert.ok( + ![...files].some((path) => path.startsWith("examples/doom-gpl/")), + "Separately licensed GPL DOOM sources must not ship in the MIT package", +); +assert.ok( + ![...files].some((path) => path.toLowerCase().endsWith(".wad")), + "IWAD data must never ship in the npm package", +); +console.log(`Package contents validated (${manifest.files.length} files).`); diff --git a/tests/abi/layout-probe.ts b/tests/abi/layout-probe.ts new file mode 100644 index 0000000..2abe21f --- /dev/null +++ b/tests/abi/layout-probe.ts @@ -0,0 +1,338 @@ +// Generated ABI probe for raylib 6.0 bindings. +import { + Vector2, + Vector3, + Vector4, + Matrix, + Color, + Rectangle, + Image, + Texture, + RenderTexture, + NPatchInfo, + GlyphInfo, + Font, + Camera3D, + Camera2D, + Mesh, + Shader, + MaterialMap, + Material, + Transform, + BoneInfo, + ModelSkeleton, + Model, + ModelAnimation, + Ray, + RayCollision, + BoundingBox, + Wave, + AudioStream, + Sound, + Music, + VrDeviceInfo, + VrStereoConfig, + FilePathList, + AutomationEvent, + AutomationEventList, + raylibLibrary, +} from "../../bindings/raylib.ts"; + +const bytesFor = (kind: string) => { + let buffer; + let value; + if (kind === "bool") { + return { value: true, bytes: new Uint8Array([1]) }; + } + if (kind === "i8") { + buffer = new ArrayBuffer(1); + value = -37; + new Int8Array(buffer)[0] = value; + } else if (kind === "u8") { + buffer = new ArrayBuffer(1); + value = 173; + new Uint8Array(buffer)[0] = value; + } else if (kind === "i16") { + buffer = new ArrayBuffer(2); + value = 12345; + new Int16Array(buffer)[0] = value; + } else if (kind === "u16") { + buffer = new ArrayBuffer(2); + value = 45678; + new Uint16Array(buffer)[0] = value; + } else if (kind === "i32") { + buffer = new ArrayBuffer(4); + value = 305419896; + new Int32Array(buffer)[0] = value; + } else if (kind === "u32") { + buffer = new ArrayBuffer(4); + value = 2309737967; + new Uint32Array(buffer)[0] = value; + } else if (kind === "i64" || kind === "u64") { + buffer = new ArrayBuffer(8); + value = 12345; + const bytes = new Uint8Array(buffer); + bytes[0] = 57; + bytes[1] = 48; + } else if (kind === "f32") { + buffer = new ArrayBuffer(4); + value = 123.25; + new Float32Array(buffer)[0] = value; + } else if (kind === "f64") { + buffer = new ArrayBuffer(8); + value = 9876.5; + new Float64Array(buffer)[0] = value; + } else { + throw new TypeError("Unknown scalar probe kind: " + kind); + } + return { value, bytes: new Uint8Array(buffer) }; +}; + +const pointerBytes = (pointer) => { + const bytes = new Uint8Array(8); + let address = pointer.address; + for (const [i] of bytes.entries()) { + bytes[i] = address % 256; + address = Math.floor(address / 256); + } + return bytes; +}; + +const findBytes = (haystack, needle) => { + const starts = Array.from( + { length: haystack.length - needle.length + 1 }, + (_unused, start) => start, + ); + for (const start of starts) { + let matches = true; + for (const [index] of needle.entries()) { + if (haystack[start + index] !== needle[index]) { + matches = false; + break; + } + } + if (matches) return start; + } + throw new Error("Unable to locate field sentinel bytes"); +}; + +const probePointer = raylibLibrary.symbol("InitWindow"); + +const fieldOffset = (Type, field, kind) => { + const value = Type.create(); + if (kind === "aggregate") return value[field].byteOffset; + if (kind === "pointer") { + value[field] = probePointer; + const width = Type.size > 4 ? 8 : 4; + return findBytes( + new Uint8Array(value.buffer), + pointerBytes(probePointer).subarray(0, width), + ); + } + const probe = bytesFor(kind); + value[field] = probe.value; + return findBytes(new Uint8Array(value.buffer), probe.bytes); +}; + +console.log("STRUCT\tVector2\t" + Vector2.size + "\t" + Vector2.alignment); +console.log("FIELD\tVector2\tx\t" + fieldOffset(Vector2, "x", "f32")); +console.log("FIELD\tVector2\ty\t" + fieldOffset(Vector2, "y", "f32")); +console.log("STRUCT\tVector3\t" + Vector3.size + "\t" + Vector3.alignment); +console.log("FIELD\tVector3\tx\t" + fieldOffset(Vector3, "x", "f32")); +console.log("FIELD\tVector3\ty\t" + fieldOffset(Vector3, "y", "f32")); +console.log("FIELD\tVector3\tz\t" + fieldOffset(Vector3, "z", "f32")); +console.log("STRUCT\tVector4\t" + Vector4.size + "\t" + Vector4.alignment); +console.log("FIELD\tVector4\tx\t" + fieldOffset(Vector4, "x", "f32")); +console.log("FIELD\tVector4\ty\t" + fieldOffset(Vector4, "y", "f32")); +console.log("FIELD\tVector4\tz\t" + fieldOffset(Vector4, "z", "f32")); +console.log("FIELD\tVector4\tw\t" + fieldOffset(Vector4, "w", "f32")); +console.log("STRUCT\tMatrix\t" + Matrix.size + "\t" + Matrix.alignment); +console.log("FIELD\tMatrix\tm0\t" + fieldOffset(Matrix, "m0", "f32")); +console.log("FIELD\tMatrix\tm4\t" + fieldOffset(Matrix, "m4", "f32")); +console.log("FIELD\tMatrix\tm8\t" + fieldOffset(Matrix, "m8", "f32")); +console.log("FIELD\tMatrix\tm12\t" + fieldOffset(Matrix, "m12", "f32")); +console.log("FIELD\tMatrix\tm1\t" + fieldOffset(Matrix, "m1", "f32")); +console.log("FIELD\tMatrix\tm5\t" + fieldOffset(Matrix, "m5", "f32")); +console.log("FIELD\tMatrix\tm9\t" + fieldOffset(Matrix, "m9", "f32")); +console.log("FIELD\tMatrix\tm13\t" + fieldOffset(Matrix, "m13", "f32")); +console.log("FIELD\tMatrix\tm2\t" + fieldOffset(Matrix, "m2", "f32")); +console.log("FIELD\tMatrix\tm6\t" + fieldOffset(Matrix, "m6", "f32")); +console.log("FIELD\tMatrix\tm10\t" + fieldOffset(Matrix, "m10", "f32")); +console.log("FIELD\tMatrix\tm14\t" + fieldOffset(Matrix, "m14", "f32")); +console.log("FIELD\tMatrix\tm3\t" + fieldOffset(Matrix, "m3", "f32")); +console.log("FIELD\tMatrix\tm7\t" + fieldOffset(Matrix, "m7", "f32")); +console.log("FIELD\tMatrix\tm11\t" + fieldOffset(Matrix, "m11", "f32")); +console.log("FIELD\tMatrix\tm15\t" + fieldOffset(Matrix, "m15", "f32")); +console.log("STRUCT\tColor\t" + Color.size + "\t" + Color.alignment); +console.log("FIELD\tColor\tr\t" + fieldOffset(Color, "r", "u8")); +console.log("FIELD\tColor\tg\t" + fieldOffset(Color, "g", "u8")); +console.log("FIELD\tColor\tb\t" + fieldOffset(Color, "b", "u8")); +console.log("FIELD\tColor\ta\t" + fieldOffset(Color, "a", "u8")); +console.log("STRUCT\tRectangle\t" + Rectangle.size + "\t" + Rectangle.alignment); +console.log("FIELD\tRectangle\tx\t" + fieldOffset(Rectangle, "x", "f32")); +console.log("FIELD\tRectangle\ty\t" + fieldOffset(Rectangle, "y", "f32")); +console.log("FIELD\tRectangle\twidth\t" + fieldOffset(Rectangle, "width", "f32")); +console.log("FIELD\tRectangle\theight\t" + fieldOffset(Rectangle, "height", "f32")); +console.log("STRUCT\tImage\t" + Image.size + "\t" + Image.alignment); +console.log("FIELD\tImage\tdata\t" + fieldOffset(Image, "data", "pointer")); +console.log("FIELD\tImage\twidth\t" + fieldOffset(Image, "width", "i32")); +console.log("FIELD\tImage\theight\t" + fieldOffset(Image, "height", "i32")); +console.log("FIELD\tImage\tmipmaps\t" + fieldOffset(Image, "mipmaps", "i32")); +console.log("FIELD\tImage\tformat\t" + fieldOffset(Image, "format", "i32")); +console.log("STRUCT\tTexture\t" + Texture.size + "\t" + Texture.alignment); +console.log("FIELD\tTexture\tid\t" + fieldOffset(Texture, "id", "u32")); +console.log("FIELD\tTexture\twidth\t" + fieldOffset(Texture, "width", "i32")); +console.log("FIELD\tTexture\theight\t" + fieldOffset(Texture, "height", "i32")); +console.log("FIELD\tTexture\tmipmaps\t" + fieldOffset(Texture, "mipmaps", "i32")); +console.log("FIELD\tTexture\tformat\t" + fieldOffset(Texture, "format", "i32")); +console.log("STRUCT\tRenderTexture\t" + RenderTexture.size + "\t" + RenderTexture.alignment); +console.log("FIELD\tRenderTexture\tid\t" + fieldOffset(RenderTexture, "id", "u32")); +console.log("FIELD\tRenderTexture\ttexture\t" + fieldOffset(RenderTexture, "texture", "aggregate")); +console.log("FIELD\tRenderTexture\tdepth\t" + fieldOffset(RenderTexture, "depth", "aggregate")); +console.log("STRUCT\tNPatchInfo\t" + NPatchInfo.size + "\t" + NPatchInfo.alignment); +console.log("FIELD\tNPatchInfo\tsource\t" + fieldOffset(NPatchInfo, "source", "aggregate")); +console.log("FIELD\tNPatchInfo\tleft\t" + fieldOffset(NPatchInfo, "left", "i32")); +console.log("FIELD\tNPatchInfo\ttop\t" + fieldOffset(NPatchInfo, "top", "i32")); +console.log("FIELD\tNPatchInfo\tright\t" + fieldOffset(NPatchInfo, "right", "i32")); +console.log("FIELD\tNPatchInfo\tbottom\t" + fieldOffset(NPatchInfo, "bottom", "i32")); +console.log("FIELD\tNPatchInfo\tlayout\t" + fieldOffset(NPatchInfo, "layout", "i32")); +console.log("STRUCT\tGlyphInfo\t" + GlyphInfo.size + "\t" + GlyphInfo.alignment); +console.log("FIELD\tGlyphInfo\tvalue\t" + fieldOffset(GlyphInfo, "value", "i32")); +console.log("FIELD\tGlyphInfo\toffsetX\t" + fieldOffset(GlyphInfo, "offsetX", "i32")); +console.log("FIELD\tGlyphInfo\toffsetY\t" + fieldOffset(GlyphInfo, "offsetY", "i32")); +console.log("FIELD\tGlyphInfo\tadvanceX\t" + fieldOffset(GlyphInfo, "advanceX", "i32")); +console.log("FIELD\tGlyphInfo\timage\t" + fieldOffset(GlyphInfo, "image", "aggregate")); +console.log("STRUCT\tFont\t" + Font.size + "\t" + Font.alignment); +console.log("FIELD\tFont\tbaseSize\t" + fieldOffset(Font, "baseSize", "i32")); +console.log("FIELD\tFont\tglyphCount\t" + fieldOffset(Font, "glyphCount", "i32")); +console.log("FIELD\tFont\tglyphPadding\t" + fieldOffset(Font, "glyphPadding", "i32")); +console.log("FIELD\tFont\ttexture\t" + fieldOffset(Font, "texture", "aggregate")); +console.log("FIELD\tFont\trecs\t" + fieldOffset(Font, "recs", "pointer")); +console.log("FIELD\tFont\tglyphs\t" + fieldOffset(Font, "glyphs", "pointer")); +console.log("STRUCT\tCamera3D\t" + Camera3D.size + "\t" + Camera3D.alignment); +console.log("FIELD\tCamera3D\tposition\t" + fieldOffset(Camera3D, "position", "aggregate")); +console.log("FIELD\tCamera3D\ttarget\t" + fieldOffset(Camera3D, "target", "aggregate")); +console.log("FIELD\tCamera3D\tup\t" + fieldOffset(Camera3D, "up", "aggregate")); +console.log("FIELD\tCamera3D\tfovy\t" + fieldOffset(Camera3D, "fovy", "f32")); +console.log("FIELD\tCamera3D\tprojection\t" + fieldOffset(Camera3D, "projection", "i32")); +console.log("STRUCT\tCamera2D\t" + Camera2D.size + "\t" + Camera2D.alignment); +console.log("FIELD\tCamera2D\toffset\t" + fieldOffset(Camera2D, "offset", "aggregate")); +console.log("FIELD\tCamera2D\ttarget\t" + fieldOffset(Camera2D, "target", "aggregate")); +console.log("FIELD\tCamera2D\trotation\t" + fieldOffset(Camera2D, "rotation", "f32")); +console.log("FIELD\tCamera2D\tzoom\t" + fieldOffset(Camera2D, "zoom", "f32")); +console.log("STRUCT\tMesh\t" + Mesh.size + "\t" + Mesh.alignment); +console.log("FIELD\tMesh\tvertexCount\t" + fieldOffset(Mesh, "vertexCount", "i32")); +console.log("FIELD\tMesh\ttriangleCount\t" + fieldOffset(Mesh, "triangleCount", "i32")); +console.log("FIELD\tMesh\tvertices\t" + fieldOffset(Mesh, "vertices", "pointer")); +console.log("FIELD\tMesh\ttexcoords\t" + fieldOffset(Mesh, "texcoords", "pointer")); +console.log("FIELD\tMesh\ttexcoords2\t" + fieldOffset(Mesh, "texcoords2", "pointer")); +console.log("FIELD\tMesh\tnormals\t" + fieldOffset(Mesh, "normals", "pointer")); +console.log("FIELD\tMesh\ttangents\t" + fieldOffset(Mesh, "tangents", "pointer")); +console.log("FIELD\tMesh\tcolors\t" + fieldOffset(Mesh, "colors", "pointer")); +console.log("FIELD\tMesh\tindices\t" + fieldOffset(Mesh, "indices", "pointer")); +console.log("FIELD\tMesh\tboneCount\t" + fieldOffset(Mesh, "boneCount", "i32")); +console.log("FIELD\tMesh\tboneIndices\t" + fieldOffset(Mesh, "boneIndices", "pointer")); +console.log("FIELD\tMesh\tboneWeights\t" + fieldOffset(Mesh, "boneWeights", "pointer")); +console.log("FIELD\tMesh\tanimVertices\t" + fieldOffset(Mesh, "animVertices", "pointer")); +console.log("FIELD\tMesh\tanimNormals\t" + fieldOffset(Mesh, "animNormals", "pointer")); +console.log("FIELD\tMesh\tvaoId\t" + fieldOffset(Mesh, "vaoId", "u32")); +console.log("FIELD\tMesh\tvboId\t" + fieldOffset(Mesh, "vboId", "pointer")); +console.log("STRUCT\tShader\t" + Shader.size + "\t" + Shader.alignment); +console.log("FIELD\tShader\tid\t" + fieldOffset(Shader, "id", "u32")); +console.log("FIELD\tShader\tlocs\t" + fieldOffset(Shader, "locs", "pointer")); +console.log("STRUCT\tMaterialMap\t" + MaterialMap.size + "\t" + MaterialMap.alignment); +console.log("FIELD\tMaterialMap\ttexture\t" + fieldOffset(MaterialMap, "texture", "aggregate")); +console.log("FIELD\tMaterialMap\tcolor\t" + fieldOffset(MaterialMap, "color", "aggregate")); +console.log("FIELD\tMaterialMap\tvalue\t" + fieldOffset(MaterialMap, "value", "f32")); +console.log("STRUCT\tMaterial\t" + Material.size + "\t" + Material.alignment); +console.log("FIELD\tMaterial\tshader\t" + fieldOffset(Material, "shader", "aggregate")); +console.log("FIELD\tMaterial\tmaps\t" + fieldOffset(Material, "maps", "pointer")); +console.log("FIELD\tMaterial\tparams\t" + fieldOffset(Material, "params", "aggregate")); +console.log("STRUCT\tTransform\t" + Transform.size + "\t" + Transform.alignment); +console.log("FIELD\tTransform\ttranslation\t" + fieldOffset(Transform, "translation", "aggregate")); +console.log("FIELD\tTransform\trotation\t" + fieldOffset(Transform, "rotation", "aggregate")); +console.log("FIELD\tTransform\tscale\t" + fieldOffset(Transform, "scale", "aggregate")); +console.log("STRUCT\tBoneInfo\t" + BoneInfo.size + "\t" + BoneInfo.alignment); +console.log("FIELD\tBoneInfo\tname\t" + fieldOffset(BoneInfo, "name", "aggregate")); +console.log("FIELD\tBoneInfo\tparent\t" + fieldOffset(BoneInfo, "parent", "i32")); +console.log("STRUCT\tModelSkeleton\t" + ModelSkeleton.size + "\t" + ModelSkeleton.alignment); +console.log("FIELD\tModelSkeleton\tboneCount\t" + fieldOffset(ModelSkeleton, "boneCount", "i32")); +console.log("FIELD\tModelSkeleton\tbones\t" + fieldOffset(ModelSkeleton, "bones", "pointer")); +console.log("FIELD\tModelSkeleton\tbindPose\t" + fieldOffset(ModelSkeleton, "bindPose", "pointer")); +console.log("STRUCT\tModel\t" + Model.size + "\t" + Model.alignment); +console.log("FIELD\tModel\ttransform\t" + fieldOffset(Model, "transform", "aggregate")); +console.log("FIELD\tModel\tmeshCount\t" + fieldOffset(Model, "meshCount", "i32")); +console.log("FIELD\tModel\tmaterialCount\t" + fieldOffset(Model, "materialCount", "i32")); +console.log("FIELD\tModel\tmeshes\t" + fieldOffset(Model, "meshes", "pointer")); +console.log("FIELD\tModel\tmaterials\t" + fieldOffset(Model, "materials", "pointer")); +console.log("FIELD\tModel\tmeshMaterial\t" + fieldOffset(Model, "meshMaterial", "pointer")); +console.log("FIELD\tModel\tskeleton\t" + fieldOffset(Model, "skeleton", "aggregate")); +console.log("FIELD\tModel\tcurrentPose\t" + fieldOffset(Model, "currentPose", "pointer")); +console.log("FIELD\tModel\tboneMatrices\t" + fieldOffset(Model, "boneMatrices", "pointer")); +console.log("STRUCT\tModelAnimation\t" + ModelAnimation.size + "\t" + ModelAnimation.alignment); +console.log("FIELD\tModelAnimation\tname\t" + fieldOffset(ModelAnimation, "name", "aggregate")); +console.log("FIELD\tModelAnimation\tboneCount\t" + fieldOffset(ModelAnimation, "boneCount", "i32")); +console.log("FIELD\tModelAnimation\tkeyframeCount\t" + fieldOffset(ModelAnimation, "keyframeCount", "i32")); +console.log("FIELD\tModelAnimation\tkeyframePoses\t" + fieldOffset(ModelAnimation, "keyframePoses", "pointer")); +console.log("STRUCT\tRay\t" + Ray.size + "\t" + Ray.alignment); +console.log("FIELD\tRay\tposition\t" + fieldOffset(Ray, "position", "aggregate")); +console.log("FIELD\tRay\tdirection\t" + fieldOffset(Ray, "direction", "aggregate")); +console.log("STRUCT\tRayCollision\t" + RayCollision.size + "\t" + RayCollision.alignment); +console.log("FIELD\tRayCollision\thit\t" + fieldOffset(RayCollision, "hit", "bool")); +console.log("FIELD\tRayCollision\tdistance\t" + fieldOffset(RayCollision, "distance", "f32")); +console.log("FIELD\tRayCollision\tpoint\t" + fieldOffset(RayCollision, "point", "aggregate")); +console.log("FIELD\tRayCollision\tnormal\t" + fieldOffset(RayCollision, "normal", "aggregate")); +console.log("STRUCT\tBoundingBox\t" + BoundingBox.size + "\t" + BoundingBox.alignment); +console.log("FIELD\tBoundingBox\tmin\t" + fieldOffset(BoundingBox, "min", "aggregate")); +console.log("FIELD\tBoundingBox\tmax\t" + fieldOffset(BoundingBox, "max", "aggregate")); +console.log("STRUCT\tWave\t" + Wave.size + "\t" + Wave.alignment); +console.log("FIELD\tWave\tframeCount\t" + fieldOffset(Wave, "frameCount", "u32")); +console.log("FIELD\tWave\tsampleRate\t" + fieldOffset(Wave, "sampleRate", "u32")); +console.log("FIELD\tWave\tsampleSize\t" + fieldOffset(Wave, "sampleSize", "u32")); +console.log("FIELD\tWave\tchannels\t" + fieldOffset(Wave, "channels", "u32")); +console.log("FIELD\tWave\tdata\t" + fieldOffset(Wave, "data", "pointer")); +console.log("STRUCT\tAudioStream\t" + AudioStream.size + "\t" + AudioStream.alignment); +console.log("FIELD\tAudioStream\tbuffer\t" + fieldOffset(AudioStream, "nativeBuffer", "pointer")); +console.log("FIELD\tAudioStream\tprocessor\t" + fieldOffset(AudioStream, "processor", "pointer")); +console.log("FIELD\tAudioStream\tsampleRate\t" + fieldOffset(AudioStream, "sampleRate", "u32")); +console.log("FIELD\tAudioStream\tsampleSize\t" + fieldOffset(AudioStream, "sampleSize", "u32")); +console.log("FIELD\tAudioStream\tchannels\t" + fieldOffset(AudioStream, "channels", "u32")); +console.log("STRUCT\tSound\t" + Sound.size + "\t" + Sound.alignment); +console.log("FIELD\tSound\tstream\t" + fieldOffset(Sound, "stream", "aggregate")); +console.log("FIELD\tSound\tframeCount\t" + fieldOffset(Sound, "frameCount", "u32")); +console.log("STRUCT\tMusic\t" + Music.size + "\t" + Music.alignment); +console.log("FIELD\tMusic\tstream\t" + fieldOffset(Music, "stream", "aggregate")); +console.log("FIELD\tMusic\tframeCount\t" + fieldOffset(Music, "frameCount", "u32")); +console.log("FIELD\tMusic\tlooping\t" + fieldOffset(Music, "looping", "bool")); +console.log("FIELD\tMusic\tctxType\t" + fieldOffset(Music, "ctxType", "i32")); +console.log("FIELD\tMusic\tctxData\t" + fieldOffset(Music, "ctxData", "pointer")); +console.log("STRUCT\tVrDeviceInfo\t" + VrDeviceInfo.size + "\t" + VrDeviceInfo.alignment); +console.log("FIELD\tVrDeviceInfo\thResolution\t" + fieldOffset(VrDeviceInfo, "hResolution", "i32")); +console.log("FIELD\tVrDeviceInfo\tvResolution\t" + fieldOffset(VrDeviceInfo, "vResolution", "i32")); +console.log("FIELD\tVrDeviceInfo\thScreenSize\t" + fieldOffset(VrDeviceInfo, "hScreenSize", "f32")); +console.log("FIELD\tVrDeviceInfo\tvScreenSize\t" + fieldOffset(VrDeviceInfo, "vScreenSize", "f32")); +console.log("FIELD\tVrDeviceInfo\teyeToScreenDistance\t" + fieldOffset(VrDeviceInfo, "eyeToScreenDistance", "f32")); +console.log("FIELD\tVrDeviceInfo\tlensSeparationDistance\t" + fieldOffset(VrDeviceInfo, "lensSeparationDistance", "f32")); +console.log("FIELD\tVrDeviceInfo\tinterpupillaryDistance\t" + fieldOffset(VrDeviceInfo, "interpupillaryDistance", "f32")); +console.log("FIELD\tVrDeviceInfo\tlensDistortionValues\t" + fieldOffset(VrDeviceInfo, "lensDistortionValues", "aggregate")); +console.log("FIELD\tVrDeviceInfo\tchromaAbCorrection\t" + fieldOffset(VrDeviceInfo, "chromaAbCorrection", "aggregate")); +console.log("STRUCT\tVrStereoConfig\t" + VrStereoConfig.size + "\t" + VrStereoConfig.alignment); +console.log("FIELD\tVrStereoConfig\tprojection\t" + fieldOffset(VrStereoConfig, "projection", "aggregate")); +console.log("FIELD\tVrStereoConfig\tviewOffset\t" + fieldOffset(VrStereoConfig, "viewOffset", "aggregate")); +console.log("FIELD\tVrStereoConfig\tleftLensCenter\t" + fieldOffset(VrStereoConfig, "leftLensCenter", "aggregate")); +console.log("FIELD\tVrStereoConfig\trightLensCenter\t" + fieldOffset(VrStereoConfig, "rightLensCenter", "aggregate")); +console.log("FIELD\tVrStereoConfig\tleftScreenCenter\t" + fieldOffset(VrStereoConfig, "leftScreenCenter", "aggregate")); +console.log("FIELD\tVrStereoConfig\trightScreenCenter\t" + fieldOffset(VrStereoConfig, "rightScreenCenter", "aggregate")); +console.log("FIELD\tVrStereoConfig\tscale\t" + fieldOffset(VrStereoConfig, "scale", "aggregate")); +console.log("FIELD\tVrStereoConfig\tscaleIn\t" + fieldOffset(VrStereoConfig, "scaleIn", "aggregate")); +console.log("STRUCT\tFilePathList\t" + FilePathList.size + "\t" + FilePathList.alignment); +console.log("FIELD\tFilePathList\tcount\t" + fieldOffset(FilePathList, "count", "u32")); +console.log("FIELD\tFilePathList\tpaths\t" + fieldOffset(FilePathList, "paths", "pointer")); +console.log("STRUCT\tAutomationEvent\t" + AutomationEvent.size + "\t" + AutomationEvent.alignment); +console.log("FIELD\tAutomationEvent\tframe\t" + fieldOffset(AutomationEvent, "frame", "u32")); +console.log("FIELD\tAutomationEvent\ttype\t" + fieldOffset(AutomationEvent, "type", "u32")); +console.log("FIELD\tAutomationEvent\tparams\t" + fieldOffset(AutomationEvent, "params", "aggregate")); +console.log("STRUCT\tAutomationEventList\t" + AutomationEventList.size + "\t" + AutomationEventList.alignment); +console.log("FIELD\tAutomationEventList\tcapacity\t" + fieldOffset(AutomationEventList, "capacity", "u32")); +console.log("FIELD\tAutomationEventList\tcount\t" + fieldOffset(AutomationEventList, "count", "u32")); +console.log("FIELD\tAutomationEventList\tevents\t" + fieldOffset(AutomationEventList, "events", "pointer")); diff --git a/tests/abi/oracle.c b/tests/abi/oracle.c new file mode 100644 index 0000000..79103e7 --- /dev/null +++ b/tests/abi/oracle.c @@ -0,0 +1,210 @@ +// Generated from official raylib 6.0. Do not edit. +#include +#include +#include "raylib.h" + +int main(void) { + printf("STRUCT\tVector2\t%zu\t%zu\n", sizeof(Vector2), _Alignof(Vector2)); + printf("FIELD\tVector2\tx\t%zu\n", offsetof(Vector2, x)); + printf("FIELD\tVector2\ty\t%zu\n", offsetof(Vector2, y)); + printf("STRUCT\tVector3\t%zu\t%zu\n", sizeof(Vector3), _Alignof(Vector3)); + printf("FIELD\tVector3\tx\t%zu\n", offsetof(Vector3, x)); + printf("FIELD\tVector3\ty\t%zu\n", offsetof(Vector3, y)); + printf("FIELD\tVector3\tz\t%zu\n", offsetof(Vector3, z)); + printf("STRUCT\tVector4\t%zu\t%zu\n", sizeof(Vector4), _Alignof(Vector4)); + printf("FIELD\tVector4\tx\t%zu\n", offsetof(Vector4, x)); + printf("FIELD\tVector4\ty\t%zu\n", offsetof(Vector4, y)); + printf("FIELD\tVector4\tz\t%zu\n", offsetof(Vector4, z)); + printf("FIELD\tVector4\tw\t%zu\n", offsetof(Vector4, w)); + printf("STRUCT\tMatrix\t%zu\t%zu\n", sizeof(Matrix), _Alignof(Matrix)); + printf("FIELD\tMatrix\tm0\t%zu\n", offsetof(Matrix, m0)); + printf("FIELD\tMatrix\tm4\t%zu\n", offsetof(Matrix, m4)); + printf("FIELD\tMatrix\tm8\t%zu\n", offsetof(Matrix, m8)); + printf("FIELD\tMatrix\tm12\t%zu\n", offsetof(Matrix, m12)); + printf("FIELD\tMatrix\tm1\t%zu\n", offsetof(Matrix, m1)); + printf("FIELD\tMatrix\tm5\t%zu\n", offsetof(Matrix, m5)); + printf("FIELD\tMatrix\tm9\t%zu\n", offsetof(Matrix, m9)); + printf("FIELD\tMatrix\tm13\t%zu\n", offsetof(Matrix, m13)); + printf("FIELD\tMatrix\tm2\t%zu\n", offsetof(Matrix, m2)); + printf("FIELD\tMatrix\tm6\t%zu\n", offsetof(Matrix, m6)); + printf("FIELD\tMatrix\tm10\t%zu\n", offsetof(Matrix, m10)); + printf("FIELD\tMatrix\tm14\t%zu\n", offsetof(Matrix, m14)); + printf("FIELD\tMatrix\tm3\t%zu\n", offsetof(Matrix, m3)); + printf("FIELD\tMatrix\tm7\t%zu\n", offsetof(Matrix, m7)); + printf("FIELD\tMatrix\tm11\t%zu\n", offsetof(Matrix, m11)); + printf("FIELD\tMatrix\tm15\t%zu\n", offsetof(Matrix, m15)); + printf("STRUCT\tColor\t%zu\t%zu\n", sizeof(Color), _Alignof(Color)); + printf("FIELD\tColor\tr\t%zu\n", offsetof(Color, r)); + printf("FIELD\tColor\tg\t%zu\n", offsetof(Color, g)); + printf("FIELD\tColor\tb\t%zu\n", offsetof(Color, b)); + printf("FIELD\tColor\ta\t%zu\n", offsetof(Color, a)); + printf("STRUCT\tRectangle\t%zu\t%zu\n", sizeof(Rectangle), _Alignof(Rectangle)); + printf("FIELD\tRectangle\tx\t%zu\n", offsetof(Rectangle, x)); + printf("FIELD\tRectangle\ty\t%zu\n", offsetof(Rectangle, y)); + printf("FIELD\tRectangle\twidth\t%zu\n", offsetof(Rectangle, width)); + printf("FIELD\tRectangle\theight\t%zu\n", offsetof(Rectangle, height)); + printf("STRUCT\tImage\t%zu\t%zu\n", sizeof(Image), _Alignof(Image)); + printf("FIELD\tImage\tdata\t%zu\n", offsetof(Image, data)); + printf("FIELD\tImage\twidth\t%zu\n", offsetof(Image, width)); + printf("FIELD\tImage\theight\t%zu\n", offsetof(Image, height)); + printf("FIELD\tImage\tmipmaps\t%zu\n", offsetof(Image, mipmaps)); + printf("FIELD\tImage\tformat\t%zu\n", offsetof(Image, format)); + printf("STRUCT\tTexture\t%zu\t%zu\n", sizeof(Texture), _Alignof(Texture)); + printf("FIELD\tTexture\tid\t%zu\n", offsetof(Texture, id)); + printf("FIELD\tTexture\twidth\t%zu\n", offsetof(Texture, width)); + printf("FIELD\tTexture\theight\t%zu\n", offsetof(Texture, height)); + printf("FIELD\tTexture\tmipmaps\t%zu\n", offsetof(Texture, mipmaps)); + printf("FIELD\tTexture\tformat\t%zu\n", offsetof(Texture, format)); + printf("STRUCT\tRenderTexture\t%zu\t%zu\n", sizeof(RenderTexture), _Alignof(RenderTexture)); + printf("FIELD\tRenderTexture\tid\t%zu\n", offsetof(RenderTexture, id)); + printf("FIELD\tRenderTexture\ttexture\t%zu\n", offsetof(RenderTexture, texture)); + printf("FIELD\tRenderTexture\tdepth\t%zu\n", offsetof(RenderTexture, depth)); + printf("STRUCT\tNPatchInfo\t%zu\t%zu\n", sizeof(NPatchInfo), _Alignof(NPatchInfo)); + printf("FIELD\tNPatchInfo\tsource\t%zu\n", offsetof(NPatchInfo, source)); + printf("FIELD\tNPatchInfo\tleft\t%zu\n", offsetof(NPatchInfo, left)); + printf("FIELD\tNPatchInfo\ttop\t%zu\n", offsetof(NPatchInfo, top)); + printf("FIELD\tNPatchInfo\tright\t%zu\n", offsetof(NPatchInfo, right)); + printf("FIELD\tNPatchInfo\tbottom\t%zu\n", offsetof(NPatchInfo, bottom)); + printf("FIELD\tNPatchInfo\tlayout\t%zu\n", offsetof(NPatchInfo, layout)); + printf("STRUCT\tGlyphInfo\t%zu\t%zu\n", sizeof(GlyphInfo), _Alignof(GlyphInfo)); + printf("FIELD\tGlyphInfo\tvalue\t%zu\n", offsetof(GlyphInfo, value)); + printf("FIELD\tGlyphInfo\toffsetX\t%zu\n", offsetof(GlyphInfo, offsetX)); + printf("FIELD\tGlyphInfo\toffsetY\t%zu\n", offsetof(GlyphInfo, offsetY)); + printf("FIELD\tGlyphInfo\tadvanceX\t%zu\n", offsetof(GlyphInfo, advanceX)); + printf("FIELD\tGlyphInfo\timage\t%zu\n", offsetof(GlyphInfo, image)); + printf("STRUCT\tFont\t%zu\t%zu\n", sizeof(Font), _Alignof(Font)); + printf("FIELD\tFont\tbaseSize\t%zu\n", offsetof(Font, baseSize)); + printf("FIELD\tFont\tglyphCount\t%zu\n", offsetof(Font, glyphCount)); + printf("FIELD\tFont\tglyphPadding\t%zu\n", offsetof(Font, glyphPadding)); + printf("FIELD\tFont\ttexture\t%zu\n", offsetof(Font, texture)); + printf("FIELD\tFont\trecs\t%zu\n", offsetof(Font, recs)); + printf("FIELD\tFont\tglyphs\t%zu\n", offsetof(Font, glyphs)); + printf("STRUCT\tCamera3D\t%zu\t%zu\n", sizeof(Camera3D), _Alignof(Camera3D)); + printf("FIELD\tCamera3D\tposition\t%zu\n", offsetof(Camera3D, position)); + printf("FIELD\tCamera3D\ttarget\t%zu\n", offsetof(Camera3D, target)); + printf("FIELD\tCamera3D\tup\t%zu\n", offsetof(Camera3D, up)); + printf("FIELD\tCamera3D\tfovy\t%zu\n", offsetof(Camera3D, fovy)); + printf("FIELD\tCamera3D\tprojection\t%zu\n", offsetof(Camera3D, projection)); + printf("STRUCT\tCamera2D\t%zu\t%zu\n", sizeof(Camera2D), _Alignof(Camera2D)); + printf("FIELD\tCamera2D\toffset\t%zu\n", offsetof(Camera2D, offset)); + printf("FIELD\tCamera2D\ttarget\t%zu\n", offsetof(Camera2D, target)); + printf("FIELD\tCamera2D\trotation\t%zu\n", offsetof(Camera2D, rotation)); + printf("FIELD\tCamera2D\tzoom\t%zu\n", offsetof(Camera2D, zoom)); + printf("STRUCT\tMesh\t%zu\t%zu\n", sizeof(Mesh), _Alignof(Mesh)); + printf("FIELD\tMesh\tvertexCount\t%zu\n", offsetof(Mesh, vertexCount)); + printf("FIELD\tMesh\ttriangleCount\t%zu\n", offsetof(Mesh, triangleCount)); + printf("FIELD\tMesh\tvertices\t%zu\n", offsetof(Mesh, vertices)); + printf("FIELD\tMesh\ttexcoords\t%zu\n", offsetof(Mesh, texcoords)); + printf("FIELD\tMesh\ttexcoords2\t%zu\n", offsetof(Mesh, texcoords2)); + printf("FIELD\tMesh\tnormals\t%zu\n", offsetof(Mesh, normals)); + printf("FIELD\tMesh\ttangents\t%zu\n", offsetof(Mesh, tangents)); + printf("FIELD\tMesh\tcolors\t%zu\n", offsetof(Mesh, colors)); + printf("FIELD\tMesh\tindices\t%zu\n", offsetof(Mesh, indices)); + printf("FIELD\tMesh\tboneCount\t%zu\n", offsetof(Mesh, boneCount)); + printf("FIELD\tMesh\tboneIndices\t%zu\n", offsetof(Mesh, boneIndices)); + printf("FIELD\tMesh\tboneWeights\t%zu\n", offsetof(Mesh, boneWeights)); + printf("FIELD\tMesh\tanimVertices\t%zu\n", offsetof(Mesh, animVertices)); + printf("FIELD\tMesh\tanimNormals\t%zu\n", offsetof(Mesh, animNormals)); + printf("FIELD\tMesh\tvaoId\t%zu\n", offsetof(Mesh, vaoId)); + printf("FIELD\tMesh\tvboId\t%zu\n", offsetof(Mesh, vboId)); + printf("STRUCT\tShader\t%zu\t%zu\n", sizeof(Shader), _Alignof(Shader)); + printf("FIELD\tShader\tid\t%zu\n", offsetof(Shader, id)); + printf("FIELD\tShader\tlocs\t%zu\n", offsetof(Shader, locs)); + printf("STRUCT\tMaterialMap\t%zu\t%zu\n", sizeof(MaterialMap), _Alignof(MaterialMap)); + printf("FIELD\tMaterialMap\ttexture\t%zu\n", offsetof(MaterialMap, texture)); + printf("FIELD\tMaterialMap\tcolor\t%zu\n", offsetof(MaterialMap, color)); + printf("FIELD\tMaterialMap\tvalue\t%zu\n", offsetof(MaterialMap, value)); + printf("STRUCT\tMaterial\t%zu\t%zu\n", sizeof(Material), _Alignof(Material)); + printf("FIELD\tMaterial\tshader\t%zu\n", offsetof(Material, shader)); + printf("FIELD\tMaterial\tmaps\t%zu\n", offsetof(Material, maps)); + printf("FIELD\tMaterial\tparams\t%zu\n", offsetof(Material, params)); + printf("STRUCT\tTransform\t%zu\t%zu\n", sizeof(Transform), _Alignof(Transform)); + printf("FIELD\tTransform\ttranslation\t%zu\n", offsetof(Transform, translation)); + printf("FIELD\tTransform\trotation\t%zu\n", offsetof(Transform, rotation)); + printf("FIELD\tTransform\tscale\t%zu\n", offsetof(Transform, scale)); + printf("STRUCT\tBoneInfo\t%zu\t%zu\n", sizeof(BoneInfo), _Alignof(BoneInfo)); + printf("FIELD\tBoneInfo\tname\t%zu\n", offsetof(BoneInfo, name)); + printf("FIELD\tBoneInfo\tparent\t%zu\n", offsetof(BoneInfo, parent)); + printf("STRUCT\tModelSkeleton\t%zu\t%zu\n", sizeof(ModelSkeleton), _Alignof(ModelSkeleton)); + printf("FIELD\tModelSkeleton\tboneCount\t%zu\n", offsetof(ModelSkeleton, boneCount)); + printf("FIELD\tModelSkeleton\tbones\t%zu\n", offsetof(ModelSkeleton, bones)); + printf("FIELD\tModelSkeleton\tbindPose\t%zu\n", offsetof(ModelSkeleton, bindPose)); + printf("STRUCT\tModel\t%zu\t%zu\n", sizeof(Model), _Alignof(Model)); + printf("FIELD\tModel\ttransform\t%zu\n", offsetof(Model, transform)); + printf("FIELD\tModel\tmeshCount\t%zu\n", offsetof(Model, meshCount)); + printf("FIELD\tModel\tmaterialCount\t%zu\n", offsetof(Model, materialCount)); + printf("FIELD\tModel\tmeshes\t%zu\n", offsetof(Model, meshes)); + printf("FIELD\tModel\tmaterials\t%zu\n", offsetof(Model, materials)); + printf("FIELD\tModel\tmeshMaterial\t%zu\n", offsetof(Model, meshMaterial)); + printf("FIELD\tModel\tskeleton\t%zu\n", offsetof(Model, skeleton)); + printf("FIELD\tModel\tcurrentPose\t%zu\n", offsetof(Model, currentPose)); + printf("FIELD\tModel\tboneMatrices\t%zu\n", offsetof(Model, boneMatrices)); + printf("STRUCT\tModelAnimation\t%zu\t%zu\n", sizeof(ModelAnimation), _Alignof(ModelAnimation)); + printf("FIELD\tModelAnimation\tname\t%zu\n", offsetof(ModelAnimation, name)); + printf("FIELD\tModelAnimation\tboneCount\t%zu\n", offsetof(ModelAnimation, boneCount)); + printf("FIELD\tModelAnimation\tkeyframeCount\t%zu\n", offsetof(ModelAnimation, keyframeCount)); + printf("FIELD\tModelAnimation\tkeyframePoses\t%zu\n", offsetof(ModelAnimation, keyframePoses)); + printf("STRUCT\tRay\t%zu\t%zu\n", sizeof(Ray), _Alignof(Ray)); + printf("FIELD\tRay\tposition\t%zu\n", offsetof(Ray, position)); + printf("FIELD\tRay\tdirection\t%zu\n", offsetof(Ray, direction)); + printf("STRUCT\tRayCollision\t%zu\t%zu\n", sizeof(RayCollision), _Alignof(RayCollision)); + printf("FIELD\tRayCollision\thit\t%zu\n", offsetof(RayCollision, hit)); + printf("FIELD\tRayCollision\tdistance\t%zu\n", offsetof(RayCollision, distance)); + printf("FIELD\tRayCollision\tpoint\t%zu\n", offsetof(RayCollision, point)); + printf("FIELD\tRayCollision\tnormal\t%zu\n", offsetof(RayCollision, normal)); + printf("STRUCT\tBoundingBox\t%zu\t%zu\n", sizeof(BoundingBox), _Alignof(BoundingBox)); + printf("FIELD\tBoundingBox\tmin\t%zu\n", offsetof(BoundingBox, min)); + printf("FIELD\tBoundingBox\tmax\t%zu\n", offsetof(BoundingBox, max)); + printf("STRUCT\tWave\t%zu\t%zu\n", sizeof(Wave), _Alignof(Wave)); + printf("FIELD\tWave\tframeCount\t%zu\n", offsetof(Wave, frameCount)); + printf("FIELD\tWave\tsampleRate\t%zu\n", offsetof(Wave, sampleRate)); + printf("FIELD\tWave\tsampleSize\t%zu\n", offsetof(Wave, sampleSize)); + printf("FIELD\tWave\tchannels\t%zu\n", offsetof(Wave, channels)); + printf("FIELD\tWave\tdata\t%zu\n", offsetof(Wave, data)); + printf("STRUCT\tAudioStream\t%zu\t%zu\n", sizeof(AudioStream), _Alignof(AudioStream)); + printf("FIELD\tAudioStream\tbuffer\t%zu\n", offsetof(AudioStream, buffer)); + printf("FIELD\tAudioStream\tprocessor\t%zu\n", offsetof(AudioStream, processor)); + printf("FIELD\tAudioStream\tsampleRate\t%zu\n", offsetof(AudioStream, sampleRate)); + printf("FIELD\tAudioStream\tsampleSize\t%zu\n", offsetof(AudioStream, sampleSize)); + printf("FIELD\tAudioStream\tchannels\t%zu\n", offsetof(AudioStream, channels)); + printf("STRUCT\tSound\t%zu\t%zu\n", sizeof(Sound), _Alignof(Sound)); + printf("FIELD\tSound\tstream\t%zu\n", offsetof(Sound, stream)); + printf("FIELD\tSound\tframeCount\t%zu\n", offsetof(Sound, frameCount)); + printf("STRUCT\tMusic\t%zu\t%zu\n", sizeof(Music), _Alignof(Music)); + printf("FIELD\tMusic\tstream\t%zu\n", offsetof(Music, stream)); + printf("FIELD\tMusic\tframeCount\t%zu\n", offsetof(Music, frameCount)); + printf("FIELD\tMusic\tlooping\t%zu\n", offsetof(Music, looping)); + printf("FIELD\tMusic\tctxType\t%zu\n", offsetof(Music, ctxType)); + printf("FIELD\tMusic\tctxData\t%zu\n", offsetof(Music, ctxData)); + printf("STRUCT\tVrDeviceInfo\t%zu\t%zu\n", sizeof(VrDeviceInfo), _Alignof(VrDeviceInfo)); + printf("FIELD\tVrDeviceInfo\thResolution\t%zu\n", offsetof(VrDeviceInfo, hResolution)); + printf("FIELD\tVrDeviceInfo\tvResolution\t%zu\n", offsetof(VrDeviceInfo, vResolution)); + printf("FIELD\tVrDeviceInfo\thScreenSize\t%zu\n", offsetof(VrDeviceInfo, hScreenSize)); + printf("FIELD\tVrDeviceInfo\tvScreenSize\t%zu\n", offsetof(VrDeviceInfo, vScreenSize)); + printf("FIELD\tVrDeviceInfo\teyeToScreenDistance\t%zu\n", offsetof(VrDeviceInfo, eyeToScreenDistance)); + printf("FIELD\tVrDeviceInfo\tlensSeparationDistance\t%zu\n", offsetof(VrDeviceInfo, lensSeparationDistance)); + printf("FIELD\tVrDeviceInfo\tinterpupillaryDistance\t%zu\n", offsetof(VrDeviceInfo, interpupillaryDistance)); + printf("FIELD\tVrDeviceInfo\tlensDistortionValues\t%zu\n", offsetof(VrDeviceInfo, lensDistortionValues)); + printf("FIELD\tVrDeviceInfo\tchromaAbCorrection\t%zu\n", offsetof(VrDeviceInfo, chromaAbCorrection)); + printf("STRUCT\tVrStereoConfig\t%zu\t%zu\n", sizeof(VrStereoConfig), _Alignof(VrStereoConfig)); + printf("FIELD\tVrStereoConfig\tprojection\t%zu\n", offsetof(VrStereoConfig, projection)); + printf("FIELD\tVrStereoConfig\tviewOffset\t%zu\n", offsetof(VrStereoConfig, viewOffset)); + printf("FIELD\tVrStereoConfig\tleftLensCenter\t%zu\n", offsetof(VrStereoConfig, leftLensCenter)); + printf("FIELD\tVrStereoConfig\trightLensCenter\t%zu\n", offsetof(VrStereoConfig, rightLensCenter)); + printf("FIELD\tVrStereoConfig\tleftScreenCenter\t%zu\n", offsetof(VrStereoConfig, leftScreenCenter)); + printf("FIELD\tVrStereoConfig\trightScreenCenter\t%zu\n", offsetof(VrStereoConfig, rightScreenCenter)); + printf("FIELD\tVrStereoConfig\tscale\t%zu\n", offsetof(VrStereoConfig, scale)); + printf("FIELD\tVrStereoConfig\tscaleIn\t%zu\n", offsetof(VrStereoConfig, scaleIn)); + printf("STRUCT\tFilePathList\t%zu\t%zu\n", sizeof(FilePathList), _Alignof(FilePathList)); + printf("FIELD\tFilePathList\tcount\t%zu\n", offsetof(FilePathList, count)); + printf("FIELD\tFilePathList\tpaths\t%zu\n", offsetof(FilePathList, paths)); + printf("STRUCT\tAutomationEvent\t%zu\t%zu\n", sizeof(AutomationEvent), _Alignof(AutomationEvent)); + printf("FIELD\tAutomationEvent\tframe\t%zu\n", offsetof(AutomationEvent, frame)); + printf("FIELD\tAutomationEvent\ttype\t%zu\n", offsetof(AutomationEvent, type)); + printf("FIELD\tAutomationEvent\tparams\t%zu\n", offsetof(AutomationEvent, params)); + printf("STRUCT\tAutomationEventList\t%zu\t%zu\n", sizeof(AutomationEventList), _Alignof(AutomationEventList)); + printf("FIELD\tAutomationEventList\tcapacity\t%zu\n", offsetof(AutomationEventList, capacity)); + printf("FIELD\tAutomationEventList\tcount\t%zu\n", offsetof(AutomationEventList, count)); + printf("FIELD\tAutomationEventList\tevents\t%zu\n", offsetof(AutomationEventList, events)); + return 0; +} diff --git a/tests/fixtures/basic-input-smoke.ts b/tests/fixtures/basic-input-smoke.ts new file mode 100644 index 0000000..950f418 --- /dev/null +++ b/tests/fixtures/basic-input-smoke.ts @@ -0,0 +1,4 @@ +globalThis.RAYLIB_EXAMPLE_MAX_FRAMES = 3; + +await import("../../examples/basic-input.ts"); +console.log("basic input startup smoke ok"); diff --git a/tests/fixtures/basic-window-smoke.ts b/tests/fixtures/basic-window-smoke.ts new file mode 100644 index 0000000..38605d3 --- /dev/null +++ b/tests/fixtures/basic-window-smoke.ts @@ -0,0 +1,4 @@ +globalThis.RAYLIB_EXAMPLE_MAX_FRAMES = 3; + +await import("../../examples/basic-window.ts"); +console.log("basic window startup smoke ok"); diff --git a/tests/fixtures/doom-smoke.ts b/tests/fixtures/doom-smoke.ts new file mode 100644 index 0000000..2463cff --- /dev/null +++ b/tests/fixtures/doom-smoke.ts @@ -0,0 +1,5 @@ +globalThis.RAYLIB_EXAMPLE_MAX_FRAMES = 3; +globalThis.RAYLIB_EXAMPLE_SCREENSHOT = "./.cache/doom-smoke.png"; + +await import("../../examples/doom-clone.ts"); +console.log("doom clone startup smoke ok"); diff --git a/tests/fixtures/ffi-smoke.ts b/tests/fixtures/ffi-smoke.ts new file mode 100644 index 0000000..67c0f2d --- /dev/null +++ b/tests/fixtures/ffi-smoke.ts @@ -0,0 +1,70 @@ +import bunnyBytes from "../../examples/assets/raybunny.png" with { type: "bytes" }; +import { + Color, + ColorToInt, + EncodeDataBase64, + GetColor, + GetFileExtension, + GetRandomValue, + IsPathFile, + LoadAutomationEventListRaw, + LoadFileText, + LoadImageFromMemory, + MemAlloc, + MemFree, + RAYLIB_BINDING_INFO, + SetRandomSeed, + TextCopy, + TextLength, + UnloadAutomationEventList, + UnloadFileText, + UnloadImage, + closeRaylib, +} from "../../bindings/raylib.ts"; + +const assert = (condition: boolean, message: string): void => { + if (!condition) throw new Error(message); +}; + +assert(RAYLIB_BINDING_INFO.raylibVersion === "6.0", "binding version"); + +SetRandomSeed(1234); +const random = GetRandomValue(10, 20); +assert(random >= 10 && random <= 20, "scalar native call"); + +const color = GetColor(305419896); +assert(color.r === 18 && color.g === 52 && color.b === 86 && color.a === 120, "aggregate return"); +assert(ColorToInt(Color.create({ r: 18, g: 52, b: 86, a: 120 })) === 305419896, "aggregate argument"); + +assert(IsPathFile("./README.md") === true, "one-byte bool return"); +assert(TextLength("raylib") === 6, "UTF-8 string argument"); +assert(GetFileExtension("sprite.png") === ".png", "UTF-8 string return"); + +const memory = MemAlloc(32); +assert(memory.isNull === false, "pointer return"); +assert(TextCopy(memory, "raylib") === 6, "mutable char pointer argument"); +MemFree(memory); + +const fileText = LoadFileText("./README.md"); +assert(fileText.isNull === false, "owned char pointer return"); +UnloadFileText(fileText); + +const outputSize = new Int32Array(1); +const encoded = EncodeDataBase64( + new Uint8Array([71, 111, 99, 99, 105, 97]), + 6, + outputSize, +); +assert(encoded.isNull === false && outputSize[0] > 0, "owned encoded text pointer"); +MemFree(encoded); + +const emptyEvents = LoadAutomationEventListRaw(null); +assert(emptyEvents.count === 0, "nullable C string raw binding"); +UnloadAutomationEventList(emptyEvents); + +const image = LoadImageFromMemory(".png", bunnyBytes, bunnyBytes.length); +assert(image.width === 32 && image.height === 32, "byte-pointer image load"); +UnloadImage(image); + +closeRaylib(); +console.log("raylib ffi smoke ok"); diff --git a/tests/fixtures/image-loading-smoke.ts b/tests/fixtures/image-loading-smoke.ts new file mode 100644 index 0000000..1a10eda --- /dev/null +++ b/tests/fixtures/image-loading-smoke.ts @@ -0,0 +1,4 @@ +globalThis.RAYLIB_EXAMPLE_MAX_FRAMES = 3; + +await import("../../examples/image-loading.ts"); +console.log("image loading startup smoke ok"); diff --git a/tests/integration/abi.test.mjs b/tests/integration/abi.test.mjs new file mode 100644 index 0000000..3a551cb --- /dev/null +++ b/tests/integration/abi.test.mjs @@ -0,0 +1,79 @@ +import assert from "node:assert/strict"; +import { mkdtemp } from "node:fs/promises"; +import { spawnSync } from "node:child_process"; +import { join } from "node:path"; +import { tmpdir } from "node:os"; +import { fromRoot } from "../../scripts/lib/project.mjs"; +import { + findGocciaLoader, + findRaylibInclude, + parseLayoutLines, +} from "./helpers.mjs"; + +const [loader, includeDir] = await Promise.all([ + findGocciaLoader(), + findRaylibInclude(), +]); +const temporaryDirectory = await mkdtemp(join(tmpdir(), "goccia-raylib-abi-")); +const oracle = join(temporaryDirectory, "raylib-abi-oracle"); +const compiler = process.env.CC || "cc"; + +const compile = spawnSync( + compiler, + [ + "-std=c11", + "-Wall", + "-Wextra", + "-Werror", + `-I${includeDir}`, + fromRoot("tests/abi/oracle.c"), + "-o", + oracle, + ], + { encoding: "utf8" }, +); +assert.equal( + compile.status, + 0, + `ABI oracle compilation failed:\n${compile.stdout}\n${compile.stderr}`, +); + +const native = spawnSync(oracle, [], { encoding: "utf8" }); +assert.equal(native.status, 0, `Native ABI oracle failed:\n${native.stderr}`); + +const goccia = spawnSync(loader, [fromRoot("tests/abi/layout-probe.ts")], { + cwd: fromRoot(), + encoding: "utf8", + env: process.env, +}); +assert.equal( + goccia.status, + 0, + `GocciaScript ABI probe failed:\n${goccia.stdout}\n${goccia.stderr}`, +); + +const expected = parseLayoutLines(native.stdout); +const actual = parseLayoutLines(goccia.stdout); +assert.equal(expected.size, 35, "Native oracle must report all 35 raylib structs"); +assert.equal(actual.size, 35, "GocciaScript probe must report all 35 raylib structs"); + +for (const [name, expectedLayout] of expected) { + const actualLayout = actual.get(name); + assert.ok(actualLayout, `Missing GocciaScript layout for ${name}`); + assert.equal(actualLayout.size, expectedLayout.size, `${name} sizeof`); + assert.equal( + actualLayout.alignment, + expectedLayout.alignment, + `${name} alignment`, + ); + assert.equal( + actualLayout.fields.size, + expectedLayout.fields.size, + `${name} field count`, + ); + for (const [field, offset] of expectedLayout.fields) { + assert.equal(actualLayout.fields.get(field), offset, `${name}.${field} offset`); + } +} + +console.log("All 35 raylib struct layouts match the native ABI oracle."); diff --git a/tests/integration/ffi.test.mjs b/tests/integration/ffi.test.mjs new file mode 100644 index 0000000..61f794a --- /dev/null +++ b/tests/integration/ffi.test.mjs @@ -0,0 +1,20 @@ +import assert from "node:assert/strict"; +import { spawnSync } from "node:child_process"; +import { fromRoot } from "../../scripts/lib/project.mjs"; +import { findGocciaLoader } from "./helpers.mjs"; + +const loader = await findGocciaLoader(); +const result = spawnSync(loader, [fromRoot("tests/fixtures/ffi-smoke.ts")], { + cwd: fromRoot(), + encoding: "utf8", + env: process.env, +}); +assert.equal( + result.status, + 0, + `Representative raylib FFI calls failed:\n${result.stdout}\n${result.stderr}`, +); +assert.match(result.stdout, /raylib ffi smoke ok/); +console.log( + "Representative scalar, bool, pointer, aggregate, UTF-8, owned-text, and nullable calls passed.", +); diff --git a/tests/integration/helpers.mjs b/tests/integration/helpers.mjs new file mode 100644 index 0000000..28840b2 --- /dev/null +++ b/tests/integration/helpers.mjs @@ -0,0 +1,71 @@ +import { access } from "node:fs/promises"; +import { constants } from "node:fs"; +import { execFileSync } from "node:child_process"; + +async function executable(path) { + if (!path) return null; + try { + await access(path, constants.X_OK); + return path; + } catch { + return null; + } +} + +export async function findGocciaLoader() { + const configured = await executable(process.env.GOCCIA_LOADER); + if (configured) return configured; + try { + const discovered = execFileSync("sh", ["-c", "command -v GocciaScriptLoader"], { + encoding: "utf8", + }).trim(); + if (await executable(discovered)) return discovered; + } catch { + // Report one actionable error below. + } + throw new Error( + "GocciaScriptLoader 0.10.0 was not found; set GOCCIA_LOADER to the release binary", + ); +} + +export async function findRaylibInclude() { + if (process.env.RAYLIB_INCLUDE_DIR) return process.env.RAYLIB_INCLUDE_DIR; + if (process.platform === "darwin") { + try { + return `${execFileSync("brew", ["--prefix", "raylib"], { encoding: "utf8" }).trim()}/include`; + } catch { + // Fall through to standard paths. + } + } + for (const candidate of ["/usr/local/include", "/usr/include"]) { + try { + await access(`${candidate}/raylib.h`, constants.R_OK); + return candidate; + } catch { + // Try the next candidate. + } + } + throw new Error( + "raylib.h 6.0 was not found; set RAYLIB_INCLUDE_DIR to its include directory", + ); +} + +export function parseLayoutLines(output) { + const layouts = new Map(); + for (const line of output.split(/\r?\n/)) { + if (!line) continue; + const parts = line.split("\t"); + if (parts[0] === "STRUCT") { + layouts.set(parts[1], { + size: Number(parts[2]), + alignment: Number(parts[3]), + fields: new Map(), + }); + } else if (parts[0] === "FIELD") { + const layout = layouts.get(parts[1]); + if (!layout) throw new Error(`Field appeared before struct: ${line}`); + layout.fields.set(parts[2], Number(parts[3])); + } + } + return layouts; +} diff --git a/tests/linux/Dockerfile b/tests/linux/Dockerfile new file mode 100644 index 0000000..9bf64d7 --- /dev/null +++ b/tests/linux/Dockerfile @@ -0,0 +1,77 @@ +FROM node:24-bookworm + +ARG TARGETARCH +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt-get update && apt-get install -y --no-install-recommends \ + build-essential \ + ca-certificates \ + cmake \ + curl \ + git \ + libasound2-dev \ + libgl1-mesa-dev \ + libglu1-mesa-dev \ + libx11-dev \ + libxcursor-dev \ + libxi-dev \ + libxinerama-dev \ + libxrandr-dev \ + ninja-build \ + patch \ + unzip \ + xauth \ + xvfb + +RUN git clone --filter=blob:none https://github.com/raysan5/raylib.git /tmp/raylib \ + && git -C /tmp/raylib checkout dbc56a87da87d973a9c5baa4e7438a9d20121d28 \ + && cmake \ + -S /tmp/raylib \ + -B /tmp/raylib-build \ + -G Ninja \ + -DBUILD_EXAMPLES=OFF \ + -DBUILD_SHARED_LIBS=ON \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=/usr/local \ + && cmake --build /tmp/raylib-build \ + && cmake --install /tmp/raylib-build \ + && ldconfig + +RUN case "$TARGETARCH" in \ + amd64) goccia_arch=x64 ;; \ + arm64) goccia_arch=arm64 ;; \ + *) echo "Unsupported Docker architecture: $TARGETARCH" >&2; exit 1 ;; \ + esac \ + && mkdir -p /opt/gocciascript \ + && curl --fail --location \ + "https://github.com/frostney/GocciaScript/releases/download/0.10.0/gocciascript-0.10.0-linux-${goccia_arch}.tar.gz" \ + --output /tmp/gocciascript.tar.gz \ + && tar -xzf /tmp/gocciascript.tar.gz -C /opt/gocciascript --strip-components=1 \ + && chmod +x \ + /opt/gocciascript/GocciaScriptLoader \ + /opt/gocciascript/GocciaTestRunner \ + && ln -s /opt/gocciascript/GocciaScriptLoader /usr/local/bin/GocciaScriptLoader \ + && ln -s /opt/gocciascript/GocciaTestRunner /usr/local/bin/GocciaTestRunner + +WORKDIR /workspace +COPY . . +ENV GOCCIA_LOADER=/usr/local/bin/GocciaScriptLoader +ENV GOCCIA_TEST_RUNNER=/usr/local/bin/GocciaTestRunner +ENV RAYLIB_INCLUDE_DIR=/usr/local/include + +RUN npm ci \ + && npm run generate \ + && npm test \ + && npm run check:generated \ + && npm run test:types \ + && npm run test:abi \ + && npm run test:ffi \ + && npm run pack:check \ + && mkdir -p .cache \ + && xvfb-run -a GocciaScriptLoader tests/fixtures/basic-window-smoke.ts \ + && xvfb-run -a GocciaScriptLoader tests/fixtures/basic-input-smoke.ts \ + && xvfb-run -a GocciaScriptLoader tests/fixtures/image-loading-smoke.ts \ + && xvfb-run -a GocciaScriptLoader examples/smoke.ts \ + && xvfb-run -a GocciaScriptLoader tests/fixtures/doom-smoke.ts \ + && test -s .cache/doom-smoke.png \ + && xvfb-run -a make -C examples/doom-gpl smoke diff --git a/tests/unit/api.test.ts b/tests/unit/api.test.ts new file mode 100644 index 0000000..a8357aa --- /dev/null +++ b/tests/unit/api.test.ts @@ -0,0 +1,53 @@ +import metadata from "../../metadata/raylib.json" with { type: "json" }; +import raw from "../../vendor/raylib-6.0-api.raw.json" with { type: "text" }; +import normalized from "../../vendor/raylib-6.0.normalized.json" with { + type: "json", +}; +import { + normalizeApiDocument, + repairOfficialJson, +} from "../../scripts/lib/api-core.ts"; + +describe("raylib API normalization", () => { + test("repairs exactly the known malformed description", () => { + expect(() => JSON.parse(raw)).toThrow(SyntaxError); + expect(JSON.parse(repairOfficialJson(raw)).functions).toHaveLength(600); + + let rejectedUnknownInput = false; + try { + repairOfficialJson("{}"); + } catch (error) { + rejectedUnknownInput = error instanceof Error; + } + expect(rejectedUnknownInput).toBe(true); + }); + + test("validates the complete raylib 6.0 inventory", () => { + const parsed = JSON.parse(repairOfficialJson(raw)); + const api = normalizeApiDocument(parsed, metadata, metadata.api.sha256); + + expect(api.inventory).toMatchObject({ + functions: 600, + structs: 35, + aliases: 6, + callbacks: 6, + }); + expect(api.source.repairs).toEqual([ + { + function: "LoadDirectoryFilesEx", + field: "description", + reason: "Escape three unescaped quoted glob examples", + count: 1, + }, + ]); + }); + + test("normalization is deterministic and matches the vendored IR", () => { + const parsed = JSON.parse(repairOfficialJson(raw)); + const first = normalizeApiDocument(parsed, metadata, metadata.api.sha256); + const second = normalizeApiDocument(parsed, metadata, metadata.api.sha256); + + expect(first).toEqual(second); + expect(first).toEqual(normalized); + }); +}); diff --git a/tests/unit/bindings.test.ts b/tests/unit/bindings.test.ts new file mode 100644 index 0000000..9a4fe6b --- /dev/null +++ b/tests/unit/bindings.test.ts @@ -0,0 +1,80 @@ +import raylibSource from "../../bindings/raylib.ts" with { type: "text" }; +import declarations from "../../bindings/raylib.d.ts" with { type: "text" }; +import skipped from "../../SKIPPED.json" with { type: "json" }; + +describe("generated raylib bindings", () => { + test("exposes the stable-safe dynamic API", () => { + expect(skipped.apiFunctions).toBe(600); + expect(skipped.callableTargetAfterUpstreamSupport).toBe(597); + expect(skipped.generatedFunctions + skipped.skippedFunctions).toBe( + skipped.apiFunctions, + ); + expect(raylibSource).toContain('linkage: "dynamic"'); + + for (const name of [ + "InitWindow", + "WindowShouldClose", + "IsKeyDown", + "LoadImageFromMemory", + "LoadTextureFromImage", + "DrawTextureV", + ]) { + expect(raylibSource).toContain(`export const ${name} =`); + } + }); + + test("emits every aggregate and representative public type family", () => { + expect(raylibSource.match(/ = FFI\.struct\(/g)).toHaveLength(35); + expect(raylibSource).toContain("export const RAYWHITE = Color.create"); + expect(raylibSource).toContain("export const KEY_W = 87;"); + expect(raylibSource).toContain("export const Quaternion = Vector4;"); + expect(raylibSource).toContain('export const AudioCallback = "pointer";'); + expect(declarations).toContain("interface VrStereoConfigValue"); + expect(declarations).toContain("export type FFITypedArray ="); + expect(declarations).not.toContain("| ArrayBufferView"); + }); + + test("preserves owned pointers and nullable string variants", () => { + expect(raylibSource).toMatch( + /export const LoadFileText = .*returns: "pointer"/, + ); + expect(raylibSource).toMatch( + /export const UnloadFileText = .*args: \["pointer"\]/, + ); + expect(raylibSource).toMatch( + /export const TextReplace = .*returns: "utf8string"/, + ); + expect(raylibSource).toMatch( + /export const TextReplaceAlloc = .*returns: "pointer"/, + ); + expect(declarations).toMatch( + /function LoadImageFromMemory\(fileType: string, fileData: FFIPointerInput/, + ); + + for (const name of [ + "LoadShaderRaw", + "LoadShaderFromMemoryRaw", + "LoadAutomationEventListRaw", + "TextReplaceRaw", + "TextReplaceAllocRaw", + "TextReplaceBetweenRaw", + "TextReplaceBetweenAllocRaw", + ]) { + expect(raylibSource).toContain(`export const ${name} =`); + expect(declarations).toContain(`function ${name}(`); + } + }); + + test("reports stable FFI and intentional exclusions explicitly", () => { + const byName = new Map( + skipped.skipped.map((item) => [item.name, item]), + ); + + expect(byName.get("TraceLog").reason).toBe("varargs"); + expect(byName.get("TextFormat").reason).toBe("varargs"); + expect(byName.get("DrawBillboardPro").reason).toBe( + "more-than-8-arguments", + ); + expect(byName.get("DrawCircle").reason).toBe("mixed-top-level-f32"); + }); +}); diff --git a/tests/unit/syntax.test.ts b/tests/unit/syntax.test.ts new file mode 100644 index 0000000..ddc0d57 --- /dev/null +++ b/tests/unit/syntax.test.ts @@ -0,0 +1,34 @@ +import abiProbe from "../abi/layout-probe.ts" with { type: "text" }; +import basicInput from "../../examples/basic-input.ts" with { type: "text" }; +import basicWindow from "../../examples/basic-window.ts" with { type: "text" }; +import bunnymark from "../../examples/lib/run-bunnymark.ts" with { + type: "text", +}; +import doomClone from "../../examples/doom-clone.ts" with { type: "text" }; +import ffiSmoke from "../fixtures/ffi-smoke.ts" with { type: "text" }; +import frames from "../../examples/lib/frames.ts" with { type: "text" }; +import imageLoading from "../../examples/image-loading.ts" with { + type: "text", +}; +import raylib from "../../bindings/raylib.ts" with { type: "text" }; + +describe("default GocciaScript syntax", () => { + test("runtime sources need neither legacy loop compatibility flag", () => { + const sources = [ + abiProbe, + basicInput, + basicWindow, + bunnymark, + doomClone, + ffiSmoke, + frames, + imageLoading, + raylib, + ]; + + for (const source of sources) { + expect(source).not.toMatch(/\bwhile\s*\(/); + expect(source).not.toMatch(/\bfor\s*\([^)]*;/); + } + }); +}); diff --git a/vendor/raylib-6.0-api.raw.json b/vendor/raylib-6.0-api.raw.json new file mode 100644 index 0000000..06abbb7 --- /dev/null +++ b/vendor/raylib-6.0-api.raw.json @@ -0,0 +1,12510 @@ +{ + "defines": [ + { + "name": "RAYLIB_H", + "type": "GUARD", + "value": "", + "description": "" + }, + { + "name": "RAYLIB_VERSION_MAJOR", + "type": "INT", + "value": 6, + "description": "" + }, + { + "name": "RAYLIB_VERSION_MINOR", + "type": "INT", + "value": 0, + "description": "" + }, + { + "name": "RAYLIB_VERSION_PATCH", + "type": "INT", + "value": 0, + "description": "" + }, + { + "name": "RAYLIB_VERSION", + "type": "STRING", + "value": "6.0", + "description": "" + }, + { + "name": "__declspec(x)", + "type": "MACRO", + "value": "__attribute__((x))", + "description": "" + }, + { + "name": "RLAPI", + "type": "UNKNOWN", + "value": "__declspec(dllexport)", + "description": "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": "" + }, + { + "name": "GetMouseRay", + "type": "UNKNOWN", + "value": "GetScreenToWorldRay", + "description": "Compatibility hack for previous raylib versions" + } + ], + "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 aperture in Y (degrees) in perspective, used as near plane height in world units 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 (screen space offset from window origin)" + }, + { + "type": "Vector2", + "name": "target", + "description": "Camera target (world space target point that is mapped to screen space offset)" + }, + { + "type": "float", + "name": "rotation", + "description": "Camera rotation in degrees (pivots around target)" + }, + { + "type": "float", + "name": "zoom", + "description": "Camera zoom (scaling around target), must not be set to 0, set to 1.0f for no scale" + } + ] + }, + { + "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 texture second coordinates (UV - 2 components per vertex) (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": "int", + "name": "boneCount", + "description": "Number of bones (MAX: 256 bones)" + }, + { + "type": "unsigned char *", + "name": "boneIndices", + "description": "Vertex bone indices, up to 4 bones influence by vertex (skinning) (shader-location = 6)" + }, + { + "type": "float *", + "name": "boneWeights", + "description": "Vertex bone weight, up to 4 bones influence by vertex (skinning) (shader-location = 7)" + }, + { + "type": "float *", + "name": "animVertices", + "description": "Animated vertex positions (after bones transformations)" + }, + { + "type": "float *", + "name": "animNormals", + "description": "Animated normals (after bones transformations)" + }, + { + "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, vertex 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": "ModelSkeleton", + "description": "Skeleton, animation bones hierarchy", + "fields": [ + { + "type": "int", + "name": "boneCount", + "description": "Number of bones" + }, + { + "type": "BoneInfo *", + "name": "bones", + "description": "Bones information (skeleton)" + }, + { + "type": "ModelAnimPose", + "name": "bindPose", + "description": "Bones base transformation (Transform[])" + } + ] + }, + { + "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": "ModelSkeleton", + "name": "skeleton", + "description": "Skeleton for animation" + }, + { + "type": "ModelAnimPose", + "name": "currentPose", + "description": "Current animation pose (Transform[])" + }, + { + "type": "Matrix *", + "name": "boneMatrices", + "description": "Bones animated transformation matrices" + } + ] + }, + { + "name": "ModelAnimation", + "description": "ModelAnimation, contains a full animation sequence", + "fields": [ + { + "type": "char[32]", + "name": "name", + "description": "Animation name" + }, + { + "type": "int", + "name": "boneCount", + "description": "Number of bones (per pose)" + }, + { + "type": "int", + "name": "keyframeCount", + "description": "Number of animation key frames" + }, + { + "type": "ModelAnimPose *", + "name": "keyframePoses", + "description": "Animation sequence keyframe poses [keyframe][pose]" + } + ] + }, + { + "name": "Ray", + "description": "Ray, ray for raycasting", + "fields": [ + { + "type": "Vector3", + "name": "position", + "description": "Ray position (origin)" + }, + { + "type": "Vector3", + "name": "direction", + "description": "Ray direction (normalized)" + } + ] + }, + { + "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 the nearest hit" + }, + { + "type": "Vector3", + "name": "point", + "description": "Point of the 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": "rAudioProcessor *", + "name": "processor", + "description": "Pointer to internal data processor, useful for audio effects" + }, + { + "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": "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" + } + ] + }, + { + "name": "FilePathList", + "description": "File path list", + "fields": [ + { + "type": "unsigned int", + "name": "count", + "description": "Filepaths entries count" + }, + { + "type": "char **", + "name": "paths", + "description": "Filepaths entries" + } + ] + }, + { + "name": "AutomationEvent", + "description": "Automation event", + "fields": [ + { + "type": "unsigned int", + "name": "frame", + "description": "Event frame" + }, + { + "type": "unsigned int", + "name": "type", + "description": "Event type (AutomationEventType)" + }, + { + "type": "int[4]", + "name": "params", + "description": "Event parameters (if required)" + } + ] + }, + { + "name": "AutomationEventList", + "description": "Automation event list", + "fields": [ + { + "type": "unsigned int", + "name": "capacity", + "description": "Events max entries (MAX_AUTOMATION_EVENTS)" + }, + { + "type": "unsigned int", + "name": "count", + "description": "Events entries count" + }, + { + "type": "AutomationEvent *", + "name": "events", + "description": "Events entries" + } + ] + } + ], + "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" + }, + { + "type": "Transform", + "name": "*ModelAnimPose", + "description": "Anim pose, an array of Transform[]" + } + ], + "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_WINDOW_MOUSE_PASSTHROUGH", + "value": 16384, + "description": "Set to support mouse passthrough, only supported when FLAG_WINDOW_UNDECORATED" + }, + { + "name": "FLAG_BORDERLESS_WINDOWED_MODE", + "value": 32768, + "description": "Set to run program in borderless windowed mode" + }, + { + "name": "FLAG_MSAA_4X_HINT", + "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": 5, + "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 forward (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 omnidirectional 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, 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: Circle, Xbox: B)" + }, + { + "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: Square, Xbox: X)" + }, + { + "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 (first), 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 axes", + "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: heightmap" + }, + { + "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": "SHADER_LOC_VERTEX_BONEIDS", + "value": 26, + "description": "Shader location: vertex attribute: bone indices" + }, + { + "name": "SHADER_LOC_VERTEX_BONEWEIGHTS", + "value": 27, + "description": "Shader location: vertex attribute: bone weights" + }, + { + "name": "SHADER_LOC_MATRIX_BONETRANSFORMS", + "value": 28, + "description": "Shader location: matrix attribute: bone transforms (animation)" + }, + { + "name": "SHADER_LOC_VERTEX_INSTANCETRANSFORM", + "value": 29, + "description": "Shader location: vertex attribute: instance transforms" + } + ] + }, + { + "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_UINT", + "value": 8, + "description": "Shader uniform type: unsigned int" + }, + { + "name": "SHADER_UNIFORM_UIVEC2", + "value": 9, + "description": "Shader uniform type: uivec2 (2 unsigned int)" + }, + { + "name": "SHADER_UNIFORM_UIVEC3", + "value": 10, + "description": "Shader uniform type: uivec3 (3 unsigned int)" + }, + { + "name": "SHADER_UNIFORM_UIVEC4", + "value": 11, + "description": "Shader uniform type: uivec4 (4 unsigned int)" + }, + { + "name": "SHADER_UNIFORM_SAMPLER2D", + "value": 12, + "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_UNCOMPRESSED_R16", + "value": 11, + "description": "16 bpp (1 channel - half float)" + }, + { + "name": "PIXELFORMAT_UNCOMPRESSED_R16G16B16", + "value": 12, + "description": "16*3 bpp (3 channels - half float)" + }, + { + "name": "PIXELFORMAT_UNCOMPRESSED_R16G16B16A16", + "value": 13, + "description": "16*4 bpp (4 channels - half float)" + }, + { + "name": "PIXELFORMAT_COMPRESSED_DXT1_RGB", + "value": 14, + "description": "4 bpp (no alpha)" + }, + { + "name": "PIXELFORMAT_COMPRESSED_DXT1_RGBA", + "value": 15, + "description": "4 bpp (1 bit alpha)" + }, + { + "name": "PIXELFORMAT_COMPRESSED_DXT3_RGBA", + "value": 16, + "description": "8 bpp" + }, + { + "name": "PIXELFORMAT_COMPRESSED_DXT5_RGBA", + "value": 17, + "description": "8 bpp" + }, + { + "name": "PIXELFORMAT_COMPRESSED_ETC1_RGB", + "value": 18, + "description": "4 bpp" + }, + { + "name": "PIXELFORMAT_COMPRESSED_ETC2_RGB", + "value": 19, + "description": "4 bpp" + }, + { + "name": "PIXELFORMAT_COMPRESSED_ETC2_EAC_RGBA", + "value": 20, + "description": "8 bpp" + }, + { + "name": "PIXELFORMAT_COMPRESSED_PVRT_RGB", + "value": 21, + "description": "4 bpp" + }, + { + "name": "PIXELFORMAT_COMPRESSED_PVRT_RGBA", + "value": 22, + "description": "4 bpp" + }, + { + "name": "PIXELFORMAT_COMPRESSED_ASTC_4x4_RGBA", + "value": 23, + "description": "8 bpp" + }, + { + "name": "PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA", + "value": 24, + "description": "2 bpp" + } + ] + }, + { + "name": "TextureFilter", + "description": "Texture parameters: filter mode", + "values": [ + { + "name": "TEXTURE_FILTER_POINT", + "value": 0, + "description": "No filter, pixel approximation" + }, + { + "name": "TEXTURE_FILTER_BILINEAR", + "value": 1, + "description": "Linear filtering" + }, + { + "name": "TEXTURE_FILTER_TRILINEAR", + "value": 2, + "description": "Trilinear filtering (linear with mipmaps)" + }, + { + "name": "TEXTURE_FILTER_ANISOTROPIC_4X", + "value": 3, + "description": "Anisotropic filtering 4x" + }, + { + "name": "TEXTURE_FILTER_ANISOTROPIC_8X", + "value": 4, + "description": "Anisotropic filtering 8x" + }, + { + "name": "TEXTURE_FILTER_ANISOTROPIC_16X", + "value": 5, + "description": "Anisotropic filtering 16x" + } + ] + }, + { + "name": "TextureWrap", + "description": "Texture parameters: wrap mode", + "values": [ + { + "name": "TEXTURE_WRAP_REPEAT", + "value": 0, + "description": "Repeats texture in tiled mode" + }, + { + "name": "TEXTURE_WRAP_CLAMP", + "value": 1, + "description": "Clamps texture to edge pixel in tiled mode" + }, + { + "name": "TEXTURE_WRAP_MIRROR_REPEAT", + "value": 2, + "description": "Mirrors and repeats the texture in tiled mode" + }, + { + "name": "TEXTURE_WRAP_MIRROR_CLAMP", + "value": 3, + "description": "Mirrors and clamps to border the texture in tiled mode" + } + ] + }, + { + "name": "CubemapLayout", + "description": "Cubemap layouts", + "values": [ + { + "name": "CUBEMAP_LAYOUT_AUTO_DETECT", + "value": 0, + "description": "Automatically detect layout type" + }, + { + "name": "CUBEMAP_LAYOUT_LINE_VERTICAL", + "value": 1, + "description": "Layout is defined by a vertical line with faces" + }, + { + "name": "CUBEMAP_LAYOUT_LINE_HORIZONTAL", + "value": 2, + "description": "Layout is defined by a 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": "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_ALPHA_PREMULTIPLY", + "value": 5, + "description": "Blend premultiplied textures considering alpha" + }, + { + "name": "BLEND_CUSTOM", + "value": 6, + "description": "Blend textures using custom src/dst factors (use rlSetBlendFactors())" + }, + { + "name": "BLEND_CUSTOM_SEPARATE", + "value": 7, + "description": "Blend textures using custom rgb/alpha separate src/dst factors (use rlSetBlendFactorsSeparate())" + } + ] + }, + { + "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": "Camera custom, controlled by user (UpdateCamera() does nothing)" + }, + { + "name": "CAMERA_FREE", + "value": 1, + "description": "Camera free mode" + }, + { + "name": "CAMERA_ORBITAL", + "value": 2, + "description": "Camera orbital, around target, zoom supported" + }, + { + "name": "CAMERA_FIRST_PERSON", + "value": 3, + "description": "Camera first person" + }, + { + "name": "CAMERA_THIRD_PERSON", + "value": 4, + "description": "Camera third person" + } + ] + }, + { + "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": "int *", + "name": "dataSize" + } + ] + }, + { + "name": "SaveFileDataCallback", + "description": "FileIO: Save binary data", + "returnType": "bool", + "params": [ + { + "type": "const char *", + "name": "fileName" + }, + { + "type": "void *", + "name": "data" + }, + { + "type": "int", + "name": "dataSize" + } + ] + }, + { + "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": "const char *", + "name": "text" + } + ] + }, + { + "name": "AudioCallback", + "description": "", + "returnType": "void", + "params": [ + { + "type": "void *", + "name": "bufferData" + }, + { + "type": "unsigned int", + "name": "frames" + } + ] + } + ], + "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": "CloseWindow", + "description": "Close window and unload OpenGL context", + "returnType": "void" + }, + { + "name": "WindowShouldClose", + "description": "Check if application should close (KEY_ESCAPE pressed or windows close icon clicked)", + "returnType": "bool" + }, + { + "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", + "returnType": "bool" + }, + { + "name": "IsWindowMinimized", + "description": "Check if window is currently minimized", + "returnType": "bool" + }, + { + "name": "IsWindowMaximized", + "description": "Check if window is currently maximized", + "returnType": "bool" + }, + { + "name": "IsWindowFocused", + "description": "Check if window is currently focused", + "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, resizes monitor to match window resolution", + "returnType": "void" + }, + { + "name": "ToggleBorderlessWindowed", + "description": "Toggle window state: borderless windowed, resizes window to match monitor resolution", + "returnType": "void" + }, + { + "name": "MaximizeWindow", + "description": "Set window state: maximized, if resizable", + "returnType": "void" + }, + { + "name": "MinimizeWindow", + "description": "Set window state: minimized, if resizable", + "returnType": "void" + }, + { + "name": "RestoreWindow", + "description": "Restore window from being minimized/maximized", + "returnType": "void" + }, + { + "name": "SetWindowIcon", + "description": "Set icon for window (single image, RGBA 32bit)", + "returnType": "void", + "params": [ + { + "type": "Image", + "name": "image" + } + ] + }, + { + "name": "SetWindowIcons", + "description": "Set icon for window (multiple images, RGBA 32bit)", + "returnType": "void", + "params": [ + { + "type": "Image *", + "name": "images" + }, + { + "type": "int", + "name": "count" + } + ] + }, + { + "name": "SetWindowTitle", + "description": "Set title for window", + "returnType": "void", + "params": [ + { + "type": "const char *", + "name": "title" + } + ] + }, + { + "name": "SetWindowPosition", + "description": "Set window position on screen", + "returnType": "void", + "params": [ + { + "type": "int", + "name": "x" + }, + { + "type": "int", + "name": "y" + } + ] + }, + { + "name": "SetWindowMonitor", + "description": "Set monitor for the current window", + "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": "SetWindowMaxSize", + "description": "Set window maximum dimensions (for FLAG_WINDOW_RESIZABLE)", + "returnType": "void", + "params": [ + { + "type": "int", + "name": "width" + }, + { + "type": "int", + "name": "height" + } + ] + }, + { + "name": "SetWindowSize", + "description": "Set window dimensions", + "returnType": "void", + "params": [ + { + "type": "int", + "name": "width" + }, + { + "type": "int", + "name": "height" + } + ] + }, + { + "name": "SetWindowOpacity", + "description": "Set window opacity [0.0f..1.0f]", + "returnType": "void", + "params": [ + { + "type": "float", + "name": "opacity" + } + ] + }, + { + "name": "SetWindowFocused", + "description": "Set window focused", + "returnType": "void" + }, + { + "name": "GetWindowHandle", + "description": "Get native window handle", + "returnType": "void *" + }, + { + "name": "GetScreenWidth", + "description": "Get current screen width", + "returnType": "int" + }, + { + "name": "GetScreenHeight", + "description": "Get current screen height", + "returnType": "int" + }, + { + "name": "GetRenderWidth", + "description": "Get current render width (it considers HiDPI)", + "returnType": "int" + }, + { + "name": "GetRenderHeight", + "description": "Get current render height (it considers HiDPI)", + "returnType": "int" + }, + { + "name": "GetMonitorCount", + "description": "Get number of connected monitors", + "returnType": "int" + }, + { + "name": "GetCurrentMonitor", + "description": "Get current monitor where window is placed", + "returnType": "int" + }, + { + "name": "GetMonitorPosition", + "description": "Get specified monitor position", + "returnType": "Vector2", + "params": [ + { + "type": "int", + "name": "monitor" + } + ] + }, + { + "name": "GetMonitorWidth", + "description": "Get specified monitor width (current video mode used by monitor)", + "returnType": "int", + "params": [ + { + "type": "int", + "name": "monitor" + } + ] + }, + { + "name": "GetMonitorHeight", + "description": "Get specified monitor height (current video mode used 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 specified 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": "GetClipboardImage", + "description": "Get clipboard image content", + "returnType": "Image" + }, + { + "name": "EnableEventWaiting", + "description": "Enable waiting for events on EndDrawing(), no automatic event polling", + "returnType": "void" + }, + { + "name": "DisableEventWaiting", + "description": "Disable waiting for events on EndDrawing(), automatic events polling", + "returnType": "void" + }, + { + "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": "IsShaderValid", + "description": "Check if a shader is valid (loaded on GPU)", + "returnType": "bool", + "params": [ + { + "type": "Shader", + "name": "shader" + } + ] + }, + { + "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 and bind the 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": "GetScreenToWorldRay", + "description": "Get a ray trace from screen position (i.e mouse)", + "returnType": "Ray", + "params": [ + { + "type": "Vector2", + "name": "position" + }, + { + "type": "Camera", + "name": "camera" + } + ] + }, + { + "name": "GetScreenToWorldRayEx", + "description": "Get a ray trace from screen position (i.e mouse) in a viewport", + "returnType": "Ray", + "params": [ + { + "type": "Vector2", + "name": "position" + }, + { + "type": "Camera", + "name": "camera" + }, + { + "type": "int", + "name": "width" + }, + { + "type": "int", + "name": "height" + } + ] + }, + { + "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": "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": "SetTargetFPS", + "description": "Set target FPS (maximum)", + "returnType": "void", + "params": [ + { + "type": "int", + "name": "fps" + } + ] + }, + { + "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": "GetFPS", + "description": "Get current FPS", + "returnType": "int" + }, + { + "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 time (halt program execution)", + "returnType": "void", + "params": [ + { + "type": "double", + "name": "seconds" + } + ] + }, + { + "name": "SetRandomSeed", + "description": "Set the seed for the random number generator", + "returnType": "void", + "params": [ + { + "type": "unsigned int", + "name": "seed" + } + ] + }, + { + "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": "LoadRandomSequence", + "description": "Load random values sequence, no values repeated", + "returnType": "int *", + "params": [ + { + "type": "unsigned int", + "name": "count" + }, + { + "type": "int", + "name": "min" + }, + { + "type": "int", + "name": "max" + } + ] + }, + { + "name": "UnloadRandomSequence", + "description": "Unload random values sequence", + "returnType": "void", + "params": [ + { + "type": "int *", + "name": "sequence" + } + ] + }, + { + "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": "OpenURL", + "description": "Open URL with default system browser (if available)", + "returnType": "void", + "params": [ + { + "type": "const char *", + "name": "url" + } + ] + }, + { + "name": "SetTraceLogLevel", + "description": "Set the current threshold (minimum) log level", + "returnType": "void", + "params": [ + { + "type": "int", + "name": "logLevel" + } + ] + }, + { + "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": "SetTraceLogCallback", + "description": "Set custom trace log", + "returnType": "void", + "params": [ + { + "type": "TraceLogCallback", + "name": "callback" + } + ] + }, + { + "name": "MemAlloc", + "description": "Internal memory allocator", + "returnType": "void *", + "params": [ + { + "type": "unsigned int", + "name": "size" + } + ] + }, + { + "name": "MemRealloc", + "description": "Internal memory reallocator", + "returnType": "void *", + "params": [ + { + "type": "void *", + "name": "ptr" + }, + { + "type": "unsigned int", + "name": "size" + } + ] + }, + { + "name": "MemFree", + "description": "Internal memory free", + "returnType": "void", + "params": [ + { + "type": "void *", + "name": "ptr" + } + ] + }, + { + "name": "LoadFileData", + "description": "Load file data as byte array (read)", + "returnType": "unsigned char *", + "params": [ + { + "type": "const char *", + "name": "fileName" + }, + { + "type": "int *", + "name": "dataSize" + } + ] + }, + { + "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": "int", + "name": "dataSize" + } + ] + }, + { + "name": "ExportDataAsCode", + "description": "Export data to code (.h), returns true on success", + "returnType": "bool", + "params": [ + { + "type": "const unsigned char *", + "name": "data" + }, + { + "type": "int", + "name": "dataSize" + }, + { + "type": "const char *", + "name": "fileName" + } + ] + }, + { + "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": "const char *", + "name": "text" + } + ] + }, + { + "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": "FileRename", + "description": "Rename file (if exists)", + "returnType": "int", + "params": [ + { + "type": "const char *", + "name": "fileName" + }, + { + "type": "const char *", + "name": "fileRename" + } + ] + }, + { + "name": "FileRemove", + "description": "Remove file (if exists)", + "returnType": "int", + "params": [ + { + "type": "const char *", + "name": "fileName" + } + ] + }, + { + "name": "FileCopy", + "description": "Copy file from one path to another, dstPath created if it doesn't exist", + "returnType": "int", + "params": [ + { + "type": "const char *", + "name": "srcPath" + }, + { + "type": "const char *", + "name": "dstPath" + } + ] + }, + { + "name": "FileMove", + "description": "Move file from one directory to another, dstPath created if it doesn't exist", + "returnType": "int", + "params": [ + { + "type": "const char *", + "name": "srcPath" + }, + { + "type": "const char *", + "name": "dstPath" + } + ] + }, + { + "name": "FileTextReplace", + "description": "Replace text in an existing file", + "returnType": "int", + "params": [ + { + "type": "const char *", + "name": "fileName" + }, + { + "type": "const char *", + "name": "search" + }, + { + "type": "const char *", + "name": "replacement" + } + ] + }, + { + "name": "FileTextFindIndex", + "description": "Find text in existing file", + "returnType": "int", + "params": [ + { + "type": "const char *", + "name": "fileName" + }, + { + "type": "const char *", + "name": "search" + } + ] + }, + { + "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 (recommended include point: .png, .wav)", + "returnType": "bool", + "params": [ + { + "type": "const char *", + "name": "fileName" + }, + { + "type": "const char *", + "name": "ext" + } + ] + }, + { + "name": "GetFileLength", + "description": "Get file length in bytes (NOTE: GetFileSize() conflicts with windows.h)", + "returnType": "int", + "params": [ + { + "type": "const char *", + "name": "fileName" + } + ] + }, + { + "name": "GetFileModTime", + "description": "Get file modification time (last write time)", + "returnType": "long", + "params": [ + { + "type": "const char *", + "name": "fileName" + } + ] + }, + { + "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": "GetApplicationDirectory", + "description": "Get the directory of the running application (uses static string)", + "returnType": "const char *" + }, + { + "name": "MakeDirectory", + "description": "Create directories (including full path requested), returns 0 on success", + "returnType": "int", + "params": [ + { + "type": "const char *", + "name": "dirPath" + } + ] + }, + { + "name": "ChangeDirectory", + "description": "Change working directory, return true on success", + "returnType": "bool", + "params": [ + { + "type": "const char *", + "name": "dirPath" + } + ] + }, + { + "name": "IsPathFile", + "description": "Check if a given path is a file or a directory", + "returnType": "bool", + "params": [ + { + "type": "const char *", + "name": "path" + } + ] + }, + { + "name": "IsFileNameValid", + "description": "Check if fileName is valid for the platform/OS", + "returnType": "bool", + "params": [ + { + "type": "const char *", + "name": "fileName" + } + ] + }, + { + "name": "LoadDirectoryFiles", + "description": "Load directory filepaths, files and directories, no subdirs scan", + "returnType": "FilePathList", + "params": [ + { + "type": "const char *", + "name": "dirPath" + } + ] + }, + { + "name": "LoadDirectoryFilesEx", + "description": "Load directory filepaths with extension filtering and subdir scan; some filters available: "*.*", "FILES*", "DIRS*"", + "returnType": "FilePathList", + "params": [ + { + "type": "const char *", + "name": "basePath" + }, + { + "type": "const char *", + "name": "filter" + }, + { + "type": "bool", + "name": "scanSubdirs" + } + ] + }, + { + "name": "UnloadDirectoryFiles", + "description": "Unload filepaths", + "returnType": "void", + "params": [ + { + "type": "FilePathList", + "name": "files" + } + ] + }, + { + "name": "IsFileDropped", + "description": "Check if a file has been dropped into window", + "returnType": "bool" + }, + { + "name": "LoadDroppedFiles", + "description": "Load dropped filepaths", + "returnType": "FilePathList" + }, + { + "name": "UnloadDroppedFiles", + "description": "Unload dropped filepaths", + "returnType": "void", + "params": [ + { + "type": "FilePathList", + "name": "files" + } + ] + }, + { + "name": "GetDirectoryFileCount", + "description": "Get the file count in a directory", + "returnType": "unsigned int", + "params": [ + { + "type": "const char *", + "name": "dirPath" + } + ] + }, + { + "name": "GetDirectoryFileCountEx", + "description": "Get the file count in a directory with extension filtering and recursive directory scan. Use 'DIR' in the filter string to include directories in the result", + "returnType": "unsigned int", + "params": [ + { + "type": "const char *", + "name": "basePath" + }, + { + "type": "const char *", + "name": "filter" + }, + { + "type": "bool", + "name": "scanSubdirs" + } + ] + }, + { + "name": "CompressData", + "description": "Compress data (DEFLATE algorithm), memory must be MemFree()", + "returnType": "unsigned char *", + "params": [ + { + "type": "const unsigned char *", + "name": "data" + }, + { + "type": "int", + "name": "dataSize" + }, + { + "type": "int *", + "name": "compDataSize" + } + ] + }, + { + "name": "DecompressData", + "description": "Decompress data (DEFLATE algorithm), memory must be MemFree()", + "returnType": "unsigned char *", + "params": [ + { + "type": "const unsigned char *", + "name": "compData" + }, + { + "type": "int", + "name": "compDataSize" + }, + { + "type": "int *", + "name": "dataSize" + } + ] + }, + { + "name": "EncodeDataBase64", + "description": "Encode data to Base64 string (includes NULL terminator), memory must be MemFree()", + "returnType": "char *", + "params": [ + { + "type": "const unsigned char *", + "name": "data" + }, + { + "type": "int", + "name": "dataSize" + }, + { + "type": "int *", + "name": "outputSize" + } + ] + }, + { + "name": "DecodeDataBase64", + "description": "Decode Base64 string (expected NULL terminated), memory must be MemFree()", + "returnType": "unsigned char *", + "params": [ + { + "type": "const char *", + "name": "text" + }, + { + "type": "int *", + "name": "outputSize" + } + ] + }, + { + "name": "ComputeCRC32", + "description": "Compute CRC32 hash code", + "returnType": "unsigned int", + "params": [ + { + "type": "unsigned char *", + "name": "data" + }, + { + "type": "int", + "name": "dataSize" + } + ] + }, + { + "name": "ComputeMD5", + "description": "Compute MD5 hash code, returns static int[4] (16 bytes)", + "returnType": "unsigned int *", + "params": [ + { + "type": "unsigned char *", + "name": "data" + }, + { + "type": "int", + "name": "dataSize" + } + ] + }, + { + "name": "ComputeSHA1", + "description": "Compute SHA1 hash code, returns static int[5] (20 bytes)", + "returnType": "unsigned int *", + "params": [ + { + "type": "unsigned char *", + "name": "data" + }, + { + "type": "int", + "name": "dataSize" + } + ] + }, + { + "name": "ComputeSHA256", + "description": "Compute SHA256 hash code, returns static int[8] (32 bytes)", + "returnType": "unsigned int *", + "params": [ + { + "type": "unsigned char *", + "name": "data" + }, + { + "type": "int", + "name": "dataSize" + } + ] + }, + { + "name": "LoadAutomationEventList", + "description": "Load automation events list from file, NULL for empty list, capacity = MAX_AUTOMATION_EVENTS", + "returnType": "AutomationEventList", + "params": [ + { + "type": "const char *", + "name": "fileName" + } + ] + }, + { + "name": "UnloadAutomationEventList", + "description": "Unload automation events list from file", + "returnType": "void", + "params": [ + { + "type": "AutomationEventList", + "name": "list" + } + ] + }, + { + "name": "ExportAutomationEventList", + "description": "Export automation events list as text file", + "returnType": "bool", + "params": [ + { + "type": "AutomationEventList", + "name": "list" + }, + { + "type": "const char *", + "name": "fileName" + } + ] + }, + { + "name": "SetAutomationEventList", + "description": "Set automation event list to record to", + "returnType": "void", + "params": [ + { + "type": "AutomationEventList *", + "name": "list" + } + ] + }, + { + "name": "SetAutomationEventBaseFrame", + "description": "Set automation event internal base frame to start recording", + "returnType": "void", + "params": [ + { + "type": "int", + "name": "frame" + } + ] + }, + { + "name": "StartAutomationEventRecording", + "description": "Start recording automation events (AutomationEventList must be set)", + "returnType": "void" + }, + { + "name": "StopAutomationEventRecording", + "description": "Stop recording automation events", + "returnType": "void" + }, + { + "name": "PlayAutomationEvent", + "description": "Play a recorded automation event", + "returnType": "void", + "params": [ + { + "type": "AutomationEvent", + "name": "event" + } + ] + }, + { + "name": "IsKeyPressed", + "description": "Check if a key has been pressed once", + "returnType": "bool", + "params": [ + { + "type": "int", + "name": "key" + } + ] + }, + { + "name": "IsKeyPressedRepeat", + "description": "Check if a key has been pressed again", + "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": "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": "GetKeyName", + "description": "Get name of a QWERTY key on the current keyboard layout (eg returns string 'q' for KEY_A on an AZERTY keyboard)", + "returnType": "const char *", + "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": "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 axis count for a gamepad", + "returnType": "int", + "params": [ + { + "type": "int", + "name": "gamepad" + } + ] + }, + { + "name": "GetGamepadAxisMovement", + "description": "Get 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": "SetGamepadVibration", + "description": "Set gamepad vibration for both motors (duration in seconds)", + "returnType": "void", + "params": [ + { + "type": "int", + "name": "gamepad" + }, + { + "type": "float", + "name": "leftMotor" + }, + { + "type": "float", + "name": "rightMotor" + }, + { + "type": "float", + "name": "duration" + } + ] + }, + { + "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 for X or Y, whichever is larger", + "returnType": "float" + }, + { + "name": "GetMouseWheelMoveV", + "description": "Get mouse wheel movement for both X and Y", + "returnType": "Vector2" + }, + { + "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": "unsigned int", + "name": "gesture" + } + ] + }, + { + "name": "GetGestureDetected", + "description": "Get latest detected gesture", + "returnType": "int" + }, + { + "name": "GetGestureHoldDuration", + "description": "Get gesture hold time in seconds", + "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": "UpdateCamera", + "description": "Update camera position for selected mode", + "returnType": "void", + "params": [ + { + "type": "Camera *", + "name": "camera" + }, + { + "type": "int", + "name": "mode" + } + ] + }, + { + "name": "UpdateCameraPro", + "description": "Update camera movement/rotation", + "returnType": "void", + "params": [ + { + "type": "Camera *", + "name": "camera" + }, + { + "type": "Vector3", + "name": "movement" + }, + { + "type": "Vector3", + "name": "rotation" + }, + { + "type": "float", + "name": "zoom" + } + ] + }, + { + "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": "GetShapesTexture", + "description": "Get texture that is used for shapes drawing", + "returnType": "Texture2D" + }, + { + "name": "GetShapesTextureRectangle", + "description": "Get texture source rectangle that is used for shapes drawing", + "returnType": "Rectangle" + }, + { + "name": "DrawPixel", + "description": "Draw a pixel using geometry [Can be slow, use with care]", + "returnType": "void", + "params": [ + { + "type": "int", + "name": "posX" + }, + { + "type": "int", + "name": "posY" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "DrawPixelV", + "description": "Draw a pixel using geometry (Vector version) [Can be slow, use with care]", + "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 (using gl lines)", + "returnType": "void", + "params": [ + { + "type": "Vector2", + "name": "startPos" + }, + { + "type": "Vector2", + "name": "endPos" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "DrawLineEx", + "description": "Draw a line (using triangles/quads)", + "returnType": "void", + "params": [ + { + "type": "Vector2", + "name": "startPos" + }, + { + "type": "Vector2", + "name": "endPos" + }, + { + "type": "float", + "name": "thick" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "DrawLineStrip", + "description": "Draw lines sequence (using gl lines)", + "returnType": "void", + "params": [ + { + "type": "const Vector2 *", + "name": "points" + }, + { + "type": "int", + "name": "pointCount" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "DrawLineBezier", + "description": "Draw line segment cubic-bezier in-out interpolation", + "returnType": "void", + "params": [ + { + "type": "Vector2", + "name": "startPos" + }, + { + "type": "Vector2", + "name": "endPos" + }, + { + "type": "float", + "name": "thick" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "DrawLineDashed", + "description": "Draw a dashed line", + "returnType": "void", + "params": [ + { + "type": "Vector2", + "name": "startPos" + }, + { + "type": "Vector2", + "name": "endPos" + }, + { + "type": "int", + "name": "dashSize" + }, + { + "type": "int", + "name": "spaceSize" + }, + { + "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": "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": "DrawCircleGradient", + "description": "Draw a gradient-filled circle", + "returnType": "void", + "params": [ + { + "type": "Vector2", + "name": "center" + }, + { + "type": "float", + "name": "radius" + }, + { + "type": "Color", + "name": "inner" + }, + { + "type": "Color", + "name": "outer" + } + ] + }, + { + "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": "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": "DrawCircleLinesV", + "description": "Draw circle outline (Vector version)", + "returnType": "void", + "params": [ + { + "type": "Vector2", + "name": "center" + }, + { + "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": "DrawEllipseV", + "description": "Draw ellipse (Vector version)", + "returnType": "void", + "params": [ + { + "type": "Vector2", + "name": "center" + }, + { + "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": "DrawEllipseLinesV", + "description": "Draw ellipse outline (Vector version)", + "returnType": "void", + "params": [ + { + "type": "Vector2", + "name": "center" + }, + { + "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": "top" + }, + { + "type": "Color", + "name": "bottom" + } + ] + }, + { + "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": "left" + }, + { + "type": "Color", + "name": "right" + } + ] + }, + { + "name": "DrawRectangleGradientEx", + "description": "Draw a gradient-filled rectangle with custom vertex colors", + "returnType": "void", + "params": [ + { + "type": "Rectangle", + "name": "rec" + }, + { + "type": "Color", + "name": "topLeft" + }, + { + "type": "Color", + "name": "bottomLeft" + }, + { + "type": "Color", + "name": "bottomRight" + }, + { + "type": "Color", + "name": "topRight" + } + ] + }, + { + "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 lines with rounded edges", + "returnType": "void", + "params": [ + { + "type": "Rectangle", + "name": "rec" + }, + { + "type": "float", + "name": "roundness" + }, + { + "type": "int", + "name": "segments" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "DrawRectangleRoundedLinesEx", + "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": "const 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": "const 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": "DrawSplineLinear", + "description": "Draw spline: Linear, minimum 2 points", + "returnType": "void", + "params": [ + { + "type": "const Vector2 *", + "name": "points" + }, + { + "type": "int", + "name": "pointCount" + }, + { + "type": "float", + "name": "thick" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "DrawSplineBasis", + "description": "Draw spline: B-Spline, minimum 4 points", + "returnType": "void", + "params": [ + { + "type": "const Vector2 *", + "name": "points" + }, + { + "type": "int", + "name": "pointCount" + }, + { + "type": "float", + "name": "thick" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "DrawSplineCatmullRom", + "description": "Draw spline: Catmull-Rom, minimum 4 points", + "returnType": "void", + "params": [ + { + "type": "const Vector2 *", + "name": "points" + }, + { + "type": "int", + "name": "pointCount" + }, + { + "type": "float", + "name": "thick" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "DrawSplineBezierQuadratic", + "description": "Draw spline: Quadratic Bezier, minimum 3 points (1 control point): [p1, c2, p3, c4...]", + "returnType": "void", + "params": [ + { + "type": "const Vector2 *", + "name": "points" + }, + { + "type": "int", + "name": "pointCount" + }, + { + "type": "float", + "name": "thick" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "DrawSplineBezierCubic", + "description": "Draw spline: Cubic Bezier, minimum 4 points (2 control points): [p1, c2, c3, p4, c5, c6...]", + "returnType": "void", + "params": [ + { + "type": "const Vector2 *", + "name": "points" + }, + { + "type": "int", + "name": "pointCount" + }, + { + "type": "float", + "name": "thick" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "DrawSplineSegmentLinear", + "description": "Draw spline segment: Linear, 2 points", + "returnType": "void", + "params": [ + { + "type": "Vector2", + "name": "p1" + }, + { + "type": "Vector2", + "name": "p2" + }, + { + "type": "float", + "name": "thick" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "DrawSplineSegmentBasis", + "description": "Draw spline segment: B-Spline, 4 points", + "returnType": "void", + "params": [ + { + "type": "Vector2", + "name": "p1" + }, + { + "type": "Vector2", + "name": "p2" + }, + { + "type": "Vector2", + "name": "p3" + }, + { + "type": "Vector2", + "name": "p4" + }, + { + "type": "float", + "name": "thick" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "DrawSplineSegmentCatmullRom", + "description": "Draw spline segment: Catmull-Rom, 4 points", + "returnType": "void", + "params": [ + { + "type": "Vector2", + "name": "p1" + }, + { + "type": "Vector2", + "name": "p2" + }, + { + "type": "Vector2", + "name": "p3" + }, + { + "type": "Vector2", + "name": "p4" + }, + { + "type": "float", + "name": "thick" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "DrawSplineSegmentBezierQuadratic", + "description": "Draw spline segment: Quadratic Bezier, 2 points, 1 control point", + "returnType": "void", + "params": [ + { + "type": "Vector2", + "name": "p1" + }, + { + "type": "Vector2", + "name": "c2" + }, + { + "type": "Vector2", + "name": "p3" + }, + { + "type": "float", + "name": "thick" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "DrawSplineSegmentBezierCubic", + "description": "Draw spline segment: Cubic Bezier, 2 points, 2 control points", + "returnType": "void", + "params": [ + { + "type": "Vector2", + "name": "p1" + }, + { + "type": "Vector2", + "name": "c2" + }, + { + "type": "Vector2", + "name": "c3" + }, + { + "type": "Vector2", + "name": "p4" + }, + { + "type": "float", + "name": "thick" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "GetSplinePointLinear", + "description": "Get (evaluate) spline point: Linear", + "returnType": "Vector2", + "params": [ + { + "type": "Vector2", + "name": "startPos" + }, + { + "type": "Vector2", + "name": "endPos" + }, + { + "type": "float", + "name": "t" + } + ] + }, + { + "name": "GetSplinePointBasis", + "description": "Get (evaluate) spline point: B-Spline", + "returnType": "Vector2", + "params": [ + { + "type": "Vector2", + "name": "p1" + }, + { + "type": "Vector2", + "name": "p2" + }, + { + "type": "Vector2", + "name": "p3" + }, + { + "type": "Vector2", + "name": "p4" + }, + { + "type": "float", + "name": "t" + } + ] + }, + { + "name": "GetSplinePointCatmullRom", + "description": "Get (evaluate) spline point: Catmull-Rom", + "returnType": "Vector2", + "params": [ + { + "type": "Vector2", + "name": "p1" + }, + { + "type": "Vector2", + "name": "p2" + }, + { + "type": "Vector2", + "name": "p3" + }, + { + "type": "Vector2", + "name": "p4" + }, + { + "type": "float", + "name": "t" + } + ] + }, + { + "name": "GetSplinePointBezierQuad", + "description": "Get (evaluate) spline point: Quadratic Bezier", + "returnType": "Vector2", + "params": [ + { + "type": "Vector2", + "name": "p1" + }, + { + "type": "Vector2", + "name": "c2" + }, + { + "type": "Vector2", + "name": "p3" + }, + { + "type": "float", + "name": "t" + } + ] + }, + { + "name": "GetSplinePointBezierCubic", + "description": "Get (evaluate) spline point: Cubic Bezier", + "returnType": "Vector2", + "params": [ + { + "type": "Vector2", + "name": "p1" + }, + { + "type": "Vector2", + "name": "c2" + }, + { + "type": "Vector2", + "name": "c3" + }, + { + "type": "Vector2", + "name": "p4" + }, + { + "type": "float", + "name": "t" + } + ] + }, + { + "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": "CheckCollisionCircleLine", + "description": "Check if circle collides with a line created betweeen two points [p1] and [p2]", + "returnType": "bool", + "params": [ + { + "type": "Vector2", + "name": "center" + }, + { + "type": "float", + "name": "radius" + }, + { + "type": "Vector2", + "name": "p1" + }, + { + "type": "Vector2", + "name": "p2" + } + ] + }, + { + "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": "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": "CheckCollisionPointPoly", + "description": "Check if point is within a polygon described by array of vertices", + "returnType": "bool", + "params": [ + { + "type": "Vector2", + "name": "point" + }, + { + "type": "const Vector2 *", + "name": "points" + }, + { + "type": "int", + "name": "pointCount" + } + ] + }, + { + "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": "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": "LoadImageAnimFromMemory", + "description": "Load image sequence from memory buffer", + "returnType": "Image", + "params": [ + { + "type": "const char *", + "name": "fileType" + }, + { + "type": "const unsigned char *", + "name": "fileData" + }, + { + "type": "int", + "name": "dataSize" + }, + { + "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": "IsImageValid", + "description": "Check if an image is valid (data and parameters)", + "returnType": "bool", + "params": [ + { + "type": "Image", + "name": "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": "ExportImageToMemory", + "description": "Export image to memory buffer, memory must be MemFree()", + "returnType": "unsigned char *", + "params": [ + { + "type": "Image", + "name": "image" + }, + { + "type": "const char *", + "name": "fileType" + }, + { + "type": "int *", + "name": "fileSize" + } + ] + }, + { + "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": "GenImageGradientLinear", + "description": "Generate image: linear gradient, direction in degrees [0..360], 0=Vertical gradient", + "returnType": "Image", + "params": [ + { + "type": "int", + "name": "width" + }, + { + "type": "int", + "name": "height" + }, + { + "type": "int", + "name": "direction" + }, + { + "type": "Color", + "name": "start" + }, + { + "type": "Color", + "name": "end" + } + ] + }, + { + "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": "GenImageGradientSquare", + "description": "Generate image: square 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": "GenImagePerlinNoise", + "description": "Generate image: perlin noise", + "returnType": "Image", + "params": [ + { + "type": "int", + "name": "width" + }, + { + "type": "int", + "name": "height" + }, + { + "type": "int", + "name": "offsetX" + }, + { + "type": "int", + "name": "offsetY" + }, + { + "type": "float", + "name": "scale" + } + ] + }, + { + "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": "GenImageText", + "description": "Generate image: grayscale image from text data", + "returnType": "Image", + "params": [ + { + "type": "int", + "name": "width" + }, + { + "type": "int", + "name": "height" + }, + { + "type": "const char *", + "name": "text" + } + ] + }, + { + "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": "ImageFromChannel", + "description": "Create an image from a selected channel of another image (GRAYSCALE)", + "returnType": "Image", + "params": [ + { + "type": "Image", + "name": "image" + }, + { + "type": "int", + "name": "selectedChannel" + } + ] + }, + { + "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": "ImageBlurGaussian", + "description": "Apply Gaussian blur using a box blur approximation", + "returnType": "void", + "params": [ + { + "type": "Image *", + "name": "image" + }, + { + "type": "int", + "name": "blurSize" + } + ] + }, + { + "name": "ImageKernelConvolution", + "description": "Apply custom square convolution kernel to image", + "returnType": "void", + "params": [ + { + "type": "Image *", + "name": "image" + }, + { + "type": "const float *", + "name": "kernel" + }, + { + "type": "int", + "name": "kernelSize" + } + ] + }, + { + "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": "ImageRotate", + "description": "Rotate image by input angle in degrees (-359 to 359)", + "returnType": "void", + "params": [ + { + "type": "Image *", + "name": "image" + }, + { + "type": "int", + "name": "degrees" + } + ] + }, + { + "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": "ImageDrawLineEx", + "description": "Draw a line defining thickness within an image", + "returnType": "void", + "params": [ + { + "type": "Image *", + "name": "dst" + }, + { + "type": "Vector2", + "name": "start" + }, + { + "type": "Vector2", + "name": "end" + }, + { + "type": "int", + "name": "thick" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "ImageDrawCircle", + "description": "Draw a filled 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 a filled 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": "ImageDrawCircleLines", + "description": "Draw circle outline 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": "ImageDrawCircleLinesV", + "description": "Draw circle outline 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": "ImageDrawTriangle", + "description": "Draw triangle within an image", + "returnType": "void", + "params": [ + { + "type": "Image *", + "name": "dst" + }, + { + "type": "Vector2", + "name": "v1" + }, + { + "type": "Vector2", + "name": "v2" + }, + { + "type": "Vector2", + "name": "v3" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "ImageDrawTriangleEx", + "description": "Draw triangle with interpolated colors within an image", + "returnType": "void", + "params": [ + { + "type": "Image *", + "name": "dst" + }, + { + "type": "Vector2", + "name": "v1" + }, + { + "type": "Vector2", + "name": "v2" + }, + { + "type": "Vector2", + "name": "v3" + }, + { + "type": "Color", + "name": "c1" + }, + { + "type": "Color", + "name": "c2" + }, + { + "type": "Color", + "name": "c3" + } + ] + }, + { + "name": "ImageDrawTriangleLines", + "description": "Draw triangle outline within an image", + "returnType": "void", + "params": [ + { + "type": "Image *", + "name": "dst" + }, + { + "type": "Vector2", + "name": "v1" + }, + { + "type": "Vector2", + "name": "v2" + }, + { + "type": "Vector2", + "name": "v3" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "ImageDrawTriangleFan", + "description": "Draw a triangle fan defined by points within an image (first vertex is the center)", + "returnType": "void", + "params": [ + { + "type": "Image *", + "name": "dst" + }, + { + "type": "const Vector2 *", + "name": "points" + }, + { + "type": "int", + "name": "pointCount" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "ImageDrawTriangleStrip", + "description": "Draw a triangle strip defined by points within an image", + "returnType": "void", + "params": [ + { + "type": "Image *", + "name": "dst" + }, + { + "type": "const Vector2 *", + "name": "points" + }, + { + "type": "int", + "name": "pointCount" + }, + { + "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": "IsTextureValid", + "description": "Check if a texture is valid (loaded in GPU)", + "returnType": "bool", + "params": [ + { + "type": "Texture2D", + "name": "texture" + } + ] + }, + { + "name": "UnloadTexture", + "description": "Unload texture from GPU memory (VRAM)", + "returnType": "void", + "params": [ + { + "type": "Texture2D", + "name": "texture" + } + ] + }, + { + "name": "IsRenderTextureValid", + "description": "Check if a render texture is valid (loaded in GPU)", + "returnType": "bool", + "params": [ + { + "type": "RenderTexture2D", + "name": "target" + } + ] + }, + { + "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 (pixels should be able to fill texture)", + "returnType": "void", + "params": [ + { + "type": "Texture2D", + "name": "texture" + }, + { + "type": "const void *", + "name": "pixels" + } + ] + }, + { + "name": "UpdateTextureRec", + "description": "Update GPU texture rectangle with new data (pixels and rec should fit in texture)", + "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": "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": "ColorIsEqual", + "description": "Check if two colors are equal", + "returnType": "bool", + "params": [ + { + "type": "Color", + "name": "col1" + }, + { + "type": "Color", + "name": "col2" + } + ] + }, + { + "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 (0xRRGGBBAA)", + "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": "ColorTint", + "description": "Get color multiplied with another color", + "returnType": "Color", + "params": [ + { + "type": "Color", + "name": "color" + }, + { + "type": "Color", + "name": "tint" + } + ] + }, + { + "name": "ColorBrightness", + "description": "Get color with brightness correction, brightness factor goes from -1.0f to 1.0f", + "returnType": "Color", + "params": [ + { + "type": "Color", + "name": "color" + }, + { + "type": "float", + "name": "factor" + } + ] + }, + { + "name": "ColorContrast", + "description": "Get color with contrast correction, contrast values between -1.0f and 1.0f", + "returnType": "Color", + "params": [ + { + "type": "Color", + "name": "color" + }, + { + "type": "float", + "name": "contrast" + } + ] + }, + { + "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": "ColorLerp", + "description": "Get color lerp interpolation between two colors, factor [0.0f..1.0f]", + "returnType": "Color", + "params": [ + { + "type": "Color", + "name": "color1" + }, + { + "type": "Color", + "name": "color2" + }, + { + "type": "float", + "name": "factor" + } + ] + }, + { + "name": "GetColor", + "description": "Get Color structure from hexadecimal value", + "returnType": "Color", + "params": [ + { + "type": "unsigned int", + "name": "hexValue" + } + ] + }, + { + "name": "GetPixelColor", + "description": "Get Color from a source pixel pointer of certain format", + "returnType": "Color", + "params": [ + { + "type": "void *", + "name": "srcPtr" + }, + { + "type": "int", + "name": "format" + } + ] + }, + { + "name": "SetPixelColor", + "description": "Set color formatted into destination pixel pointer", + "returnType": "void", + "params": [ + { + "type": "void *", + "name": "dstPtr" + }, + { + "type": "Color", + "name": "color" + }, + { + "type": "int", + "name": "format" + } + ] + }, + { + "name": "GetPixelDataSize", + "description": "Get pixel data size in bytes for certain format", + "returnType": "int", + "params": [ + { + "type": "int", + "name": "width" + }, + { + "type": "int", + "name": "height" + }, + { + "type": "int", + "name": "format" + } + ] + }, + { + "name": "GetFontDefault", + "description": "Get the default Font", + "returnType": "Font" + }, + { + "name": "LoadFont", + "description": "Load font from file into GPU memory (VRAM)", + "returnType": "Font", + "params": [ + { + "type": "const char *", + "name": "fileName" + } + ] + }, + { + "name": "LoadFontEx", + "description": "Load font from file with extended parameters, use NULL for codepoints and 0 for codepointCount to load the default character set, font size is provided in pixels height", + "returnType": "Font", + "params": [ + { + "type": "const char *", + "name": "fileName" + }, + { + "type": "int", + "name": "fontSize" + }, + { + "type": "const int *", + "name": "codepoints" + }, + { + "type": "int", + "name": "codepointCount" + } + ] + }, + { + "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": "const int *", + "name": "codepoints" + }, + { + "type": "int", + "name": "codepointCount" + } + ] + }, + { + "name": "IsFontValid", + "description": "Check if a font is valid (font data loaded, WARNING: GPU texture not checked)", + "returnType": "bool", + "params": [ + { + "type": "Font", + "name": "font" + } + ] + }, + { + "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": "const int *", + "name": "codepoints" + }, + { + "type": "int", + "name": "codepointCount" + }, + { + "type": "int", + "name": "type" + }, + { + "type": "int *", + "name": "glyphCount" + } + ] + }, + { + "name": "GenImageFontAtlas", + "description": "Generate image font atlas using chars info", + "returnType": "Image", + "params": [ + { + "type": "const GlyphInfo *", + "name": "glyphs" + }, + { + "type": "Rectangle **", + "name": "glyphRecs" + }, + { + "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": "glyphs" + }, + { + "type": "int", + "name": "glyphCount" + } + ] + }, + { + "name": "UnloadFont", + "description": "Unload font from GPU memory (VRAM)", + "returnType": "void", + "params": [ + { + "type": "Font", + "name": "font" + } + ] + }, + { + "name": "ExportFontAsCode", + "description": "Export font as code file, returns true on success", + "returnType": "bool", + "params": [ + { + "type": "Font", + "name": "font" + }, + { + "type": "const char *", + "name": "fileName" + } + ] + }, + { + "name": "DrawFPS", + "description": "Draw current FPS", + "returnType": "void", + "params": [ + { + "type": "int", + "name": "posX" + }, + { + "type": "int", + "name": "posY" + } + ] + }, + { + "name": "DrawText", + "description": "Draw text (using default font)", + "returnType": "void", + "params": [ + { + "type": "const char *", + "name": "text" + }, + { + "type": "int", + "name": "posX" + }, + { + "type": "int", + "name": "posY" + }, + { + "type": "int", + "name": "fontSize" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "DrawTextEx", + "description": "Draw text using font and additional parameters", + "returnType": "void", + "params": [ + { + "type": "Font", + "name": "font" + }, + { + "type": "const char *", + "name": "text" + }, + { + "type": "Vector2", + "name": "position" + }, + { + "type": "float", + "name": "fontSize" + }, + { + "type": "float", + "name": "spacing" + }, + { + "type": "Color", + "name": "tint" + } + ] + }, + { + "name": "DrawTextPro", + "description": "Draw text using Font and pro parameters (rotation)", + "returnType": "void", + "params": [ + { + "type": "Font", + "name": "font" + }, + { + "type": "const char *", + "name": "text" + }, + { + "type": "Vector2", + "name": "position" + }, + { + "type": "Vector2", + "name": "origin" + }, + { + "type": "float", + "name": "rotation" + }, + { + "type": "float", + "name": "fontSize" + }, + { + "type": "float", + "name": "spacing" + }, + { + "type": "Color", + "name": "tint" + } + ] + }, + { + "name": "DrawTextCodepoint", + "description": "Draw one character (codepoint)", + "returnType": "void", + "params": [ + { + "type": "Font", + "name": "font" + }, + { + "type": "int", + "name": "codepoint" + }, + { + "type": "Vector2", + "name": "position" + }, + { + "type": "float", + "name": "fontSize" + }, + { + "type": "Color", + "name": "tint" + } + ] + }, + { + "name": "DrawTextCodepoints", + "description": "Draw multiple character (codepoint)", + "returnType": "void", + "params": [ + { + "type": "Font", + "name": "font" + }, + { + "type": "const int *", + "name": "codepoints" + }, + { + "type": "int", + "name": "codepointCount" + }, + { + "type": "Vector2", + "name": "position" + }, + { + "type": "float", + "name": "fontSize" + }, + { + "type": "float", + "name": "spacing" + }, + { + "type": "Color", + "name": "tint" + } + ] + }, + { + "name": "SetTextLineSpacing", + "description": "Set vertical line spacing when drawing with line-breaks", + "returnType": "void", + "params": [ + { + "type": "int", + "name": "spacing" + } + ] + }, + { + "name": "MeasureText", + "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": "MeasureTextCodepoints", + "description": "Measure string size for an existing array of codepoints for Font", + "returnType": "Vector2", + "params": [ + { + "type": "Font", + "name": "font" + }, + { + "type": "const int *", + "name": "codepoints" + }, + { + "type": "int", + "name": "length" + }, + { + "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": "LoadUTF8", + "description": "Load UTF-8 text encoded from codepoints array", + "returnType": "char *", + "params": [ + { + "type": "const int *", + "name": "codepoints" + }, + { + "type": "int", + "name": "length" + } + ] + }, + { + "name": "UnloadUTF8", + "description": "Unload UTF-8 text encoded from codepoints array", + "returnType": "void", + "params": [ + { + "type": "char *", + "name": "text" + } + ] + }, + { + "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": "codepointSize" + } + ] + }, + { + "name": "GetCodepointNext", + "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": "codepointSize" + } + ] + }, + { + "name": "GetCodepointPrevious", + "description": "Get previous codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure", + "returnType": "int", + "params": [ + { + "type": "const char *", + "name": "text" + }, + { + "type": "int *", + "name": "codepointSize" + } + ] + }, + { + "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": "utf8Size" + } + ] + }, + { + "name": "LoadTextLines", + "description": "Load text as separate lines ('\\n')", + "returnType": "char **", + "params": [ + { + "type": "const char *", + "name": "text" + }, + { + "type": "int *", + "name": "count" + } + ] + }, + { + "name": "UnloadTextLines", + "description": "Unload text lines", + "returnType": "void", + "params": [ + { + "type": "char **", + "name": "text" + }, + { + "type": "int", + "name": "lineCount" + } + ] + }, + { + "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": "TextRemoveSpaces", + "description": "Remove text spaces, concat words", + "returnType": "const char *", + "params": [ + { + "type": "const char *", + "name": "text" + } + ] + }, + { + "name": "GetTextBetween", + "description": "Get text between two strings", + "returnType": "char *", + "params": [ + { + "type": "const char *", + "name": "text" + }, + { + "type": "const char *", + "name": "begin" + }, + { + "type": "const char *", + "name": "end" + } + ] + }, + { + "name": "TextReplace", + "description": "Replace text string with new string", + "returnType": "char *", + "params": [ + { + "type": "const char *", + "name": "text" + }, + { + "type": "const char *", + "name": "search" + }, + { + "type": "const char *", + "name": "replacement" + } + ] + }, + { + "name": "TextReplaceAlloc", + "description": "Replace text string with new string, memory must be MemFree()", + "returnType": "char *", + "params": [ + { + "type": "const char *", + "name": "text" + }, + { + "type": "const char *", + "name": "search" + }, + { + "type": "const char *", + "name": "replacement" + } + ] + }, + { + "name": "TextReplaceBetween", + "description": "Replace text between two specific strings", + "returnType": "char *", + "params": [ + { + "type": "const char *", + "name": "text" + }, + { + "type": "const char *", + "name": "begin" + }, + { + "type": "const char *", + "name": "end" + }, + { + "type": "const char *", + "name": "replacement" + } + ] + }, + { + "name": "TextReplaceBetweenAlloc", + "description": "Replace text between two specific strings, memory must be MemFree()", + "returnType": "char *", + "params": [ + { + "type": "const char *", + "name": "text" + }, + { + "type": "const char *", + "name": "begin" + }, + { + "type": "const char *", + "name": "end" + }, + { + "type": "const char *", + "name": "replacement" + } + ] + }, + { + "name": "TextInsert", + "description": "Insert text in a defined byte position", + "returnType": "char *", + "params": [ + { + "type": "const char *", + "name": "text" + }, + { + "type": "const char *", + "name": "insert" + }, + { + "type": "int", + "name": "position" + } + ] + }, + { + "name": "TextInsertAlloc", + "description": "Insert text in a defined byte position, memory must be MemFree()", + "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": "char *", + "params": [ + { + "type": "char **", + "name": "textList" + }, + { + "type": "int", + "name": "count" + }, + { + "type": "const char *", + "name": "delimiter" + } + ] + }, + { + "name": "TextSplit", + "description": "Split text into multiple strings, using MAX_TEXTSPLIT_COUNT static strings", + "returnType": "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, -1 if not found", + "returnType": "int", + "params": [ + { + "type": "const char *", + "name": "text" + }, + { + "type": "const char *", + "name": "search" + } + ] + }, + { + "name": "TextToUpper", + "description": "Get upper case version of provided string", + "returnType": "char *", + "params": [ + { + "type": "const char *", + "name": "text" + } + ] + }, + { + "name": "TextToLower", + "description": "Get lower case version of provided string", + "returnType": "char *", + "params": [ + { + "type": "const char *", + "name": "text" + } + ] + }, + { + "name": "TextToPascal", + "description": "Get Pascal case notation version of provided string", + "returnType": "char *", + "params": [ + { + "type": "const char *", + "name": "text" + } + ] + }, + { + "name": "TextToSnake", + "description": "Get Snake case notation version of provided string", + "returnType": "char *", + "params": [ + { + "type": "const char *", + "name": "text" + } + ] + }, + { + "name": "TextToCamel", + "description": "Get Camel case notation version of provided string", + "returnType": "char *", + "params": [ + { + "type": "const char *", + "name": "text" + } + ] + }, + { + "name": "TextToInteger", + "description": "Get integer value from text", + "returnType": "int", + "params": [ + { + "type": "const char *", + "name": "text" + } + ] + }, + { + "name": "TextToFloat", + "description": "Get float value from text", + "returnType": "float", + "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": "const 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": "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": "DrawCapsule", + "description": "Draw a capsule with the center of its sphere caps at startPos and endPos", + "returnType": "void", + "params": [ + { + "type": "Vector3", + "name": "startPos" + }, + { + "type": "Vector3", + "name": "endPos" + }, + { + "type": "float", + "name": "radius" + }, + { + "type": "int", + "name": "slices" + }, + { + "type": "int", + "name": "rings" + }, + { + "type": "Color", + "name": "color" + } + ] + }, + { + "name": "DrawCapsuleWires", + "description": "Draw capsule wireframe with the center of its sphere caps at startPos and endPos", + "returnType": "void", + "params": [ + { + "type": "Vector3", + "name": "startPos" + }, + { + "type": "Vector3", + "name": "endPos" + }, + { + "type": "float", + "name": "radius" + }, + { + "type": "int", + "name": "slices" + }, + { + "type": "int", + "name": "rings" + }, + { + "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": "IsModelValid", + "description": "Check if a model is valid (loaded in GPU, VAO/VBOs)", + "returnType": "bool", + "params": [ + { + "type": "Model", + "name": "model" + } + ] + }, + { + "name": "UnloadModel", + "description": "Unload model (including 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": "scale" + }, + { + "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": "const 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": "const Matrix *", + "name": "transforms" + }, + { + "type": "int", + "name": "instances" + } + ] + }, + { + "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": "ExportMesh", + "description": "Export mesh data to file, returns true on success", + "returnType": "bool", + "params": [ + { + "type": "Mesh", + "name": "mesh" + }, + { + "type": "const char *", + "name": "fileName" + } + ] + }, + { + "name": "ExportMeshAsCode", + "description": "Export mesh as code file (.h) defining multiple arrays of vertex attributes", + "returnType": "bool", + "params": [ + { + "type": "Mesh", + "name": "mesh" + }, + { + "type": "const char *", + "name": "fileName" + } + ] + }, + { + "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": "IsMaterialValid", + "description": "Check if a material is valid (shader assigned, map textures loaded in GPU)", + "returnType": "bool", + "params": [ + { + "type": "Material", + "name": "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": "int *", + "name": "animCount" + } + ] + }, + { + "name": "UpdateModelAnimation", + "description": "Update model animation pose (vertex buffers and bone matrices)", + "returnType": "void", + "params": [ + { + "type": "Model", + "name": "model" + }, + { + "type": "ModelAnimation", + "name": "anim" + }, + { + "type": "float", + "name": "frame" + } + ] + }, + { + "name": "UpdateModelAnimationEx", + "description": "Update model animation pose, blending two animations", + "returnType": "void", + "params": [ + { + "type": "Model", + "name": "model" + }, + { + "type": "ModelAnimation", + "name": "animA" + }, + { + "type": "float", + "name": "frameA" + }, + { + "type": "ModelAnimation", + "name": "animB" + }, + { + "type": "float", + "name": "frameB" + }, + { + "type": "float", + "name": "blend" + } + ] + }, + { + "name": "UnloadModelAnimations", + "description": "Unload animation array data", + "returnType": "void", + "params": [ + { + "type": "ModelAnimation *", + "name": "animations" + }, + { + "type": "int", + "name": "animCount" + } + ] + }, + { + "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": "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": "GetMasterVolume", + "description": "Get master volume (listener)", + "returnType": "float" + }, + { + "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": "IsWaveValid", + "description": "Checks if wave data is valid (data loaded and parameters)", + "returnType": "bool", + "params": [ + { + "type": "Wave", + "name": "wave" + } + ] + }, + { + "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": "LoadSoundAlias", + "description": "Create a new sound that shares the same sample data as the source sound, does not own the sound data", + "returnType": "Sound", + "params": [ + { + "type": "Sound", + "name": "source" + } + ] + }, + { + "name": "IsSoundValid", + "description": "Checks if a sound is valid (data loaded and buffers initialized)", + "returnType": "bool", + "params": [ + { + "type": "Sound", + "name": "sound" + } + ] + }, + { + "name": "UpdateSound", + "description": "Update sound buffer with new data (default data format: 32 bit float, stereo)", + "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": "UnloadSoundAlias", + "description": "Unload a sound alias (does not deallocate sample data)", + "returnType": "void", + "params": [ + { + "type": "Sound", + "name": "alias" + } + ] + }, + { + "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": "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": "SetSoundPan", + "description": "Set pan for a sound (-1.0 left, 0.0 center, 1.0 right)", + "returnType": "void", + "params": [ + { + "type": "Sound", + "name": "sound" + }, + { + "type": "float", + "name": "pan" + } + ] + }, + { + "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 frames range", + "returnType": "void", + "params": [ + { + "type": "Wave *", + "name": "wave" + }, + { + "type": "int", + "name": "initFrame" + }, + { + "type": "int", + "name": "finalFrame" + } + ] + }, + { + "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": "LoadWaveSamples", + "description": "Load samples data from wave as a 32bit float data 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": "const unsigned char *", + "name": "data" + }, + { + "type": "int", + "name": "dataSize" + } + ] + }, + { + "name": "IsMusicValid", + "description": "Checks if a music stream is valid (context and buffers initialized)", + "returnType": "bool", + "params": [ + { + "type": "Music", + "name": "music" + } + ] + }, + { + "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": "SetMusicPan", + "description": "Set pan for a music (-1.0 left, 0.0 center, 1.0 right)", + "returnType": "void", + "params": [ + { + "type": "Music", + "name": "music" + }, + { + "type": "float", + "name": "pan" + } + ] + }, + { + "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": "IsAudioStreamValid", + "description": "Checks if an audio stream is valid (buffers initialized)", + "returnType": "bool", + "params": [ + { + "type": "AudioStream", + "name": "stream" + } + ] + }, + { + "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": "SetAudioStreamPan", + "description": "Set pan for audio stream (-1.0 to 1.0 range, 0.0 is centered)", + "returnType": "void", + "params": [ + { + "type": "AudioStream", + "name": "stream" + }, + { + "type": "float", + "name": "pan" + } + ] + }, + { + "name": "SetAudioStreamBufferSizeDefault", + "description": "Default size for new audio streams", + "returnType": "void", + "params": [ + { + "type": "int", + "name": "size" + } + ] + }, + { + "name": "SetAudioStreamCallback", + "description": "Audio thread callback to request new data", + "returnType": "void", + "params": [ + { + "type": "AudioStream", + "name": "stream" + }, + { + "type": "AudioCallback", + "name": "callback" + } + ] + }, + { + "name": "AttachAudioStreamProcessor", + "description": "Attach audio stream processor to stream, receives frames x 2 samples as 'float' (stereo)", + "returnType": "void", + "params": [ + { + "type": "AudioStream", + "name": "stream" + }, + { + "type": "AudioCallback", + "name": "processor" + } + ] + }, + { + "name": "DetachAudioStreamProcessor", + "description": "Detach audio stream processor from stream", + "returnType": "void", + "params": [ + { + "type": "AudioStream", + "name": "stream" + }, + { + "type": "AudioCallback", + "name": "processor" + } + ] + }, + { + "name": "AttachAudioMixedProcessor", + "description": "Attach audio stream processor to the entire audio pipeline, receives frames x 2 samples as 'float' (stereo)", + "returnType": "void", + "params": [ + { + "type": "AudioCallback", + "name": "processor" + } + ] + }, + { + "name": "DetachAudioMixedProcessor", + "description": "Detach audio stream processor from the entire audio pipeline", + "returnType": "void", + "params": [ + { + "type": "AudioCallback", + "name": "processor" + } + ] + } + ] +} diff --git a/vendor/raylib-6.0.normalized.json b/vendor/raylib-6.0.normalized.json new file mode 100644 index 0000000..729a1df --- /dev/null +++ b/vendor/raylib-6.0.normalized.json @@ -0,0 +1,13959 @@ +{ + "schemaVersion": 1, + "source": { + "repository": "https://github.com/raysan5/raylib", + "version": "6.0", + "commit": "dbc56a87da87d973a9c5baa4e7438a9d20121d28", + "path": "tools/rlparser/output/raylib_api.json", + "blob": "06abbb7f74d1817217b21454ce463ba1b2f1e612", + "sha256": "d4e2dd0727a8edf4d4f828e23f86e3bb74e373861edd0eabef4a634ae74936d6", + "repairs": [ + { + "function": "LoadDirectoryFilesEx", + "field": "description", + "reason": "Escape three unescaped quoted glob examples", + "count": 1 + } + ] + }, + "inventory": { + "defines": 57, + "structs": 35, + "aliases": 6, + "enums": 21, + "callbacks": 6, + "functions": 600 + }, + "defines": [ + { + "name": "RAYLIB_H", + "type": "GUARD", + "value": "", + "description": "" + }, + { + "name": "RAYLIB_VERSION_MAJOR", + "type": "INT", + "value": 6, + "description": "" + }, + { + "name": "RAYLIB_VERSION_MINOR", + "type": "INT", + "value": 0, + "description": "" + }, + { + "name": "RAYLIB_VERSION_PATCH", + "type": "INT", + "value": 0, + "description": "" + }, + { + "name": "RAYLIB_VERSION", + "type": "STRING", + "value": "6.0", + "description": "" + }, + { + "name": "__declspec(x)", + "type": "MACRO", + "value": "__attribute__((x))", + "description": "" + }, + { + "name": "RLAPI", + "type": "UNKNOWN", + "value": "__declspec(dllexport)", + "description": "Building the library as a Win32 shared library (.dll)" + }, + { + "name": "PI", + "type": "FLOAT", + "value": 3.141592653589793, + "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": "" + }, + { + "name": "GetMouseRay", + "type": "UNKNOWN", + "value": "GetScreenToWorldRay", + "description": "Compatibility hack for previous raylib versions" + } + ], + "structs": [ + { + "name": "Vector2", + "description": "Vector2, 2 components", + "fields": [ + { + "name": "x", + "type": "float", + "description": "Vector x component" + }, + { + "name": "y", + "type": "float", + "description": "Vector y component" + } + ] + }, + { + "name": "Vector3", + "description": "Vector3, 3 components", + "fields": [ + { + "name": "x", + "type": "float", + "description": "Vector x component" + }, + { + "name": "y", + "type": "float", + "description": "Vector y component" + }, + { + "name": "z", + "type": "float", + "description": "Vector z component" + } + ] + }, + { + "name": "Vector4", + "description": "Vector4, 4 components", + "fields": [ + { + "name": "x", + "type": "float", + "description": "Vector x component" + }, + { + "name": "y", + "type": "float", + "description": "Vector y component" + }, + { + "name": "z", + "type": "float", + "description": "Vector z component" + }, + { + "name": "w", + "type": "float", + "description": "Vector w component" + } + ] + }, + { + "name": "Matrix", + "description": "Matrix, 4x4 components, column major, OpenGL style, right-handed", + "fields": [ + { + "name": "m0", + "type": "float", + "description": "Matrix first row (4 components)" + }, + { + "name": "m4", + "type": "float", + "description": "Matrix first row (4 components)" + }, + { + "name": "m8", + "type": "float", + "description": "Matrix first row (4 components)" + }, + { + "name": "m12", + "type": "float", + "description": "Matrix first row (4 components)" + }, + { + "name": "m1", + "type": "float", + "description": "Matrix second row (4 components)" + }, + { + "name": "m5", + "type": "float", + "description": "Matrix second row (4 components)" + }, + { + "name": "m9", + "type": "float", + "description": "Matrix second row (4 components)" + }, + { + "name": "m13", + "type": "float", + "description": "Matrix second row (4 components)" + }, + { + "name": "m2", + "type": "float", + "description": "Matrix third row (4 components)" + }, + { + "name": "m6", + "type": "float", + "description": "Matrix third row (4 components)" + }, + { + "name": "m10", + "type": "float", + "description": "Matrix third row (4 components)" + }, + { + "name": "m14", + "type": "float", + "description": "Matrix third row (4 components)" + }, + { + "name": "m3", + "type": "float", + "description": "Matrix fourth row (4 components)" + }, + { + "name": "m7", + "type": "float", + "description": "Matrix fourth row (4 components)" + }, + { + "name": "m11", + "type": "float", + "description": "Matrix fourth row (4 components)" + }, + { + "name": "m15", + "type": "float", + "description": "Matrix fourth row (4 components)" + } + ] + }, + { + "name": "Color", + "description": "Color, 4 components, R8G8B8A8 (32bit)", + "fields": [ + { + "name": "r", + "type": "unsigned char", + "description": "Color red value" + }, + { + "name": "g", + "type": "unsigned char", + "description": "Color green value" + }, + { + "name": "b", + "type": "unsigned char", + "description": "Color blue value" + }, + { + "name": "a", + "type": "unsigned char", + "description": "Color alpha value" + } + ] + }, + { + "name": "Rectangle", + "description": "Rectangle, 4 components", + "fields": [ + { + "name": "x", + "type": "float", + "description": "Rectangle top-left corner position x" + }, + { + "name": "y", + "type": "float", + "description": "Rectangle top-left corner position y" + }, + { + "name": "width", + "type": "float", + "description": "Rectangle width" + }, + { + "name": "height", + "type": "float", + "description": "Rectangle height" + } + ] + }, + { + "name": "Image", + "description": "Image, pixel data stored in CPU memory (RAM)", + "fields": [ + { + "name": "data", + "type": "void *", + "description": "Image raw data" + }, + { + "name": "width", + "type": "int", + "description": "Image base width" + }, + { + "name": "height", + "type": "int", + "description": "Image base height" + }, + { + "name": "mipmaps", + "type": "int", + "description": "Mipmap levels, 1 by default" + }, + { + "name": "format", + "type": "int", + "description": "Data format (PixelFormat type)" + } + ] + }, + { + "name": "Texture", + "description": "Texture, tex data stored in GPU memory (VRAM)", + "fields": [ + { + "name": "id", + "type": "unsigned int", + "description": "OpenGL texture id" + }, + { + "name": "width", + "type": "int", + "description": "Texture base width" + }, + { + "name": "height", + "type": "int", + "description": "Texture base height" + }, + { + "name": "mipmaps", + "type": "int", + "description": "Mipmap levels, 1 by default" + }, + { + "name": "format", + "type": "int", + "description": "Data format (PixelFormat type)" + } + ] + }, + { + "name": "RenderTexture", + "description": "RenderTexture, fbo for texture rendering", + "fields": [ + { + "name": "id", + "type": "unsigned int", + "description": "OpenGL framebuffer object id" + }, + { + "name": "texture", + "type": "Texture", + "description": "Color buffer attachment texture" + }, + { + "name": "depth", + "type": "Texture", + "description": "Depth buffer attachment texture" + } + ] + }, + { + "name": "NPatchInfo", + "description": "NPatchInfo, n-patch layout info", + "fields": [ + { + "name": "source", + "type": "Rectangle", + "description": "Texture source rectangle" + }, + { + "name": "left", + "type": "int", + "description": "Left border offset" + }, + { + "name": "top", + "type": "int", + "description": "Top border offset" + }, + { + "name": "right", + "type": "int", + "description": "Right border offset" + }, + { + "name": "bottom", + "type": "int", + "description": "Bottom border offset" + }, + { + "name": "layout", + "type": "int", + "description": "Layout of the n-patch: 3x3, 1x3 or 3x1" + } + ] + }, + { + "name": "GlyphInfo", + "description": "GlyphInfo, font characters glyphs info", + "fields": [ + { + "name": "value", + "type": "int", + "description": "Character value (Unicode)" + }, + { + "name": "offsetX", + "type": "int", + "description": "Character offset X when drawing" + }, + { + "name": "offsetY", + "type": "int", + "description": "Character offset Y when drawing" + }, + { + "name": "advanceX", + "type": "int", + "description": "Character advance position X" + }, + { + "name": "image", + "type": "Image", + "description": "Character image data" + } + ] + }, + { + "name": "Font", + "description": "Font, font texture and GlyphInfo array data", + "fields": [ + { + "name": "baseSize", + "type": "int", + "description": "Base size (default chars height)" + }, + { + "name": "glyphCount", + "type": "int", + "description": "Number of glyph characters" + }, + { + "name": "glyphPadding", + "type": "int", + "description": "Padding around the glyph characters" + }, + { + "name": "texture", + "type": "Texture2D", + "description": "Texture atlas containing the glyphs" + }, + { + "name": "recs", + "type": "Rectangle *", + "description": "Rectangles in texture for the glyphs" + }, + { + "name": "glyphs", + "type": "GlyphInfo *", + "description": "Glyphs info data" + } + ] + }, + { + "name": "Camera3D", + "description": "Camera, defines position/orientation in 3d space", + "fields": [ + { + "name": "position", + "type": "Vector3", + "description": "Camera position" + }, + { + "name": "target", + "type": "Vector3", + "description": "Camera target it looks-at" + }, + { + "name": "up", + "type": "Vector3", + "description": "Camera up vector (rotation over its axis)" + }, + { + "name": "fovy", + "type": "float", + "description": "Camera field-of-view aperture in Y (degrees) in perspective, used as near plane height in world units in orthographic" + }, + { + "name": "projection", + "type": "int", + "description": "Camera projection: CAMERA_PERSPECTIVE or CAMERA_ORTHOGRAPHIC" + } + ] + }, + { + "name": "Camera2D", + "description": "Camera2D, defines position/orientation in 2d space", + "fields": [ + { + "name": "offset", + "type": "Vector2", + "description": "Camera offset (screen space offset from window origin)" + }, + { + "name": "target", + "type": "Vector2", + "description": "Camera target (world space target point that is mapped to screen space offset)" + }, + { + "name": "rotation", + "type": "float", + "description": "Camera rotation in degrees (pivots around target)" + }, + { + "name": "zoom", + "type": "float", + "description": "Camera zoom (scaling around target), must not be set to 0, set to 1.0f for no scale" + } + ] + }, + { + "name": "Mesh", + "description": "Mesh, vertex data and vao/vbo", + "fields": [ + { + "name": "vertexCount", + "type": "int", + "description": "Number of vertices stored in arrays" + }, + { + "name": "triangleCount", + "type": "int", + "description": "Number of triangles stored (indexed or not)" + }, + { + "name": "vertices", + "type": "float *", + "description": "Vertex position (XYZ - 3 components per vertex) (shader-location = 0)" + }, + { + "name": "texcoords", + "type": "float *", + "description": "Vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1)" + }, + { + "name": "texcoords2", + "type": "float *", + "description": "Vertex texture second coordinates (UV - 2 components per vertex) (shader-location = 5)" + }, + { + "name": "normals", + "type": "float *", + "description": "Vertex normals (XYZ - 3 components per vertex) (shader-location = 2)" + }, + { + "name": "tangents", + "type": "float *", + "description": "Vertex tangents (XYZW - 4 components per vertex) (shader-location = 4)" + }, + { + "name": "colors", + "type": "unsigned char *", + "description": "Vertex colors (RGBA - 4 components per vertex) (shader-location = 3)" + }, + { + "name": "indices", + "type": "unsigned short *", + "description": "Vertex indices (in case vertex data comes indexed)" + }, + { + "name": "boneCount", + "type": "int", + "description": "Number of bones (MAX: 256 bones)" + }, + { + "name": "boneIndices", + "type": "unsigned char *", + "description": "Vertex bone indices, up to 4 bones influence by vertex (skinning) (shader-location = 6)" + }, + { + "name": "boneWeights", + "type": "float *", + "description": "Vertex bone weight, up to 4 bones influence by vertex (skinning) (shader-location = 7)" + }, + { + "name": "animVertices", + "type": "float *", + "description": "Animated vertex positions (after bones transformations)" + }, + { + "name": "animNormals", + "type": "float *", + "description": "Animated normals (after bones transformations)" + }, + { + "name": "vaoId", + "type": "unsigned int", + "description": "OpenGL Vertex Array Object id" + }, + { + "name": "vboId", + "type": "unsigned int *", + "description": "OpenGL Vertex Buffer Objects id (default vertex data)" + } + ] + }, + { + "name": "Shader", + "description": "Shader", + "fields": [ + { + "name": "id", + "type": "unsigned int", + "description": "Shader program id" + }, + { + "name": "locs", + "type": "int *", + "description": "Shader locations array (RL_MAX_SHADER_LOCATIONS)" + } + ] + }, + { + "name": "MaterialMap", + "description": "MaterialMap", + "fields": [ + { + "name": "texture", + "type": "Texture2D", + "description": "Material map texture" + }, + { + "name": "color", + "type": "Color", + "description": "Material map color" + }, + { + "name": "value", + "type": "float", + "description": "Material map value" + } + ] + }, + { + "name": "Material", + "description": "Material, includes shader and maps", + "fields": [ + { + "name": "shader", + "type": "Shader", + "description": "Material shader" + }, + { + "name": "maps", + "type": "MaterialMap *", + "description": "Material maps array (MAX_MATERIAL_MAPS)" + }, + { + "name": "params", + "type": "float[4]", + "description": "Material generic parameters (if required)" + } + ] + }, + { + "name": "Transform", + "description": "Transform, vertex transformation data", + "fields": [ + { + "name": "translation", + "type": "Vector3", + "description": "Translation" + }, + { + "name": "rotation", + "type": "Quaternion", + "description": "Rotation" + }, + { + "name": "scale", + "type": "Vector3", + "description": "Scale" + } + ] + }, + { + "name": "BoneInfo", + "description": "Bone, skeletal animation bone", + "fields": [ + { + "name": "name", + "type": "char[32]", + "description": "Bone name" + }, + { + "name": "parent", + "type": "int", + "description": "Bone parent" + } + ] + }, + { + "name": "ModelSkeleton", + "description": "Skeleton, animation bones hierarchy", + "fields": [ + { + "name": "boneCount", + "type": "int", + "description": "Number of bones" + }, + { + "name": "bones", + "type": "BoneInfo *", + "description": "Bones information (skeleton)" + }, + { + "name": "bindPose", + "type": "ModelAnimPose", + "description": "Bones base transformation (Transform[])" + } + ] + }, + { + "name": "Model", + "description": "Model, meshes, materials and animation data", + "fields": [ + { + "name": "transform", + "type": "Matrix", + "description": "Local transform matrix" + }, + { + "name": "meshCount", + "type": "int", + "description": "Number of meshes" + }, + { + "name": "materialCount", + "type": "int", + "description": "Number of materials" + }, + { + "name": "meshes", + "type": "Mesh *", + "description": "Meshes array" + }, + { + "name": "materials", + "type": "Material *", + "description": "Materials array" + }, + { + "name": "meshMaterial", + "type": "int *", + "description": "Mesh material number" + }, + { + "name": "skeleton", + "type": "ModelSkeleton", + "description": "Skeleton for animation" + }, + { + "name": "currentPose", + "type": "ModelAnimPose", + "description": "Current animation pose (Transform[])" + }, + { + "name": "boneMatrices", + "type": "Matrix *", + "description": "Bones animated transformation matrices" + } + ] + }, + { + "name": "ModelAnimation", + "description": "ModelAnimation, contains a full animation sequence", + "fields": [ + { + "name": "name", + "type": "char[32]", + "description": "Animation name" + }, + { + "name": "boneCount", + "type": "int", + "description": "Number of bones (per pose)" + }, + { + "name": "keyframeCount", + "type": "int", + "description": "Number of animation key frames" + }, + { + "name": "keyframePoses", + "type": "ModelAnimPose *", + "description": "Animation sequence keyframe poses [keyframe][pose]" + } + ] + }, + { + "name": "Ray", + "description": "Ray, ray for raycasting", + "fields": [ + { + "name": "position", + "type": "Vector3", + "description": "Ray position (origin)" + }, + { + "name": "direction", + "type": "Vector3", + "description": "Ray direction (normalized)" + } + ] + }, + { + "name": "RayCollision", + "description": "RayCollision, ray hit information", + "fields": [ + { + "name": "hit", + "type": "bool", + "description": "Did the ray hit something?" + }, + { + "name": "distance", + "type": "float", + "description": "Distance to the nearest hit" + }, + { + "name": "point", + "type": "Vector3", + "description": "Point of the nearest hit" + }, + { + "name": "normal", + "type": "Vector3", + "description": "Surface normal of hit" + } + ] + }, + { + "name": "BoundingBox", + "description": "BoundingBox", + "fields": [ + { + "name": "min", + "type": "Vector3", + "description": "Minimum vertex box-corner" + }, + { + "name": "max", + "type": "Vector3", + "description": "Maximum vertex box-corner" + } + ] + }, + { + "name": "Wave", + "description": "Wave, audio wave data", + "fields": [ + { + "name": "frameCount", + "type": "unsigned int", + "description": "Total number of frames (considering channels)" + }, + { + "name": "sampleRate", + "type": "unsigned int", + "description": "Frequency (samples per second)" + }, + { + "name": "sampleSize", + "type": "unsigned int", + "description": "Bit depth (bits per sample): 8, 16, 32 (24 not supported)" + }, + { + "name": "channels", + "type": "unsigned int", + "description": "Number of channels (1-mono, 2-stereo, ...)" + }, + { + "name": "data", + "type": "void *", + "description": "Buffer data pointer" + } + ] + }, + { + "name": "AudioStream", + "description": "AudioStream, custom audio stream", + "fields": [ + { + "name": "buffer", + "type": "rAudioBuffer *", + "description": "Pointer to internal data used by the audio system" + }, + { + "name": "processor", + "type": "rAudioProcessor *", + "description": "Pointer to internal data processor, useful for audio effects" + }, + { + "name": "sampleRate", + "type": "unsigned int", + "description": "Frequency (samples per second)" + }, + { + "name": "sampleSize", + "type": "unsigned int", + "description": "Bit depth (bits per sample): 8, 16, 32 (24 not supported)" + }, + { + "name": "channels", + "type": "unsigned int", + "description": "Number of channels (1-mono, 2-stereo, ...)" + } + ] + }, + { + "name": "Sound", + "description": "Sound", + "fields": [ + { + "name": "stream", + "type": "AudioStream", + "description": "Audio stream" + }, + { + "name": "frameCount", + "type": "unsigned int", + "description": "Total number of frames (considering channels)" + } + ] + }, + { + "name": "Music", + "description": "Music, audio stream, anything longer than ~10 seconds should be streamed", + "fields": [ + { + "name": "stream", + "type": "AudioStream", + "description": "Audio stream" + }, + { + "name": "frameCount", + "type": "unsigned int", + "description": "Total number of frames (considering channels)" + }, + { + "name": "looping", + "type": "bool", + "description": "Music looping enable" + }, + { + "name": "ctxType", + "type": "int", + "description": "Type of music context (audio filetype)" + }, + { + "name": "ctxData", + "type": "void *", + "description": "Audio context data, depends on type" + } + ] + }, + { + "name": "VrDeviceInfo", + "description": "VrDeviceInfo, Head-Mounted-Display device parameters", + "fields": [ + { + "name": "hResolution", + "type": "int", + "description": "Horizontal resolution in pixels" + }, + { + "name": "vResolution", + "type": "int", + "description": "Vertical resolution in pixels" + }, + { + "name": "hScreenSize", + "type": "float", + "description": "Horizontal size in meters" + }, + { + "name": "vScreenSize", + "type": "float", + "description": "Vertical size in meters" + }, + { + "name": "eyeToScreenDistance", + "type": "float", + "description": "Distance between eye and display in meters" + }, + { + "name": "lensSeparationDistance", + "type": "float", + "description": "Lens separation distance in meters" + }, + { + "name": "interpupillaryDistance", + "type": "float", + "description": "IPD (distance between pupils) in meters" + }, + { + "name": "lensDistortionValues", + "type": "float[4]", + "description": "Lens distortion constant parameters" + }, + { + "name": "chromaAbCorrection", + "type": "float[4]", + "description": "Chromatic aberration correction parameters" + } + ] + }, + { + "name": "VrStereoConfig", + "description": "VrStereoConfig, VR stereo rendering configuration for simulator", + "fields": [ + { + "name": "projection", + "type": "Matrix[2]", + "description": "VR projection matrices (per eye)" + }, + { + "name": "viewOffset", + "type": "Matrix[2]", + "description": "VR view offset matrices (per eye)" + }, + { + "name": "leftLensCenter", + "type": "float[2]", + "description": "VR left lens center" + }, + { + "name": "rightLensCenter", + "type": "float[2]", + "description": "VR right lens center" + }, + { + "name": "leftScreenCenter", + "type": "float[2]", + "description": "VR left screen center" + }, + { + "name": "rightScreenCenter", + "type": "float[2]", + "description": "VR right screen center" + }, + { + "name": "scale", + "type": "float[2]", + "description": "VR distortion scale" + }, + { + "name": "scaleIn", + "type": "float[2]", + "description": "VR distortion scale in" + } + ] + }, + { + "name": "FilePathList", + "description": "File path list", + "fields": [ + { + "name": "count", + "type": "unsigned int", + "description": "Filepaths entries count" + }, + { + "name": "paths", + "type": "char **", + "description": "Filepaths entries" + } + ] + }, + { + "name": "AutomationEvent", + "description": "Automation event", + "fields": [ + { + "name": "frame", + "type": "unsigned int", + "description": "Event frame" + }, + { + "name": "type", + "type": "unsigned int", + "description": "Event type (AutomationEventType)" + }, + { + "name": "params", + "type": "int[4]", + "description": "Event parameters (if required)" + } + ] + }, + { + "name": "AutomationEventList", + "description": "Automation event list", + "fields": [ + { + "name": "capacity", + "type": "unsigned int", + "description": "Events max entries (MAX_AUTOMATION_EVENTS)" + }, + { + "name": "count", + "type": "unsigned int", + "description": "Events entries count" + }, + { + "name": "events", + "type": "AutomationEvent *", + "description": "Events entries" + } + ] + } + ], + "aliases": [ + { + "name": "Quaternion", + "type": "Vector4", + "pointerDepth": 0, + "description": "Quaternion, 4 components (Vector4 alias)" + }, + { + "name": "Texture2D", + "type": "Texture", + "pointerDepth": 0, + "description": "Texture2D, same as Texture" + }, + { + "name": "TextureCubemap", + "type": "Texture", + "pointerDepth": 0, + "description": "TextureCubemap, same as Texture" + }, + { + "name": "RenderTexture2D", + "type": "RenderTexture", + "pointerDepth": 0, + "description": "RenderTexture2D, same as RenderTexture" + }, + { + "name": "Camera", + "type": "Camera3D", + "pointerDepth": 0, + "description": "Camera type fallback, defaults to Camera3D" + }, + { + "name": "ModelAnimPose", + "type": "Transform", + "pointerDepth": 1, + "description": "Anim pose, an array of Transform[]" + } + ], + "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_WINDOW_MOUSE_PASSTHROUGH", + "value": 16384, + "description": "Set to support mouse passthrough, only supported when FLAG_WINDOW_UNDECORATED" + }, + { + "name": "FLAG_BORDERLESS_WINDOWED_MODE", + "value": 32768, + "description": "Set to run program in borderless windowed mode" + }, + { + "name": "FLAG_MSAA_4X_HINT", + "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": 5, + "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 forward (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 omnidirectional 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, 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: Circle, Xbox: B)" + }, + { + "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: Square, Xbox: X)" + }, + { + "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 (first), 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 axes", + "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: heightmap" + }, + { + "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": "SHADER_LOC_VERTEX_BONEIDS", + "value": 26, + "description": "Shader location: vertex attribute: bone indices" + }, + { + "name": "SHADER_LOC_VERTEX_BONEWEIGHTS", + "value": 27, + "description": "Shader location: vertex attribute: bone weights" + }, + { + "name": "SHADER_LOC_MATRIX_BONETRANSFORMS", + "value": 28, + "description": "Shader location: matrix attribute: bone transforms (animation)" + }, + { + "name": "SHADER_LOC_VERTEX_INSTANCETRANSFORM", + "value": 29, + "description": "Shader location: vertex attribute: instance transforms" + } + ] + }, + { + "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_UINT", + "value": 8, + "description": "Shader uniform type: unsigned int" + }, + { + "name": "SHADER_UNIFORM_UIVEC2", + "value": 9, + "description": "Shader uniform type: uivec2 (2 unsigned int)" + }, + { + "name": "SHADER_UNIFORM_UIVEC3", + "value": 10, + "description": "Shader uniform type: uivec3 (3 unsigned int)" + }, + { + "name": "SHADER_UNIFORM_UIVEC4", + "value": 11, + "description": "Shader uniform type: uivec4 (4 unsigned int)" + }, + { + "name": "SHADER_UNIFORM_SAMPLER2D", + "value": 12, + "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_UNCOMPRESSED_R16", + "value": 11, + "description": "16 bpp (1 channel - half float)" + }, + { + "name": "PIXELFORMAT_UNCOMPRESSED_R16G16B16", + "value": 12, + "description": "16*3 bpp (3 channels - half float)" + }, + { + "name": "PIXELFORMAT_UNCOMPRESSED_R16G16B16A16", + "value": 13, + "description": "16*4 bpp (4 channels - half float)" + }, + { + "name": "PIXELFORMAT_COMPRESSED_DXT1_RGB", + "value": 14, + "description": "4 bpp (no alpha)" + }, + { + "name": "PIXELFORMAT_COMPRESSED_DXT1_RGBA", + "value": 15, + "description": "4 bpp (1 bit alpha)" + }, + { + "name": "PIXELFORMAT_COMPRESSED_DXT3_RGBA", + "value": 16, + "description": "8 bpp" + }, + { + "name": "PIXELFORMAT_COMPRESSED_DXT5_RGBA", + "value": 17, + "description": "8 bpp" + }, + { + "name": "PIXELFORMAT_COMPRESSED_ETC1_RGB", + "value": 18, + "description": "4 bpp" + }, + { + "name": "PIXELFORMAT_COMPRESSED_ETC2_RGB", + "value": 19, + "description": "4 bpp" + }, + { + "name": "PIXELFORMAT_COMPRESSED_ETC2_EAC_RGBA", + "value": 20, + "description": "8 bpp" + }, + { + "name": "PIXELFORMAT_COMPRESSED_PVRT_RGB", + "value": 21, + "description": "4 bpp" + }, + { + "name": "PIXELFORMAT_COMPRESSED_PVRT_RGBA", + "value": 22, + "description": "4 bpp" + }, + { + "name": "PIXELFORMAT_COMPRESSED_ASTC_4x4_RGBA", + "value": 23, + "description": "8 bpp" + }, + { + "name": "PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA", + "value": 24, + "description": "2 bpp" + } + ] + }, + { + "name": "TextureFilter", + "description": "Texture parameters: filter mode", + "values": [ + { + "name": "TEXTURE_FILTER_POINT", + "value": 0, + "description": "No filter, pixel approximation" + }, + { + "name": "TEXTURE_FILTER_BILINEAR", + "value": 1, + "description": "Linear filtering" + }, + { + "name": "TEXTURE_FILTER_TRILINEAR", + "value": 2, + "description": "Trilinear filtering (linear with mipmaps)" + }, + { + "name": "TEXTURE_FILTER_ANISOTROPIC_4X", + "value": 3, + "description": "Anisotropic filtering 4x" + }, + { + "name": "TEXTURE_FILTER_ANISOTROPIC_8X", + "value": 4, + "description": "Anisotropic filtering 8x" + }, + { + "name": "TEXTURE_FILTER_ANISOTROPIC_16X", + "value": 5, + "description": "Anisotropic filtering 16x" + } + ] + }, + { + "name": "TextureWrap", + "description": "Texture parameters: wrap mode", + "values": [ + { + "name": "TEXTURE_WRAP_REPEAT", + "value": 0, + "description": "Repeats texture in tiled mode" + }, + { + "name": "TEXTURE_WRAP_CLAMP", + "value": 1, + "description": "Clamps texture to edge pixel in tiled mode" + }, + { + "name": "TEXTURE_WRAP_MIRROR_REPEAT", + "value": 2, + "description": "Mirrors and repeats the texture in tiled mode" + }, + { + "name": "TEXTURE_WRAP_MIRROR_CLAMP", + "value": 3, + "description": "Mirrors and clamps to border the texture in tiled mode" + } + ] + }, + { + "name": "CubemapLayout", + "description": "Cubemap layouts", + "values": [ + { + "name": "CUBEMAP_LAYOUT_AUTO_DETECT", + "value": 0, + "description": "Automatically detect layout type" + }, + { + "name": "CUBEMAP_LAYOUT_LINE_VERTICAL", + "value": 1, + "description": "Layout is defined by a vertical line with faces" + }, + { + "name": "CUBEMAP_LAYOUT_LINE_HORIZONTAL", + "value": 2, + "description": "Layout is defined by a 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": "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_ALPHA_PREMULTIPLY", + "value": 5, + "description": "Blend premultiplied textures considering alpha" + }, + { + "name": "BLEND_CUSTOM", + "value": 6, + "description": "Blend textures using custom src/dst factors (use rlSetBlendFactors())" + }, + { + "name": "BLEND_CUSTOM_SEPARATE", + "value": 7, + "description": "Blend textures using custom rgb/alpha separate src/dst factors (use rlSetBlendFactorsSeparate())" + } + ] + }, + { + "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": "Camera custom, controlled by user (UpdateCamera() does nothing)" + }, + { + "name": "CAMERA_FREE", + "value": 1, + "description": "Camera free mode" + }, + { + "name": "CAMERA_ORBITAL", + "value": 2, + "description": "Camera orbital, around target, zoom supported" + }, + { + "name": "CAMERA_FIRST_PERSON", + "value": 3, + "description": "Camera first person" + }, + { + "name": "CAMERA_THIRD_PERSON", + "value": 4, + "description": "Camera third person" + } + ] + }, + { + "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": [ + { + "name": "logLevel", + "type": "int", + "description": "" + }, + { + "name": "text", + "type": "const char *", + "description": "" + }, + { + "name": "args", + "type": "va_list", + "description": "" + } + ] + }, + { + "name": "LoadFileDataCallback", + "description": "FileIO: Load binary data", + "returnType": "unsigned char *", + "params": [ + { + "name": "fileName", + "type": "const char *", + "description": "" + }, + { + "name": "dataSize", + "type": "int *", + "description": "" + } + ] + }, + { + "name": "SaveFileDataCallback", + "description": "FileIO: Save binary data", + "returnType": "bool", + "params": [ + { + "name": "fileName", + "type": "const char *", + "description": "" + }, + { + "name": "data", + "type": "void *", + "description": "" + }, + { + "name": "dataSize", + "type": "int", + "description": "" + } + ] + }, + { + "name": "LoadFileTextCallback", + "description": "FileIO: Load text data", + "returnType": "char *", + "params": [ + { + "name": "fileName", + "type": "const char *", + "description": "" + } + ] + }, + { + "name": "SaveFileTextCallback", + "description": "FileIO: Save text data", + "returnType": "bool", + "params": [ + { + "name": "fileName", + "type": "const char *", + "description": "" + }, + { + "name": "text", + "type": "const char *", + "description": "" + } + ] + }, + { + "name": "AudioCallback", + "description": "", + "returnType": "void", + "params": [ + { + "name": "bufferData", + "type": "void *", + "description": "" + }, + { + "name": "frames", + "type": "unsigned int", + "description": "" + } + ] + } + ], + "functions": [ + { + "name": "InitWindow", + "description": "Initialize window and OpenGL context", + "returnType": "void", + "params": [ + { + "name": "width", + "type": "int", + "description": "" + }, + { + "name": "height", + "type": "int", + "description": "" + }, + { + "name": "title", + "type": "const char *", + "description": "" + } + ] + }, + { + "name": "CloseWindow", + "description": "Close window and unload OpenGL context", + "returnType": "void", + "params": [] + }, + { + "name": "WindowShouldClose", + "description": "Check if application should close (KEY_ESCAPE pressed or windows close icon clicked)", + "returnType": "bool", + "params": [] + }, + { + "name": "IsWindowReady", + "description": "Check if window has been initialized successfully", + "returnType": "bool", + "params": [] + }, + { + "name": "IsWindowFullscreen", + "description": "Check if window is currently fullscreen", + "returnType": "bool", + "params": [] + }, + { + "name": "IsWindowHidden", + "description": "Check if window is currently hidden", + "returnType": "bool", + "params": [] + }, + { + "name": "IsWindowMinimized", + "description": "Check if window is currently minimized", + "returnType": "bool", + "params": [] + }, + { + "name": "IsWindowMaximized", + "description": "Check if window is currently maximized", + "returnType": "bool", + "params": [] + }, + { + "name": "IsWindowFocused", + "description": "Check if window is currently focused", + "returnType": "bool", + "params": [] + }, + { + "name": "IsWindowResized", + "description": "Check if window has been resized last frame", + "returnType": "bool", + "params": [] + }, + { + "name": "IsWindowState", + "description": "Check if one specific window flag is enabled", + "returnType": "bool", + "params": [ + { + "name": "flag", + "type": "unsigned int", + "description": "" + } + ] + }, + { + "name": "SetWindowState", + "description": "Set window configuration state using flags", + "returnType": "void", + "params": [ + { + "name": "flags", + "type": "unsigned int", + "description": "" + } + ] + }, + { + "name": "ClearWindowState", + "description": "Clear window configuration state flags", + "returnType": "void", + "params": [ + { + "name": "flags", + "type": "unsigned int", + "description": "" + } + ] + }, + { + "name": "ToggleFullscreen", + "description": "Toggle window state: fullscreen/windowed, resizes monitor to match window resolution", + "returnType": "void", + "params": [] + }, + { + "name": "ToggleBorderlessWindowed", + "description": "Toggle window state: borderless windowed, resizes window to match monitor resolution", + "returnType": "void", + "params": [] + }, + { + "name": "MaximizeWindow", + "description": "Set window state: maximized, if resizable", + "returnType": "void", + "params": [] + }, + { + "name": "MinimizeWindow", + "description": "Set window state: minimized, if resizable", + "returnType": "void", + "params": [] + }, + { + "name": "RestoreWindow", + "description": "Restore window from being minimized/maximized", + "returnType": "void", + "params": [] + }, + { + "name": "SetWindowIcon", + "description": "Set icon for window (single image, RGBA 32bit)", + "returnType": "void", + "params": [ + { + "name": "image", + "type": "Image", + "description": "" + } + ] + }, + { + "name": "SetWindowIcons", + "description": "Set icon for window (multiple images, RGBA 32bit)", + "returnType": "void", + "params": [ + { + "name": "images", + "type": "Image *", + "description": "" + }, + { + "name": "count", + "type": "int", + "description": "" + } + ] + }, + { + "name": "SetWindowTitle", + "description": "Set title for window", + "returnType": "void", + "params": [ + { + "name": "title", + "type": "const char *", + "description": "" + } + ] + }, + { + "name": "SetWindowPosition", + "description": "Set window position on screen", + "returnType": "void", + "params": [ + { + "name": "x", + "type": "int", + "description": "" + }, + { + "name": "y", + "type": "int", + "description": "" + } + ] + }, + { + "name": "SetWindowMonitor", + "description": "Set monitor for the current window", + "returnType": "void", + "params": [ + { + "name": "monitor", + "type": "int", + "description": "" + } + ] + }, + { + "name": "SetWindowMinSize", + "description": "Set window minimum dimensions (for FLAG_WINDOW_RESIZABLE)", + "returnType": "void", + "params": [ + { + "name": "width", + "type": "int", + "description": "" + }, + { + "name": "height", + "type": "int", + "description": "" + } + ] + }, + { + "name": "SetWindowMaxSize", + "description": "Set window maximum dimensions (for FLAG_WINDOW_RESIZABLE)", + "returnType": "void", + "params": [ + { + "name": "width", + "type": "int", + "description": "" + }, + { + "name": "height", + "type": "int", + "description": "" + } + ] + }, + { + "name": "SetWindowSize", + "description": "Set window dimensions", + "returnType": "void", + "params": [ + { + "name": "width", + "type": "int", + "description": "" + }, + { + "name": "height", + "type": "int", + "description": "" + } + ] + }, + { + "name": "SetWindowOpacity", + "description": "Set window opacity [0.0f..1.0f]", + "returnType": "void", + "params": [ + { + "name": "opacity", + "type": "float", + "description": "" + } + ] + }, + { + "name": "SetWindowFocused", + "description": "Set window focused", + "returnType": "void", + "params": [] + }, + { + "name": "GetWindowHandle", + "description": "Get native window handle", + "returnType": "void *", + "params": [] + }, + { + "name": "GetScreenWidth", + "description": "Get current screen width", + "returnType": "int", + "params": [] + }, + { + "name": "GetScreenHeight", + "description": "Get current screen height", + "returnType": "int", + "params": [] + }, + { + "name": "GetRenderWidth", + "description": "Get current render width (it considers HiDPI)", + "returnType": "int", + "params": [] + }, + { + "name": "GetRenderHeight", + "description": "Get current render height (it considers HiDPI)", + "returnType": "int", + "params": [] + }, + { + "name": "GetMonitorCount", + "description": "Get number of connected monitors", + "returnType": "int", + "params": [] + }, + { + "name": "GetCurrentMonitor", + "description": "Get current monitor where window is placed", + "returnType": "int", + "params": [] + }, + { + "name": "GetMonitorPosition", + "description": "Get specified monitor position", + "returnType": "Vector2", + "params": [ + { + "name": "monitor", + "type": "int", + "description": "" + } + ] + }, + { + "name": "GetMonitorWidth", + "description": "Get specified monitor width (current video mode used by monitor)", + "returnType": "int", + "params": [ + { + "name": "monitor", + "type": "int", + "description": "" + } + ] + }, + { + "name": "GetMonitorHeight", + "description": "Get specified monitor height (current video mode used by monitor)", + "returnType": "int", + "params": [ + { + "name": "monitor", + "type": "int", + "description": "" + } + ] + }, + { + "name": "GetMonitorPhysicalWidth", + "description": "Get specified monitor physical width in millimetres", + "returnType": "int", + "params": [ + { + "name": "monitor", + "type": "int", + "description": "" + } + ] + }, + { + "name": "GetMonitorPhysicalHeight", + "description": "Get specified monitor physical height in millimetres", + "returnType": "int", + "params": [ + { + "name": "monitor", + "type": "int", + "description": "" + } + ] + }, + { + "name": "GetMonitorRefreshRate", + "description": "Get specified monitor refresh rate", + "returnType": "int", + "params": [ + { + "name": "monitor", + "type": "int", + "description": "" + } + ] + }, + { + "name": "GetWindowPosition", + "description": "Get window position XY on monitor", + "returnType": "Vector2", + "params": [] + }, + { + "name": "GetWindowScaleDPI", + "description": "Get window scale DPI factor", + "returnType": "Vector2", + "params": [] + }, + { + "name": "GetMonitorName", + "description": "Get the human-readable, UTF-8 encoded name of the specified monitor", + "returnType": "const char *", + "params": [ + { + "name": "monitor", + "type": "int", + "description": "" + } + ] + }, + { + "name": "SetClipboardText", + "description": "Set clipboard text content", + "returnType": "void", + "params": [ + { + "name": "text", + "type": "const char *", + "description": "" + } + ] + }, + { + "name": "GetClipboardText", + "description": "Get clipboard text content", + "returnType": "const char *", + "params": [] + }, + { + "name": "GetClipboardImage", + "description": "Get clipboard image content", + "returnType": "Image", + "params": [] + }, + { + "name": "EnableEventWaiting", + "description": "Enable waiting for events on EndDrawing(), no automatic event polling", + "returnType": "void", + "params": [] + }, + { + "name": "DisableEventWaiting", + "description": "Disable waiting for events on EndDrawing(), automatic events polling", + "returnType": "void", + "params": [] + }, + { + "name": "ShowCursor", + "description": "Shows cursor", + "returnType": "void", + "params": [] + }, + { + "name": "HideCursor", + "description": "Hides cursor", + "returnType": "void", + "params": [] + }, + { + "name": "IsCursorHidden", + "description": "Check if cursor is not visible", + "returnType": "bool", + "params": [] + }, + { + "name": "EnableCursor", + "description": "Enables cursor (unlock cursor)", + "returnType": "void", + "params": [] + }, + { + "name": "DisableCursor", + "description": "Disables cursor (lock cursor)", + "returnType": "void", + "params": [] + }, + { + "name": "IsCursorOnScreen", + "description": "Check if cursor is on the screen", + "returnType": "bool", + "params": [] + }, + { + "name": "ClearBackground", + "description": "Set background color (framebuffer clear color)", + "returnType": "void", + "params": [ + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "BeginDrawing", + "description": "Setup canvas (framebuffer) to start drawing", + "returnType": "void", + "params": [] + }, + { + "name": "EndDrawing", + "description": "End canvas drawing and swap buffers (double buffering)", + "returnType": "void", + "params": [] + }, + { + "name": "BeginMode2D", + "description": "Begin 2D mode with custom camera (2D)", + "returnType": "void", + "params": [ + { + "name": "camera", + "type": "Camera2D", + "description": "" + } + ] + }, + { + "name": "EndMode2D", + "description": "Ends 2D mode with custom camera", + "returnType": "void", + "params": [] + }, + { + "name": "BeginMode3D", + "description": "Begin 3D mode with custom camera (3D)", + "returnType": "void", + "params": [ + { + "name": "camera", + "type": "Camera3D", + "description": "" + } + ] + }, + { + "name": "EndMode3D", + "description": "Ends 3D mode and returns to default 2D orthographic mode", + "returnType": "void", + "params": [] + }, + { + "name": "BeginTextureMode", + "description": "Begin drawing to render texture", + "returnType": "void", + "params": [ + { + "name": "target", + "type": "RenderTexture2D", + "description": "" + } + ] + }, + { + "name": "EndTextureMode", + "description": "Ends drawing to render texture", + "returnType": "void", + "params": [] + }, + { + "name": "BeginShaderMode", + "description": "Begin custom shader drawing", + "returnType": "void", + "params": [ + { + "name": "shader", + "type": "Shader", + "description": "" + } + ] + }, + { + "name": "EndShaderMode", + "description": "End custom shader drawing (use default shader)", + "returnType": "void", + "params": [] + }, + { + "name": "BeginBlendMode", + "description": "Begin blending mode (alpha, additive, multiplied, subtract, custom)", + "returnType": "void", + "params": [ + { + "name": "mode", + "type": "int", + "description": "" + } + ] + }, + { + "name": "EndBlendMode", + "description": "End blending mode (reset to default: alpha blending)", + "returnType": "void", + "params": [] + }, + { + "name": "BeginScissorMode", + "description": "Begin scissor mode (define screen area for following drawing)", + "returnType": "void", + "params": [ + { + "name": "x", + "type": "int", + "description": "" + }, + { + "name": "y", + "type": "int", + "description": "" + }, + { + "name": "width", + "type": "int", + "description": "" + }, + { + "name": "height", + "type": "int", + "description": "" + } + ] + }, + { + "name": "EndScissorMode", + "description": "End scissor mode", + "returnType": "void", + "params": [] + }, + { + "name": "BeginVrStereoMode", + "description": "Begin stereo rendering (requires VR simulator)", + "returnType": "void", + "params": [ + { + "name": "config", + "type": "VrStereoConfig", + "description": "" + } + ] + }, + { + "name": "EndVrStereoMode", + "description": "End stereo rendering (requires VR simulator)", + "returnType": "void", + "params": [] + }, + { + "name": "LoadVrStereoConfig", + "description": "Load VR stereo config for VR simulator device parameters", + "returnType": "VrStereoConfig", + "params": [ + { + "name": "device", + "type": "VrDeviceInfo", + "description": "" + } + ] + }, + { + "name": "UnloadVrStereoConfig", + "description": "Unload VR stereo config", + "returnType": "void", + "params": [ + { + "name": "config", + "type": "VrStereoConfig", + "description": "" + } + ] + }, + { + "name": "LoadShader", + "description": "Load shader from files and bind default locations", + "returnType": "Shader", + "params": [ + { + "name": "vsFileName", + "type": "const char *", + "description": "" + }, + { + "name": "fsFileName", + "type": "const char *", + "description": "" + } + ] + }, + { + "name": "LoadShaderFromMemory", + "description": "Load shader from code strings and bind default locations", + "returnType": "Shader", + "params": [ + { + "name": "vsCode", + "type": "const char *", + "description": "" + }, + { + "name": "fsCode", + "type": "const char *", + "description": "" + } + ] + }, + { + "name": "IsShaderValid", + "description": "Check if a shader is valid (loaded on GPU)", + "returnType": "bool", + "params": [ + { + "name": "shader", + "type": "Shader", + "description": "" + } + ] + }, + { + "name": "GetShaderLocation", + "description": "Get shader uniform location", + "returnType": "int", + "params": [ + { + "name": "shader", + "type": "Shader", + "description": "" + }, + { + "name": "uniformName", + "type": "const char *", + "description": "" + } + ] + }, + { + "name": "GetShaderLocationAttrib", + "description": "Get shader attribute location", + "returnType": "int", + "params": [ + { + "name": "shader", + "type": "Shader", + "description": "" + }, + { + "name": "attribName", + "type": "const char *", + "description": "" + } + ] + }, + { + "name": "SetShaderValue", + "description": "Set shader uniform value", + "returnType": "void", + "params": [ + { + "name": "shader", + "type": "Shader", + "description": "" + }, + { + "name": "locIndex", + "type": "int", + "description": "" + }, + { + "name": "value", + "type": "const void *", + "description": "" + }, + { + "name": "uniformType", + "type": "int", + "description": "" + } + ] + }, + { + "name": "SetShaderValueV", + "description": "Set shader uniform value vector", + "returnType": "void", + "params": [ + { + "name": "shader", + "type": "Shader", + "description": "" + }, + { + "name": "locIndex", + "type": "int", + "description": "" + }, + { + "name": "value", + "type": "const void *", + "description": "" + }, + { + "name": "uniformType", + "type": "int", + "description": "" + }, + { + "name": "count", + "type": "int", + "description": "" + } + ] + }, + { + "name": "SetShaderValueMatrix", + "description": "Set shader uniform value (matrix 4x4)", + "returnType": "void", + "params": [ + { + "name": "shader", + "type": "Shader", + "description": "" + }, + { + "name": "locIndex", + "type": "int", + "description": "" + }, + { + "name": "mat", + "type": "Matrix", + "description": "" + } + ] + }, + { + "name": "SetShaderValueTexture", + "description": "Set shader uniform value and bind the texture (sampler2d)", + "returnType": "void", + "params": [ + { + "name": "shader", + "type": "Shader", + "description": "" + }, + { + "name": "locIndex", + "type": "int", + "description": "" + }, + { + "name": "texture", + "type": "Texture2D", + "description": "" + } + ] + }, + { + "name": "UnloadShader", + "description": "Unload shader from GPU memory (VRAM)", + "returnType": "void", + "params": [ + { + "name": "shader", + "type": "Shader", + "description": "" + } + ] + }, + { + "name": "GetScreenToWorldRay", + "description": "Get a ray trace from screen position (i.e mouse)", + "returnType": "Ray", + "params": [ + { + "name": "position", + "type": "Vector2", + "description": "" + }, + { + "name": "camera", + "type": "Camera", + "description": "" + } + ] + }, + { + "name": "GetScreenToWorldRayEx", + "description": "Get a ray trace from screen position (i.e mouse) in a viewport", + "returnType": "Ray", + "params": [ + { + "name": "position", + "type": "Vector2", + "description": "" + }, + { + "name": "camera", + "type": "Camera", + "description": "" + }, + { + "name": "width", + "type": "int", + "description": "" + }, + { + "name": "height", + "type": "int", + "description": "" + } + ] + }, + { + "name": "GetWorldToScreen", + "description": "Get the screen space position for a 3d world space position", + "returnType": "Vector2", + "params": [ + { + "name": "position", + "type": "Vector3", + "description": "" + }, + { + "name": "camera", + "type": "Camera", + "description": "" + } + ] + }, + { + "name": "GetWorldToScreenEx", + "description": "Get size position for a 3d world space position", + "returnType": "Vector2", + "params": [ + { + "name": "position", + "type": "Vector3", + "description": "" + }, + { + "name": "camera", + "type": "Camera", + "description": "" + }, + { + "name": "width", + "type": "int", + "description": "" + }, + { + "name": "height", + "type": "int", + "description": "" + } + ] + }, + { + "name": "GetWorldToScreen2D", + "description": "Get the screen space position for a 2d camera world space position", + "returnType": "Vector2", + "params": [ + { + "name": "position", + "type": "Vector2", + "description": "" + }, + { + "name": "camera", + "type": "Camera2D", + "description": "" + } + ] + }, + { + "name": "GetScreenToWorld2D", + "description": "Get the world space position for a 2d camera screen space position", + "returnType": "Vector2", + "params": [ + { + "name": "position", + "type": "Vector2", + "description": "" + }, + { + "name": "camera", + "type": "Camera2D", + "description": "" + } + ] + }, + { + "name": "GetCameraMatrix", + "description": "Get camera transform matrix (view matrix)", + "returnType": "Matrix", + "params": [ + { + "name": "camera", + "type": "Camera", + "description": "" + } + ] + }, + { + "name": "GetCameraMatrix2D", + "description": "Get camera 2d transform matrix", + "returnType": "Matrix", + "params": [ + { + "name": "camera", + "type": "Camera2D", + "description": "" + } + ] + }, + { + "name": "SetTargetFPS", + "description": "Set target FPS (maximum)", + "returnType": "void", + "params": [ + { + "name": "fps", + "type": "int", + "description": "" + } + ] + }, + { + "name": "GetFrameTime", + "description": "Get time in seconds for last frame drawn (delta time)", + "returnType": "float", + "params": [] + }, + { + "name": "GetTime", + "description": "Get elapsed time in seconds since InitWindow()", + "returnType": "double", + "params": [] + }, + { + "name": "GetFPS", + "description": "Get current FPS", + "returnType": "int", + "params": [] + }, + { + "name": "SwapScreenBuffer", + "description": "Swap back buffer with front buffer (screen drawing)", + "returnType": "void", + "params": [] + }, + { + "name": "PollInputEvents", + "description": "Register all input events", + "returnType": "void", + "params": [] + }, + { + "name": "WaitTime", + "description": "Wait for some time (halt program execution)", + "returnType": "void", + "params": [ + { + "name": "seconds", + "type": "double", + "description": "" + } + ] + }, + { + "name": "SetRandomSeed", + "description": "Set the seed for the random number generator", + "returnType": "void", + "params": [ + { + "name": "seed", + "type": "unsigned int", + "description": "" + } + ] + }, + { + "name": "GetRandomValue", + "description": "Get a random value between min and max (both included)", + "returnType": "int", + "params": [ + { + "name": "min", + "type": "int", + "description": "" + }, + { + "name": "max", + "type": "int", + "description": "" + } + ] + }, + { + "name": "LoadRandomSequence", + "description": "Load random values sequence, no values repeated", + "returnType": "int *", + "params": [ + { + "name": "count", + "type": "unsigned int", + "description": "" + }, + { + "name": "min", + "type": "int", + "description": "" + }, + { + "name": "max", + "type": "int", + "description": "" + } + ] + }, + { + "name": "UnloadRandomSequence", + "description": "Unload random values sequence", + "returnType": "void", + "params": [ + { + "name": "sequence", + "type": "int *", + "description": "" + } + ] + }, + { + "name": "TakeScreenshot", + "description": "Takes a screenshot of current screen (filename extension defines format)", + "returnType": "void", + "params": [ + { + "name": "fileName", + "type": "const char *", + "description": "" + } + ] + }, + { + "name": "SetConfigFlags", + "description": "Setup init configuration flags (view FLAGS)", + "returnType": "void", + "params": [ + { + "name": "flags", + "type": "unsigned int", + "description": "" + } + ] + }, + { + "name": "OpenURL", + "description": "Open URL with default system browser (if available)", + "returnType": "void", + "params": [ + { + "name": "url", + "type": "const char *", + "description": "" + } + ] + }, + { + "name": "SetTraceLogLevel", + "description": "Set the current threshold (minimum) log level", + "returnType": "void", + "params": [ + { + "name": "logLevel", + "type": "int", + "description": "" + } + ] + }, + { + "name": "TraceLog", + "description": "Show trace log messages (LOG_DEBUG, LOG_INFO, LOG_WARNING, LOG_ERROR...)", + "returnType": "void", + "params": [ + { + "name": "logLevel", + "type": "int", + "description": "" + }, + { + "name": "text", + "type": "const char *", + "description": "" + }, + { + "name": "args", + "type": "...", + "description": "" + } + ] + }, + { + "name": "SetTraceLogCallback", + "description": "Set custom trace log", + "returnType": "void", + "params": [ + { + "name": "callback", + "type": "TraceLogCallback", + "description": "" + } + ] + }, + { + "name": "MemAlloc", + "description": "Internal memory allocator", + "returnType": "void *", + "params": [ + { + "name": "size", + "type": "unsigned int", + "description": "" + } + ] + }, + { + "name": "MemRealloc", + "description": "Internal memory reallocator", + "returnType": "void *", + "params": [ + { + "name": "ptr", + "type": "void *", + "description": "" + }, + { + "name": "size", + "type": "unsigned int", + "description": "" + } + ] + }, + { + "name": "MemFree", + "description": "Internal memory free", + "returnType": "void", + "params": [ + { + "name": "ptr", + "type": "void *", + "description": "" + } + ] + }, + { + "name": "LoadFileData", + "description": "Load file data as byte array (read)", + "returnType": "unsigned char *", + "params": [ + { + "name": "fileName", + "type": "const char *", + "description": "" + }, + { + "name": "dataSize", + "type": "int *", + "description": "" + } + ] + }, + { + "name": "UnloadFileData", + "description": "Unload file data allocated by LoadFileData()", + "returnType": "void", + "params": [ + { + "name": "data", + "type": "unsigned char *", + "description": "" + } + ] + }, + { + "name": "SaveFileData", + "description": "Save data to file from byte array (write), returns true on success", + "returnType": "bool", + "params": [ + { + "name": "fileName", + "type": "const char *", + "description": "" + }, + { + "name": "data", + "type": "void *", + "description": "" + }, + { + "name": "dataSize", + "type": "int", + "description": "" + } + ] + }, + { + "name": "ExportDataAsCode", + "description": "Export data to code (.h), returns true on success", + "returnType": "bool", + "params": [ + { + "name": "data", + "type": "const unsigned char *", + "description": "" + }, + { + "name": "dataSize", + "type": "int", + "description": "" + }, + { + "name": "fileName", + "type": "const char *", + "description": "" + } + ] + }, + { + "name": "LoadFileText", + "description": "Load text data from file (read), returns a '\\0' terminated string", + "returnType": "char *", + "params": [ + { + "name": "fileName", + "type": "const char *", + "description": "" + } + ] + }, + { + "name": "UnloadFileText", + "description": "Unload file text data allocated by LoadFileText()", + "returnType": "void", + "params": [ + { + "name": "text", + "type": "char *", + "description": "" + } + ] + }, + { + "name": "SaveFileText", + "description": "Save text data to file (write), string must be '\\0' terminated, returns true on success", + "returnType": "bool", + "params": [ + { + "name": "fileName", + "type": "const char *", + "description": "" + }, + { + "name": "text", + "type": "const char *", + "description": "" + } + ] + }, + { + "name": "SetLoadFileDataCallback", + "description": "Set custom file binary data loader", + "returnType": "void", + "params": [ + { + "name": "callback", + "type": "LoadFileDataCallback", + "description": "" + } + ] + }, + { + "name": "SetSaveFileDataCallback", + "description": "Set custom file binary data saver", + "returnType": "void", + "params": [ + { + "name": "callback", + "type": "SaveFileDataCallback", + "description": "" + } + ] + }, + { + "name": "SetLoadFileTextCallback", + "description": "Set custom file text data loader", + "returnType": "void", + "params": [ + { + "name": "callback", + "type": "LoadFileTextCallback", + "description": "" + } + ] + }, + { + "name": "SetSaveFileTextCallback", + "description": "Set custom file text data saver", + "returnType": "void", + "params": [ + { + "name": "callback", + "type": "SaveFileTextCallback", + "description": "" + } + ] + }, + { + "name": "FileRename", + "description": "Rename file (if exists)", + "returnType": "int", + "params": [ + { + "name": "fileName", + "type": "const char *", + "description": "" + }, + { + "name": "fileRename", + "type": "const char *", + "description": "" + } + ] + }, + { + "name": "FileRemove", + "description": "Remove file (if exists)", + "returnType": "int", + "params": [ + { + "name": "fileName", + "type": "const char *", + "description": "" + } + ] + }, + { + "name": "FileCopy", + "description": "Copy file from one path to another, dstPath created if it doesn't exist", + "returnType": "int", + "params": [ + { + "name": "srcPath", + "type": "const char *", + "description": "" + }, + { + "name": "dstPath", + "type": "const char *", + "description": "" + } + ] + }, + { + "name": "FileMove", + "description": "Move file from one directory to another, dstPath created if it doesn't exist", + "returnType": "int", + "params": [ + { + "name": "srcPath", + "type": "const char *", + "description": "" + }, + { + "name": "dstPath", + "type": "const char *", + "description": "" + } + ] + }, + { + "name": "FileTextReplace", + "description": "Replace text in an existing file", + "returnType": "int", + "params": [ + { + "name": "fileName", + "type": "const char *", + "description": "" + }, + { + "name": "search", + "type": "const char *", + "description": "" + }, + { + "name": "replacement", + "type": "const char *", + "description": "" + } + ] + }, + { + "name": "FileTextFindIndex", + "description": "Find text in existing file", + "returnType": "int", + "params": [ + { + "name": "fileName", + "type": "const char *", + "description": "" + }, + { + "name": "search", + "type": "const char *", + "description": "" + } + ] + }, + { + "name": "FileExists", + "description": "Check if file exists", + "returnType": "bool", + "params": [ + { + "name": "fileName", + "type": "const char *", + "description": "" + } + ] + }, + { + "name": "DirectoryExists", + "description": "Check if a directory path exists", + "returnType": "bool", + "params": [ + { + "name": "dirPath", + "type": "const char *", + "description": "" + } + ] + }, + { + "name": "IsFileExtension", + "description": "Check file extension (recommended include point: .png, .wav)", + "returnType": "bool", + "params": [ + { + "name": "fileName", + "type": "const char *", + "description": "" + }, + { + "name": "ext", + "type": "const char *", + "description": "" + } + ] + }, + { + "name": "GetFileLength", + "description": "Get file length in bytes (NOTE: GetFileSize() conflicts with windows.h)", + "returnType": "int", + "params": [ + { + "name": "fileName", + "type": "const char *", + "description": "" + } + ] + }, + { + "name": "GetFileModTime", + "description": "Get file modification time (last write time)", + "returnType": "long", + "params": [ + { + "name": "fileName", + "type": "const char *", + "description": "" + } + ] + }, + { + "name": "GetFileExtension", + "description": "Get pointer to extension for a filename string (includes dot: '.png')", + "returnType": "const char *", + "params": [ + { + "name": "fileName", + "type": "const char *", + "description": "" + } + ] + }, + { + "name": "GetFileName", + "description": "Get pointer to filename for a path string", + "returnType": "const char *", + "params": [ + { + "name": "filePath", + "type": "const char *", + "description": "" + } + ] + }, + { + "name": "GetFileNameWithoutExt", + "description": "Get filename string without extension (uses static string)", + "returnType": "const char *", + "params": [ + { + "name": "filePath", + "type": "const char *", + "description": "" + } + ] + }, + { + "name": "GetDirectoryPath", + "description": "Get full path for a given fileName with path (uses static string)", + "returnType": "const char *", + "params": [ + { + "name": "filePath", + "type": "const char *", + "description": "" + } + ] + }, + { + "name": "GetPrevDirectoryPath", + "description": "Get previous directory path for a given path (uses static string)", + "returnType": "const char *", + "params": [ + { + "name": "dirPath", + "type": "const char *", + "description": "" + } + ] + }, + { + "name": "GetWorkingDirectory", + "description": "Get current working directory (uses static string)", + "returnType": "const char *", + "params": [] + }, + { + "name": "GetApplicationDirectory", + "description": "Get the directory of the running application (uses static string)", + "returnType": "const char *", + "params": [] + }, + { + "name": "MakeDirectory", + "description": "Create directories (including full path requested), returns 0 on success", + "returnType": "int", + "params": [ + { + "name": "dirPath", + "type": "const char *", + "description": "" + } + ] + }, + { + "name": "ChangeDirectory", + "description": "Change working directory, return true on success", + "returnType": "bool", + "params": [ + { + "name": "dirPath", + "type": "const char *", + "description": "" + } + ] + }, + { + "name": "IsPathFile", + "description": "Check if a given path is a file or a directory", + "returnType": "bool", + "params": [ + { + "name": "path", + "type": "const char *", + "description": "" + } + ] + }, + { + "name": "IsFileNameValid", + "description": "Check if fileName is valid for the platform/OS", + "returnType": "bool", + "params": [ + { + "name": "fileName", + "type": "const char *", + "description": "" + } + ] + }, + { + "name": "LoadDirectoryFiles", + "description": "Load directory filepaths, files and directories, no subdirs scan", + "returnType": "FilePathList", + "params": [ + { + "name": "dirPath", + "type": "const char *", + "description": "" + } + ] + }, + { + "name": "LoadDirectoryFilesEx", + "description": "Load directory filepaths with extension filtering and subdir scan; some filters available: \"*.*\", \"FILES*\", \"DIRS*\"", + "returnType": "FilePathList", + "params": [ + { + "name": "basePath", + "type": "const char *", + "description": "" + }, + { + "name": "filter", + "type": "const char *", + "description": "" + }, + { + "name": "scanSubdirs", + "type": "bool", + "description": "" + } + ] + }, + { + "name": "UnloadDirectoryFiles", + "description": "Unload filepaths", + "returnType": "void", + "params": [ + { + "name": "files", + "type": "FilePathList", + "description": "" + } + ] + }, + { + "name": "IsFileDropped", + "description": "Check if a file has been dropped into window", + "returnType": "bool", + "params": [] + }, + { + "name": "LoadDroppedFiles", + "description": "Load dropped filepaths", + "returnType": "FilePathList", + "params": [] + }, + { + "name": "UnloadDroppedFiles", + "description": "Unload dropped filepaths", + "returnType": "void", + "params": [ + { + "name": "files", + "type": "FilePathList", + "description": "" + } + ] + }, + { + "name": "GetDirectoryFileCount", + "description": "Get the file count in a directory", + "returnType": "unsigned int", + "params": [ + { + "name": "dirPath", + "type": "const char *", + "description": "" + } + ] + }, + { + "name": "GetDirectoryFileCountEx", + "description": "Get the file count in a directory with extension filtering and recursive directory scan. Use 'DIR' in the filter string to include directories in the result", + "returnType": "unsigned int", + "params": [ + { + "name": "basePath", + "type": "const char *", + "description": "" + }, + { + "name": "filter", + "type": "const char *", + "description": "" + }, + { + "name": "scanSubdirs", + "type": "bool", + "description": "" + } + ] + }, + { + "name": "CompressData", + "description": "Compress data (DEFLATE algorithm), memory must be MemFree()", + "returnType": "unsigned char *", + "params": [ + { + "name": "data", + "type": "const unsigned char *", + "description": "" + }, + { + "name": "dataSize", + "type": "int", + "description": "" + }, + { + "name": "compDataSize", + "type": "int *", + "description": "" + } + ] + }, + { + "name": "DecompressData", + "description": "Decompress data (DEFLATE algorithm), memory must be MemFree()", + "returnType": "unsigned char *", + "params": [ + { + "name": "compData", + "type": "const unsigned char *", + "description": "" + }, + { + "name": "compDataSize", + "type": "int", + "description": "" + }, + { + "name": "dataSize", + "type": "int *", + "description": "" + } + ] + }, + { + "name": "EncodeDataBase64", + "description": "Encode data to Base64 string (includes NULL terminator), memory must be MemFree()", + "returnType": "char *", + "params": [ + { + "name": "data", + "type": "const unsigned char *", + "description": "" + }, + { + "name": "dataSize", + "type": "int", + "description": "" + }, + { + "name": "outputSize", + "type": "int *", + "description": "" + } + ] + }, + { + "name": "DecodeDataBase64", + "description": "Decode Base64 string (expected NULL terminated), memory must be MemFree()", + "returnType": "unsigned char *", + "params": [ + { + "name": "text", + "type": "const char *", + "description": "" + }, + { + "name": "outputSize", + "type": "int *", + "description": "" + } + ] + }, + { + "name": "ComputeCRC32", + "description": "Compute CRC32 hash code", + "returnType": "unsigned int", + "params": [ + { + "name": "data", + "type": "unsigned char *", + "description": "" + }, + { + "name": "dataSize", + "type": "int", + "description": "" + } + ] + }, + { + "name": "ComputeMD5", + "description": "Compute MD5 hash code, returns static int[4] (16 bytes)", + "returnType": "unsigned int *", + "params": [ + { + "name": "data", + "type": "unsigned char *", + "description": "" + }, + { + "name": "dataSize", + "type": "int", + "description": "" + } + ] + }, + { + "name": "ComputeSHA1", + "description": "Compute SHA1 hash code, returns static int[5] (20 bytes)", + "returnType": "unsigned int *", + "params": [ + { + "name": "data", + "type": "unsigned char *", + "description": "" + }, + { + "name": "dataSize", + "type": "int", + "description": "" + } + ] + }, + { + "name": "ComputeSHA256", + "description": "Compute SHA256 hash code, returns static int[8] (32 bytes)", + "returnType": "unsigned int *", + "params": [ + { + "name": "data", + "type": "unsigned char *", + "description": "" + }, + { + "name": "dataSize", + "type": "int", + "description": "" + } + ] + }, + { + "name": "LoadAutomationEventList", + "description": "Load automation events list from file, NULL for empty list, capacity = MAX_AUTOMATION_EVENTS", + "returnType": "AutomationEventList", + "params": [ + { + "name": "fileName", + "type": "const char *", + "description": "" + } + ] + }, + { + "name": "UnloadAutomationEventList", + "description": "Unload automation events list from file", + "returnType": "void", + "params": [ + { + "name": "list", + "type": "AutomationEventList", + "description": "" + } + ] + }, + { + "name": "ExportAutomationEventList", + "description": "Export automation events list as text file", + "returnType": "bool", + "params": [ + { + "name": "list", + "type": "AutomationEventList", + "description": "" + }, + { + "name": "fileName", + "type": "const char *", + "description": "" + } + ] + }, + { + "name": "SetAutomationEventList", + "description": "Set automation event list to record to", + "returnType": "void", + "params": [ + { + "name": "list", + "type": "AutomationEventList *", + "description": "" + } + ] + }, + { + "name": "SetAutomationEventBaseFrame", + "description": "Set automation event internal base frame to start recording", + "returnType": "void", + "params": [ + { + "name": "frame", + "type": "int", + "description": "" + } + ] + }, + { + "name": "StartAutomationEventRecording", + "description": "Start recording automation events (AutomationEventList must be set)", + "returnType": "void", + "params": [] + }, + { + "name": "StopAutomationEventRecording", + "description": "Stop recording automation events", + "returnType": "void", + "params": [] + }, + { + "name": "PlayAutomationEvent", + "description": "Play a recorded automation event", + "returnType": "void", + "params": [ + { + "name": "event", + "type": "AutomationEvent", + "description": "" + } + ] + }, + { + "name": "IsKeyPressed", + "description": "Check if a key has been pressed once", + "returnType": "bool", + "params": [ + { + "name": "key", + "type": "int", + "description": "" + } + ] + }, + { + "name": "IsKeyPressedRepeat", + "description": "Check if a key has been pressed again", + "returnType": "bool", + "params": [ + { + "name": "key", + "type": "int", + "description": "" + } + ] + }, + { + "name": "IsKeyDown", + "description": "Check if a key is being pressed", + "returnType": "bool", + "params": [ + { + "name": "key", + "type": "int", + "description": "" + } + ] + }, + { + "name": "IsKeyReleased", + "description": "Check if a key has been released once", + "returnType": "bool", + "params": [ + { + "name": "key", + "type": "int", + "description": "" + } + ] + }, + { + "name": "IsKeyUp", + "description": "Check if a key is NOT being pressed", + "returnType": "bool", + "params": [ + { + "name": "key", + "type": "int", + "description": "" + } + ] + }, + { + "name": "GetKeyPressed", + "description": "Get key pressed (keycode), call it multiple times for keys queued, returns 0 when the queue is empty", + "returnType": "int", + "params": [] + }, + { + "name": "GetCharPressed", + "description": "Get char pressed (unicode), call it multiple times for chars queued, returns 0 when the queue is empty", + "returnType": "int", + "params": [] + }, + { + "name": "GetKeyName", + "description": "Get name of a QWERTY key on the current keyboard layout (eg returns string 'q' for KEY_A on an AZERTY keyboard)", + "returnType": "const char *", + "params": [ + { + "name": "key", + "type": "int", + "description": "" + } + ] + }, + { + "name": "SetExitKey", + "description": "Set a custom key to exit program (default is ESC)", + "returnType": "void", + "params": [ + { + "name": "key", + "type": "int", + "description": "" + } + ] + }, + { + "name": "IsGamepadAvailable", + "description": "Check if a gamepad is available", + "returnType": "bool", + "params": [ + { + "name": "gamepad", + "type": "int", + "description": "" + } + ] + }, + { + "name": "GetGamepadName", + "description": "Get gamepad internal name id", + "returnType": "const char *", + "params": [ + { + "name": "gamepad", + "type": "int", + "description": "" + } + ] + }, + { + "name": "IsGamepadButtonPressed", + "description": "Check if a gamepad button has been pressed once", + "returnType": "bool", + "params": [ + { + "name": "gamepad", + "type": "int", + "description": "" + }, + { + "name": "button", + "type": "int", + "description": "" + } + ] + }, + { + "name": "IsGamepadButtonDown", + "description": "Check if a gamepad button is being pressed", + "returnType": "bool", + "params": [ + { + "name": "gamepad", + "type": "int", + "description": "" + }, + { + "name": "button", + "type": "int", + "description": "" + } + ] + }, + { + "name": "IsGamepadButtonReleased", + "description": "Check if a gamepad button has been released once", + "returnType": "bool", + "params": [ + { + "name": "gamepad", + "type": "int", + "description": "" + }, + { + "name": "button", + "type": "int", + "description": "" + } + ] + }, + { + "name": "IsGamepadButtonUp", + "description": "Check if a gamepad button is NOT being pressed", + "returnType": "bool", + "params": [ + { + "name": "gamepad", + "type": "int", + "description": "" + }, + { + "name": "button", + "type": "int", + "description": "" + } + ] + }, + { + "name": "GetGamepadButtonPressed", + "description": "Get the last gamepad button pressed", + "returnType": "int", + "params": [] + }, + { + "name": "GetGamepadAxisCount", + "description": "Get axis count for a gamepad", + "returnType": "int", + "params": [ + { + "name": "gamepad", + "type": "int", + "description": "" + } + ] + }, + { + "name": "GetGamepadAxisMovement", + "description": "Get movement value for a gamepad axis", + "returnType": "float", + "params": [ + { + "name": "gamepad", + "type": "int", + "description": "" + }, + { + "name": "axis", + "type": "int", + "description": "" + } + ] + }, + { + "name": "SetGamepadMappings", + "description": "Set internal gamepad mappings (SDL_GameControllerDB)", + "returnType": "int", + "params": [ + { + "name": "mappings", + "type": "const char *", + "description": "" + } + ] + }, + { + "name": "SetGamepadVibration", + "description": "Set gamepad vibration for both motors (duration in seconds)", + "returnType": "void", + "params": [ + { + "name": "gamepad", + "type": "int", + "description": "" + }, + { + "name": "leftMotor", + "type": "float", + "description": "" + }, + { + "name": "rightMotor", + "type": "float", + "description": "" + }, + { + "name": "duration", + "type": "float", + "description": "" + } + ] + }, + { + "name": "IsMouseButtonPressed", + "description": "Check if a mouse button has been pressed once", + "returnType": "bool", + "params": [ + { + "name": "button", + "type": "int", + "description": "" + } + ] + }, + { + "name": "IsMouseButtonDown", + "description": "Check if a mouse button is being pressed", + "returnType": "bool", + "params": [ + { + "name": "button", + "type": "int", + "description": "" + } + ] + }, + { + "name": "IsMouseButtonReleased", + "description": "Check if a mouse button has been released once", + "returnType": "bool", + "params": [ + { + "name": "button", + "type": "int", + "description": "" + } + ] + }, + { + "name": "IsMouseButtonUp", + "description": "Check if a mouse button is NOT being pressed", + "returnType": "bool", + "params": [ + { + "name": "button", + "type": "int", + "description": "" + } + ] + }, + { + "name": "GetMouseX", + "description": "Get mouse position X", + "returnType": "int", + "params": [] + }, + { + "name": "GetMouseY", + "description": "Get mouse position Y", + "returnType": "int", + "params": [] + }, + { + "name": "GetMousePosition", + "description": "Get mouse position XY", + "returnType": "Vector2", + "params": [] + }, + { + "name": "GetMouseDelta", + "description": "Get mouse delta between frames", + "returnType": "Vector2", + "params": [] + }, + { + "name": "SetMousePosition", + "description": "Set mouse position XY", + "returnType": "void", + "params": [ + { + "name": "x", + "type": "int", + "description": "" + }, + { + "name": "y", + "type": "int", + "description": "" + } + ] + }, + { + "name": "SetMouseOffset", + "description": "Set mouse offset", + "returnType": "void", + "params": [ + { + "name": "offsetX", + "type": "int", + "description": "" + }, + { + "name": "offsetY", + "type": "int", + "description": "" + } + ] + }, + { + "name": "SetMouseScale", + "description": "Set mouse scaling", + "returnType": "void", + "params": [ + { + "name": "scaleX", + "type": "float", + "description": "" + }, + { + "name": "scaleY", + "type": "float", + "description": "" + } + ] + }, + { + "name": "GetMouseWheelMove", + "description": "Get mouse wheel movement for X or Y, whichever is larger", + "returnType": "float", + "params": [] + }, + { + "name": "GetMouseWheelMoveV", + "description": "Get mouse wheel movement for both X and Y", + "returnType": "Vector2", + "params": [] + }, + { + "name": "SetMouseCursor", + "description": "Set mouse cursor", + "returnType": "void", + "params": [ + { + "name": "cursor", + "type": "int", + "description": "" + } + ] + }, + { + "name": "GetTouchX", + "description": "Get touch position X for touch point 0 (relative to screen size)", + "returnType": "int", + "params": [] + }, + { + "name": "GetTouchY", + "description": "Get touch position Y for touch point 0 (relative to screen size)", + "returnType": "int", + "params": [] + }, + { + "name": "GetTouchPosition", + "description": "Get touch position XY for a touch point index (relative to screen size)", + "returnType": "Vector2", + "params": [ + { + "name": "index", + "type": "int", + "description": "" + } + ] + }, + { + "name": "GetTouchPointId", + "description": "Get touch point identifier for given index", + "returnType": "int", + "params": [ + { + "name": "index", + "type": "int", + "description": "" + } + ] + }, + { + "name": "GetTouchPointCount", + "description": "Get number of touch points", + "returnType": "int", + "params": [] + }, + { + "name": "SetGesturesEnabled", + "description": "Enable a set of gestures using flags", + "returnType": "void", + "params": [ + { + "name": "flags", + "type": "unsigned int", + "description": "" + } + ] + }, + { + "name": "IsGestureDetected", + "description": "Check if a gesture have been detected", + "returnType": "bool", + "params": [ + { + "name": "gesture", + "type": "unsigned int", + "description": "" + } + ] + }, + { + "name": "GetGestureDetected", + "description": "Get latest detected gesture", + "returnType": "int", + "params": [] + }, + { + "name": "GetGestureHoldDuration", + "description": "Get gesture hold time in seconds", + "returnType": "float", + "params": [] + }, + { + "name": "GetGestureDragVector", + "description": "Get gesture drag vector", + "returnType": "Vector2", + "params": [] + }, + { + "name": "GetGestureDragAngle", + "description": "Get gesture drag angle", + "returnType": "float", + "params": [] + }, + { + "name": "GetGesturePinchVector", + "description": "Get gesture pinch delta", + "returnType": "Vector2", + "params": [] + }, + { + "name": "GetGesturePinchAngle", + "description": "Get gesture pinch angle", + "returnType": "float", + "params": [] + }, + { + "name": "UpdateCamera", + "description": "Update camera position for selected mode", + "returnType": "void", + "params": [ + { + "name": "camera", + "type": "Camera *", + "description": "" + }, + { + "name": "mode", + "type": "int", + "description": "" + } + ] + }, + { + "name": "UpdateCameraPro", + "description": "Update camera movement/rotation", + "returnType": "void", + "params": [ + { + "name": "camera", + "type": "Camera *", + "description": "" + }, + { + "name": "movement", + "type": "Vector3", + "description": "" + }, + { + "name": "rotation", + "type": "Vector3", + "description": "" + }, + { + "name": "zoom", + "type": "float", + "description": "" + } + ] + }, + { + "name": "SetShapesTexture", + "description": "Set texture and rectangle to be used on shapes drawing", + "returnType": "void", + "params": [ + { + "name": "texture", + "type": "Texture2D", + "description": "" + }, + { + "name": "source", + "type": "Rectangle", + "description": "" + } + ] + }, + { + "name": "GetShapesTexture", + "description": "Get texture that is used for shapes drawing", + "returnType": "Texture2D", + "params": [] + }, + { + "name": "GetShapesTextureRectangle", + "description": "Get texture source rectangle that is used for shapes drawing", + "returnType": "Rectangle", + "params": [] + }, + { + "name": "DrawPixel", + "description": "Draw a pixel using geometry [Can be slow, use with care]", + "returnType": "void", + "params": [ + { + "name": "posX", + "type": "int", + "description": "" + }, + { + "name": "posY", + "type": "int", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "DrawPixelV", + "description": "Draw a pixel using geometry (Vector version) [Can be slow, use with care]", + "returnType": "void", + "params": [ + { + "name": "position", + "type": "Vector2", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "DrawLine", + "description": "Draw a line", + "returnType": "void", + "params": [ + { + "name": "startPosX", + "type": "int", + "description": "" + }, + { + "name": "startPosY", + "type": "int", + "description": "" + }, + { + "name": "endPosX", + "type": "int", + "description": "" + }, + { + "name": "endPosY", + "type": "int", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "DrawLineV", + "description": "Draw a line (using gl lines)", + "returnType": "void", + "params": [ + { + "name": "startPos", + "type": "Vector2", + "description": "" + }, + { + "name": "endPos", + "type": "Vector2", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "DrawLineEx", + "description": "Draw a line (using triangles/quads)", + "returnType": "void", + "params": [ + { + "name": "startPos", + "type": "Vector2", + "description": "" + }, + { + "name": "endPos", + "type": "Vector2", + "description": "" + }, + { + "name": "thick", + "type": "float", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "DrawLineStrip", + "description": "Draw lines sequence (using gl lines)", + "returnType": "void", + "params": [ + { + "name": "points", + "type": "const Vector2 *", + "description": "" + }, + { + "name": "pointCount", + "type": "int", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "DrawLineBezier", + "description": "Draw line segment cubic-bezier in-out interpolation", + "returnType": "void", + "params": [ + { + "name": "startPos", + "type": "Vector2", + "description": "" + }, + { + "name": "endPos", + "type": "Vector2", + "description": "" + }, + { + "name": "thick", + "type": "float", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "DrawLineDashed", + "description": "Draw a dashed line", + "returnType": "void", + "params": [ + { + "name": "startPos", + "type": "Vector2", + "description": "" + }, + { + "name": "endPos", + "type": "Vector2", + "description": "" + }, + { + "name": "dashSize", + "type": "int", + "description": "" + }, + { + "name": "spaceSize", + "type": "int", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "DrawCircle", + "description": "Draw a color-filled circle", + "returnType": "void", + "params": [ + { + "name": "centerX", + "type": "int", + "description": "" + }, + { + "name": "centerY", + "type": "int", + "description": "" + }, + { + "name": "radius", + "type": "float", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "DrawCircleV", + "description": "Draw a color-filled circle (Vector version)", + "returnType": "void", + "params": [ + { + "name": "center", + "type": "Vector2", + "description": "" + }, + { + "name": "radius", + "type": "float", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "DrawCircleGradient", + "description": "Draw a gradient-filled circle", + "returnType": "void", + "params": [ + { + "name": "center", + "type": "Vector2", + "description": "" + }, + { + "name": "radius", + "type": "float", + "description": "" + }, + { + "name": "inner", + "type": "Color", + "description": "" + }, + { + "name": "outer", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "DrawCircleSector", + "description": "Draw a piece of a circle", + "returnType": "void", + "params": [ + { + "name": "center", + "type": "Vector2", + "description": "" + }, + { + "name": "radius", + "type": "float", + "description": "" + }, + { + "name": "startAngle", + "type": "float", + "description": "" + }, + { + "name": "endAngle", + "type": "float", + "description": "" + }, + { + "name": "segments", + "type": "int", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "DrawCircleSectorLines", + "description": "Draw circle sector outline", + "returnType": "void", + "params": [ + { + "name": "center", + "type": "Vector2", + "description": "" + }, + { + "name": "radius", + "type": "float", + "description": "" + }, + { + "name": "startAngle", + "type": "float", + "description": "" + }, + { + "name": "endAngle", + "type": "float", + "description": "" + }, + { + "name": "segments", + "type": "int", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "DrawCircleLines", + "description": "Draw circle outline", + "returnType": "void", + "params": [ + { + "name": "centerX", + "type": "int", + "description": "" + }, + { + "name": "centerY", + "type": "int", + "description": "" + }, + { + "name": "radius", + "type": "float", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "DrawCircleLinesV", + "description": "Draw circle outline (Vector version)", + "returnType": "void", + "params": [ + { + "name": "center", + "type": "Vector2", + "description": "" + }, + { + "name": "radius", + "type": "float", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "DrawEllipse", + "description": "Draw ellipse", + "returnType": "void", + "params": [ + { + "name": "centerX", + "type": "int", + "description": "" + }, + { + "name": "centerY", + "type": "int", + "description": "" + }, + { + "name": "radiusH", + "type": "float", + "description": "" + }, + { + "name": "radiusV", + "type": "float", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "DrawEllipseV", + "description": "Draw ellipse (Vector version)", + "returnType": "void", + "params": [ + { + "name": "center", + "type": "Vector2", + "description": "" + }, + { + "name": "radiusH", + "type": "float", + "description": "" + }, + { + "name": "radiusV", + "type": "float", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "DrawEllipseLines", + "description": "Draw ellipse outline", + "returnType": "void", + "params": [ + { + "name": "centerX", + "type": "int", + "description": "" + }, + { + "name": "centerY", + "type": "int", + "description": "" + }, + { + "name": "radiusH", + "type": "float", + "description": "" + }, + { + "name": "radiusV", + "type": "float", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "DrawEllipseLinesV", + "description": "Draw ellipse outline (Vector version)", + "returnType": "void", + "params": [ + { + "name": "center", + "type": "Vector2", + "description": "" + }, + { + "name": "radiusH", + "type": "float", + "description": "" + }, + { + "name": "radiusV", + "type": "float", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "DrawRing", + "description": "Draw ring", + "returnType": "void", + "params": [ + { + "name": "center", + "type": "Vector2", + "description": "" + }, + { + "name": "innerRadius", + "type": "float", + "description": "" + }, + { + "name": "outerRadius", + "type": "float", + "description": "" + }, + { + "name": "startAngle", + "type": "float", + "description": "" + }, + { + "name": "endAngle", + "type": "float", + "description": "" + }, + { + "name": "segments", + "type": "int", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "DrawRingLines", + "description": "Draw ring outline", + "returnType": "void", + "params": [ + { + "name": "center", + "type": "Vector2", + "description": "" + }, + { + "name": "innerRadius", + "type": "float", + "description": "" + }, + { + "name": "outerRadius", + "type": "float", + "description": "" + }, + { + "name": "startAngle", + "type": "float", + "description": "" + }, + { + "name": "endAngle", + "type": "float", + "description": "" + }, + { + "name": "segments", + "type": "int", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "DrawRectangle", + "description": "Draw a color-filled rectangle", + "returnType": "void", + "params": [ + { + "name": "posX", + "type": "int", + "description": "" + }, + { + "name": "posY", + "type": "int", + "description": "" + }, + { + "name": "width", + "type": "int", + "description": "" + }, + { + "name": "height", + "type": "int", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "DrawRectangleV", + "description": "Draw a color-filled rectangle (Vector version)", + "returnType": "void", + "params": [ + { + "name": "position", + "type": "Vector2", + "description": "" + }, + { + "name": "size", + "type": "Vector2", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "DrawRectangleRec", + "description": "Draw a color-filled rectangle", + "returnType": "void", + "params": [ + { + "name": "rec", + "type": "Rectangle", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "DrawRectanglePro", + "description": "Draw a color-filled rectangle with pro parameters", + "returnType": "void", + "params": [ + { + "name": "rec", + "type": "Rectangle", + "description": "" + }, + { + "name": "origin", + "type": "Vector2", + "description": "" + }, + { + "name": "rotation", + "type": "float", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "DrawRectangleGradientV", + "description": "Draw a vertical-gradient-filled rectangle", + "returnType": "void", + "params": [ + { + "name": "posX", + "type": "int", + "description": "" + }, + { + "name": "posY", + "type": "int", + "description": "" + }, + { + "name": "width", + "type": "int", + "description": "" + }, + { + "name": "height", + "type": "int", + "description": "" + }, + { + "name": "top", + "type": "Color", + "description": "" + }, + { + "name": "bottom", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "DrawRectangleGradientH", + "description": "Draw a horizontal-gradient-filled rectangle", + "returnType": "void", + "params": [ + { + "name": "posX", + "type": "int", + "description": "" + }, + { + "name": "posY", + "type": "int", + "description": "" + }, + { + "name": "width", + "type": "int", + "description": "" + }, + { + "name": "height", + "type": "int", + "description": "" + }, + { + "name": "left", + "type": "Color", + "description": "" + }, + { + "name": "right", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "DrawRectangleGradientEx", + "description": "Draw a gradient-filled rectangle with custom vertex colors", + "returnType": "void", + "params": [ + { + "name": "rec", + "type": "Rectangle", + "description": "" + }, + { + "name": "topLeft", + "type": "Color", + "description": "" + }, + { + "name": "bottomLeft", + "type": "Color", + "description": "" + }, + { + "name": "bottomRight", + "type": "Color", + "description": "" + }, + { + "name": "topRight", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "DrawRectangleLines", + "description": "Draw rectangle outline", + "returnType": "void", + "params": [ + { + "name": "posX", + "type": "int", + "description": "" + }, + { + "name": "posY", + "type": "int", + "description": "" + }, + { + "name": "width", + "type": "int", + "description": "" + }, + { + "name": "height", + "type": "int", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "DrawRectangleLinesEx", + "description": "Draw rectangle outline with extended parameters", + "returnType": "void", + "params": [ + { + "name": "rec", + "type": "Rectangle", + "description": "" + }, + { + "name": "lineThick", + "type": "float", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "DrawRectangleRounded", + "description": "Draw rectangle with rounded edges", + "returnType": "void", + "params": [ + { + "name": "rec", + "type": "Rectangle", + "description": "" + }, + { + "name": "roundness", + "type": "float", + "description": "" + }, + { + "name": "segments", + "type": "int", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "DrawRectangleRoundedLines", + "description": "Draw rectangle lines with rounded edges", + "returnType": "void", + "params": [ + { + "name": "rec", + "type": "Rectangle", + "description": "" + }, + { + "name": "roundness", + "type": "float", + "description": "" + }, + { + "name": "segments", + "type": "int", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "DrawRectangleRoundedLinesEx", + "description": "Draw rectangle with rounded edges outline", + "returnType": "void", + "params": [ + { + "name": "rec", + "type": "Rectangle", + "description": "" + }, + { + "name": "roundness", + "type": "float", + "description": "" + }, + { + "name": "segments", + "type": "int", + "description": "" + }, + { + "name": "lineThick", + "type": "float", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "DrawTriangle", + "description": "Draw a color-filled triangle (vertex in counter-clockwise order!)", + "returnType": "void", + "params": [ + { + "name": "v1", + "type": "Vector2", + "description": "" + }, + { + "name": "v2", + "type": "Vector2", + "description": "" + }, + { + "name": "v3", + "type": "Vector2", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "DrawTriangleLines", + "description": "Draw triangle outline (vertex in counter-clockwise order!)", + "returnType": "void", + "params": [ + { + "name": "v1", + "type": "Vector2", + "description": "" + }, + { + "name": "v2", + "type": "Vector2", + "description": "" + }, + { + "name": "v3", + "type": "Vector2", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "DrawTriangleFan", + "description": "Draw a triangle fan defined by points (first vertex is the center)", + "returnType": "void", + "params": [ + { + "name": "points", + "type": "const Vector2 *", + "description": "" + }, + { + "name": "pointCount", + "type": "int", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "DrawTriangleStrip", + "description": "Draw a triangle strip defined by points", + "returnType": "void", + "params": [ + { + "name": "points", + "type": "const Vector2 *", + "description": "" + }, + { + "name": "pointCount", + "type": "int", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "DrawPoly", + "description": "Draw a regular polygon (Vector version)", + "returnType": "void", + "params": [ + { + "name": "center", + "type": "Vector2", + "description": "" + }, + { + "name": "sides", + "type": "int", + "description": "" + }, + { + "name": "radius", + "type": "float", + "description": "" + }, + { + "name": "rotation", + "type": "float", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "DrawPolyLines", + "description": "Draw a polygon outline of n sides", + "returnType": "void", + "params": [ + { + "name": "center", + "type": "Vector2", + "description": "" + }, + { + "name": "sides", + "type": "int", + "description": "" + }, + { + "name": "radius", + "type": "float", + "description": "" + }, + { + "name": "rotation", + "type": "float", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "DrawPolyLinesEx", + "description": "Draw a polygon outline of n sides with extended parameters", + "returnType": "void", + "params": [ + { + "name": "center", + "type": "Vector2", + "description": "" + }, + { + "name": "sides", + "type": "int", + "description": "" + }, + { + "name": "radius", + "type": "float", + "description": "" + }, + { + "name": "rotation", + "type": "float", + "description": "" + }, + { + "name": "lineThick", + "type": "float", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "DrawSplineLinear", + "description": "Draw spline: Linear, minimum 2 points", + "returnType": "void", + "params": [ + { + "name": "points", + "type": "const Vector2 *", + "description": "" + }, + { + "name": "pointCount", + "type": "int", + "description": "" + }, + { + "name": "thick", + "type": "float", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "DrawSplineBasis", + "description": "Draw spline: B-Spline, minimum 4 points", + "returnType": "void", + "params": [ + { + "name": "points", + "type": "const Vector2 *", + "description": "" + }, + { + "name": "pointCount", + "type": "int", + "description": "" + }, + { + "name": "thick", + "type": "float", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "DrawSplineCatmullRom", + "description": "Draw spline: Catmull-Rom, minimum 4 points", + "returnType": "void", + "params": [ + { + "name": "points", + "type": "const Vector2 *", + "description": "" + }, + { + "name": "pointCount", + "type": "int", + "description": "" + }, + { + "name": "thick", + "type": "float", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "DrawSplineBezierQuadratic", + "description": "Draw spline: Quadratic Bezier, minimum 3 points (1 control point): [p1, c2, p3, c4...]", + "returnType": "void", + "params": [ + { + "name": "points", + "type": "const Vector2 *", + "description": "" + }, + { + "name": "pointCount", + "type": "int", + "description": "" + }, + { + "name": "thick", + "type": "float", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "DrawSplineBezierCubic", + "description": "Draw spline: Cubic Bezier, minimum 4 points (2 control points): [p1, c2, c3, p4, c5, c6...]", + "returnType": "void", + "params": [ + { + "name": "points", + "type": "const Vector2 *", + "description": "" + }, + { + "name": "pointCount", + "type": "int", + "description": "" + }, + { + "name": "thick", + "type": "float", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "DrawSplineSegmentLinear", + "description": "Draw spline segment: Linear, 2 points", + "returnType": "void", + "params": [ + { + "name": "p1", + "type": "Vector2", + "description": "" + }, + { + "name": "p2", + "type": "Vector2", + "description": "" + }, + { + "name": "thick", + "type": "float", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "DrawSplineSegmentBasis", + "description": "Draw spline segment: B-Spline, 4 points", + "returnType": "void", + "params": [ + { + "name": "p1", + "type": "Vector2", + "description": "" + }, + { + "name": "p2", + "type": "Vector2", + "description": "" + }, + { + "name": "p3", + "type": "Vector2", + "description": "" + }, + { + "name": "p4", + "type": "Vector2", + "description": "" + }, + { + "name": "thick", + "type": "float", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "DrawSplineSegmentCatmullRom", + "description": "Draw spline segment: Catmull-Rom, 4 points", + "returnType": "void", + "params": [ + { + "name": "p1", + "type": "Vector2", + "description": "" + }, + { + "name": "p2", + "type": "Vector2", + "description": "" + }, + { + "name": "p3", + "type": "Vector2", + "description": "" + }, + { + "name": "p4", + "type": "Vector2", + "description": "" + }, + { + "name": "thick", + "type": "float", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "DrawSplineSegmentBezierQuadratic", + "description": "Draw spline segment: Quadratic Bezier, 2 points, 1 control point", + "returnType": "void", + "params": [ + { + "name": "p1", + "type": "Vector2", + "description": "" + }, + { + "name": "c2", + "type": "Vector2", + "description": "" + }, + { + "name": "p3", + "type": "Vector2", + "description": "" + }, + { + "name": "thick", + "type": "float", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "DrawSplineSegmentBezierCubic", + "description": "Draw spline segment: Cubic Bezier, 2 points, 2 control points", + "returnType": "void", + "params": [ + { + "name": "p1", + "type": "Vector2", + "description": "" + }, + { + "name": "c2", + "type": "Vector2", + "description": "" + }, + { + "name": "c3", + "type": "Vector2", + "description": "" + }, + { + "name": "p4", + "type": "Vector2", + "description": "" + }, + { + "name": "thick", + "type": "float", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "GetSplinePointLinear", + "description": "Get (evaluate) spline point: Linear", + "returnType": "Vector2", + "params": [ + { + "name": "startPos", + "type": "Vector2", + "description": "" + }, + { + "name": "endPos", + "type": "Vector2", + "description": "" + }, + { + "name": "t", + "type": "float", + "description": "" + } + ] + }, + { + "name": "GetSplinePointBasis", + "description": "Get (evaluate) spline point: B-Spline", + "returnType": "Vector2", + "params": [ + { + "name": "p1", + "type": "Vector2", + "description": "" + }, + { + "name": "p2", + "type": "Vector2", + "description": "" + }, + { + "name": "p3", + "type": "Vector2", + "description": "" + }, + { + "name": "p4", + "type": "Vector2", + "description": "" + }, + { + "name": "t", + "type": "float", + "description": "" + } + ] + }, + { + "name": "GetSplinePointCatmullRom", + "description": "Get (evaluate) spline point: Catmull-Rom", + "returnType": "Vector2", + "params": [ + { + "name": "p1", + "type": "Vector2", + "description": "" + }, + { + "name": "p2", + "type": "Vector2", + "description": "" + }, + { + "name": "p3", + "type": "Vector2", + "description": "" + }, + { + "name": "p4", + "type": "Vector2", + "description": "" + }, + { + "name": "t", + "type": "float", + "description": "" + } + ] + }, + { + "name": "GetSplinePointBezierQuad", + "description": "Get (evaluate) spline point: Quadratic Bezier", + "returnType": "Vector2", + "params": [ + { + "name": "p1", + "type": "Vector2", + "description": "" + }, + { + "name": "c2", + "type": "Vector2", + "description": "" + }, + { + "name": "p3", + "type": "Vector2", + "description": "" + }, + { + "name": "t", + "type": "float", + "description": "" + } + ] + }, + { + "name": "GetSplinePointBezierCubic", + "description": "Get (evaluate) spline point: Cubic Bezier", + "returnType": "Vector2", + "params": [ + { + "name": "p1", + "type": "Vector2", + "description": "" + }, + { + "name": "c2", + "type": "Vector2", + "description": "" + }, + { + "name": "c3", + "type": "Vector2", + "description": "" + }, + { + "name": "p4", + "type": "Vector2", + "description": "" + }, + { + "name": "t", + "type": "float", + "description": "" + } + ] + }, + { + "name": "CheckCollisionRecs", + "description": "Check collision between two rectangles", + "returnType": "bool", + "params": [ + { + "name": "rec1", + "type": "Rectangle", + "description": "" + }, + { + "name": "rec2", + "type": "Rectangle", + "description": "" + } + ] + }, + { + "name": "CheckCollisionCircles", + "description": "Check collision between two circles", + "returnType": "bool", + "params": [ + { + "name": "center1", + "type": "Vector2", + "description": "" + }, + { + "name": "radius1", + "type": "float", + "description": "" + }, + { + "name": "center2", + "type": "Vector2", + "description": "" + }, + { + "name": "radius2", + "type": "float", + "description": "" + } + ] + }, + { + "name": "CheckCollisionCircleRec", + "description": "Check collision between circle and rectangle", + "returnType": "bool", + "params": [ + { + "name": "center", + "type": "Vector2", + "description": "" + }, + { + "name": "radius", + "type": "float", + "description": "" + }, + { + "name": "rec", + "type": "Rectangle", + "description": "" + } + ] + }, + { + "name": "CheckCollisionCircleLine", + "description": "Check if circle collides with a line created betweeen two points [p1] and [p2]", + "returnType": "bool", + "params": [ + { + "name": "center", + "type": "Vector2", + "description": "" + }, + { + "name": "radius", + "type": "float", + "description": "" + }, + { + "name": "p1", + "type": "Vector2", + "description": "" + }, + { + "name": "p2", + "type": "Vector2", + "description": "" + } + ] + }, + { + "name": "CheckCollisionPointRec", + "description": "Check if point is inside rectangle", + "returnType": "bool", + "params": [ + { + "name": "point", + "type": "Vector2", + "description": "" + }, + { + "name": "rec", + "type": "Rectangle", + "description": "" + } + ] + }, + { + "name": "CheckCollisionPointCircle", + "description": "Check if point is inside circle", + "returnType": "bool", + "params": [ + { + "name": "point", + "type": "Vector2", + "description": "" + }, + { + "name": "center", + "type": "Vector2", + "description": "" + }, + { + "name": "radius", + "type": "float", + "description": "" + } + ] + }, + { + "name": "CheckCollisionPointTriangle", + "description": "Check if point is inside a triangle", + "returnType": "bool", + "params": [ + { + "name": "point", + "type": "Vector2", + "description": "" + }, + { + "name": "p1", + "type": "Vector2", + "description": "" + }, + { + "name": "p2", + "type": "Vector2", + "description": "" + }, + { + "name": "p3", + "type": "Vector2", + "description": "" + } + ] + }, + { + "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": [ + { + "name": "point", + "type": "Vector2", + "description": "" + }, + { + "name": "p1", + "type": "Vector2", + "description": "" + }, + { + "name": "p2", + "type": "Vector2", + "description": "" + }, + { + "name": "threshold", + "type": "int", + "description": "" + } + ] + }, + { + "name": "CheckCollisionPointPoly", + "description": "Check if point is within a polygon described by array of vertices", + "returnType": "bool", + "params": [ + { + "name": "point", + "type": "Vector2", + "description": "" + }, + { + "name": "points", + "type": "const Vector2 *", + "description": "" + }, + { + "name": "pointCount", + "type": "int", + "description": "" + } + ] + }, + { + "name": "CheckCollisionLines", + "description": "Check the collision between two lines defined by two points each, returns collision point by reference", + "returnType": "bool", + "params": [ + { + "name": "startPos1", + "type": "Vector2", + "description": "" + }, + { + "name": "endPos1", + "type": "Vector2", + "description": "" + }, + { + "name": "startPos2", + "type": "Vector2", + "description": "" + }, + { + "name": "endPos2", + "type": "Vector2", + "description": "" + }, + { + "name": "collisionPoint", + "type": "Vector2 *", + "description": "" + } + ] + }, + { + "name": "GetCollisionRec", + "description": "Get collision rectangle for two rectangles collision", + "returnType": "Rectangle", + "params": [ + { + "name": "rec1", + "type": "Rectangle", + "description": "" + }, + { + "name": "rec2", + "type": "Rectangle", + "description": "" + } + ] + }, + { + "name": "LoadImage", + "description": "Load image from file into CPU memory (RAM)", + "returnType": "Image", + "params": [ + { + "name": "fileName", + "type": "const char *", + "description": "" + } + ] + }, + { + "name": "LoadImageRaw", + "description": "Load image from RAW file data", + "returnType": "Image", + "params": [ + { + "name": "fileName", + "type": "const char *", + "description": "" + }, + { + "name": "width", + "type": "int", + "description": "" + }, + { + "name": "height", + "type": "int", + "description": "" + }, + { + "name": "format", + "type": "int", + "description": "" + }, + { + "name": "headerSize", + "type": "int", + "description": "" + } + ] + }, + { + "name": "LoadImageAnim", + "description": "Load image sequence from file (frames appended to image.data)", + "returnType": "Image", + "params": [ + { + "name": "fileName", + "type": "const char *", + "description": "" + }, + { + "name": "frames", + "type": "int *", + "description": "" + } + ] + }, + { + "name": "LoadImageAnimFromMemory", + "description": "Load image sequence from memory buffer", + "returnType": "Image", + "params": [ + { + "name": "fileType", + "type": "const char *", + "description": "" + }, + { + "name": "fileData", + "type": "const unsigned char *", + "description": "" + }, + { + "name": "dataSize", + "type": "int", + "description": "" + }, + { + "name": "frames", + "type": "int *", + "description": "" + } + ] + }, + { + "name": "LoadImageFromMemory", + "description": "Load image from memory buffer, fileType refers to extension: i.e. '.png'", + "returnType": "Image", + "params": [ + { + "name": "fileType", + "type": "const char *", + "description": "" + }, + { + "name": "fileData", + "type": "const unsigned char *", + "description": "" + }, + { + "name": "dataSize", + "type": "int", + "description": "" + } + ] + }, + { + "name": "LoadImageFromTexture", + "description": "Load image from GPU texture data", + "returnType": "Image", + "params": [ + { + "name": "texture", + "type": "Texture2D", + "description": "" + } + ] + }, + { + "name": "LoadImageFromScreen", + "description": "Load image from screen buffer and (screenshot)", + "returnType": "Image", + "params": [] + }, + { + "name": "IsImageValid", + "description": "Check if an image is valid (data and parameters)", + "returnType": "bool", + "params": [ + { + "name": "image", + "type": "Image", + "description": "" + } + ] + }, + { + "name": "UnloadImage", + "description": "Unload image from CPU memory (RAM)", + "returnType": "void", + "params": [ + { + "name": "image", + "type": "Image", + "description": "" + } + ] + }, + { + "name": "ExportImage", + "description": "Export image data to file, returns true on success", + "returnType": "bool", + "params": [ + { + "name": "image", + "type": "Image", + "description": "" + }, + { + "name": "fileName", + "type": "const char *", + "description": "" + } + ] + }, + { + "name": "ExportImageToMemory", + "description": "Export image to memory buffer, memory must be MemFree()", + "returnType": "unsigned char *", + "params": [ + { + "name": "image", + "type": "Image", + "description": "" + }, + { + "name": "fileType", + "type": "const char *", + "description": "" + }, + { + "name": "fileSize", + "type": "int *", + "description": "" + } + ] + }, + { + "name": "ExportImageAsCode", + "description": "Export image as code file defining an array of bytes, returns true on success", + "returnType": "bool", + "params": [ + { + "name": "image", + "type": "Image", + "description": "" + }, + { + "name": "fileName", + "type": "const char *", + "description": "" + } + ] + }, + { + "name": "GenImageColor", + "description": "Generate image: plain color", + "returnType": "Image", + "params": [ + { + "name": "width", + "type": "int", + "description": "" + }, + { + "name": "height", + "type": "int", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "GenImageGradientLinear", + "description": "Generate image: linear gradient, direction in degrees [0..360], 0=Vertical gradient", + "returnType": "Image", + "params": [ + { + "name": "width", + "type": "int", + "description": "" + }, + { + "name": "height", + "type": "int", + "description": "" + }, + { + "name": "direction", + "type": "int", + "description": "" + }, + { + "name": "start", + "type": "Color", + "description": "" + }, + { + "name": "end", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "GenImageGradientRadial", + "description": "Generate image: radial gradient", + "returnType": "Image", + "params": [ + { + "name": "width", + "type": "int", + "description": "" + }, + { + "name": "height", + "type": "int", + "description": "" + }, + { + "name": "density", + "type": "float", + "description": "" + }, + { + "name": "inner", + "type": "Color", + "description": "" + }, + { + "name": "outer", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "GenImageGradientSquare", + "description": "Generate image: square gradient", + "returnType": "Image", + "params": [ + { + "name": "width", + "type": "int", + "description": "" + }, + { + "name": "height", + "type": "int", + "description": "" + }, + { + "name": "density", + "type": "float", + "description": "" + }, + { + "name": "inner", + "type": "Color", + "description": "" + }, + { + "name": "outer", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "GenImageChecked", + "description": "Generate image: checked", + "returnType": "Image", + "params": [ + { + "name": "width", + "type": "int", + "description": "" + }, + { + "name": "height", + "type": "int", + "description": "" + }, + { + "name": "checksX", + "type": "int", + "description": "" + }, + { + "name": "checksY", + "type": "int", + "description": "" + }, + { + "name": "col1", + "type": "Color", + "description": "" + }, + { + "name": "col2", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "GenImageWhiteNoise", + "description": "Generate image: white noise", + "returnType": "Image", + "params": [ + { + "name": "width", + "type": "int", + "description": "" + }, + { + "name": "height", + "type": "int", + "description": "" + }, + { + "name": "factor", + "type": "float", + "description": "" + } + ] + }, + { + "name": "GenImagePerlinNoise", + "description": "Generate image: perlin noise", + "returnType": "Image", + "params": [ + { + "name": "width", + "type": "int", + "description": "" + }, + { + "name": "height", + "type": "int", + "description": "" + }, + { + "name": "offsetX", + "type": "int", + "description": "" + }, + { + "name": "offsetY", + "type": "int", + "description": "" + }, + { + "name": "scale", + "type": "float", + "description": "" + } + ] + }, + { + "name": "GenImageCellular", + "description": "Generate image: cellular algorithm, bigger tileSize means bigger cells", + "returnType": "Image", + "params": [ + { + "name": "width", + "type": "int", + "description": "" + }, + { + "name": "height", + "type": "int", + "description": "" + }, + { + "name": "tileSize", + "type": "int", + "description": "" + } + ] + }, + { + "name": "GenImageText", + "description": "Generate image: grayscale image from text data", + "returnType": "Image", + "params": [ + { + "name": "width", + "type": "int", + "description": "" + }, + { + "name": "height", + "type": "int", + "description": "" + }, + { + "name": "text", + "type": "const char *", + "description": "" + } + ] + }, + { + "name": "ImageCopy", + "description": "Create an image duplicate (useful for transformations)", + "returnType": "Image", + "params": [ + { + "name": "image", + "type": "Image", + "description": "" + } + ] + }, + { + "name": "ImageFromImage", + "description": "Create an image from another image piece", + "returnType": "Image", + "params": [ + { + "name": "image", + "type": "Image", + "description": "" + }, + { + "name": "rec", + "type": "Rectangle", + "description": "" + } + ] + }, + { + "name": "ImageFromChannel", + "description": "Create an image from a selected channel of another image (GRAYSCALE)", + "returnType": "Image", + "params": [ + { + "name": "image", + "type": "Image", + "description": "" + }, + { + "name": "selectedChannel", + "type": "int", + "description": "" + } + ] + }, + { + "name": "ImageText", + "description": "Create an image from text (default font)", + "returnType": "Image", + "params": [ + { + "name": "text", + "type": "const char *", + "description": "" + }, + { + "name": "fontSize", + "type": "int", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "ImageTextEx", + "description": "Create an image from text (custom sprite font)", + "returnType": "Image", + "params": [ + { + "name": "font", + "type": "Font", + "description": "" + }, + { + "name": "text", + "type": "const char *", + "description": "" + }, + { + "name": "fontSize", + "type": "float", + "description": "" + }, + { + "name": "spacing", + "type": "float", + "description": "" + }, + { + "name": "tint", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "ImageFormat", + "description": "Convert image data to desired format", + "returnType": "void", + "params": [ + { + "name": "image", + "type": "Image *", + "description": "" + }, + { + "name": "newFormat", + "type": "int", + "description": "" + } + ] + }, + { + "name": "ImageToPOT", + "description": "Convert image to POT (power-of-two)", + "returnType": "void", + "params": [ + { + "name": "image", + "type": "Image *", + "description": "" + }, + { + "name": "fill", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "ImageCrop", + "description": "Crop an image to a defined rectangle", + "returnType": "void", + "params": [ + { + "name": "image", + "type": "Image *", + "description": "" + }, + { + "name": "crop", + "type": "Rectangle", + "description": "" + } + ] + }, + { + "name": "ImageAlphaCrop", + "description": "Crop image depending on alpha value", + "returnType": "void", + "params": [ + { + "name": "image", + "type": "Image *", + "description": "" + }, + { + "name": "threshold", + "type": "float", + "description": "" + } + ] + }, + { + "name": "ImageAlphaClear", + "description": "Clear alpha channel to desired color", + "returnType": "void", + "params": [ + { + "name": "image", + "type": "Image *", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + }, + { + "name": "threshold", + "type": "float", + "description": "" + } + ] + }, + { + "name": "ImageAlphaMask", + "description": "Apply alpha mask to image", + "returnType": "void", + "params": [ + { + "name": "image", + "type": "Image *", + "description": "" + }, + { + "name": "alphaMask", + "type": "Image", + "description": "" + } + ] + }, + { + "name": "ImageAlphaPremultiply", + "description": "Premultiply alpha channel", + "returnType": "void", + "params": [ + { + "name": "image", + "type": "Image *", + "description": "" + } + ] + }, + { + "name": "ImageBlurGaussian", + "description": "Apply Gaussian blur using a box blur approximation", + "returnType": "void", + "params": [ + { + "name": "image", + "type": "Image *", + "description": "" + }, + { + "name": "blurSize", + "type": "int", + "description": "" + } + ] + }, + { + "name": "ImageKernelConvolution", + "description": "Apply custom square convolution kernel to image", + "returnType": "void", + "params": [ + { + "name": "image", + "type": "Image *", + "description": "" + }, + { + "name": "kernel", + "type": "const float *", + "description": "" + }, + { + "name": "kernelSize", + "type": "int", + "description": "" + } + ] + }, + { + "name": "ImageResize", + "description": "Resize image (Bicubic scaling algorithm)", + "returnType": "void", + "params": [ + { + "name": "image", + "type": "Image *", + "description": "" + }, + { + "name": "newWidth", + "type": "int", + "description": "" + }, + { + "name": "newHeight", + "type": "int", + "description": "" + } + ] + }, + { + "name": "ImageResizeNN", + "description": "Resize image (Nearest-Neighbor scaling algorithm)", + "returnType": "void", + "params": [ + { + "name": "image", + "type": "Image *", + "description": "" + }, + { + "name": "newWidth", + "type": "int", + "description": "" + }, + { + "name": "newHeight", + "type": "int", + "description": "" + } + ] + }, + { + "name": "ImageResizeCanvas", + "description": "Resize canvas and fill with color", + "returnType": "void", + "params": [ + { + "name": "image", + "type": "Image *", + "description": "" + }, + { + "name": "newWidth", + "type": "int", + "description": "" + }, + { + "name": "newHeight", + "type": "int", + "description": "" + }, + { + "name": "offsetX", + "type": "int", + "description": "" + }, + { + "name": "offsetY", + "type": "int", + "description": "" + }, + { + "name": "fill", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "ImageMipmaps", + "description": "Compute all mipmap levels for a provided image", + "returnType": "void", + "params": [ + { + "name": "image", + "type": "Image *", + "description": "" + } + ] + }, + { + "name": "ImageDither", + "description": "Dither image data to 16bpp or lower (Floyd-Steinberg dithering)", + "returnType": "void", + "params": [ + { + "name": "image", + "type": "Image *", + "description": "" + }, + { + "name": "rBpp", + "type": "int", + "description": "" + }, + { + "name": "gBpp", + "type": "int", + "description": "" + }, + { + "name": "bBpp", + "type": "int", + "description": "" + }, + { + "name": "aBpp", + "type": "int", + "description": "" + } + ] + }, + { + "name": "ImageFlipVertical", + "description": "Flip image vertically", + "returnType": "void", + "params": [ + { + "name": "image", + "type": "Image *", + "description": "" + } + ] + }, + { + "name": "ImageFlipHorizontal", + "description": "Flip image horizontally", + "returnType": "void", + "params": [ + { + "name": "image", + "type": "Image *", + "description": "" + } + ] + }, + { + "name": "ImageRotate", + "description": "Rotate image by input angle in degrees (-359 to 359)", + "returnType": "void", + "params": [ + { + "name": "image", + "type": "Image *", + "description": "" + }, + { + "name": "degrees", + "type": "int", + "description": "" + } + ] + }, + { + "name": "ImageRotateCW", + "description": "Rotate image clockwise 90deg", + "returnType": "void", + "params": [ + { + "name": "image", + "type": "Image *", + "description": "" + } + ] + }, + { + "name": "ImageRotateCCW", + "description": "Rotate image counter-clockwise 90deg", + "returnType": "void", + "params": [ + { + "name": "image", + "type": "Image *", + "description": "" + } + ] + }, + { + "name": "ImageColorTint", + "description": "Modify image color: tint", + "returnType": "void", + "params": [ + { + "name": "image", + "type": "Image *", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "ImageColorInvert", + "description": "Modify image color: invert", + "returnType": "void", + "params": [ + { + "name": "image", + "type": "Image *", + "description": "" + } + ] + }, + { + "name": "ImageColorGrayscale", + "description": "Modify image color: grayscale", + "returnType": "void", + "params": [ + { + "name": "image", + "type": "Image *", + "description": "" + } + ] + }, + { + "name": "ImageColorContrast", + "description": "Modify image color: contrast (-100 to 100)", + "returnType": "void", + "params": [ + { + "name": "image", + "type": "Image *", + "description": "" + }, + { + "name": "contrast", + "type": "float", + "description": "" + } + ] + }, + { + "name": "ImageColorBrightness", + "description": "Modify image color: brightness (-255 to 255)", + "returnType": "void", + "params": [ + { + "name": "image", + "type": "Image *", + "description": "" + }, + { + "name": "brightness", + "type": "int", + "description": "" + } + ] + }, + { + "name": "ImageColorReplace", + "description": "Modify image color: replace color", + "returnType": "void", + "params": [ + { + "name": "image", + "type": "Image *", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + }, + { + "name": "replace", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "LoadImageColors", + "description": "Load color data from image as a Color array (RGBA - 32bit)", + "returnType": "Color *", + "params": [ + { + "name": "image", + "type": "Image", + "description": "" + } + ] + }, + { + "name": "LoadImagePalette", + "description": "Load colors palette from image as a Color array (RGBA - 32bit)", + "returnType": "Color *", + "params": [ + { + "name": "image", + "type": "Image", + "description": "" + }, + { + "name": "maxPaletteSize", + "type": "int", + "description": "" + }, + { + "name": "colorCount", + "type": "int *", + "description": "" + } + ] + }, + { + "name": "UnloadImageColors", + "description": "Unload color data loaded with LoadImageColors()", + "returnType": "void", + "params": [ + { + "name": "colors", + "type": "Color *", + "description": "" + } + ] + }, + { + "name": "UnloadImagePalette", + "description": "Unload colors palette loaded with LoadImagePalette()", + "returnType": "void", + "params": [ + { + "name": "colors", + "type": "Color *", + "description": "" + } + ] + }, + { + "name": "GetImageAlphaBorder", + "description": "Get image alpha border rectangle", + "returnType": "Rectangle", + "params": [ + { + "name": "image", + "type": "Image", + "description": "" + }, + { + "name": "threshold", + "type": "float", + "description": "" + } + ] + }, + { + "name": "GetImageColor", + "description": "Get image pixel color at (x, y) position", + "returnType": "Color", + "params": [ + { + "name": "image", + "type": "Image", + "description": "" + }, + { + "name": "x", + "type": "int", + "description": "" + }, + { + "name": "y", + "type": "int", + "description": "" + } + ] + }, + { + "name": "ImageClearBackground", + "description": "Clear image background with given color", + "returnType": "void", + "params": [ + { + "name": "dst", + "type": "Image *", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "ImageDrawPixel", + "description": "Draw pixel within an image", + "returnType": "void", + "params": [ + { + "name": "dst", + "type": "Image *", + "description": "" + }, + { + "name": "posX", + "type": "int", + "description": "" + }, + { + "name": "posY", + "type": "int", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "ImageDrawPixelV", + "description": "Draw pixel within an image (Vector version)", + "returnType": "void", + "params": [ + { + "name": "dst", + "type": "Image *", + "description": "" + }, + { + "name": "position", + "type": "Vector2", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "ImageDrawLine", + "description": "Draw line within an image", + "returnType": "void", + "params": [ + { + "name": "dst", + "type": "Image *", + "description": "" + }, + { + "name": "startPosX", + "type": "int", + "description": "" + }, + { + "name": "startPosY", + "type": "int", + "description": "" + }, + { + "name": "endPosX", + "type": "int", + "description": "" + }, + { + "name": "endPosY", + "type": "int", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "ImageDrawLineV", + "description": "Draw line within an image (Vector version)", + "returnType": "void", + "params": [ + { + "name": "dst", + "type": "Image *", + "description": "" + }, + { + "name": "start", + "type": "Vector2", + "description": "" + }, + { + "name": "end", + "type": "Vector2", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "ImageDrawLineEx", + "description": "Draw a line defining thickness within an image", + "returnType": "void", + "params": [ + { + "name": "dst", + "type": "Image *", + "description": "" + }, + { + "name": "start", + "type": "Vector2", + "description": "" + }, + { + "name": "end", + "type": "Vector2", + "description": "" + }, + { + "name": "thick", + "type": "int", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "ImageDrawCircle", + "description": "Draw a filled circle within an image", + "returnType": "void", + "params": [ + { + "name": "dst", + "type": "Image *", + "description": "" + }, + { + "name": "centerX", + "type": "int", + "description": "" + }, + { + "name": "centerY", + "type": "int", + "description": "" + }, + { + "name": "radius", + "type": "int", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "ImageDrawCircleV", + "description": "Draw a filled circle within an image (Vector version)", + "returnType": "void", + "params": [ + { + "name": "dst", + "type": "Image *", + "description": "" + }, + { + "name": "center", + "type": "Vector2", + "description": "" + }, + { + "name": "radius", + "type": "int", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "ImageDrawCircleLines", + "description": "Draw circle outline within an image", + "returnType": "void", + "params": [ + { + "name": "dst", + "type": "Image *", + "description": "" + }, + { + "name": "centerX", + "type": "int", + "description": "" + }, + { + "name": "centerY", + "type": "int", + "description": "" + }, + { + "name": "radius", + "type": "int", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "ImageDrawCircleLinesV", + "description": "Draw circle outline within an image (Vector version)", + "returnType": "void", + "params": [ + { + "name": "dst", + "type": "Image *", + "description": "" + }, + { + "name": "center", + "type": "Vector2", + "description": "" + }, + { + "name": "radius", + "type": "int", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "ImageDrawRectangle", + "description": "Draw rectangle within an image", + "returnType": "void", + "params": [ + { + "name": "dst", + "type": "Image *", + "description": "" + }, + { + "name": "posX", + "type": "int", + "description": "" + }, + { + "name": "posY", + "type": "int", + "description": "" + }, + { + "name": "width", + "type": "int", + "description": "" + }, + { + "name": "height", + "type": "int", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "ImageDrawRectangleV", + "description": "Draw rectangle within an image (Vector version)", + "returnType": "void", + "params": [ + { + "name": "dst", + "type": "Image *", + "description": "" + }, + { + "name": "position", + "type": "Vector2", + "description": "" + }, + { + "name": "size", + "type": "Vector2", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "ImageDrawRectangleRec", + "description": "Draw rectangle within an image", + "returnType": "void", + "params": [ + { + "name": "dst", + "type": "Image *", + "description": "" + }, + { + "name": "rec", + "type": "Rectangle", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "ImageDrawRectangleLines", + "description": "Draw rectangle lines within an image", + "returnType": "void", + "params": [ + { + "name": "dst", + "type": "Image *", + "description": "" + }, + { + "name": "rec", + "type": "Rectangle", + "description": "" + }, + { + "name": "thick", + "type": "int", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "ImageDrawTriangle", + "description": "Draw triangle within an image", + "returnType": "void", + "params": [ + { + "name": "dst", + "type": "Image *", + "description": "" + }, + { + "name": "v1", + "type": "Vector2", + "description": "" + }, + { + "name": "v2", + "type": "Vector2", + "description": "" + }, + { + "name": "v3", + "type": "Vector2", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "ImageDrawTriangleEx", + "description": "Draw triangle with interpolated colors within an image", + "returnType": "void", + "params": [ + { + "name": "dst", + "type": "Image *", + "description": "" + }, + { + "name": "v1", + "type": "Vector2", + "description": "" + }, + { + "name": "v2", + "type": "Vector2", + "description": "" + }, + { + "name": "v3", + "type": "Vector2", + "description": "" + }, + { + "name": "c1", + "type": "Color", + "description": "" + }, + { + "name": "c2", + "type": "Color", + "description": "" + }, + { + "name": "c3", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "ImageDrawTriangleLines", + "description": "Draw triangle outline within an image", + "returnType": "void", + "params": [ + { + "name": "dst", + "type": "Image *", + "description": "" + }, + { + "name": "v1", + "type": "Vector2", + "description": "" + }, + { + "name": "v2", + "type": "Vector2", + "description": "" + }, + { + "name": "v3", + "type": "Vector2", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "ImageDrawTriangleFan", + "description": "Draw a triangle fan defined by points within an image (first vertex is the center)", + "returnType": "void", + "params": [ + { + "name": "dst", + "type": "Image *", + "description": "" + }, + { + "name": "points", + "type": "const Vector2 *", + "description": "" + }, + { + "name": "pointCount", + "type": "int", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "ImageDrawTriangleStrip", + "description": "Draw a triangle strip defined by points within an image", + "returnType": "void", + "params": [ + { + "name": "dst", + "type": "Image *", + "description": "" + }, + { + "name": "points", + "type": "const Vector2 *", + "description": "" + }, + { + "name": "pointCount", + "type": "int", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "ImageDraw", + "description": "Draw a source image within a destination image (tint applied to source)", + "returnType": "void", + "params": [ + { + "name": "dst", + "type": "Image *", + "description": "" + }, + { + "name": "src", + "type": "Image", + "description": "" + }, + { + "name": "srcRec", + "type": "Rectangle", + "description": "" + }, + { + "name": "dstRec", + "type": "Rectangle", + "description": "" + }, + { + "name": "tint", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "ImageDrawText", + "description": "Draw text (using default font) within an image (destination)", + "returnType": "void", + "params": [ + { + "name": "dst", + "type": "Image *", + "description": "" + }, + { + "name": "text", + "type": "const char *", + "description": "" + }, + { + "name": "posX", + "type": "int", + "description": "" + }, + { + "name": "posY", + "type": "int", + "description": "" + }, + { + "name": "fontSize", + "type": "int", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "ImageDrawTextEx", + "description": "Draw text (custom sprite font) within an image (destination)", + "returnType": "void", + "params": [ + { + "name": "dst", + "type": "Image *", + "description": "" + }, + { + "name": "font", + "type": "Font", + "description": "" + }, + { + "name": "text", + "type": "const char *", + "description": "" + }, + { + "name": "position", + "type": "Vector2", + "description": "" + }, + { + "name": "fontSize", + "type": "float", + "description": "" + }, + { + "name": "spacing", + "type": "float", + "description": "" + }, + { + "name": "tint", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "LoadTexture", + "description": "Load texture from file into GPU memory (VRAM)", + "returnType": "Texture2D", + "params": [ + { + "name": "fileName", + "type": "const char *", + "description": "" + } + ] + }, + { + "name": "LoadTextureFromImage", + "description": "Load texture from image data", + "returnType": "Texture2D", + "params": [ + { + "name": "image", + "type": "Image", + "description": "" + } + ] + }, + { + "name": "LoadTextureCubemap", + "description": "Load cubemap from image, multiple image cubemap layouts supported", + "returnType": "TextureCubemap", + "params": [ + { + "name": "image", + "type": "Image", + "description": "" + }, + { + "name": "layout", + "type": "int", + "description": "" + } + ] + }, + { + "name": "LoadRenderTexture", + "description": "Load texture for rendering (framebuffer)", + "returnType": "RenderTexture2D", + "params": [ + { + "name": "width", + "type": "int", + "description": "" + }, + { + "name": "height", + "type": "int", + "description": "" + } + ] + }, + { + "name": "IsTextureValid", + "description": "Check if a texture is valid (loaded in GPU)", + "returnType": "bool", + "params": [ + { + "name": "texture", + "type": "Texture2D", + "description": "" + } + ] + }, + { + "name": "UnloadTexture", + "description": "Unload texture from GPU memory (VRAM)", + "returnType": "void", + "params": [ + { + "name": "texture", + "type": "Texture2D", + "description": "" + } + ] + }, + { + "name": "IsRenderTextureValid", + "description": "Check if a render texture is valid (loaded in GPU)", + "returnType": "bool", + "params": [ + { + "name": "target", + "type": "RenderTexture2D", + "description": "" + } + ] + }, + { + "name": "UnloadRenderTexture", + "description": "Unload render texture from GPU memory (VRAM)", + "returnType": "void", + "params": [ + { + "name": "target", + "type": "RenderTexture2D", + "description": "" + } + ] + }, + { + "name": "UpdateTexture", + "description": "Update GPU texture with new data (pixels should be able to fill texture)", + "returnType": "void", + "params": [ + { + "name": "texture", + "type": "Texture2D", + "description": "" + }, + { + "name": "pixels", + "type": "const void *", + "description": "" + } + ] + }, + { + "name": "UpdateTextureRec", + "description": "Update GPU texture rectangle with new data (pixels and rec should fit in texture)", + "returnType": "void", + "params": [ + { + "name": "texture", + "type": "Texture2D", + "description": "" + }, + { + "name": "rec", + "type": "Rectangle", + "description": "" + }, + { + "name": "pixels", + "type": "const void *", + "description": "" + } + ] + }, + { + "name": "GenTextureMipmaps", + "description": "Generate GPU mipmaps for a texture", + "returnType": "void", + "params": [ + { + "name": "texture", + "type": "Texture2D *", + "description": "" + } + ] + }, + { + "name": "SetTextureFilter", + "description": "Set texture scaling filter mode", + "returnType": "void", + "params": [ + { + "name": "texture", + "type": "Texture2D", + "description": "" + }, + { + "name": "filter", + "type": "int", + "description": "" + } + ] + }, + { + "name": "SetTextureWrap", + "description": "Set texture wrapping mode", + "returnType": "void", + "params": [ + { + "name": "texture", + "type": "Texture2D", + "description": "" + }, + { + "name": "wrap", + "type": "int", + "description": "" + } + ] + }, + { + "name": "DrawTexture", + "description": "Draw a Texture2D", + "returnType": "void", + "params": [ + { + "name": "texture", + "type": "Texture2D", + "description": "" + }, + { + "name": "posX", + "type": "int", + "description": "" + }, + { + "name": "posY", + "type": "int", + "description": "" + }, + { + "name": "tint", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "DrawTextureV", + "description": "Draw a Texture2D with position defined as Vector2", + "returnType": "void", + "params": [ + { + "name": "texture", + "type": "Texture2D", + "description": "" + }, + { + "name": "position", + "type": "Vector2", + "description": "" + }, + { + "name": "tint", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "DrawTextureEx", + "description": "Draw a Texture2D with extended parameters", + "returnType": "void", + "params": [ + { + "name": "texture", + "type": "Texture2D", + "description": "" + }, + { + "name": "position", + "type": "Vector2", + "description": "" + }, + { + "name": "rotation", + "type": "float", + "description": "" + }, + { + "name": "scale", + "type": "float", + "description": "" + }, + { + "name": "tint", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "DrawTextureRec", + "description": "Draw a part of a texture defined by a rectangle", + "returnType": "void", + "params": [ + { + "name": "texture", + "type": "Texture2D", + "description": "" + }, + { + "name": "source", + "type": "Rectangle", + "description": "" + }, + { + "name": "position", + "type": "Vector2", + "description": "" + }, + { + "name": "tint", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "DrawTexturePro", + "description": "Draw a part of a texture defined by a rectangle with 'pro' parameters", + "returnType": "void", + "params": [ + { + "name": "texture", + "type": "Texture2D", + "description": "" + }, + { + "name": "source", + "type": "Rectangle", + "description": "" + }, + { + "name": "dest", + "type": "Rectangle", + "description": "" + }, + { + "name": "origin", + "type": "Vector2", + "description": "" + }, + { + "name": "rotation", + "type": "float", + "description": "" + }, + { + "name": "tint", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "DrawTextureNPatch", + "description": "Draws a texture (or part of it) that stretches or shrinks nicely", + "returnType": "void", + "params": [ + { + "name": "texture", + "type": "Texture2D", + "description": "" + }, + { + "name": "nPatchInfo", + "type": "NPatchInfo", + "description": "" + }, + { + "name": "dest", + "type": "Rectangle", + "description": "" + }, + { + "name": "origin", + "type": "Vector2", + "description": "" + }, + { + "name": "rotation", + "type": "float", + "description": "" + }, + { + "name": "tint", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "ColorIsEqual", + "description": "Check if two colors are equal", + "returnType": "bool", + "params": [ + { + "name": "col1", + "type": "Color", + "description": "" + }, + { + "name": "col2", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "Fade", + "description": "Get color with alpha applied, alpha goes from 0.0f to 1.0f", + "returnType": "Color", + "params": [ + { + "name": "color", + "type": "Color", + "description": "" + }, + { + "name": "alpha", + "type": "float", + "description": "" + } + ] + }, + { + "name": "ColorToInt", + "description": "Get hexadecimal value for a Color (0xRRGGBBAA)", + "returnType": "int", + "params": [ + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "ColorNormalize", + "description": "Get Color normalized as float [0..1]", + "returnType": "Vector4", + "params": [ + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "ColorFromNormalized", + "description": "Get Color from normalized values [0..1]", + "returnType": "Color", + "params": [ + { + "name": "normalized", + "type": "Vector4", + "description": "" + } + ] + }, + { + "name": "ColorToHSV", + "description": "Get HSV values for a Color, hue [0..360], saturation/value [0..1]", + "returnType": "Vector3", + "params": [ + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "ColorFromHSV", + "description": "Get a Color from HSV values, hue [0..360], saturation/value [0..1]", + "returnType": "Color", + "params": [ + { + "name": "hue", + "type": "float", + "description": "" + }, + { + "name": "saturation", + "type": "float", + "description": "" + }, + { + "name": "value", + "type": "float", + "description": "" + } + ] + }, + { + "name": "ColorTint", + "description": "Get color multiplied with another color", + "returnType": "Color", + "params": [ + { + "name": "color", + "type": "Color", + "description": "" + }, + { + "name": "tint", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "ColorBrightness", + "description": "Get color with brightness correction, brightness factor goes from -1.0f to 1.0f", + "returnType": "Color", + "params": [ + { + "name": "color", + "type": "Color", + "description": "" + }, + { + "name": "factor", + "type": "float", + "description": "" + } + ] + }, + { + "name": "ColorContrast", + "description": "Get color with contrast correction, contrast values between -1.0f and 1.0f", + "returnType": "Color", + "params": [ + { + "name": "color", + "type": "Color", + "description": "" + }, + { + "name": "contrast", + "type": "float", + "description": "" + } + ] + }, + { + "name": "ColorAlpha", + "description": "Get color with alpha applied, alpha goes from 0.0f to 1.0f", + "returnType": "Color", + "params": [ + { + "name": "color", + "type": "Color", + "description": "" + }, + { + "name": "alpha", + "type": "float", + "description": "" + } + ] + }, + { + "name": "ColorAlphaBlend", + "description": "Get src alpha-blended into dst color with tint", + "returnType": "Color", + "params": [ + { + "name": "dst", + "type": "Color", + "description": "" + }, + { + "name": "src", + "type": "Color", + "description": "" + }, + { + "name": "tint", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "ColorLerp", + "description": "Get color lerp interpolation between two colors, factor [0.0f..1.0f]", + "returnType": "Color", + "params": [ + { + "name": "color1", + "type": "Color", + "description": "" + }, + { + "name": "color2", + "type": "Color", + "description": "" + }, + { + "name": "factor", + "type": "float", + "description": "" + } + ] + }, + { + "name": "GetColor", + "description": "Get Color structure from hexadecimal value", + "returnType": "Color", + "params": [ + { + "name": "hexValue", + "type": "unsigned int", + "description": "" + } + ] + }, + { + "name": "GetPixelColor", + "description": "Get Color from a source pixel pointer of certain format", + "returnType": "Color", + "params": [ + { + "name": "srcPtr", + "type": "void *", + "description": "" + }, + { + "name": "format", + "type": "int", + "description": "" + } + ] + }, + { + "name": "SetPixelColor", + "description": "Set color formatted into destination pixel pointer", + "returnType": "void", + "params": [ + { + "name": "dstPtr", + "type": "void *", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + }, + { + "name": "format", + "type": "int", + "description": "" + } + ] + }, + { + "name": "GetPixelDataSize", + "description": "Get pixel data size in bytes for certain format", + "returnType": "int", + "params": [ + { + "name": "width", + "type": "int", + "description": "" + }, + { + "name": "height", + "type": "int", + "description": "" + }, + { + "name": "format", + "type": "int", + "description": "" + } + ] + }, + { + "name": "GetFontDefault", + "description": "Get the default Font", + "returnType": "Font", + "params": [] + }, + { + "name": "LoadFont", + "description": "Load font from file into GPU memory (VRAM)", + "returnType": "Font", + "params": [ + { + "name": "fileName", + "type": "const char *", + "description": "" + } + ] + }, + { + "name": "LoadFontEx", + "description": "Load font from file with extended parameters, use NULL for codepoints and 0 for codepointCount to load the default character set, font size is provided in pixels height", + "returnType": "Font", + "params": [ + { + "name": "fileName", + "type": "const char *", + "description": "" + }, + { + "name": "fontSize", + "type": "int", + "description": "" + }, + { + "name": "codepoints", + "type": "const int *", + "description": "" + }, + { + "name": "codepointCount", + "type": "int", + "description": "" + } + ] + }, + { + "name": "LoadFontFromImage", + "description": "Load font from Image (XNA style)", + "returnType": "Font", + "params": [ + { + "name": "image", + "type": "Image", + "description": "" + }, + { + "name": "key", + "type": "Color", + "description": "" + }, + { + "name": "firstChar", + "type": "int", + "description": "" + } + ] + }, + { + "name": "LoadFontFromMemory", + "description": "Load font from memory buffer, fileType refers to extension: i.e. '.ttf'", + "returnType": "Font", + "params": [ + { + "name": "fileType", + "type": "const char *", + "description": "" + }, + { + "name": "fileData", + "type": "const unsigned char *", + "description": "" + }, + { + "name": "dataSize", + "type": "int", + "description": "" + }, + { + "name": "fontSize", + "type": "int", + "description": "" + }, + { + "name": "codepoints", + "type": "const int *", + "description": "" + }, + { + "name": "codepointCount", + "type": "int", + "description": "" + } + ] + }, + { + "name": "IsFontValid", + "description": "Check if a font is valid (font data loaded, WARNING: GPU texture not checked)", + "returnType": "bool", + "params": [ + { + "name": "font", + "type": "Font", + "description": "" + } + ] + }, + { + "name": "LoadFontData", + "description": "Load font data for further use", + "returnType": "GlyphInfo *", + "params": [ + { + "name": "fileData", + "type": "const unsigned char *", + "description": "" + }, + { + "name": "dataSize", + "type": "int", + "description": "" + }, + { + "name": "fontSize", + "type": "int", + "description": "" + }, + { + "name": "codepoints", + "type": "const int *", + "description": "" + }, + { + "name": "codepointCount", + "type": "int", + "description": "" + }, + { + "name": "type", + "type": "int", + "description": "" + }, + { + "name": "glyphCount", + "type": "int *", + "description": "" + } + ] + }, + { + "name": "GenImageFontAtlas", + "description": "Generate image font atlas using chars info", + "returnType": "Image", + "params": [ + { + "name": "glyphs", + "type": "const GlyphInfo *", + "description": "" + }, + { + "name": "glyphRecs", + "type": "Rectangle **", + "description": "" + }, + { + "name": "glyphCount", + "type": "int", + "description": "" + }, + { + "name": "fontSize", + "type": "int", + "description": "" + }, + { + "name": "padding", + "type": "int", + "description": "" + }, + { + "name": "packMethod", + "type": "int", + "description": "" + } + ] + }, + { + "name": "UnloadFontData", + "description": "Unload font chars info data (RAM)", + "returnType": "void", + "params": [ + { + "name": "glyphs", + "type": "GlyphInfo *", + "description": "" + }, + { + "name": "glyphCount", + "type": "int", + "description": "" + } + ] + }, + { + "name": "UnloadFont", + "description": "Unload font from GPU memory (VRAM)", + "returnType": "void", + "params": [ + { + "name": "font", + "type": "Font", + "description": "" + } + ] + }, + { + "name": "ExportFontAsCode", + "description": "Export font as code file, returns true on success", + "returnType": "bool", + "params": [ + { + "name": "font", + "type": "Font", + "description": "" + }, + { + "name": "fileName", + "type": "const char *", + "description": "" + } + ] + }, + { + "name": "DrawFPS", + "description": "Draw current FPS", + "returnType": "void", + "params": [ + { + "name": "posX", + "type": "int", + "description": "" + }, + { + "name": "posY", + "type": "int", + "description": "" + } + ] + }, + { + "name": "DrawText", + "description": "Draw text (using default font)", + "returnType": "void", + "params": [ + { + "name": "text", + "type": "const char *", + "description": "" + }, + { + "name": "posX", + "type": "int", + "description": "" + }, + { + "name": "posY", + "type": "int", + "description": "" + }, + { + "name": "fontSize", + "type": "int", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "DrawTextEx", + "description": "Draw text using font and additional parameters", + "returnType": "void", + "params": [ + { + "name": "font", + "type": "Font", + "description": "" + }, + { + "name": "text", + "type": "const char *", + "description": "" + }, + { + "name": "position", + "type": "Vector2", + "description": "" + }, + { + "name": "fontSize", + "type": "float", + "description": "" + }, + { + "name": "spacing", + "type": "float", + "description": "" + }, + { + "name": "tint", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "DrawTextPro", + "description": "Draw text using Font and pro parameters (rotation)", + "returnType": "void", + "params": [ + { + "name": "font", + "type": "Font", + "description": "" + }, + { + "name": "text", + "type": "const char *", + "description": "" + }, + { + "name": "position", + "type": "Vector2", + "description": "" + }, + { + "name": "origin", + "type": "Vector2", + "description": "" + }, + { + "name": "rotation", + "type": "float", + "description": "" + }, + { + "name": "fontSize", + "type": "float", + "description": "" + }, + { + "name": "spacing", + "type": "float", + "description": "" + }, + { + "name": "tint", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "DrawTextCodepoint", + "description": "Draw one character (codepoint)", + "returnType": "void", + "params": [ + { + "name": "font", + "type": "Font", + "description": "" + }, + { + "name": "codepoint", + "type": "int", + "description": "" + }, + { + "name": "position", + "type": "Vector2", + "description": "" + }, + { + "name": "fontSize", + "type": "float", + "description": "" + }, + { + "name": "tint", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "DrawTextCodepoints", + "description": "Draw multiple character (codepoint)", + "returnType": "void", + "params": [ + { + "name": "font", + "type": "Font", + "description": "" + }, + { + "name": "codepoints", + "type": "const int *", + "description": "" + }, + { + "name": "codepointCount", + "type": "int", + "description": "" + }, + { + "name": "position", + "type": "Vector2", + "description": "" + }, + { + "name": "fontSize", + "type": "float", + "description": "" + }, + { + "name": "spacing", + "type": "float", + "description": "" + }, + { + "name": "tint", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "SetTextLineSpacing", + "description": "Set vertical line spacing when drawing with line-breaks", + "returnType": "void", + "params": [ + { + "name": "spacing", + "type": "int", + "description": "" + } + ] + }, + { + "name": "MeasureText", + "description": "Measure string width for default font", + "returnType": "int", + "params": [ + { + "name": "text", + "type": "const char *", + "description": "" + }, + { + "name": "fontSize", + "type": "int", + "description": "" + } + ] + }, + { + "name": "MeasureTextEx", + "description": "Measure string size for Font", + "returnType": "Vector2", + "params": [ + { + "name": "font", + "type": "Font", + "description": "" + }, + { + "name": "text", + "type": "const char *", + "description": "" + }, + { + "name": "fontSize", + "type": "float", + "description": "" + }, + { + "name": "spacing", + "type": "float", + "description": "" + } + ] + }, + { + "name": "MeasureTextCodepoints", + "description": "Measure string size for an existing array of codepoints for Font", + "returnType": "Vector2", + "params": [ + { + "name": "font", + "type": "Font", + "description": "" + }, + { + "name": "codepoints", + "type": "const int *", + "description": "" + }, + { + "name": "length", + "type": "int", + "description": "" + }, + { + "name": "fontSize", + "type": "float", + "description": "" + }, + { + "name": "spacing", + "type": "float", + "description": "" + } + ] + }, + { + "name": "GetGlyphIndex", + "description": "Get glyph index position in font for a codepoint (unicode character), fallback to '?' if not found", + "returnType": "int", + "params": [ + { + "name": "font", + "type": "Font", + "description": "" + }, + { + "name": "codepoint", + "type": "int", + "description": "" + } + ] + }, + { + "name": "GetGlyphInfo", + "description": "Get glyph font info data for a codepoint (unicode character), fallback to '?' if not found", + "returnType": "GlyphInfo", + "params": [ + { + "name": "font", + "type": "Font", + "description": "" + }, + { + "name": "codepoint", + "type": "int", + "description": "" + } + ] + }, + { + "name": "GetGlyphAtlasRec", + "description": "Get glyph rectangle in font atlas for a codepoint (unicode character), fallback to '?' if not found", + "returnType": "Rectangle", + "params": [ + { + "name": "font", + "type": "Font", + "description": "" + }, + { + "name": "codepoint", + "type": "int", + "description": "" + } + ] + }, + { + "name": "LoadUTF8", + "description": "Load UTF-8 text encoded from codepoints array", + "returnType": "char *", + "params": [ + { + "name": "codepoints", + "type": "const int *", + "description": "" + }, + { + "name": "length", + "type": "int", + "description": "" + } + ] + }, + { + "name": "UnloadUTF8", + "description": "Unload UTF-8 text encoded from codepoints array", + "returnType": "void", + "params": [ + { + "name": "text", + "type": "char *", + "description": "" + } + ] + }, + { + "name": "LoadCodepoints", + "description": "Load all codepoints from a UTF-8 text string, codepoints count returned by parameter", + "returnType": "int *", + "params": [ + { + "name": "text", + "type": "const char *", + "description": "" + }, + { + "name": "count", + "type": "int *", + "description": "" + } + ] + }, + { + "name": "UnloadCodepoints", + "description": "Unload codepoints data from memory", + "returnType": "void", + "params": [ + { + "name": "codepoints", + "type": "int *", + "description": "" + } + ] + }, + { + "name": "GetCodepointCount", + "description": "Get total number of codepoints in a UTF-8 encoded string", + "returnType": "int", + "params": [ + { + "name": "text", + "type": "const char *", + "description": "" + } + ] + }, + { + "name": "GetCodepoint", + "description": "Get next codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure", + "returnType": "int", + "params": [ + { + "name": "text", + "type": "const char *", + "description": "" + }, + { + "name": "codepointSize", + "type": "int *", + "description": "" + } + ] + }, + { + "name": "GetCodepointNext", + "description": "Get next codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure", + "returnType": "int", + "params": [ + { + "name": "text", + "type": "const char *", + "description": "" + }, + { + "name": "codepointSize", + "type": "int *", + "description": "" + } + ] + }, + { + "name": "GetCodepointPrevious", + "description": "Get previous codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure", + "returnType": "int", + "params": [ + { + "name": "text", + "type": "const char *", + "description": "" + }, + { + "name": "codepointSize", + "type": "int *", + "description": "" + } + ] + }, + { + "name": "CodepointToUTF8", + "description": "Encode one codepoint into UTF-8 byte array (array length returned as parameter)", + "returnType": "const char *", + "params": [ + { + "name": "codepoint", + "type": "int", + "description": "" + }, + { + "name": "utf8Size", + "type": "int *", + "description": "" + } + ] + }, + { + "name": "LoadTextLines", + "description": "Load text as separate lines ('\\n')", + "returnType": "char **", + "params": [ + { + "name": "text", + "type": "const char *", + "description": "" + }, + { + "name": "count", + "type": "int *", + "description": "" + } + ] + }, + { + "name": "UnloadTextLines", + "description": "Unload text lines", + "returnType": "void", + "params": [ + { + "name": "text", + "type": "char **", + "description": "" + }, + { + "name": "lineCount", + "type": "int", + "description": "" + } + ] + }, + { + "name": "TextCopy", + "description": "Copy one string to another, returns bytes copied", + "returnType": "int", + "params": [ + { + "name": "dst", + "type": "char *", + "description": "" + }, + { + "name": "src", + "type": "const char *", + "description": "" + } + ] + }, + { + "name": "TextIsEqual", + "description": "Check if two text string are equal", + "returnType": "bool", + "params": [ + { + "name": "text1", + "type": "const char *", + "description": "" + }, + { + "name": "text2", + "type": "const char *", + "description": "" + } + ] + }, + { + "name": "TextLength", + "description": "Get text length, checks for '\\0' ending", + "returnType": "unsigned int", + "params": [ + { + "name": "text", + "type": "const char *", + "description": "" + } + ] + }, + { + "name": "TextFormat", + "description": "Text formatting with variables (sprintf() style)", + "returnType": "const char *", + "params": [ + { + "name": "text", + "type": "const char *", + "description": "" + }, + { + "name": "args", + "type": "...", + "description": "" + } + ] + }, + { + "name": "TextSubtext", + "description": "Get a piece of a text string", + "returnType": "const char *", + "params": [ + { + "name": "text", + "type": "const char *", + "description": "" + }, + { + "name": "position", + "type": "int", + "description": "" + }, + { + "name": "length", + "type": "int", + "description": "" + } + ] + }, + { + "name": "TextRemoveSpaces", + "description": "Remove text spaces, concat words", + "returnType": "const char *", + "params": [ + { + "name": "text", + "type": "const char *", + "description": "" + } + ] + }, + { + "name": "GetTextBetween", + "description": "Get text between two strings", + "returnType": "char *", + "params": [ + { + "name": "text", + "type": "const char *", + "description": "" + }, + { + "name": "begin", + "type": "const char *", + "description": "" + }, + { + "name": "end", + "type": "const char *", + "description": "" + } + ] + }, + { + "name": "TextReplace", + "description": "Replace text string with new string", + "returnType": "char *", + "params": [ + { + "name": "text", + "type": "const char *", + "description": "" + }, + { + "name": "search", + "type": "const char *", + "description": "" + }, + { + "name": "replacement", + "type": "const char *", + "description": "" + } + ] + }, + { + "name": "TextReplaceAlloc", + "description": "Replace text string with new string, memory must be MemFree()", + "returnType": "char *", + "params": [ + { + "name": "text", + "type": "const char *", + "description": "" + }, + { + "name": "search", + "type": "const char *", + "description": "" + }, + { + "name": "replacement", + "type": "const char *", + "description": "" + } + ] + }, + { + "name": "TextReplaceBetween", + "description": "Replace text between two specific strings", + "returnType": "char *", + "params": [ + { + "name": "text", + "type": "const char *", + "description": "" + }, + { + "name": "begin", + "type": "const char *", + "description": "" + }, + { + "name": "end", + "type": "const char *", + "description": "" + }, + { + "name": "replacement", + "type": "const char *", + "description": "" + } + ] + }, + { + "name": "TextReplaceBetweenAlloc", + "description": "Replace text between two specific strings, memory must be MemFree()", + "returnType": "char *", + "params": [ + { + "name": "text", + "type": "const char *", + "description": "" + }, + { + "name": "begin", + "type": "const char *", + "description": "" + }, + { + "name": "end", + "type": "const char *", + "description": "" + }, + { + "name": "replacement", + "type": "const char *", + "description": "" + } + ] + }, + { + "name": "TextInsert", + "description": "Insert text in a defined byte position", + "returnType": "char *", + "params": [ + { + "name": "text", + "type": "const char *", + "description": "" + }, + { + "name": "insert", + "type": "const char *", + "description": "" + }, + { + "name": "position", + "type": "int", + "description": "" + } + ] + }, + { + "name": "TextInsertAlloc", + "description": "Insert text in a defined byte position, memory must be MemFree()", + "returnType": "char *", + "params": [ + { + "name": "text", + "type": "const char *", + "description": "" + }, + { + "name": "insert", + "type": "const char *", + "description": "" + }, + { + "name": "position", + "type": "int", + "description": "" + } + ] + }, + { + "name": "TextJoin", + "description": "Join text strings with delimiter", + "returnType": "char *", + "params": [ + { + "name": "textList", + "type": "char **", + "description": "" + }, + { + "name": "count", + "type": "int", + "description": "" + }, + { + "name": "delimiter", + "type": "const char *", + "description": "" + } + ] + }, + { + "name": "TextSplit", + "description": "Split text into multiple strings, using MAX_TEXTSPLIT_COUNT static strings", + "returnType": "char **", + "params": [ + { + "name": "text", + "type": "const char *", + "description": "" + }, + { + "name": "delimiter", + "type": "char", + "description": "" + }, + { + "name": "count", + "type": "int *", + "description": "" + } + ] + }, + { + "name": "TextAppend", + "description": "Append text at specific position and move cursor", + "returnType": "void", + "params": [ + { + "name": "text", + "type": "char *", + "description": "" + }, + { + "name": "append", + "type": "const char *", + "description": "" + }, + { + "name": "position", + "type": "int *", + "description": "" + } + ] + }, + { + "name": "TextFindIndex", + "description": "Find first text occurrence within a string, -1 if not found", + "returnType": "int", + "params": [ + { + "name": "text", + "type": "const char *", + "description": "" + }, + { + "name": "search", + "type": "const char *", + "description": "" + } + ] + }, + { + "name": "TextToUpper", + "description": "Get upper case version of provided string", + "returnType": "char *", + "params": [ + { + "name": "text", + "type": "const char *", + "description": "" + } + ] + }, + { + "name": "TextToLower", + "description": "Get lower case version of provided string", + "returnType": "char *", + "params": [ + { + "name": "text", + "type": "const char *", + "description": "" + } + ] + }, + { + "name": "TextToPascal", + "description": "Get Pascal case notation version of provided string", + "returnType": "char *", + "params": [ + { + "name": "text", + "type": "const char *", + "description": "" + } + ] + }, + { + "name": "TextToSnake", + "description": "Get Snake case notation version of provided string", + "returnType": "char *", + "params": [ + { + "name": "text", + "type": "const char *", + "description": "" + } + ] + }, + { + "name": "TextToCamel", + "description": "Get Camel case notation version of provided string", + "returnType": "char *", + "params": [ + { + "name": "text", + "type": "const char *", + "description": "" + } + ] + }, + { + "name": "TextToInteger", + "description": "Get integer value from text", + "returnType": "int", + "params": [ + { + "name": "text", + "type": "const char *", + "description": "" + } + ] + }, + { + "name": "TextToFloat", + "description": "Get float value from text", + "returnType": "float", + "params": [ + { + "name": "text", + "type": "const char *", + "description": "" + } + ] + }, + { + "name": "DrawLine3D", + "description": "Draw a line in 3D world space", + "returnType": "void", + "params": [ + { + "name": "startPos", + "type": "Vector3", + "description": "" + }, + { + "name": "endPos", + "type": "Vector3", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "DrawPoint3D", + "description": "Draw a point in 3D space, actually a small line", + "returnType": "void", + "params": [ + { + "name": "position", + "type": "Vector3", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "DrawCircle3D", + "description": "Draw a circle in 3D world space", + "returnType": "void", + "params": [ + { + "name": "center", + "type": "Vector3", + "description": "" + }, + { + "name": "radius", + "type": "float", + "description": "" + }, + { + "name": "rotationAxis", + "type": "Vector3", + "description": "" + }, + { + "name": "rotationAngle", + "type": "float", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "DrawTriangle3D", + "description": "Draw a color-filled triangle (vertex in counter-clockwise order!)", + "returnType": "void", + "params": [ + { + "name": "v1", + "type": "Vector3", + "description": "" + }, + { + "name": "v2", + "type": "Vector3", + "description": "" + }, + { + "name": "v3", + "type": "Vector3", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "DrawTriangleStrip3D", + "description": "Draw a triangle strip defined by points", + "returnType": "void", + "params": [ + { + "name": "points", + "type": "const Vector3 *", + "description": "" + }, + { + "name": "pointCount", + "type": "int", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "DrawCube", + "description": "Draw cube", + "returnType": "void", + "params": [ + { + "name": "position", + "type": "Vector3", + "description": "" + }, + { + "name": "width", + "type": "float", + "description": "" + }, + { + "name": "height", + "type": "float", + "description": "" + }, + { + "name": "length", + "type": "float", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "DrawCubeV", + "description": "Draw cube (Vector version)", + "returnType": "void", + "params": [ + { + "name": "position", + "type": "Vector3", + "description": "" + }, + { + "name": "size", + "type": "Vector3", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "DrawCubeWires", + "description": "Draw cube wires", + "returnType": "void", + "params": [ + { + "name": "position", + "type": "Vector3", + "description": "" + }, + { + "name": "width", + "type": "float", + "description": "" + }, + { + "name": "height", + "type": "float", + "description": "" + }, + { + "name": "length", + "type": "float", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "DrawCubeWiresV", + "description": "Draw cube wires (Vector version)", + "returnType": "void", + "params": [ + { + "name": "position", + "type": "Vector3", + "description": "" + }, + { + "name": "size", + "type": "Vector3", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "DrawSphere", + "description": "Draw sphere", + "returnType": "void", + "params": [ + { + "name": "centerPos", + "type": "Vector3", + "description": "" + }, + { + "name": "radius", + "type": "float", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "DrawSphereEx", + "description": "Draw sphere with extended parameters", + "returnType": "void", + "params": [ + { + "name": "centerPos", + "type": "Vector3", + "description": "" + }, + { + "name": "radius", + "type": "float", + "description": "" + }, + { + "name": "rings", + "type": "int", + "description": "" + }, + { + "name": "slices", + "type": "int", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "DrawSphereWires", + "description": "Draw sphere wires", + "returnType": "void", + "params": [ + { + "name": "centerPos", + "type": "Vector3", + "description": "" + }, + { + "name": "radius", + "type": "float", + "description": "" + }, + { + "name": "rings", + "type": "int", + "description": "" + }, + { + "name": "slices", + "type": "int", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "DrawCylinder", + "description": "Draw a cylinder/cone", + "returnType": "void", + "params": [ + { + "name": "position", + "type": "Vector3", + "description": "" + }, + { + "name": "radiusTop", + "type": "float", + "description": "" + }, + { + "name": "radiusBottom", + "type": "float", + "description": "" + }, + { + "name": "height", + "type": "float", + "description": "" + }, + { + "name": "slices", + "type": "int", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "DrawCylinderEx", + "description": "Draw a cylinder with base at startPos and top at endPos", + "returnType": "void", + "params": [ + { + "name": "startPos", + "type": "Vector3", + "description": "" + }, + { + "name": "endPos", + "type": "Vector3", + "description": "" + }, + { + "name": "startRadius", + "type": "float", + "description": "" + }, + { + "name": "endRadius", + "type": "float", + "description": "" + }, + { + "name": "sides", + "type": "int", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "DrawCylinderWires", + "description": "Draw a cylinder/cone wires", + "returnType": "void", + "params": [ + { + "name": "position", + "type": "Vector3", + "description": "" + }, + { + "name": "radiusTop", + "type": "float", + "description": "" + }, + { + "name": "radiusBottom", + "type": "float", + "description": "" + }, + { + "name": "height", + "type": "float", + "description": "" + }, + { + "name": "slices", + "type": "int", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "DrawCylinderWiresEx", + "description": "Draw a cylinder wires with base at startPos and top at endPos", + "returnType": "void", + "params": [ + { + "name": "startPos", + "type": "Vector3", + "description": "" + }, + { + "name": "endPos", + "type": "Vector3", + "description": "" + }, + { + "name": "startRadius", + "type": "float", + "description": "" + }, + { + "name": "endRadius", + "type": "float", + "description": "" + }, + { + "name": "sides", + "type": "int", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "DrawCapsule", + "description": "Draw a capsule with the center of its sphere caps at startPos and endPos", + "returnType": "void", + "params": [ + { + "name": "startPos", + "type": "Vector3", + "description": "" + }, + { + "name": "endPos", + "type": "Vector3", + "description": "" + }, + { + "name": "radius", + "type": "float", + "description": "" + }, + { + "name": "slices", + "type": "int", + "description": "" + }, + { + "name": "rings", + "type": "int", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "DrawCapsuleWires", + "description": "Draw capsule wireframe with the center of its sphere caps at startPos and endPos", + "returnType": "void", + "params": [ + { + "name": "startPos", + "type": "Vector3", + "description": "" + }, + { + "name": "endPos", + "type": "Vector3", + "description": "" + }, + { + "name": "radius", + "type": "float", + "description": "" + }, + { + "name": "slices", + "type": "int", + "description": "" + }, + { + "name": "rings", + "type": "int", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "DrawPlane", + "description": "Draw a plane XZ", + "returnType": "void", + "params": [ + { + "name": "centerPos", + "type": "Vector3", + "description": "" + }, + { + "name": "size", + "type": "Vector2", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "DrawRay", + "description": "Draw a ray line", + "returnType": "void", + "params": [ + { + "name": "ray", + "type": "Ray", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "DrawGrid", + "description": "Draw a grid (centered at (0, 0, 0))", + "returnType": "void", + "params": [ + { + "name": "slices", + "type": "int", + "description": "" + }, + { + "name": "spacing", + "type": "float", + "description": "" + } + ] + }, + { + "name": "LoadModel", + "description": "Load model from files (meshes and materials)", + "returnType": "Model", + "params": [ + { + "name": "fileName", + "type": "const char *", + "description": "" + } + ] + }, + { + "name": "LoadModelFromMesh", + "description": "Load model from generated mesh (default material)", + "returnType": "Model", + "params": [ + { + "name": "mesh", + "type": "Mesh", + "description": "" + } + ] + }, + { + "name": "IsModelValid", + "description": "Check if a model is valid (loaded in GPU, VAO/VBOs)", + "returnType": "bool", + "params": [ + { + "name": "model", + "type": "Model", + "description": "" + } + ] + }, + { + "name": "UnloadModel", + "description": "Unload model (including meshes) from memory (RAM and/or VRAM)", + "returnType": "void", + "params": [ + { + "name": "model", + "type": "Model", + "description": "" + } + ] + }, + { + "name": "GetModelBoundingBox", + "description": "Compute model bounding box limits (considers all meshes)", + "returnType": "BoundingBox", + "params": [ + { + "name": "model", + "type": "Model", + "description": "" + } + ] + }, + { + "name": "DrawModel", + "description": "Draw a model (with texture if set)", + "returnType": "void", + "params": [ + { + "name": "model", + "type": "Model", + "description": "" + }, + { + "name": "position", + "type": "Vector3", + "description": "" + }, + { + "name": "scale", + "type": "float", + "description": "" + }, + { + "name": "tint", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "DrawModelEx", + "description": "Draw a model with extended parameters", + "returnType": "void", + "params": [ + { + "name": "model", + "type": "Model", + "description": "" + }, + { + "name": "position", + "type": "Vector3", + "description": "" + }, + { + "name": "rotationAxis", + "type": "Vector3", + "description": "" + }, + { + "name": "rotationAngle", + "type": "float", + "description": "" + }, + { + "name": "scale", + "type": "Vector3", + "description": "" + }, + { + "name": "tint", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "DrawModelWires", + "description": "Draw a model wires (with texture if set)", + "returnType": "void", + "params": [ + { + "name": "model", + "type": "Model", + "description": "" + }, + { + "name": "position", + "type": "Vector3", + "description": "" + }, + { + "name": "scale", + "type": "float", + "description": "" + }, + { + "name": "tint", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "DrawModelWiresEx", + "description": "Draw a model wires (with texture if set) with extended parameters", + "returnType": "void", + "params": [ + { + "name": "model", + "type": "Model", + "description": "" + }, + { + "name": "position", + "type": "Vector3", + "description": "" + }, + { + "name": "rotationAxis", + "type": "Vector3", + "description": "" + }, + { + "name": "rotationAngle", + "type": "float", + "description": "" + }, + { + "name": "scale", + "type": "Vector3", + "description": "" + }, + { + "name": "tint", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "DrawBoundingBox", + "description": "Draw bounding box (wires)", + "returnType": "void", + "params": [ + { + "name": "box", + "type": "BoundingBox", + "description": "" + }, + { + "name": "color", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "DrawBillboard", + "description": "Draw a billboard texture", + "returnType": "void", + "params": [ + { + "name": "camera", + "type": "Camera", + "description": "" + }, + { + "name": "texture", + "type": "Texture2D", + "description": "" + }, + { + "name": "position", + "type": "Vector3", + "description": "" + }, + { + "name": "scale", + "type": "float", + "description": "" + }, + { + "name": "tint", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "DrawBillboardRec", + "description": "Draw a billboard texture defined by source", + "returnType": "void", + "params": [ + { + "name": "camera", + "type": "Camera", + "description": "" + }, + { + "name": "texture", + "type": "Texture2D", + "description": "" + }, + { + "name": "source", + "type": "Rectangle", + "description": "" + }, + { + "name": "position", + "type": "Vector3", + "description": "" + }, + { + "name": "size", + "type": "Vector2", + "description": "" + }, + { + "name": "tint", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "DrawBillboardPro", + "description": "Draw a billboard texture defined by source and rotation", + "returnType": "void", + "params": [ + { + "name": "camera", + "type": "Camera", + "description": "" + }, + { + "name": "texture", + "type": "Texture2D", + "description": "" + }, + { + "name": "source", + "type": "Rectangle", + "description": "" + }, + { + "name": "position", + "type": "Vector3", + "description": "" + }, + { + "name": "up", + "type": "Vector3", + "description": "" + }, + { + "name": "size", + "type": "Vector2", + "description": "" + }, + { + "name": "origin", + "type": "Vector2", + "description": "" + }, + { + "name": "rotation", + "type": "float", + "description": "" + }, + { + "name": "tint", + "type": "Color", + "description": "" + } + ] + }, + { + "name": "UploadMesh", + "description": "Upload mesh vertex data in GPU and provide VAO/VBO ids", + "returnType": "void", + "params": [ + { + "name": "mesh", + "type": "Mesh *", + "description": "" + }, + { + "name": "dynamic", + "type": "bool", + "description": "" + } + ] + }, + { + "name": "UpdateMeshBuffer", + "description": "Update mesh vertex data in GPU for a specific buffer index", + "returnType": "void", + "params": [ + { + "name": "mesh", + "type": "Mesh", + "description": "" + }, + { + "name": "index", + "type": "int", + "description": "" + }, + { + "name": "data", + "type": "const void *", + "description": "" + }, + { + "name": "dataSize", + "type": "int", + "description": "" + }, + { + "name": "offset", + "type": "int", + "description": "" + } + ] + }, + { + "name": "UnloadMesh", + "description": "Unload mesh data from CPU and GPU", + "returnType": "void", + "params": [ + { + "name": "mesh", + "type": "Mesh", + "description": "" + } + ] + }, + { + "name": "DrawMesh", + "description": "Draw a 3d mesh with material and transform", + "returnType": "void", + "params": [ + { + "name": "mesh", + "type": "Mesh", + "description": "" + }, + { + "name": "material", + "type": "Material", + "description": "" + }, + { + "name": "transform", + "type": "Matrix", + "description": "" + } + ] + }, + { + "name": "DrawMeshInstanced", + "description": "Draw multiple mesh instances with material and different transforms", + "returnType": "void", + "params": [ + { + "name": "mesh", + "type": "Mesh", + "description": "" + }, + { + "name": "material", + "type": "Material", + "description": "" + }, + { + "name": "transforms", + "type": "const Matrix *", + "description": "" + }, + { + "name": "instances", + "type": "int", + "description": "" + } + ] + }, + { + "name": "GetMeshBoundingBox", + "description": "Compute mesh bounding box limits", + "returnType": "BoundingBox", + "params": [ + { + "name": "mesh", + "type": "Mesh", + "description": "" + } + ] + }, + { + "name": "GenMeshTangents", + "description": "Compute mesh tangents", + "returnType": "void", + "params": [ + { + "name": "mesh", + "type": "Mesh *", + "description": "" + } + ] + }, + { + "name": "ExportMesh", + "description": "Export mesh data to file, returns true on success", + "returnType": "bool", + "params": [ + { + "name": "mesh", + "type": "Mesh", + "description": "" + }, + { + "name": "fileName", + "type": "const char *", + "description": "" + } + ] + }, + { + "name": "ExportMeshAsCode", + "description": "Export mesh as code file (.h) defining multiple arrays of vertex attributes", + "returnType": "bool", + "params": [ + { + "name": "mesh", + "type": "Mesh", + "description": "" + }, + { + "name": "fileName", + "type": "const char *", + "description": "" + } + ] + }, + { + "name": "GenMeshPoly", + "description": "Generate polygonal mesh", + "returnType": "Mesh", + "params": [ + { + "name": "sides", + "type": "int", + "description": "" + }, + { + "name": "radius", + "type": "float", + "description": "" + } + ] + }, + { + "name": "GenMeshPlane", + "description": "Generate plane mesh (with subdivisions)", + "returnType": "Mesh", + "params": [ + { + "name": "width", + "type": "float", + "description": "" + }, + { + "name": "length", + "type": "float", + "description": "" + }, + { + "name": "resX", + "type": "int", + "description": "" + }, + { + "name": "resZ", + "type": "int", + "description": "" + } + ] + }, + { + "name": "GenMeshCube", + "description": "Generate cuboid mesh", + "returnType": "Mesh", + "params": [ + { + "name": "width", + "type": "float", + "description": "" + }, + { + "name": "height", + "type": "float", + "description": "" + }, + { + "name": "length", + "type": "float", + "description": "" + } + ] + }, + { + "name": "GenMeshSphere", + "description": "Generate sphere mesh (standard sphere)", + "returnType": "Mesh", + "params": [ + { + "name": "radius", + "type": "float", + "description": "" + }, + { + "name": "rings", + "type": "int", + "description": "" + }, + { + "name": "slices", + "type": "int", + "description": "" + } + ] + }, + { + "name": "GenMeshHemiSphere", + "description": "Generate half-sphere mesh (no bottom cap)", + "returnType": "Mesh", + "params": [ + { + "name": "radius", + "type": "float", + "description": "" + }, + { + "name": "rings", + "type": "int", + "description": "" + }, + { + "name": "slices", + "type": "int", + "description": "" + } + ] + }, + { + "name": "GenMeshCylinder", + "description": "Generate cylinder mesh", + "returnType": "Mesh", + "params": [ + { + "name": "radius", + "type": "float", + "description": "" + }, + { + "name": "height", + "type": "float", + "description": "" + }, + { + "name": "slices", + "type": "int", + "description": "" + } + ] + }, + { + "name": "GenMeshCone", + "description": "Generate cone/pyramid mesh", + "returnType": "Mesh", + "params": [ + { + "name": "radius", + "type": "float", + "description": "" + }, + { + "name": "height", + "type": "float", + "description": "" + }, + { + "name": "slices", + "type": "int", + "description": "" + } + ] + }, + { + "name": "GenMeshTorus", + "description": "Generate torus mesh", + "returnType": "Mesh", + "params": [ + { + "name": "radius", + "type": "float", + "description": "" + }, + { + "name": "size", + "type": "float", + "description": "" + }, + { + "name": "radSeg", + "type": "int", + "description": "" + }, + { + "name": "sides", + "type": "int", + "description": "" + } + ] + }, + { + "name": "GenMeshKnot", + "description": "Generate trefoil knot mesh", + "returnType": "Mesh", + "params": [ + { + "name": "radius", + "type": "float", + "description": "" + }, + { + "name": "size", + "type": "float", + "description": "" + }, + { + "name": "radSeg", + "type": "int", + "description": "" + }, + { + "name": "sides", + "type": "int", + "description": "" + } + ] + }, + { + "name": "GenMeshHeightmap", + "description": "Generate heightmap mesh from image data", + "returnType": "Mesh", + "params": [ + { + "name": "heightmap", + "type": "Image", + "description": "" + }, + { + "name": "size", + "type": "Vector3", + "description": "" + } + ] + }, + { + "name": "GenMeshCubicmap", + "description": "Generate cubes-based map mesh from image data", + "returnType": "Mesh", + "params": [ + { + "name": "cubicmap", + "type": "Image", + "description": "" + }, + { + "name": "cubeSize", + "type": "Vector3", + "description": "" + } + ] + }, + { + "name": "LoadMaterials", + "description": "Load materials from model file", + "returnType": "Material *", + "params": [ + { + "name": "fileName", + "type": "const char *", + "description": "" + }, + { + "name": "materialCount", + "type": "int *", + "description": "" + } + ] + }, + { + "name": "LoadMaterialDefault", + "description": "Load default material (Supports: DIFFUSE, SPECULAR, NORMAL maps)", + "returnType": "Material", + "params": [] + }, + { + "name": "IsMaterialValid", + "description": "Check if a material is valid (shader assigned, map textures loaded in GPU)", + "returnType": "bool", + "params": [ + { + "name": "material", + "type": "Material", + "description": "" + } + ] + }, + { + "name": "UnloadMaterial", + "description": "Unload material from GPU memory (VRAM)", + "returnType": "void", + "params": [ + { + "name": "material", + "type": "Material", + "description": "" + } + ] + }, + { + "name": "SetMaterialTexture", + "description": "Set texture for a material map type (MATERIAL_MAP_DIFFUSE, MATERIAL_MAP_SPECULAR...)", + "returnType": "void", + "params": [ + { + "name": "material", + "type": "Material *", + "description": "" + }, + { + "name": "mapType", + "type": "int", + "description": "" + }, + { + "name": "texture", + "type": "Texture2D", + "description": "" + } + ] + }, + { + "name": "SetModelMeshMaterial", + "description": "Set material for a mesh", + "returnType": "void", + "params": [ + { + "name": "model", + "type": "Model *", + "description": "" + }, + { + "name": "meshId", + "type": "int", + "description": "" + }, + { + "name": "materialId", + "type": "int", + "description": "" + } + ] + }, + { + "name": "LoadModelAnimations", + "description": "Load model animations from file", + "returnType": "ModelAnimation *", + "params": [ + { + "name": "fileName", + "type": "const char *", + "description": "" + }, + { + "name": "animCount", + "type": "int *", + "description": "" + } + ] + }, + { + "name": "UpdateModelAnimation", + "description": "Update model animation pose (vertex buffers and bone matrices)", + "returnType": "void", + "params": [ + { + "name": "model", + "type": "Model", + "description": "" + }, + { + "name": "anim", + "type": "ModelAnimation", + "description": "" + }, + { + "name": "frame", + "type": "float", + "description": "" + } + ] + }, + { + "name": "UpdateModelAnimationEx", + "description": "Update model animation pose, blending two animations", + "returnType": "void", + "params": [ + { + "name": "model", + "type": "Model", + "description": "" + }, + { + "name": "animA", + "type": "ModelAnimation", + "description": "" + }, + { + "name": "frameA", + "type": "float", + "description": "" + }, + { + "name": "animB", + "type": "ModelAnimation", + "description": "" + }, + { + "name": "frameB", + "type": "float", + "description": "" + }, + { + "name": "blend", + "type": "float", + "description": "" + } + ] + }, + { + "name": "UnloadModelAnimations", + "description": "Unload animation array data", + "returnType": "void", + "params": [ + { + "name": "animations", + "type": "ModelAnimation *", + "description": "" + }, + { + "name": "animCount", + "type": "int", + "description": "" + } + ] + }, + { + "name": "IsModelAnimationValid", + "description": "Check model animation skeleton match", + "returnType": "bool", + "params": [ + { + "name": "model", + "type": "Model", + "description": "" + }, + { + "name": "anim", + "type": "ModelAnimation", + "description": "" + } + ] + }, + { + "name": "CheckCollisionSpheres", + "description": "Check collision between two spheres", + "returnType": "bool", + "params": [ + { + "name": "center1", + "type": "Vector3", + "description": "" + }, + { + "name": "radius1", + "type": "float", + "description": "" + }, + { + "name": "center2", + "type": "Vector3", + "description": "" + }, + { + "name": "radius2", + "type": "float", + "description": "" + } + ] + }, + { + "name": "CheckCollisionBoxes", + "description": "Check collision between two bounding boxes", + "returnType": "bool", + "params": [ + { + "name": "box1", + "type": "BoundingBox", + "description": "" + }, + { + "name": "box2", + "type": "BoundingBox", + "description": "" + } + ] + }, + { + "name": "CheckCollisionBoxSphere", + "description": "Check collision between box and sphere", + "returnType": "bool", + "params": [ + { + "name": "box", + "type": "BoundingBox", + "description": "" + }, + { + "name": "center", + "type": "Vector3", + "description": "" + }, + { + "name": "radius", + "type": "float", + "description": "" + } + ] + }, + { + "name": "GetRayCollisionSphere", + "description": "Get collision info between ray and sphere", + "returnType": "RayCollision", + "params": [ + { + "name": "ray", + "type": "Ray", + "description": "" + }, + { + "name": "center", + "type": "Vector3", + "description": "" + }, + { + "name": "radius", + "type": "float", + "description": "" + } + ] + }, + { + "name": "GetRayCollisionBox", + "description": "Get collision info between ray and box", + "returnType": "RayCollision", + "params": [ + { + "name": "ray", + "type": "Ray", + "description": "" + }, + { + "name": "box", + "type": "BoundingBox", + "description": "" + } + ] + }, + { + "name": "GetRayCollisionMesh", + "description": "Get collision info between ray and mesh", + "returnType": "RayCollision", + "params": [ + { + "name": "ray", + "type": "Ray", + "description": "" + }, + { + "name": "mesh", + "type": "Mesh", + "description": "" + }, + { + "name": "transform", + "type": "Matrix", + "description": "" + } + ] + }, + { + "name": "GetRayCollisionTriangle", + "description": "Get collision info between ray and triangle", + "returnType": "RayCollision", + "params": [ + { + "name": "ray", + "type": "Ray", + "description": "" + }, + { + "name": "p1", + "type": "Vector3", + "description": "" + }, + { + "name": "p2", + "type": "Vector3", + "description": "" + }, + { + "name": "p3", + "type": "Vector3", + "description": "" + } + ] + }, + { + "name": "GetRayCollisionQuad", + "description": "Get collision info between ray and quad", + "returnType": "RayCollision", + "params": [ + { + "name": "ray", + "type": "Ray", + "description": "" + }, + { + "name": "p1", + "type": "Vector3", + "description": "" + }, + { + "name": "p2", + "type": "Vector3", + "description": "" + }, + { + "name": "p3", + "type": "Vector3", + "description": "" + }, + { + "name": "p4", + "type": "Vector3", + "description": "" + } + ] + }, + { + "name": "InitAudioDevice", + "description": "Initialize audio device and context", + "returnType": "void", + "params": [] + }, + { + "name": "CloseAudioDevice", + "description": "Close the audio device and context", + "returnType": "void", + "params": [] + }, + { + "name": "IsAudioDeviceReady", + "description": "Check if audio device has been initialized successfully", + "returnType": "bool", + "params": [] + }, + { + "name": "SetMasterVolume", + "description": "Set master volume (listener)", + "returnType": "void", + "params": [ + { + "name": "volume", + "type": "float", + "description": "" + } + ] + }, + { + "name": "GetMasterVolume", + "description": "Get master volume (listener)", + "returnType": "float", + "params": [] + }, + { + "name": "LoadWave", + "description": "Load wave data from file", + "returnType": "Wave", + "params": [ + { + "name": "fileName", + "type": "const char *", + "description": "" + } + ] + }, + { + "name": "LoadWaveFromMemory", + "description": "Load wave from memory buffer, fileType refers to extension: i.e. '.wav'", + "returnType": "Wave", + "params": [ + { + "name": "fileType", + "type": "const char *", + "description": "" + }, + { + "name": "fileData", + "type": "const unsigned char *", + "description": "" + }, + { + "name": "dataSize", + "type": "int", + "description": "" + } + ] + }, + { + "name": "IsWaveValid", + "description": "Checks if wave data is valid (data loaded and parameters)", + "returnType": "bool", + "params": [ + { + "name": "wave", + "type": "Wave", + "description": "" + } + ] + }, + { + "name": "LoadSound", + "description": "Load sound from file", + "returnType": "Sound", + "params": [ + { + "name": "fileName", + "type": "const char *", + "description": "" + } + ] + }, + { + "name": "LoadSoundFromWave", + "description": "Load sound from wave data", + "returnType": "Sound", + "params": [ + { + "name": "wave", + "type": "Wave", + "description": "" + } + ] + }, + { + "name": "LoadSoundAlias", + "description": "Create a new sound that shares the same sample data as the source sound, does not own the sound data", + "returnType": "Sound", + "params": [ + { + "name": "source", + "type": "Sound", + "description": "" + } + ] + }, + { + "name": "IsSoundValid", + "description": "Checks if a sound is valid (data loaded and buffers initialized)", + "returnType": "bool", + "params": [ + { + "name": "sound", + "type": "Sound", + "description": "" + } + ] + }, + { + "name": "UpdateSound", + "description": "Update sound buffer with new data (default data format: 32 bit float, stereo)", + "returnType": "void", + "params": [ + { + "name": "sound", + "type": "Sound", + "description": "" + }, + { + "name": "data", + "type": "const void *", + "description": "" + }, + { + "name": "sampleCount", + "type": "int", + "description": "" + } + ] + }, + { + "name": "UnloadWave", + "description": "Unload wave data", + "returnType": "void", + "params": [ + { + "name": "wave", + "type": "Wave", + "description": "" + } + ] + }, + { + "name": "UnloadSound", + "description": "Unload sound", + "returnType": "void", + "params": [ + { + "name": "sound", + "type": "Sound", + "description": "" + } + ] + }, + { + "name": "UnloadSoundAlias", + "description": "Unload a sound alias (does not deallocate sample data)", + "returnType": "void", + "params": [ + { + "name": "alias", + "type": "Sound", + "description": "" + } + ] + }, + { + "name": "ExportWave", + "description": "Export wave data to file, returns true on success", + "returnType": "bool", + "params": [ + { + "name": "wave", + "type": "Wave", + "description": "" + }, + { + "name": "fileName", + "type": "const char *", + "description": "" + } + ] + }, + { + "name": "ExportWaveAsCode", + "description": "Export wave sample data to code (.h), returns true on success", + "returnType": "bool", + "params": [ + { + "name": "wave", + "type": "Wave", + "description": "" + }, + { + "name": "fileName", + "type": "const char *", + "description": "" + } + ] + }, + { + "name": "PlaySound", + "description": "Play a sound", + "returnType": "void", + "params": [ + { + "name": "sound", + "type": "Sound", + "description": "" + } + ] + }, + { + "name": "StopSound", + "description": "Stop playing a sound", + "returnType": "void", + "params": [ + { + "name": "sound", + "type": "Sound", + "description": "" + } + ] + }, + { + "name": "PauseSound", + "description": "Pause a sound", + "returnType": "void", + "params": [ + { + "name": "sound", + "type": "Sound", + "description": "" + } + ] + }, + { + "name": "ResumeSound", + "description": "Resume a paused sound", + "returnType": "void", + "params": [ + { + "name": "sound", + "type": "Sound", + "description": "" + } + ] + }, + { + "name": "IsSoundPlaying", + "description": "Check if a sound is currently playing", + "returnType": "bool", + "params": [ + { + "name": "sound", + "type": "Sound", + "description": "" + } + ] + }, + { + "name": "SetSoundVolume", + "description": "Set volume for a sound (1.0 is max level)", + "returnType": "void", + "params": [ + { + "name": "sound", + "type": "Sound", + "description": "" + }, + { + "name": "volume", + "type": "float", + "description": "" + } + ] + }, + { + "name": "SetSoundPitch", + "description": "Set pitch for a sound (1.0 is base level)", + "returnType": "void", + "params": [ + { + "name": "sound", + "type": "Sound", + "description": "" + }, + { + "name": "pitch", + "type": "float", + "description": "" + } + ] + }, + { + "name": "SetSoundPan", + "description": "Set pan for a sound (-1.0 left, 0.0 center, 1.0 right)", + "returnType": "void", + "params": [ + { + "name": "sound", + "type": "Sound", + "description": "" + }, + { + "name": "pan", + "type": "float", + "description": "" + } + ] + }, + { + "name": "WaveCopy", + "description": "Copy a wave to a new wave", + "returnType": "Wave", + "params": [ + { + "name": "wave", + "type": "Wave", + "description": "" + } + ] + }, + { + "name": "WaveCrop", + "description": "Crop a wave to defined frames range", + "returnType": "void", + "params": [ + { + "name": "wave", + "type": "Wave *", + "description": "" + }, + { + "name": "initFrame", + "type": "int", + "description": "" + }, + { + "name": "finalFrame", + "type": "int", + "description": "" + } + ] + }, + { + "name": "WaveFormat", + "description": "Convert wave data to desired format", + "returnType": "void", + "params": [ + { + "name": "wave", + "type": "Wave *", + "description": "" + }, + { + "name": "sampleRate", + "type": "int", + "description": "" + }, + { + "name": "sampleSize", + "type": "int", + "description": "" + }, + { + "name": "channels", + "type": "int", + "description": "" + } + ] + }, + { + "name": "LoadWaveSamples", + "description": "Load samples data from wave as a 32bit float data array", + "returnType": "float *", + "params": [ + { + "name": "wave", + "type": "Wave", + "description": "" + } + ] + }, + { + "name": "UnloadWaveSamples", + "description": "Unload samples data loaded with LoadWaveSamples()", + "returnType": "void", + "params": [ + { + "name": "samples", + "type": "float *", + "description": "" + } + ] + }, + { + "name": "LoadMusicStream", + "description": "Load music stream from file", + "returnType": "Music", + "params": [ + { + "name": "fileName", + "type": "const char *", + "description": "" + } + ] + }, + { + "name": "LoadMusicStreamFromMemory", + "description": "Load music stream from data", + "returnType": "Music", + "params": [ + { + "name": "fileType", + "type": "const char *", + "description": "" + }, + { + "name": "data", + "type": "const unsigned char *", + "description": "" + }, + { + "name": "dataSize", + "type": "int", + "description": "" + } + ] + }, + { + "name": "IsMusicValid", + "description": "Checks if a music stream is valid (context and buffers initialized)", + "returnType": "bool", + "params": [ + { + "name": "music", + "type": "Music", + "description": "" + } + ] + }, + { + "name": "UnloadMusicStream", + "description": "Unload music stream", + "returnType": "void", + "params": [ + { + "name": "music", + "type": "Music", + "description": "" + } + ] + }, + { + "name": "PlayMusicStream", + "description": "Start music playing", + "returnType": "void", + "params": [ + { + "name": "music", + "type": "Music", + "description": "" + } + ] + }, + { + "name": "IsMusicStreamPlaying", + "description": "Check if music is playing", + "returnType": "bool", + "params": [ + { + "name": "music", + "type": "Music", + "description": "" + } + ] + }, + { + "name": "UpdateMusicStream", + "description": "Updates buffers for music streaming", + "returnType": "void", + "params": [ + { + "name": "music", + "type": "Music", + "description": "" + } + ] + }, + { + "name": "StopMusicStream", + "description": "Stop music playing", + "returnType": "void", + "params": [ + { + "name": "music", + "type": "Music", + "description": "" + } + ] + }, + { + "name": "PauseMusicStream", + "description": "Pause music playing", + "returnType": "void", + "params": [ + { + "name": "music", + "type": "Music", + "description": "" + } + ] + }, + { + "name": "ResumeMusicStream", + "description": "Resume playing paused music", + "returnType": "void", + "params": [ + { + "name": "music", + "type": "Music", + "description": "" + } + ] + }, + { + "name": "SeekMusicStream", + "description": "Seek music to a position (in seconds)", + "returnType": "void", + "params": [ + { + "name": "music", + "type": "Music", + "description": "" + }, + { + "name": "position", + "type": "float", + "description": "" + } + ] + }, + { + "name": "SetMusicVolume", + "description": "Set volume for music (1.0 is max level)", + "returnType": "void", + "params": [ + { + "name": "music", + "type": "Music", + "description": "" + }, + { + "name": "volume", + "type": "float", + "description": "" + } + ] + }, + { + "name": "SetMusicPitch", + "description": "Set pitch for a music (1.0 is base level)", + "returnType": "void", + "params": [ + { + "name": "music", + "type": "Music", + "description": "" + }, + { + "name": "pitch", + "type": "float", + "description": "" + } + ] + }, + { + "name": "SetMusicPan", + "description": "Set pan for a music (-1.0 left, 0.0 center, 1.0 right)", + "returnType": "void", + "params": [ + { + "name": "music", + "type": "Music", + "description": "" + }, + { + "name": "pan", + "type": "float", + "description": "" + } + ] + }, + { + "name": "GetMusicTimeLength", + "description": "Get music time length (in seconds)", + "returnType": "float", + "params": [ + { + "name": "music", + "type": "Music", + "description": "" + } + ] + }, + { + "name": "GetMusicTimePlayed", + "description": "Get current music time played (in seconds)", + "returnType": "float", + "params": [ + { + "name": "music", + "type": "Music", + "description": "" + } + ] + }, + { + "name": "LoadAudioStream", + "description": "Load audio stream (to stream raw audio pcm data)", + "returnType": "AudioStream", + "params": [ + { + "name": "sampleRate", + "type": "unsigned int", + "description": "" + }, + { + "name": "sampleSize", + "type": "unsigned int", + "description": "" + }, + { + "name": "channels", + "type": "unsigned int", + "description": "" + } + ] + }, + { + "name": "IsAudioStreamValid", + "description": "Checks if an audio stream is valid (buffers initialized)", + "returnType": "bool", + "params": [ + { + "name": "stream", + "type": "AudioStream", + "description": "" + } + ] + }, + { + "name": "UnloadAudioStream", + "description": "Unload audio stream and free memory", + "returnType": "void", + "params": [ + { + "name": "stream", + "type": "AudioStream", + "description": "" + } + ] + }, + { + "name": "UpdateAudioStream", + "description": "Update audio stream buffers with data", + "returnType": "void", + "params": [ + { + "name": "stream", + "type": "AudioStream", + "description": "" + }, + { + "name": "data", + "type": "const void *", + "description": "" + }, + { + "name": "frameCount", + "type": "int", + "description": "" + } + ] + }, + { + "name": "IsAudioStreamProcessed", + "description": "Check if any audio stream buffers requires refill", + "returnType": "bool", + "params": [ + { + "name": "stream", + "type": "AudioStream", + "description": "" + } + ] + }, + { + "name": "PlayAudioStream", + "description": "Play audio stream", + "returnType": "void", + "params": [ + { + "name": "stream", + "type": "AudioStream", + "description": "" + } + ] + }, + { + "name": "PauseAudioStream", + "description": "Pause audio stream", + "returnType": "void", + "params": [ + { + "name": "stream", + "type": "AudioStream", + "description": "" + } + ] + }, + { + "name": "ResumeAudioStream", + "description": "Resume audio stream", + "returnType": "void", + "params": [ + { + "name": "stream", + "type": "AudioStream", + "description": "" + } + ] + }, + { + "name": "IsAudioStreamPlaying", + "description": "Check if audio stream is playing", + "returnType": "bool", + "params": [ + { + "name": "stream", + "type": "AudioStream", + "description": "" + } + ] + }, + { + "name": "StopAudioStream", + "description": "Stop audio stream", + "returnType": "void", + "params": [ + { + "name": "stream", + "type": "AudioStream", + "description": "" + } + ] + }, + { + "name": "SetAudioStreamVolume", + "description": "Set volume for audio stream (1.0 is max level)", + "returnType": "void", + "params": [ + { + "name": "stream", + "type": "AudioStream", + "description": "" + }, + { + "name": "volume", + "type": "float", + "description": "" + } + ] + }, + { + "name": "SetAudioStreamPitch", + "description": "Set pitch for audio stream (1.0 is base level)", + "returnType": "void", + "params": [ + { + "name": "stream", + "type": "AudioStream", + "description": "" + }, + { + "name": "pitch", + "type": "float", + "description": "" + } + ] + }, + { + "name": "SetAudioStreamPan", + "description": "Set pan for audio stream (-1.0 to 1.0 range, 0.0 is centered)", + "returnType": "void", + "params": [ + { + "name": "stream", + "type": "AudioStream", + "description": "" + }, + { + "name": "pan", + "type": "float", + "description": "" + } + ] + }, + { + "name": "SetAudioStreamBufferSizeDefault", + "description": "Default size for new audio streams", + "returnType": "void", + "params": [ + { + "name": "size", + "type": "int", + "description": "" + } + ] + }, + { + "name": "SetAudioStreamCallback", + "description": "Audio thread callback to request new data", + "returnType": "void", + "params": [ + { + "name": "stream", + "type": "AudioStream", + "description": "" + }, + { + "name": "callback", + "type": "AudioCallback", + "description": "" + } + ] + }, + { + "name": "AttachAudioStreamProcessor", + "description": "Attach audio stream processor to stream, receives frames x 2 samples as 'float' (stereo)", + "returnType": "void", + "params": [ + { + "name": "stream", + "type": "AudioStream", + "description": "" + }, + { + "name": "processor", + "type": "AudioCallback", + "description": "" + } + ] + }, + { + "name": "DetachAudioStreamProcessor", + "description": "Detach audio stream processor from stream", + "returnType": "void", + "params": [ + { + "name": "stream", + "type": "AudioStream", + "description": "" + }, + { + "name": "processor", + "type": "AudioCallback", + "description": "" + } + ] + }, + { + "name": "AttachAudioMixedProcessor", + "description": "Attach audio stream processor to the entire audio pipeline, receives frames x 2 samples as 'float' (stereo)", + "returnType": "void", + "params": [ + { + "name": "processor", + "type": "AudioCallback", + "description": "" + } + ] + }, + { + "name": "DetachAudioMixedProcessor", + "description": "Detach audio stream processor from the entire audio pipeline", + "returnType": "void", + "params": [ + { + "name": "processor", + "type": "AudioCallback", + "description": "" + } + ] + } + ] +}