diff --git a/.github/workflows/analyze_codeql.yml b/.github/workflows/analyze_codeql.yml index 5fd169dd0..cd783c8c9 100644 --- a/.github/workflows/analyze_codeql.yml +++ b/.github/workflows/analyze_codeql.yml @@ -44,7 +44,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@master with: submodules: recursive @@ -71,7 +71,7 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v3 + uses: github/codeql-action/init@v4 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. @@ -90,7 +90,7 @@ jobs: cmake --build . --config $BUILD_TYPE - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v3 + uses: github/codeql-action/analyze@v4 with: category: "/language:${{matrix.language}}" upload: false @@ -99,7 +99,7 @@ jobs: # Filter out rules with low severity or high false positve rate # Also filter out warnings in third-party code - name: Filter out unwanted errors and warnings - uses: advanced-security/filter-sarif@v1 + uses: advanced-security/filter-sarif@v1.1 with: patterns: | -**:cpp/path-injection @@ -121,14 +121,14 @@ jobs: output: ${{ steps.step1.outputs.sarif-output }}/cpp.sarif - name: Upload CodeQL results to code scanning - uses: github/codeql-action/upload-sarif@v2 + uses: github/codeql-action/upload-sarif@v4 with: sarif_file: ${{ steps.step1.outputs.sarif-output }} category: "/language:${{matrix.language}}" - name: Upload CodeQL results as an artifact if: success() || failure() - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: codeql-results path: ${{ steps.step1.outputs.sarif-output }} diff --git a/.github/workflows/build_android.yml b/.github/workflows/build_android.yml index c87807847..b4efab67c 100644 --- a/.github/workflows/build_android.yml +++ b/.github/workflows/build_android.yml @@ -21,7 +21,7 @@ permissions: jobs: build: permissions: - contents: write # for actions/upload-release-asset to upload release asset + contents: write # Required for actions/upload-release-asset to upload release asset runs-on: windows-latest strategy: fail-fast: false @@ -82,7 +82,7 @@ jobs: tar -czvf ${{ env.RELEASE_NAME }}.tar.gz ${{ env.RELEASE_NAME }} - name: Upload Artifacts - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: ${{ env.RELEASE_NAME }} path: | @@ -90,7 +90,7 @@ jobs: !./build/${{ env.RELEASE_NAME }}.tar.gz - name: Upload Artifact to Release - uses: softprops/action-gh-release@v1 + uses: softprops/action-gh-release@v3 with: files: ./build/${{ env.RELEASE_NAME }}.tar.gz env: diff --git a/.github/workflows/build_cmake.yml b/.github/workflows/build_cmake.yml index 0158fb510..da1993026 100644 --- a/.github/workflows/build_cmake.yml +++ b/.github/workflows/build_cmake.yml @@ -36,7 +36,7 @@ jobs: runs-on: windows-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@master - name: Create Build Environment # Some projects don't allow in-source building, so create a separate build directory @@ -75,7 +75,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@master - name: Create Build Environment # Some projects don't allow in-source building, so create a separate build directory diff --git a/.github/workflows/build_examples_linux.yml b/.github/workflows/build_examples_linux.yml index c293efd1d..ca15acd81 100644 --- a/.github/workflows/build_examples_linux.yml +++ b/.github/workflows/build_examples_linux.yml @@ -22,7 +22,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@master - name: Setup Environment run: | diff --git a/.github/workflows/build_examples_windows.yml b/.github/workflows/build_examples_windows.yml index 4cc2e84b9..ccbcaafee 100644 --- a/.github/workflows/build_examples_windows.yml +++ b/.github/workflows/build_examples_windows.yml @@ -22,10 +22,10 @@ jobs: runs-on: windows-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@master - name: Add MSBuild to PATH - uses: microsoft/setup-msbuild@v1 + uses: microsoft/setup-msbuild@v3 - name: Build Library (MSVC16) run: | diff --git a/.github/workflows/build_linux.yml b/.github/workflows/build_linux.yml index 0fc32d374..fa1c0b82c 100644 --- a/.github/workflows/build_linux.yml +++ b/.github/workflows/build_linux.yml @@ -21,7 +21,7 @@ permissions: jobs: build: permissions: - contents: write # for actions/upload-release-asset to upload release asset + contents: write # Required for actions/upload-release-asset to upload release asset strategy: fail-fast: false max-parallel: 1 @@ -112,7 +112,7 @@ jobs: tar -czvf ${{ env.RELEASE_NAME }}.tar.gz ${{ env.RELEASE_NAME }} - name: Upload Artifacts - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: ${{ env.RELEASE_NAME }} path: | @@ -120,7 +120,7 @@ jobs: !./build/${{ env.RELEASE_NAME }}.tar.gz - name: Upload Artifact to Release - uses: softprops/action-gh-release@v1 + uses: softprops/action-gh-release@v3 with: files: ./build/${{ env.RELEASE_NAME }}.tar.gz env: diff --git a/.github/workflows/build_macos.yml b/.github/workflows/build_macos.yml index 08ea0188a..9da31412e 100644 --- a/.github/workflows/build_macos.yml +++ b/.github/workflows/build_macos.yml @@ -21,7 +21,7 @@ permissions: jobs: build: permissions: - contents: write # for actions/upload-release-asset to upload release asset + contents: write # Required for actions/upload-release-asset to upload release asset runs-on: macos-latest env: @@ -99,7 +99,7 @@ jobs: tar -czvf ${{ env.RELEASE_NAME }}.tar.gz ${{ env.RELEASE_NAME }} - name: Upload Artifacts - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: ${{ env.RELEASE_NAME }} path: | @@ -107,7 +107,7 @@ jobs: !./build/${{ env.RELEASE_NAME }}.tar.gz - name: Upload Artifact to Release - uses: softprops/action-gh-release@v1 + uses: softprops/action-gh-release@v3 with: files: ./build/${{ env.RELEASE_NAME }}.tar.gz env: diff --git a/.github/workflows/build_webassembly.yml b/.github/workflows/build_webassembly.yml index 1e4066c26..ae4b37087 100644 --- a/.github/workflows/build_webassembly.yml +++ b/.github/workflows/build_webassembly.yml @@ -27,7 +27,7 @@ jobs: uses: actions/checkout@master - name: Setup emsdk - uses: mymindstorm/setup-emsdk@v14 + uses: emscripten-core/setup-emsdk@v15 with: version: 5.0.3 actions-cache-folder: 'emsdk-cache' @@ -69,7 +69,7 @@ jobs: shell: cmd - name: Upload Artifacts - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: ${{ env.RELEASE_NAME }} path: | @@ -77,7 +77,7 @@ jobs: !./build/${{ env.RELEASE_NAME }}.zip - name: Upload Artifact to Release - uses: softprops/action-gh-release@v1 + uses: softprops/action-gh-release@v3 with: files: ./build/${{ env.RELEASE_NAME }}.zip env: diff --git a/.github/workflows/build_windows.yml b/.github/workflows/build_windows.yml index 988428403..10b7ca91b 100644 --- a/.github/workflows/build_windows.yml +++ b/.github/workflows/build_windows.yml @@ -21,7 +21,7 @@ permissions: jobs: build: permissions: - contents: write # for actions/upload-release-asset to upload release asset + contents: write # Required for actions/upload-release-asset to upload release asset runs-on: windows-latest strategy: fail-fast: false @@ -81,7 +81,7 @@ jobs: # Setup MSBuild.exe path if required - name: Setup MSBuild - uses: microsoft/setup-msbuild@v2 + uses: microsoft/setup-msbuild@v3 if: matrix.compiler == 'msvc16' - name: Build Library (MinGW-w64 32bit) @@ -140,7 +140,7 @@ jobs: shell: cmd - name: Upload Artifacts - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: ${{ env.RELEASE_NAME }} path: | @@ -148,7 +148,7 @@ jobs: !./build/${{ env.RELEASE_NAME }}.zip - name: Upload Artifact to Release - uses: softprops/action-gh-release@v1 + uses: softprops/action-gh-release@v3 with: files: ./build/${{ env.RELEASE_NAME }}.zip env: diff --git a/.github/workflows/parse_api.yml b/.github/workflows/parse_api.yml index e25cde18b..36f7fb5db 100644 --- a/.github/workflows/parse_api.yml +++ b/.github/workflows/parse_api.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@master - name: Update parse files working-directory: tools/rlparser diff --git a/.github/workflows/update_examples.yml b/.github/workflows/update_examples.yml index fe8e4c48f..1d1edc524 100644 --- a/.github/workflows/update_examples.yml +++ b/.github/workflows/update_examples.yml @@ -15,10 +15,10 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@master - name: Setup emsdk - uses: mymindstorm/setup-emsdk@v14 + uses: emscripten-core/setup-emsdk@v15 with: version: 'latest' actions-cache-folder: 'emsdk-cache' diff --git a/BINDINGS.md b/BINDINGS.md index f528c892a..624ec8155 100644 --- a/BINDINGS.md +++ b/BINDINGS.md @@ -52,7 +52,7 @@ Some people ported raylib to other languages in the form of bindings or wrappers | [KaylibKit](https://codeberg.org/Kenta/KaylibKit) | 4.5 | [Kotlin/native](https://kotlinlang.org) | Zlib | | [raylib-lua](https://github.com/TSnake41/raylib-lua) | 5.5 | [Lua](http://www.lua.org) | ISC | | [raylib-lua-bindings (WIP)](https://github.com/legendaryredfox/raylib-lua-bindings) | 5.5 | [Lua](http://www.lua.org) | ISC | -| [ReiLua](https://github.com/nullstare/ReiLua) | 5.5 | [Lua](http://www.lua.org) | MIT | +| [ReiLua](https://github.com/nullstare/ReiLua) | 6.0 | [Lua](http://www.lua.org) | MIT | | [raylib-lua-sol](https://github.com/RobLoach/raylib-lua-sol) | 5.5 | [Lua](http://www.lua.org) | Zlib | | [raylib-luajit](https://github.com/homma/raylib-luajit) | 5.5 | [Lua](http://www.lua.org) | MIT | | [raylib-luajit-generated](https://github.com/james2doyle/raylib-luajit-generated) | 5.5 | [Lua](http://www.lua.org) | MIT | diff --git a/SECURITY.md b/SECURITY.md index 48a825e37..7a52e4359 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -11,8 +11,4 @@ Most considerations of errors and defects can be handled using the project Issue ## Reporting a Vulnerability -Discovered vulnerability can be directly reported using the project Issues and/or Discussions. - -_TODO: Tell them where to go, how often they can expect to get an update on a -reported vulnerability, what to expect if the vulnerability is accepted or -declined, etc._ +Discovered vulnerability can be directly reported using the project Issues and/or Discussions. They will be reviewed as soon as possible. diff --git a/examples/shaders/resources/shaders/glsl100/pbr.fs b/examples/shaders/resources/shaders/glsl100/pbr.fs index 28212bf63..f29cb0e59 100644 --- a/examples/shaders/resources/shaders/glsl100/pbr.fs +++ b/examples/shaders/resources/shaders/glsl100/pbr.fs @@ -99,7 +99,7 @@ vec3 ComputePBR() vec3 N = normalize(fragNormal); if (useTexNormal == 1) { - N = texture2D(normalMap, vec2(fragTexCoord.x*tiling.x + offset.y, fragTexCoord.y*tiling.y + offset.y)).rgb; + N = texture2D(normalMap, vec2(fragTexCoord.x*tiling.x + offset.x, fragTexCoord.y*tiling.y + offset.y)).rgb; N = normalize(N*2.0 - 1.0); N = normalize(N*TBN); } diff --git a/examples/shaders/resources/shaders/glsl120/pbr.fs b/examples/shaders/resources/shaders/glsl120/pbr.fs index b36b76bee..450986f1b 100644 --- a/examples/shaders/resources/shaders/glsl120/pbr.fs +++ b/examples/shaders/resources/shaders/glsl120/pbr.fs @@ -97,7 +97,7 @@ vec3 ComputePBR() vec3 N = normalize(fragNormal); if (useTexNormal == 1) { - N = texture2D(normalMap, vec2(fragTexCoord.x*tiling.x + offset.y, fragTexCoord.y*tiling.y + offset.y)).rgb; + N = texture2D(normalMap, vec2(fragTexCoord.x*tiling.x + offset.x, fragTexCoord.y*tiling.y + offset.y)).rgb; N = normalize(N*2.0 - 1.0); N = normalize(N*TBN); } diff --git a/examples/shaders/resources/shaders/glsl330/pbr.fs b/examples/shaders/resources/shaders/glsl330/pbr.fs index ceaead308..67254851c 100644 --- a/examples/shaders/resources/shaders/glsl330/pbr.fs +++ b/examples/shaders/resources/shaders/glsl330/pbr.fs @@ -100,7 +100,7 @@ vec3 ComputePBR() vec3 N = normalize(fragNormal); if (useTexNormal == 1) { - N = texture(normalMap, vec2(fragTexCoord.x*tiling.x + offset.y, fragTexCoord.y*tiling.y + offset.y)).rgb; + N = texture(normalMap, vec2(fragTexCoord.x*tiling.x + offset.x, fragTexCoord.y*tiling.y + offset.y)).rgb; N = normalize(N*2.0 - 1.0); N = normalize(N*TBN); } diff --git a/projects/4coder/Makefile b/projects/4coder/Makefile deleted file mode 100644 index ec0977aaf..000000000 --- a/projects/4coder/Makefile +++ /dev/null @@ -1,401 +0,0 @@ -#************************************************************************************************** -# -# raylib makefile for Desktop platforms, Raspberry Pi, Android and HTML5 -# -# Copyright (c) 2013-2026 Ramon Santamaria (@raysan5) -# -# This software is provided "as-is", without any express or implied warranty. In no event -# will the authors be held liable for any damages arising from the use of this software. -# -# Permission is granted to anyone to use this software for any purpose, including commercial -# applications, and to alter it and redistribute it freely, subject to the following restrictions: -# -# 1. The origin of this software must not be misrepresented; you must not claim that you -# wrote the original software. If you use this software in a product, an acknowledgment -# in the product documentation would be appreciated but is not required. -# -# 2. Altered source versions must be plainly marked as such, and must not be misrepresented -# as being the original software. -# -# 3. This notice may not be removed or altered from any source distribution. -# -#************************************************************************************************** - -.PHONY: all clean - -# Define required raylib variables -PROJECT_NAME ?= game -RAYLIB_VERSION ?= 4.2.0 -RAYLIB_PATH ?= ..\.. - -# Define default options - -# One of PLATFORM_DESKTOP, PLATFORM_RPI, PLATFORM_ANDROID, PLATFORM_WEB -PLATFORM ?= PLATFORM_DESKTOP - -# Locations of your newly installed library and associated headers. See ../src/Makefile -# On Linux, if you have installed raylib but cannot compile the examples, check that -# the *_INSTALL_PATH values here are the same as those in src/Makefile or point to known locations. -# To enable system-wide compile-time and runtime linking to libraylib.so, run ../src/$ sudo make install RAYLIB_LIBTYPE_SHARED. -# To enable compile-time linking to a special version of libraylib.so, change these variables here. -# To enable runtime linking to a special version of libraylib.so, see EXAMPLE_RUNTIME_PATH below. -# If there is a libraylib in both EXAMPLE_RUNTIME_PATH and RAYLIB_INSTALL_PATH, at runtime, -# the library at EXAMPLE_RUNTIME_PATH, if present, will take precedence over the one at RAYLIB_INSTALL_PATH. -# RAYLIB_INSTALL_PATH should be the desired full path to libraylib. No relative paths. -DESTDIR ?= /usr/local -RAYLIB_INSTALL_PATH ?= $(DESTDIR)/lib -# RAYLIB_H_INSTALL_PATH locates the installed raylib header and associated source files. -RAYLIB_H_INSTALL_PATH ?= $(DESTDIR)/include - -# Library type used for raylib: STATIC (.a) or SHARED (.so/.dll) -RAYLIB_LIBTYPE ?= STATIC - -# Build mode for project: DEBUG or RELEASE -BUILD_MODE ?= RELEASE - -# Use external GLFW library instead of rglfw module -# TODO: Review usage on Linux. Target version of choice. Switch on -lglfw or -lglfw3 -USE_EXTERNAL_GLFW ?= FALSE - -# Use Wayland display server protocol on Linux desktop -# by default it uses X11 windowing system -USE_WAYLAND_DISPLAY ?= FALSE - -# Determine PLATFORM_OS in case PLATFORM_DESKTOP selected -ifeq ($(PLATFORM),PLATFORM_DESKTOP) - # No uname.exe on MinGW!, but OS=Windows_NT on Windows! - # ifeq ($(UNAME),Msys) -> Windows - ifeq ($(OS),Windows_NT) - PLATFORM_OS=WINDOWS - else - UNAMEOS=$(shell uname) - ifeq ($(UNAMEOS),Linux) - PLATFORM_OS=LINUX - endif - ifeq ($(UNAMEOS),FreeBSD) - PLATFORM_OS=BSD - endif - ifeq ($(UNAMEOS),OpenBSD) - PLATFORM_OS=BSD - endif - ifeq ($(UNAMEOS),NetBSD) - PLATFORM_OS=BSD - endif - ifeq ($(UNAMEOS),DragonFly) - PLATFORM_OS=BSD - endif - ifeq ($(UNAMEOS),Darwin) - PLATFORM_OS=OSX - endif - endif -endif -ifeq ($(PLATFORM),PLATFORM_RPI) - UNAMEOS=$(shell uname) - ifeq ($(UNAMEOS),Linux) - PLATFORM_OS=LINUX - endif -endif - -# RAYLIB_PATH adjustment for different platforms. -# If using GNU make, we can get the full path to the top of the tree. Windows? BSD? -# Required for ldconfig or other tools that do not perform path expansion. -ifeq ($(PLATFORM),PLATFORM_DESKTOP) - ifeq ($(PLATFORM_OS),LINUX) - RAYLIB_PREFIX ?= .. - RAYLIB_PATH = $(realpath $(RAYLIB_PREFIX)) - endif -endif -# Default path for raylib on Raspberry Pi, if installed in different path, update it! -# This is not currently used by src/Makefile. Not sure of its origin or usage. Refer to wiki. -# TODO: update install: target in src/Makefile for RPI, consider relation to LINUX. -ifeq ($(PLATFORM),PLATFORM_RPI) - RAYLIB_PATH ?= /home/pi/raylib -endif - -ifeq ($(PLATFORM),PLATFORM_WEB) - # Emscripten required variables - EMSDK_PATH ?= C:/raylib/emsdk - EMSCRIPTEN_PATH ?= $(EMSDK_PATH)/upstream/emscripten - CLANG_PATH = $(EMSDK_PATH)/upstream/bin - PYTHON_PATH = $(EMSDK_PATH)/python/3.13.3_64bit - NODE_PATH = $(EMSDK_PATH)/node/22.16.0_64bit/bin - export PATH = $(EMSDK_PATH);$(EMSCRIPTEN_PATH);$(CLANG_PATH);$(NODE_PATH);$(PYTHON_PATH);C:\raylib\MinGW\bin:$$(PATH) -endif - -# Define raylib release directory for compiled library. -# RAYLIB_RELEASE_PATH points to provided binaries or your freshly built version -RAYLIB_RELEASE_PATH ?= $(RAYLIB_PATH)/src - -# EXAMPLE_RUNTIME_PATH embeds a custom runtime location of libraylib.so or other desired libraries -# into each example binary compiled with RAYLIB_LIBTYPE=SHARED. It defaults to RAYLIB_RELEASE_PATH -# so that these examples link at runtime with your version of libraylib.so in ../release/libs/linux -# without formal installation from ../src/Makefile. It aids portability and is useful if you have -# multiple versions of raylib, have raylib installed to a non-standard location, or want to -# bundle libraylib.so with your game. Change it to your liking. -# NOTE: If, at runtime, there is a libraylib.so at both EXAMPLE_RUNTIME_PATH and RAYLIB_INSTALL_PATH, -# The library at EXAMPLE_RUNTIME_PATH, if present, will take precedence over RAYLIB_INSTALL_PATH, -# Implemented for LINUX below with CFLAGS += -Wl,-rpath,$(EXAMPLE_RUNTIME_PATH) -# To see the result, run readelf -d core/core_basic_window; looking at the RPATH or RUNPATH attribute. -# To see which libraries a built example is linking to, ldd core/core_basic_window; -# Look for libraylib.so.1 => $(RAYLIB_INSTALL_PATH)/libraylib.so.1 or similar listing. -EXAMPLE_RUNTIME_PATH ?= $(RAYLIB_RELEASE_PATH) - -# Define default C compiler: gcc -# NOTE: define g++ compiler if using C++ -CC = gcc - -ifeq ($(PLATFORM),PLATFORM_DESKTOP) - ifeq ($(PLATFORM_OS),OSX) - # OSX default compiler - CC = clang - endif - ifeq ($(PLATFORM_OS),BSD) - # FreeBSD, OpenBSD, NetBSD, DragonFly default compiler - CC = clang - endif -endif -ifeq ($(PLATFORM),PLATFORM_RPI) - ifeq ($(USE_RPI_CROSS_COMPILER),TRUE) - # Define RPI cross-compiler - #CC = armv6j-hardfloat-linux-gnueabi-gcc - CC = $(RPI_TOOLCHAIN)/bin/arm-linux-gnueabihf-gcc - endif -endif -ifeq ($(PLATFORM),PLATFORM_WEB) - # HTML5 emscripten compiler - # WARNING: To compile to HTML5, code must be redesigned - # to use emscripten.h and emscripten_set_main_loop() - CC = emcc -endif - -# Define default make program: Mingw32-make -MAKE = mingw32-make - -ifeq ($(PLATFORM),PLATFORM_DESKTOP) - ifeq ($(PLATFORM_OS),LINUX) - MAKE = make - endif - ifeq ($(PLATFORM_OS),OSX) - MAKE = make - endif -endif - -# Define compiler flags: -# -O1 defines optimization level -# -g include debug information on compilation -# -s strip unnecessary data from build -# -Wall turns on most, but not all, compiler warnings -# -std=c99 defines C language mode (standard C from 1999 revision) -# -std=gnu99 defines C language mode (GNU C from 1999 revision) -# -Wno-missing-braces ignore invalid warning (GCC bug 53119) -# -D_DEFAULT_SOURCE use with -std=c99 on Linux and PLATFORM_WEB, required for timespec -CFLAGS += -O1 -s -Wall -std=c99 -D_DEFAULT_SOURCE -Wno-missing-braces - -ifeq ($(BUILD_MODE),DEBUG) - CFLAGS += -g -endif - -# Additional flags for compiler (if desired) -#CFLAGS += -Wextra -Wmissing-prototypes -Wstrict-prototypes -ifeq ($(PLATFORM),PLATFORM_DESKTOP) - ifeq ($(PLATFORM_OS),WINDOWS) - # resource file contains windows executable icon and properties - # -Wl,--subsystem,windows hides the console window - CFLAGS += $(RAYLIB_PATH)/src/raylib.rc.data -Wl,--subsystem,windows - endif - ifeq ($(PLATFORM_OS),LINUX) - ifeq ($(RAYLIB_LIBTYPE),STATIC) - CFLAGS += -D_DEFAULT_SOURCE - endif - ifeq ($(RAYLIB_LIBTYPE),SHARED) - # Explicitly enable runtime link to libraylib.so - CFLAGS += -Wl,-rpath,$(EXAMPLE_RUNTIME_PATH) - endif - endif -endif -ifeq ($(PLATFORM),PLATFORM_RPI) - CFLAGS += -std=gnu99 -endif -ifeq ($(PLATFORM),PLATFORM_WEB) - # -Os # size optimization - # -O2 # optimization level 2, if used, also set --memory-init-file 0 - # -sUSE_GLFW=3 # Use glfw3 library (context/input management) - # -sALLOW_MEMORY_GROWTH=1 # to allow memory resizing -> WARNING: Audio buffers could FAIL! - # -sTOTAL_MEMORY=16777216 # to specify heap memory size (default = 16MB) (67108864 = 64MB) - # -sUSE_PTHREADS=1 # multithreading support - # -sWASM=0 # disable Web Assembly, emitted by default - # -sASYNCIFY # lets synchronous C/C++ code interact with asynchronous JS - # -sFORCE_FILESYSTEM=1 # force filesystem to load/save files data - # -sASSERTIONS=1 # enable runtime checks for common memory allocation errors (-O1 and above turn it off) - # -sMINIFY_HTML=0 # minify generated html from shell.html - # --profiling # include information for code profiling - # --memory-init-file 0 # to avoid an external memory initialization code file (.mem) - # --preload-file resources # specify a resources folder for data compilation - # --source-map-base # allow debugging in browser with source map - # --shell-file shell.html # define a custom shell .html and output extension - CFLAGS += -Os -sUSE_GLFW=3 -sTOTAL_MEMORY=16777216 --preload-file resources -sMINIFY_HTML=0 - ifeq ($(BUILD_MODE), DEBUG) - CFLAGS += -sASSERTIONS=1 --profiling - endif - - # Define a custom shell .html and output extension - CFLAGS += --shell-file $(RAYLIB_PATH)/src/shell.html - EXT = .html -endif - -# Define include paths for required headers -# NOTE: Several external required libraries (stb and others) -INCLUDE_PATHS = -I. -I$(RAYLIB_PATH)/src -I$(RAYLIB_PATH)/src/external - -# Define additional directories containing required header files -ifeq ($(PLATFORM),PLATFORM_RPI) - # RPI required libraries - INCLUDE_PATHS += -I/opt/vc/include - INCLUDE_PATHS += -I/opt/vc/include/interface/vmcs_host/linux - INCLUDE_PATHS += -I/opt/vc/include/interface/vcos/pthreads -endif -ifeq ($(PLATFORM),PLATFORM_DESKTOP) - ifeq ($(PLATFORM_OS),BSD) - # Consider -L$(RAYLIB_H_INSTALL_PATH) - INCLUDE_PATHS += -I/usr/local/include - endif - ifeq ($(PLATFORM_OS),LINUX) - # Reset everything. - # Precedence: immediately local, installed version, raysan5 provided libs -I$(RAYLIB_H_INSTALL_PATH) -I$(RAYLIB_PATH)/release/include - INCLUDE_PATHS = -I$(RAYLIB_H_INSTALL_PATH) -isystem. -isystem$(RAYLIB_PATH)/src -isystem$(RAYLIB_PATH)/release/include -isystem$(RAYLIB_PATH)/src/external - endif -endif - -# Define library paths containing required libs. -LDFLAGS = -L. -L$(RAYLIB_RELEASE_PATH) -L$(RAYLIB_PATH)/src - -ifeq ($(PLATFORM),PLATFORM_DESKTOP) - ifeq ($(PLATFORM_OS),BSD) - # Consider -L$(RAYLIB_INSTALL_PATH) - LDFLAGS += -L. -Lsrc -L/usr/local/lib - endif - ifeq ($(PLATFORM_OS),LINUX) - # Reset everything. - # Precedence: immediately local, installed version, raysan5 provided libs - LDFLAGS = -L. -L$(RAYLIB_INSTALL_PATH) -L$(RAYLIB_RELEASE_PATH) - endif -endif - -ifeq ($(PLATFORM),PLATFORM_RPI) - LDFLAGS += -L/opt/vc/lib -endif - -# Define any libraries required on linking -# if you want to link libraries (libname.so or libname.a), use the -lname -ifeq ($(PLATFORM),PLATFORM_DESKTOP) - ifeq ($(PLATFORM_OS),WINDOWS) - # Libraries for Windows desktop compilation - # NOTE: WinMM library required to set high-res timer resolution - LDLIBS = -lraylib -lopengl32 -lgdi32 -lwinmm - endif - ifeq ($(PLATFORM_OS),LINUX) - # Libraries for Debian GNU/Linux desktop compiling - # NOTE: Required packages: libegl1-mesa-dev - LDLIBS = -lraylib -lGL -lm -lpthread -ldl -lrt - - # On X11 requires also below libraries - LDLIBS += -lX11 - # NOTE: It seems additional libraries are not required any more, latest GLFW just dlopen them - #LDLIBS += -lXrandr -lXinerama -lXi -lXxf86vm -lXcursor - - # On Wayland windowing system, additional libraries requires - ifeq ($(USE_WAYLAND_DISPLAY),TRUE) - LDLIBS += -lwayland-client -lwayland-cursor -lwayland-egl -lxkbcommon - endif - # Explicit link to libc - ifeq ($(RAYLIB_LIBTYPE),SHARED) - LDLIBS += -lc - endif - endif - ifeq ($(PLATFORM_OS),OSX) - # Libraries for OSX 10.9 desktop compiling - # NOTE: Required packages: libopenal-dev libegl1-mesa-dev - LDLIBS = -lraylib -framework OpenGL -framework OpenAL -framework Cocoa - endif - ifeq ($(PLATFORM_OS),BSD) - # Libraries for FreeBSD, OpenBSD, NetBSD, DragonFly desktop compiling - # NOTE: Required packages: mesa-libs - LDLIBS = -lraylib -lGL -lpthread -lm - - # On XWindow requires also below libraries - LDLIBS += -lX11 -lXrandr -lXinerama -lXi -lXxf86vm -lXcursor - endif - ifeq ($(USE_EXTERNAL_GLFW),TRUE) - # NOTE: It could require additional packages installed: libglfw3-dev - LDLIBS += -lglfw - endif -endif -ifeq ($(PLATFORM),PLATFORM_RPI) - # Libraries for Raspberry Pi compiling - # NOTE: Required packages: libasound2-dev (ALSA) - LDLIBS = -lraylib -lbrcmGLESv2 -lbrcmEGL -lpthread -lrt -lm -lbcm_host -ldl -endif -ifeq ($(PLATFORM),PLATFORM_WEB) - # Libraries for web (HTML5) compiling - LDLIBS = $(RAYLIB_RELEASE_PATH)/libraylib.bc -endif - -# Define a recursive wildcard function -rwildcard=$(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2) $(filter $(subst *,%,$2),$d)) - -# Define all source files required -SRC_DIR = src -OBJ_DIR = obj - -# Define all object files from source files -SRC = $(call rwildcard, *.c, *.h) -#OBJS = $(SRC:$(SRC_DIR)/%.c=$(OBJ_DIR)/%.o) -OBJS = main.c - -# For Android platform we call a custom Makefile.Android -ifeq ($(PLATFORM),PLATFORM_ANDROID) - MAKEFILE_PARAMS = -f Makefile.Android - export PROJECT_NAME - export SRC_DIR -else - MAKEFILE_PARAMS = $(PROJECT_NAME) -endif - -# Default target entry -# NOTE: We call this Makefile target or Makefile.Android target -all: - $(MAKE) $(MAKEFILE_PARAMS) - -# Project target defined by PROJECT_NAME -$(PROJECT_NAME): $(OBJS) - $(CC) -o $(PROJECT_NAME)$(EXT) $(OBJS) $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) - -# Compile source files -# NOTE: This pattern will compile every module defined on $(OBJS) -#%.o: %.c -$(OBJ_DIR)/%.o: $(SRC_DIR)/%.c - $(CC) -c $< -o $@ $(CFLAGS) $(INCLUDE_PATHS) -D$(PLATFORM) - -# Clean everything -clean: -ifeq ($(PLATFORM),PLATFORM_DESKTOP) - ifeq ($(PLATFORM_OS),WINDOWS) - del *.o *.exe /s - endif - ifeq ($(PLATFORM_OS),LINUX) - find -type f -executable | xargs file -i | grep -E 'x-object|x-archive|x-sharedlib|x-executable' | rev | cut -d ':' -f 2- | rev | xargs rm -fv - endif - ifeq ($(PLATFORM_OS),OSX) - find . -type f -perm +ugo+x -delete - rm -f *.o - endif -endif -ifeq ($(PLATFORM),PLATFORM_RPI) - find . -type f -executable -delete - rm -fv *.o -endif -ifeq ($(PLATFORM),PLATFORM_WEB) - del *.o *.html *.js -endif - @echo Cleaning done - diff --git a/projects/4coder/Makefile.Android b/projects/4coder/Makefile.Android deleted file mode 100644 index 9e6773651..000000000 --- a/projects/4coder/Makefile.Android +++ /dev/null @@ -1,300 +0,0 @@ -#************************************************************************************************** -# -# raylib makefile for Android project (APK building) -# -# Copyright (c) 2017 Ramon Santamaria (@raysan5) -# -# This software is provided "as-is", without any express or implied warranty. In no event -# will the authors be held liable for any damages arising from the use of this software. -# -# Permission is granted to anyone to use this software for any purpose, including commercial -# applications, and to alter it and redistribute it freely, subject to the following restrictions: -# -# 1. The origin of this software must not be misrepresented; you must not claim that you -# wrote the original software. If you use this software in a product, an acknowledgment -# in the product documentation would be appreciated but is not required. -# -# 2. Altered source versions must be plainly marked as such, and must not be misrepresented -# as being the original software. -# -# 3. This notice may not be removed or altered from any source distribution. -# -#************************************************************************************************** - -# Define required raylib variables -PLATFORM ?= PLATFORM_ANDROID -RAYLIB_PATH ?= ..\.. - -# Define Android architecture (armeabi-v7a, arm64-v8a, x86, x86-64) and API version -ANDROID_ARCH ?= ARM -ANDROID_API_VERSION = 21 -ifeq ($(ANDROID_ARCH),ARM) - ANDROID_ARCH_NAME = armeabi-v7a -endif -ifeq ($(ANDROID_ARCH),ARM64) - ANDROID_ARCH_NAME = arm64-v8a -endif - -# Required path variables -# NOTE: JAVA_HOME must be set to JDK -JAVA_HOME ?= C:/JavaJDK -ANDROID_HOME = C:/android-sdk -ANDROID_TOOLCHAIN = C:/android_toolchain_$(ANDROID_ARCH)_API$(ANDROID_API_VERSION) -ANDROID_BUILD_TOOLS = $(ANDROID_HOME)/build-tools/28.0.1 -ANDROID_PLATFORM_TOOLS = $(ANDROID_HOME)/platform-tools - -# Android project configuration variables -PROJECT_NAME ?= raylib_game -PROJECT_LIBRARY_NAME ?= main -PROJECT_BUILD_PATH ?= android.$(PROJECT_NAME) -PROJECT_RESOURCES_PATH ?= resources -PROJECT_SOURCE_FILES ?= raylib_game.c - -# Some source files are placed in directories, when compiling to some -# output directory other than source, that directory must pre-exist. -# Here we get a list of required folders that need to be created on -# code output folder $(PROJECT_BUILD_PATH)\obj to avoid GCC errors. -PROJECT_SOURCE_DIRS = $(sort $(dir $(PROJECT_SOURCE_FILES))) - -# Android app configuration variables -APP_LABEL_NAME ?= rGame -APP_COMPANY_NAME ?= raylib -APP_PRODUCT_NAME ?= rgame -APP_VERSION_CODE ?= 1 -APP_VERSION_NAME ?= 1.0 -APP_ICON_LDPI ?= $(RAYLIB_PATH)\logo\raylib_36x36.png -APP_ICON_MDPI ?= $(RAYLIB_PATH)\logo\raylib_48x48.png -APP_ICON_HDPI ?= $(RAYLIB_PATH)\logo\raylib_72x72.png -APP_SCREEN_ORIENTATION ?= landscape -APP_KEYSTORE_PASS ?= raylib - -# Library type used for raylib: STATIC (.a) or SHARED (.so/.dll) -RAYLIB_LIBTYPE ?= STATIC - -# Library path for libraylib.a/libraylib.so -RAYLIB_LIB_PATH = $(RAYLIB_PATH)\src - -# Shared libs must be added to APK if required -# NOTE: Generated NativeLoader.java automatically load those libraries -ifeq ($(RAYLIB_LIBTYPE),SHARED) - PROJECT_SHARED_LIBS = lib/$(ANDROID_ARCH_NAME)/libraylib.so -endif - -# Compiler and archiver -# NOTE: GCC is being deprecated in Android NDK r16 -ifeq ($(ANDROID_ARCH),ARM) - CC = $(ANDROID_TOOLCHAIN)/bin/arm-linux-androideabi-clang - AR = $(ANDROID_TOOLCHAIN)/bin/arm-linux-androideabi-ar -endif -ifeq ($(ANDROID_ARCH),ARM64) - CC = $(ANDROID_TOOLCHAIN)/bin/aarch64-linux-android-clang - AR = $(ANDROID_TOOLCHAIN)/bin/aarch64-linux-android-ar -endif - -# Compiler flags for arquitecture -ifeq ($(ANDROID_ARCH),ARM) - CFLAGS = -std=c99 -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -endif -ifeq ($(ANDROID_ARCH),ARM64) - CFLAGS = -std=c99 -mfix-cortex-a53-835769 -endif -# Compilation functions attributes options -CFLAGS += -ffunction-sections -funwind-tables -fstack-protector-strong -fPIC -# Compiler options for the linker -CFLAGS += -Wall -Wa,--noexecstack -Wformat -Werror=format-security -no-canonical-prefixes -# Preprocessor macro definitions -CFLAGS += -DANDROID -DPLATFORM_ANDROID -D__ANDROID_API__=$(ANDROID_API_VERSION) - -# Paths containing required header files -INCLUDE_PATHS = -I. -I$(RAYLIB_PATH)/src -I$(RAYLIB_PATH)/src/external/android/native_app_glue - -# Linker options -LDFLAGS = -Wl,-soname,lib$(PROJECT_LIBRARY_NAME).so -Wl,--exclude-libs,libatomic.a -LDFLAGS += -Wl,--build-id -Wl,--no-undefined -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,--warn-shared-textrel -Wl,--fatal-warnings -# Force linking of library module to define symbol -LDFLAGS += -u ANativeActivity_onCreate -# Library paths containing required libs -LDFLAGS += -L. -L$(PROJECT_BUILD_PATH)/obj -L$(PROJECT_BUILD_PATH)/lib/$(ANDROID_ARCH_NAME) -L$(ANDROID_TOOLCHAIN)\sysroot\usr\lib - -# Define any libraries to link into executable -# if you want to link libraries (libname.so or libname.a), use the -lname -LDLIBS = -lm -lc -lraylib -llog -landroid -lEGL -lGLESv2 -lOpenSLES -ldl - -# Generate target objects list from PROJECT_SOURCE_FILES -OBJS = $(patsubst %.c, $(PROJECT_BUILD_PATH)/obj/%.o, $(PROJECT_SOURCE_FILES)) - -# Android APK building process... some steps required... -# NOTE: typing 'make' will invoke the default target entry called 'all', -all: create_temp_project_dirs \ - copy_project_required_libs \ - copy_project_resources \ - generate_loader_script \ - generate_android_manifest \ - generate_apk_keystore \ - config_project_package \ - compile_project_code \ - compile_project_class \ - compile_project_class_dex \ - create_project_apk_package \ - sign_project_apk_package \ - zipalign_project_apk_package - -# Create required temp directories for APK building -create_temp_project_dirs: - if not exist $(PROJECT_BUILD_PATH) mkdir $(PROJECT_BUILD_PATH) - if not exist $(PROJECT_BUILD_PATH)\obj mkdir $(PROJECT_BUILD_PATH)\obj - if not exist $(PROJECT_BUILD_PATH)\src mkdir $(PROJECT_BUILD_PATH)\src - if not exist $(PROJECT_BUILD_PATH)\src\com mkdir $(PROJECT_BUILD_PATH)\src\com - if not exist $(PROJECT_BUILD_PATH)\src\com\$(APP_COMPANY_NAME) mkdir $(PROJECT_BUILD_PATH)\src\com\$(APP_COMPANY_NAME) - if not exist $(PROJECT_BUILD_PATH)\src\com\$(APP_COMPANY_NAME)\$(APP_PRODUCT_NAME) mkdir $(PROJECT_BUILD_PATH)\src\com\$(APP_COMPANY_NAME)\$(APP_PRODUCT_NAME) - if not exist $(PROJECT_BUILD_PATH)\lib mkdir $(PROJECT_BUILD_PATH)\lib - if not exist $(PROJECT_BUILD_PATH)\lib\$(ANDROID_ARCH_NAME) mkdir $(PROJECT_BUILD_PATH)\lib\$(ANDROID_ARCH_NAME) - if not exist $(PROJECT_BUILD_PATH)\bin mkdir $(PROJECT_BUILD_PATH)\bin - if not exist $(PROJECT_BUILD_PATH)\res mkdir $(PROJECT_BUILD_PATH)\res - if not exist $(PROJECT_BUILD_PATH)\res\drawable-ldpi mkdir $(PROJECT_BUILD_PATH)\res\drawable-ldpi - if not exist $(PROJECT_BUILD_PATH)\res\drawable-mdpi mkdir $(PROJECT_BUILD_PATH)\res\drawable-mdpi - if not exist $(PROJECT_BUILD_PATH)\res\drawable-hdpi mkdir $(PROJECT_BUILD_PATH)\res\drawable-hdpi - if not exist $(PROJECT_BUILD_PATH)\res\values mkdir $(PROJECT_BUILD_PATH)\res\values - if not exist $(PROJECT_BUILD_PATH)\assets mkdir $(PROJECT_BUILD_PATH)\assets - if not exist $(PROJECT_BUILD_PATH)\assets\$(PROJECT_RESOURCES_PATH) mkdir $(PROJECT_BUILD_PATH)\assets\$(PROJECT_RESOURCES_PATH) - if not exist $(PROJECT_BUILD_PATH)\obj\screens mkdir $(PROJECT_BUILD_PATH)\obj\screens - $(foreach dir, $(PROJECT_SOURCE_DIRS), $(call create_dir, $(dir))) - -define create_dir - if not exist $(PROJECT_BUILD_PATH)\obj\$(1) mkdir $(PROJECT_BUILD_PATH)\obj\$(1) -endef - -# Copy required shared libs for integration into APK -# NOTE: If using shared libs they are loaded by generated NativeLoader.java -copy_project_required_libs: -ifeq ($(RAYLIB_LIBTYPE),SHARED) - copy /Y $(RAYLIB_LIB_PATH)\libraylib.so $(PROJECT_BUILD_PATH)\lib\$(ANDROID_ARCH_NAME)\libraylib.so -endif -ifeq ($(RAYLIB_LIBTYPE),STATIC) - copy /Y $(RAYLIB_LIB_PATH)\libraylib.a $(PROJECT_BUILD_PATH)\lib\$(ANDROID_ARCH_NAME)\libraylib.a -endif - -# Copy project required resources: strings.xml, icon.png, assets -# NOTE: Required strings.xml is generated and game resources are copied to assets folder -# TODO: Review xcopy usage, it can not be found in some systems! -copy_project_resources: - copy $(APP_ICON_LDPI) $(PROJECT_BUILD_PATH)\res\drawable-ldpi\icon.png /Y - copy $(APP_ICON_MDPI) $(PROJECT_BUILD_PATH)\res\drawable-mdpi\icon.png /Y - copy $(APP_ICON_HDPI) $(PROJECT_BUILD_PATH)\res\drawable-hdpi\icon.png /Y - @echo ^ > $(PROJECT_BUILD_PATH)/res/values/strings.xml - @echo ^^$(APP_LABEL_NAME)^^ >> $(PROJECT_BUILD_PATH)/res/values/strings.xml - if exist $(PROJECT_RESOURCES_PATH) C:\Windows\System32\xcopy $(PROJECT_RESOURCES_PATH) $(PROJECT_BUILD_PATH)\assets\$(PROJECT_RESOURCES_PATH) /Y /E /F - -# Generate NativeLoader.java to load required shared libraries -# NOTE: Probably not the bet way to generate this file... but it works. -generate_loader_script: - @echo package com.$(APP_COMPANY_NAME).$(APP_PRODUCT_NAME); > $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/NativeLoader.java - @echo. >> $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/NativeLoader.java - @echo public class NativeLoader extends android.app.NativeActivity { >> $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/NativeLoader.java - @echo static { >> $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/NativeLoader.java -ifeq ($(RAYLIB_LIBTYPE),SHARED) - @echo System.loadLibrary("raylib"); >> $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/NativeLoader.java -endif - @echo System.loadLibrary("$(PROJECT_LIBRARY_NAME)"); >> $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/NativeLoader.java - @echo } >> $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/NativeLoader.java - @echo } >> $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/NativeLoader.java - -# Generate AndroidManifest.xml with all the required options -# NOTE: Probably not the bet way to generate this file... but it works. -generate_android_manifest: - @echo ^ > $(PROJECT_BUILD_PATH)/AndroidManifest.xml - @echo ^> $(PROJECT_BUILD_PATH)/AndroidManifest.xml - @echo package="com.$(APP_COMPANY_NAME).$(APP_PRODUCT_NAME)" >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml - @echo android:versionCode="$(APP_VERSION_CODE)" android:versionName="$(APP_VERSION_NAME)" ^> >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml - @echo ^ >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml - @echo ^ >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml - @echo ^ >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml - @echo ^> $(PROJECT_BUILD_PATH)/AndroidManifest.xml - @echo android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml - @echo android:configChanges="orientation|keyboardHidden|screenSize" >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml - @echo android:screenOrientation="$(APP_SCREEN_ORIENTATION)" android:launchMode="singleTask" >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml - @echo android:clearTaskOnLaunch="true"^> >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml - @echo ^ >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml - @echo ^ >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml - @echo ^ >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml - @echo ^ >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml - @echo ^ >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml - @echo ^ >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml - @echo ^ >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml - @echo ^ >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml - -# Generate storekey for APK signing: $(PROJECT_NAME).keystore -# NOTE: Configure here your Distinguished Names (-dname) if required! -generate_apk_keystore: - if not exist $(PROJECT_BUILD_PATH)/$(PROJECT_NAME).keystore $(JAVA_HOME)/bin/keytool -genkeypair -validity 1000 -dname "CN=$(APP_COMPANY_NAME),O=Android,C=ES" -keystore $(PROJECT_BUILD_PATH)/$(PROJECT_NAME).keystore -storepass $(APP_KEYSTORE_PASS) -keypass $(APP_KEYSTORE_PASS) -alias $(PROJECT_NAME)Key -keyalg RSA - -# Config project package and resource using AndroidManifest.xml and res/values/strings.xml -# NOTE: Generates resources file: src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/R.java -config_project_package: - $(ANDROID_BUILD_TOOLS)/aapt package -f -m -S $(PROJECT_BUILD_PATH)/res -J $(PROJECT_BUILD_PATH)/src -M $(PROJECT_BUILD_PATH)/AndroidManifest.xml -I $(ANDROID_HOME)/platforms/android-$(ANDROID_API_VERSION)/android.jar - -# Compile native_app_glue code as static library: obj/libnative_app_glue.a -compile_native_app_glue: - $(CC) -c $(RAYLIB_PATH)/src/external/android/native_app_glue/android_native_app_glue.c -o $(PROJECT_BUILD_PATH)/obj/native_app_glue.o $(CFLAGS) - $(AR) rcs $(PROJECT_BUILD_PATH)/obj/libnative_app_glue.a $(PROJECT_BUILD_PATH)/obj/native_app_glue.o - -# Compile project code into a shared library: lib/lib$(PROJECT_LIBRARY_NAME).so -compile_project_code: $(OBJS) - $(CC) -o $(PROJECT_BUILD_PATH)/lib/$(ANDROID_ARCH_NAME)/lib$(PROJECT_LIBRARY_NAME).so $(OBJS) -shared $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) - -# Compile all .c files required into object (.o) files -# NOTE: Those files will be linked into a shared library -$(PROJECT_BUILD_PATH)/obj/%.o:%.c - $(CC) -c $^ -o $@ $(INCLUDE_PATHS) $(CFLAGS) --sysroot=$(ANDROID_TOOLCHAIN)/sysroot - -# Compile project .java code into .class (Java bytecode) -compile_project_class: - $(JAVA_HOME)/bin/javac -verbose -source 1.7 -target 1.7 -d $(PROJECT_BUILD_PATH)/obj -bootclasspath $(JAVA_HOME)/jre/lib/rt.jar -classpath $(ANDROID_HOME)/platforms/android-$(ANDROID_API_VERSION)/android.jar;$(PROJECT_BUILD_PATH)/obj -sourcepath $(PROJECT_BUILD_PATH)/src $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/R.java $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/NativeLoader.java - -# Compile .class files into Dalvik executable bytecode (.dex) -# NOTE: Since Android 5.0, Dalvik interpreter (JIT) has been replaced by ART (AOT) -compile_project_class_dex: - $(ANDROID_BUILD_TOOLS)/dx --verbose --dex --output=$(PROJECT_BUILD_PATH)/bin/classes.dex $(PROJECT_BUILD_PATH)/obj - -# Create Android APK package: bin/$(PROJECT_NAME).unsigned.apk -# NOTE: Requires compiled classes.dex and lib$(PROJECT_LIBRARY_NAME).so -# NOTE: Use -A resources to define additional directory in which to find raw asset files -create_project_apk_package: - $(ANDROID_BUILD_TOOLS)/aapt package -f -M $(PROJECT_BUILD_PATH)/AndroidManifest.xml -S $(PROJECT_BUILD_PATH)/res -A $(PROJECT_BUILD_PATH)/assets -I $(ANDROID_HOME)/platforms/android-$(ANDROID_API_VERSION)/android.jar -F $(PROJECT_BUILD_PATH)/bin/$(PROJECT_NAME).unsigned.apk $(PROJECT_BUILD_PATH)/bin - cd $(PROJECT_BUILD_PATH) && $(ANDROID_BUILD_TOOLS)/aapt add bin/$(PROJECT_NAME).unsigned.apk lib/$(ANDROID_ARCH_NAME)/lib$(PROJECT_LIBRARY_NAME).so $(PROJECT_SHARED_LIBS) - -# Create signed APK package using generated Key: bin/$(PROJECT_NAME).signed.apk -sign_project_apk_package: - $(JAVA_HOME)/bin/jarsigner -keystore $(PROJECT_BUILD_PATH)/$(PROJECT_NAME).keystore -storepass $(APP_KEYSTORE_PASS) -keypass $(APP_KEYSTORE_PASS) -signedjar $(PROJECT_BUILD_PATH)/bin/$(PROJECT_NAME).signed.apk $(PROJECT_BUILD_PATH)/bin/$(PROJECT_NAME).unsigned.apk $(PROJECT_NAME)Key - -# Create zip-aligned APK package: $(PROJECT_NAME).apk -zipalign_project_apk_package: - $(ANDROID_BUILD_TOOLS)/zipalign -f 4 $(PROJECT_BUILD_PATH)/bin/$(PROJECT_NAME).signed.apk $(PROJECT_NAME).apk - -# Install $(PROJECT_NAME).apk to default emulator/device -# NOTE: Use -e (emulator) or -d (device) parameters if required -install: - $(ANDROID_PLATFORM_TOOLS)/adb install --abi $(ANDROID_ARCH_NAME) -rds $(PROJECT_NAME).apk - -# Check supported ABI for the device (armeabi-v7a, arm64-v8a, x86, x86_64) -check_device_abi: - $(ANDROID_PLATFORM_TOOLS)/adb shell getprop ro.product.cpu.abi - -# Monitorize output log coming from device, only raylib tag -logcat: - $(ANDROID_PLATFORM_TOOLS)/adb logcat -c - $(ANDROID_PLATFORM_TOOLS)/adb logcat raylib:V *:S - -# Install and monitorize $(PROJECT_NAME).apk to default emulator/device -deploy: - $(ANDROID_PLATFORM_TOOLS)/adb install -r $(PROJECT_NAME).apk - $(ANDROID_PLATFORM_TOOLS)/adb logcat -c - $(ANDROID_PLATFORM_TOOLS)/adb logcat raylib:V *:S - -#$(ANDROID_PLATFORM_TOOLS)/adb logcat *:W - -# Clean everything -clean: - del $(PROJECT_BUILD_PATH)\* /f /s /q - rmdir $(PROJECT_BUILD_PATH) /s /q - @echo Cleaning done diff --git a/projects/4coder/main.c b/projects/4coder/main.c deleted file mode 100644 index 78e1519cb..000000000 --- a/projects/4coder/main.c +++ /dev/null @@ -1,40 +0,0 @@ -#include -#include "raylib.h" - -int main() -{ - int screenWidth = 800; - int screenHeight = 450; - - InitWindow(screenWidth, screenHeight, "raylib"); - - Camera cam; - cam.position = (Vector3){ 0.0f, 10.0f, 8.f }; - cam.target = (Vector3){ 0.0f, 0.0f, 0.0f }; - cam.up = (Vector3){ 0.0f, 1.f, 0.0f }; - cam.fovy = 60.0f; - - Vector3 cubePos = { 0.0f, 0.0f, 0.0f }; - - SetTargetFPS(60); - - while (!WindowShouldClose()) - { - cam.position.x = sin(GetTime())*10.0f; - cam.position.z = cos(GetTime())*10.0f; - - BeginDrawing(); - ClearBackground(RAYWHITE); - BeginMode3D(cam); - DrawCube(cubePos, 2.f, 2.f, 2.f, RED); - DrawCubeWires(cubePos, 2.f, 2.f, 2.f, MAROON); - DrawGrid(10, 1.f); - EndMode3D(); - DrawText("This is a raylib example", 10, 40, 20, DARKGRAY); - DrawFPS(10, 10); - EndDrawing(); - } - - CloseWindow(); - return 0; -} diff --git a/projects/4coder/project.4coder b/projects/4coder/project.4coder deleted file mode 100644 index 568de79bd..000000000 --- a/projects/4coder/project.4coder +++ /dev/null @@ -1,54 +0,0 @@ -version(1); - -project_name = "raylib-example"; - -patterns = { -"*.cpp", -"*.c", -"*.h", -"*.bat", -"*.sh", -"*.4coder", -"Makefile", -}; - -blacklist_patterns = { -".*", -}; - -load_paths = { - { { {".", .relative = true, .recursive = true, } }, .os = "win" }, - { { {".", .relative = true, .recursive = true, } }, .os = "linux" }, - { { {".", .relative = true, .recursive = true, } }, .os = "mac" }, -}; - -command_list = { - { .name = "clean", - .out = "*clean*", .footer_panel = true, .save_dirty_files = false, .cursor_at_end = true, - .cmd = { - {"mingw32-make clean", .os = "win"}, - {"make clean", .os = "linux"}, - {"make clean", .os = "mac"}, - }, - }, - { .name = "build", - .out = "*compile*", .footer_panel = true, .save_dirty_files = true, .cursor_at_end = false, - .cmd = { - {"mingw32-make", .os = "win"}, - {"make", .os = "linux"}, - {"make", .os = "mac"}, - }, - }, - { .name = "run", - .out = "*run*", .footer_panel = true, .save_dirty_files = false, .cursor_at_end = true, - .cmd = { - {".\game.exe", .os = "win"}, - {"./game", .os = "linux"}, - {"./game", .os = "mac"}, - }, - }, -}; - -fkey_command[3] = "clean"; -fkey_command[4] = "build"; -fkey_command[5] = "run"; diff --git a/projects/README.md b/projects/README.md index 2758cb86e..b1f48cdf2 100644 --- a/projects/README.md +++ b/projects/README.md @@ -4,15 +4,14 @@ This folder contains raylib templates for some common IDEs. IDE | Platform(s) | Source | Example(s) ----| ------------| :-------: | :-----: -[4coder](http://4coder.net/) | Windows | ❌ | ✔️ [Builder](https://wiki.gnome.org/Apps/Builder) | Linux | ❌ | ✔️ [CMake](https://cmake.org/) | Windows, Linux, macOS, Web | ✔️ | ✔️ [CodeBlocks](http://www.codeblocks.org/) | Windows, Linux, macOS | ❌ | ✔️ [Geany](https://www.geany.org/) | Windows, Linux | ✔️ | ✔️ -[Notepad++](https://notepad-plus-plus.org/) | Windows | ✔️ | ✔️ +[Notepad++](https://notepad-plus-plus.org/) | Windows, Web | ✔️ | ✔️ [SublimeText](https://www.sublimetext.com/) | Windows, Linux, macOS | ✔️ | ✔️ -[VS2019](https://www.visualstudio.com) | Windows | ✔️ | ✔️ -[VSCode](https://code.visualstudio.com/) | Windows, macOS | ❌ | ✔️ +[VS2022](https://www.visualstudio.com) | Windows | ✔️ | ✔️ +[VSCode](https://code.visualstudio.com/) | Windows, Linux, macOS | ❌ | ✔️ [Zig](https://ziglang.org) | Windows, Linux, macOS, Web | ✔️ | ✔️ scripts | Windows, Linux, macOS | ✔️ | ✔️ diff --git a/projects/VS2019-Android/raylib_android.sln b/projects/VS2019-Android/raylib_android.sln deleted file mode 100644 index ec1880c0e..000000000 --- a/projects/VS2019-Android/raylib_android.sln +++ /dev/null @@ -1,75 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.31702.278 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "raylib_android", "raylib_android", "{5C24BC76-8848-40EA-9BBB-A544648D8D5B}" -EndProject -Project("{39E2626F-3545-4960-A6E8-258AD8476CE5}") = "raylib_android.Packaging", "raylib_android\raylib_android.Packaging\raylib_android.Packaging.androidproj", "{B2231F0D-52DA-4C55-8998-5886F766553C}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "raylib_android.NativeActivity", "raylib_android\raylib_android.NativeActivity\raylib_android.NativeActivity.vcxproj", "{BFB31759-4FCA-4503-BC7C-A97F705EFDB2}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|ARM = Debug|ARM - Debug|ARM64 = Debug|ARM64 - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|ARM = Release|ARM - Release|ARM64 = Release|ARM64 - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {B2231F0D-52DA-4C55-8998-5886F766553C}.Debug|ARM.ActiveCfg = Debug|ARM - {B2231F0D-52DA-4C55-8998-5886F766553C}.Debug|ARM.Build.0 = Debug|ARM - {B2231F0D-52DA-4C55-8998-5886F766553C}.Debug|ARM.Deploy.0 = Debug|ARM - {B2231F0D-52DA-4C55-8998-5886F766553C}.Debug|ARM64.ActiveCfg = Debug|ARM64 - {B2231F0D-52DA-4C55-8998-5886F766553C}.Debug|ARM64.Build.0 = Debug|ARM64 - {B2231F0D-52DA-4C55-8998-5886F766553C}.Debug|ARM64.Deploy.0 = Debug|ARM64 - {B2231F0D-52DA-4C55-8998-5886F766553C}.Debug|x64.ActiveCfg = Debug|x64 - {B2231F0D-52DA-4C55-8998-5886F766553C}.Debug|x64.Build.0 = Debug|x64 - {B2231F0D-52DA-4C55-8998-5886F766553C}.Debug|x64.Deploy.0 = Debug|x64 - {B2231F0D-52DA-4C55-8998-5886F766553C}.Debug|x86.ActiveCfg = Debug|x86 - {B2231F0D-52DA-4C55-8998-5886F766553C}.Debug|x86.Build.0 = Debug|x86 - {B2231F0D-52DA-4C55-8998-5886F766553C}.Debug|x86.Deploy.0 = Debug|x86 - {B2231F0D-52DA-4C55-8998-5886F766553C}.Release|ARM.ActiveCfg = Release|ARM - {B2231F0D-52DA-4C55-8998-5886F766553C}.Release|ARM.Build.0 = Release|ARM - {B2231F0D-52DA-4C55-8998-5886F766553C}.Release|ARM.Deploy.0 = Release|ARM - {B2231F0D-52DA-4C55-8998-5886F766553C}.Release|ARM64.ActiveCfg = Release|ARM64 - {B2231F0D-52DA-4C55-8998-5886F766553C}.Release|ARM64.Build.0 = Release|ARM64 - {B2231F0D-52DA-4C55-8998-5886F766553C}.Release|ARM64.Deploy.0 = Release|ARM64 - {B2231F0D-52DA-4C55-8998-5886F766553C}.Release|x64.ActiveCfg = Release|x64 - {B2231F0D-52DA-4C55-8998-5886F766553C}.Release|x64.Build.0 = Release|x64 - {B2231F0D-52DA-4C55-8998-5886F766553C}.Release|x64.Deploy.0 = Release|x64 - {B2231F0D-52DA-4C55-8998-5886F766553C}.Release|x86.ActiveCfg = Release|x86 - {B2231F0D-52DA-4C55-8998-5886F766553C}.Release|x86.Build.0 = Release|x86 - {B2231F0D-52DA-4C55-8998-5886F766553C}.Release|x86.Deploy.0 = Release|x86 - {BFB31759-4FCA-4503-BC7C-A97F705EFDB2}.Debug|ARM.ActiveCfg = Debug|ARM - {BFB31759-4FCA-4503-BC7C-A97F705EFDB2}.Debug|ARM.Build.0 = Debug|ARM - {BFB31759-4FCA-4503-BC7C-A97F705EFDB2}.Debug|ARM64.ActiveCfg = Debug|ARM64 - {BFB31759-4FCA-4503-BC7C-A97F705EFDB2}.Debug|ARM64.Build.0 = Debug|ARM64 - {BFB31759-4FCA-4503-BC7C-A97F705EFDB2}.Debug|x64.ActiveCfg = Debug|x64 - {BFB31759-4FCA-4503-BC7C-A97F705EFDB2}.Debug|x64.Build.0 = Debug|x64 - {BFB31759-4FCA-4503-BC7C-A97F705EFDB2}.Debug|x86.ActiveCfg = Debug|x86 - {BFB31759-4FCA-4503-BC7C-A97F705EFDB2}.Debug|x86.Build.0 = Debug|x86 - {BFB31759-4FCA-4503-BC7C-A97F705EFDB2}.Release|ARM.ActiveCfg = Release|ARM - {BFB31759-4FCA-4503-BC7C-A97F705EFDB2}.Release|ARM.Build.0 = Release|ARM - {BFB31759-4FCA-4503-BC7C-A97F705EFDB2}.Release|ARM64.ActiveCfg = Release|ARM64 - {BFB31759-4FCA-4503-BC7C-A97F705EFDB2}.Release|ARM64.Build.0 = Release|ARM64 - {BFB31759-4FCA-4503-BC7C-A97F705EFDB2}.Release|x64.ActiveCfg = Release|x64 - {BFB31759-4FCA-4503-BC7C-A97F705EFDB2}.Release|x64.Build.0 = Release|x64 - {BFB31759-4FCA-4503-BC7C-A97F705EFDB2}.Release|x86.ActiveCfg = Release|x86 - {BFB31759-4FCA-4503-BC7C-A97F705EFDB2}.Release|x86.Build.0 = Release|x86 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {B2231F0D-52DA-4C55-8998-5886F766553C} = {5C24BC76-8848-40EA-9BBB-A544648D8D5B} - {BFB31759-4FCA-4503-BC7C-A97F705EFDB2} = {5C24BC76-8848-40EA-9BBB-A544648D8D5B} - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {B7ED0AA6-6B00-40AC-BF71-526D5BEEFC78} - EndGlobalSection -EndGlobal diff --git a/projects/VS2019-Android/raylib_android/raylib_android.NativeActivity/android_native_app_glue.c b/projects/VS2019-Android/raylib_android/raylib_android.NativeActivity/android_native_app_glue.c deleted file mode 100644 index 0b8379423..000000000 --- a/projects/VS2019-Android/raylib_android/raylib_android.NativeActivity/android_native_app_glue.c +++ /dev/null @@ -1,437 +0,0 @@ -/* - * Copyright (C) 2010 The Android Open Source Project - * - * лицензировано по лицензии Apache License, версия 2.0 ( "Лицензия"); - *этот файл можно использовать только в соответствии с лицензией. - *Копию лицензии можно получить на веб-сайте - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - *Если только не требуется в соответствии с применимым законодательством или согласовано в письменном виде, программное обеспечение - * распространяется в рамках лицензии на УСЛОВИЯХ "КАК ЕСТЬ", - * БЕЗ ГАРАНТИЙ И УСЛОВИЙ ЛЮБОГО РОДА, явно выраженных и подразумеваемых. - * См. лицензию для получения информации об определенных разрешениях по использованию языка и - * ограничениях в рамках лицензии. - * - */ - -#include - -#include -#include -#include -#include -#include - -#include "android_native_app_glue.h" -#include - -#define LOGI(...) ((void)__android_log_print(ANDROID_LOG_INFO, "threaded_app", __VA_ARGS__)) -#define LOGE(...) ((void)__android_log_print(ANDROID_LOG_ERROR, "threaded_app", __VA_ARGS__)) - -/* Для отладочных построений необходимо всегда включать трассировку отладки в этой библиотеке*/ -#ifndef NDEBUG -# define LOGV(...) ((void)__android_log_print(ANDROID_LOG_VERBOSE, "threaded_app", __VA_ARGS__)) -#else -# define LOGV(...) ((void)0) -#endif - -static void free_saved_state(struct android_app* android_app) { - pthread_mutex_lock(&android_app->mutex); - if (android_app->savedState != NULL) { - free(android_app->savedState); - android_app->savedState = NULL; - android_app->savedStateSize = 0; - } - pthread_mutex_unlock(&android_app->mutex); -} - -int8_t android_app_read_cmd(struct android_app* android_app) { - int8_t cmd; - if (read(android_app->msgread, &cmd, sizeof(cmd)) == sizeof(cmd)) { - switch (cmd) { - case APP_CMD_SAVE_STATE: - free_saved_state(android_app); - break; - } - return cmd; - } else { - LOGE("No data on command pipe!"); - } - return -1; -} - -static void print_cur_config(struct android_app* android_app) { - char lang[2], country[2]; - AConfiguration_getLanguage(android_app->config, lang); - AConfiguration_getCountry(android_app->config, country); - - LOGV("Config: mcc=%d mnc=%d lang=%c%c cnt=%c%c orien=%d touch=%d dens=%d " - "keys=%d nav=%d keysHid=%d navHid=%d sdk=%d size=%d long=%d " - "modetype=%d modenight=%d", - AConfiguration_getMcc(android_app->config), - AConfiguration_getMnc(android_app->config), - lang[0], lang[1], country[0], country[1], - AConfiguration_getOrientation(android_app->config), - AConfiguration_getTouchscreen(android_app->config), - AConfiguration_getDensity(android_app->config), - AConfiguration_getKeyboard(android_app->config), - AConfiguration_getNavigation(android_app->config), - AConfiguration_getKeysHidden(android_app->config), - AConfiguration_getNavHidden(android_app->config), - AConfiguration_getSdkVersion(android_app->config), - AConfiguration_getScreenSize(android_app->config), - AConfiguration_getScreenLong(android_app->config), - AConfiguration_getUiModeType(android_app->config), - AConfiguration_getUiModeNight(android_app->config)); -} - -void android_app_pre_exec_cmd(struct android_app* android_app, int8_t cmd) { - switch (cmd) { - case APP_CMD_INPUT_CHANGED: - LOGV("APP_CMD_INPUT_CHANGED\n"); - pthread_mutex_lock(&android_app->mutex); - if (android_app->inputQueue != NULL) { - AInputQueue_detachLooper(android_app->inputQueue); - } - android_app->inputQueue = android_app->pendingInputQueue; - if (android_app->inputQueue != NULL) { - LOGV("Attaching input queue to looper"); - AInputQueue_attachLooper(android_app->inputQueue, - android_app->looper, LOOPER_ID_INPUT, NULL, - &android_app->inputPollSource); - } - pthread_cond_broadcast(&android_app->cond); - pthread_mutex_unlock(&android_app->mutex); - break; - - case APP_CMD_INIT_WINDOW: - LOGV("APP_CMD_INIT_WINDOW\n"); - pthread_mutex_lock(&android_app->mutex); - android_app->window = android_app->pendingWindow; - pthread_cond_broadcast(&android_app->cond); - pthread_mutex_unlock(&android_app->mutex); - break; - - case APP_CMD_TERM_WINDOW: - LOGV("APP_CMD_TERM_WINDOW\n"); - pthread_cond_broadcast(&android_app->cond); - break; - - case APP_CMD_RESUME: - case APP_CMD_START: - case APP_CMD_PAUSE: - case APP_CMD_STOP: - LOGV("activityState=%d\n", cmd); - pthread_mutex_lock(&android_app->mutex); - android_app->activityState = cmd; - pthread_cond_broadcast(&android_app->cond); - pthread_mutex_unlock(&android_app->mutex); - break; - - case APP_CMD_CONFIG_CHANGED: - LOGV("APP_CMD_CONFIG_CHANGED\n"); - AConfiguration_fromAssetManager(android_app->config, - android_app->activity->assetManager); - print_cur_config(android_app); - break; - - case APP_CMD_DESTROY: - LOGV("APP_CMD_DESTROY\n"); - android_app->destroyRequested = 1; - break; - } -} - -void android_app_post_exec_cmd(struct android_app* android_app, int8_t cmd) { - switch (cmd) { - case APP_CMD_TERM_WINDOW: - LOGV("APP_CMD_TERM_WINDOW\n"); - pthread_mutex_lock(&android_app->mutex); - android_app->window = NULL; - pthread_cond_broadcast(&android_app->cond); - pthread_mutex_unlock(&android_app->mutex); - break; - - case APP_CMD_SAVE_STATE: - LOGV("APP_CMD_SAVE_STATE\n"); - pthread_mutex_lock(&android_app->mutex); - android_app->stateSaved = 1; - pthread_cond_broadcast(&android_app->cond); - pthread_mutex_unlock(&android_app->mutex); - break; - - case APP_CMD_RESUME: - free_saved_state(android_app); - break; - } -} - -static void android_app_destroy(struct android_app* android_app) { - LOGV("android_app_destroy!"); - free_saved_state(android_app); - pthread_mutex_lock(&android_app->mutex); - if (android_app->inputQueue != NULL) { - AInputQueue_detachLooper(android_app->inputQueue); - } - AConfiguration_delete(android_app->config); - android_app->destroyed = 1; - pthread_cond_broadcast(&android_app->cond); - pthread_mutex_unlock(&android_app->mutex); - // После этого нельзя изменять объект android_app. -} - -static void process_input(struct android_app* app, struct android_poll_source* source) { - AInputEvent* event = NULL; - while (AInputQueue_getEvent(app->inputQueue, &event) >= 0) { - LOGV("New input event: type=%d\n", AInputEvent_getType(event)); - if (AInputQueue_preDispatchEvent(app->inputQueue, event)) { - continue; - } - int32_t handled = 0; - if (app->onInputEvent != NULL) handled = app->onInputEvent(app, event); - AInputQueue_finishEvent(app->inputQueue, event, handled); - } -} - -static void process_cmd(struct android_app* app, struct android_poll_source* source) { - int8_t cmd = android_app_read_cmd(app); - android_app_pre_exec_cmd(app, cmd); - if (app->onAppCmd != NULL) app->onAppCmd(app, cmd); - android_app_post_exec_cmd(app, cmd); -} - -static void* android_app_entry(void* param) { - struct android_app* android_app = (struct android_app*)param; - - android_app->config = AConfiguration_new(); - AConfiguration_fromAssetManager(android_app->config, android_app->activity->assetManager); - - print_cur_config(android_app); - - android_app->cmdPollSource.id = LOOPER_ID_MAIN; - android_app->cmdPollSource.app = android_app; - android_app->cmdPollSource.process = process_cmd; - android_app->inputPollSource.id = LOOPER_ID_INPUT; - android_app->inputPollSource.app = android_app; - android_app->inputPollSource.process = process_input; - - ALooper* looper = ALooper_prepare(ALOOPER_PREPARE_ALLOW_NON_CALLBACKS); - ALooper_addFd(looper, android_app->msgread, LOOPER_ID_MAIN, ALOOPER_EVENT_INPUT, NULL, - &android_app->cmdPollSource); - android_app->looper = looper; - - pthread_mutex_lock(&android_app->mutex); - android_app->running = 1; - pthread_cond_broadcast(&android_app->cond); - pthread_mutex_unlock(&android_app->mutex); - - android_main(android_app); - - android_app_destroy(android_app); - return NULL; -} - -// -------------------------------------------------------------------- -// Взаимодействие NativeАctivity (вызванное из основного потока) -// -------------------------------------------------------------------- - -static struct android_app* android_app_create(ANativeActivity* activity, - void* savedState, size_t savedStateSize) { - struct android_app* android_app = (struct android_app*)malloc(sizeof(struct android_app)); - memset(android_app, 0, sizeof(struct android_app)); - android_app->activity = activity; - - pthread_mutex_init(&android_app->mutex, NULL); - pthread_cond_init(&android_app->cond, NULL); - - if (savedState != NULL) { - android_app->savedState = malloc(savedStateSize); - android_app->savedStateSize = savedStateSize; - memcpy(android_app->savedState, savedState, savedStateSize); - } - - int msgpipe[2]; - if (pipe(msgpipe)) { - LOGE("could not create pipe: %s", strerror(errno)); - return NULL; - } - android_app->msgread = msgpipe[0]; - android_app->msgwrite = msgpipe[1]; - - pthread_attr_t attr; - pthread_attr_init(&attr); - pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); - pthread_create(&android_app->thread, &attr, android_app_entry, android_app); - - // Дождитесь запуска потока. - pthread_mutex_lock(&android_app->mutex); - while (!android_app->running) { - pthread_cond_wait(&android_app->cond, &android_app->mutex); - } - pthread_mutex_unlock(&android_app->mutex); - - return android_app; -} - -static void android_app_write_cmd(struct android_app* android_app, int8_t cmd) { - if (write(android_app->msgwrite, &cmd, sizeof(cmd)) != sizeof(cmd)) { - LOGE("Failure writing android_app cmd: %s\n", strerror(errno)); - } -} - -static void android_app_set_input(struct android_app* android_app, AInputQueue* inputQueue) { - pthread_mutex_lock(&android_app->mutex); - android_app->pendingInputQueue = inputQueue; - android_app_write_cmd(android_app, APP_CMD_INPUT_CHANGED); - while (android_app->inputQueue != android_app->pendingInputQueue) { - pthread_cond_wait(&android_app->cond, &android_app->mutex); - } - pthread_mutex_unlock(&android_app->mutex); -} - -static void android_app_set_window(struct android_app* android_app, ANativeWindow* window) { - pthread_mutex_lock(&android_app->mutex); - if (android_app->pendingWindow != NULL) { - android_app_write_cmd(android_app, APP_CMD_TERM_WINDOW); - } - android_app->pendingWindow = window; - if (window != NULL) { - android_app_write_cmd(android_app, APP_CMD_INIT_WINDOW); - } - while (android_app->window != android_app->pendingWindow) { - pthread_cond_wait(&android_app->cond, &android_app->mutex); - } - pthread_mutex_unlock(&android_app->mutex); -} - -static void android_app_set_activity_state(struct android_app* android_app, int8_t cmd) { - pthread_mutex_lock(&android_app->mutex); - android_app_write_cmd(android_app, cmd); - while (android_app->activityState != cmd) { - pthread_cond_wait(&android_app->cond, &android_app->mutex); - } - pthread_mutex_unlock(&android_app->mutex); -} - -static void android_app_free(struct android_app* android_app) { - pthread_mutex_lock(&android_app->mutex); - android_app_write_cmd(android_app, APP_CMD_DESTROY); - while (!android_app->destroyed) { - pthread_cond_wait(&android_app->cond, &android_app->mutex); - } - pthread_mutex_unlock(&android_app->mutex); - - close(android_app->msgread); - close(android_app->msgwrite); - pthread_cond_destroy(&android_app->cond); - pthread_mutex_destroy(&android_app->mutex); - free(android_app); -} - -static void onDestroy(ANativeActivity* activity) { - LOGV("Destroy: %p\n", activity); - android_app_free((struct android_app*)activity->instance); -} - -static void onStart(ANativeActivity* activity) { - LOGV("Start: %p\n", activity); - android_app_set_activity_state((struct android_app*)activity->instance, APP_CMD_START); -} - -static void onResume(ANativeActivity* activity) { - LOGV("Resume: %p\n", activity); - android_app_set_activity_state((struct android_app*)activity->instance, APP_CMD_RESUME); -} - -static void* onSaveInstanceState(ANativeActivity* activity, size_t* outLen) { - struct android_app* android_app = (struct android_app*)activity->instance; - void* savedState = NULL; - - LOGV("SaveInstanceState: %p\n", activity); - pthread_mutex_lock(&android_app->mutex); - android_app->stateSaved = 0; - android_app_write_cmd(android_app, APP_CMD_SAVE_STATE); - while (!android_app->stateSaved) { - pthread_cond_wait(&android_app->cond, &android_app->mutex); - } - - if (android_app->savedState != NULL) { - savedState = android_app->savedState; - *outLen = android_app->savedStateSize; - android_app->savedState = NULL; - android_app->savedStateSize = 0; - } - - pthread_mutex_unlock(&android_app->mutex); - - return savedState; -} - -static void onPause(ANativeActivity* activity) { - LOGV("Pause: %p\n", activity); - android_app_set_activity_state((struct android_app*)activity->instance, APP_CMD_PAUSE); -} - -static void onStop(ANativeActivity* activity) { - LOGV("Stop: %p\n", activity); - android_app_set_activity_state((struct android_app*)activity->instance, APP_CMD_STOP); -} - -static void onConfigurationChanged(ANativeActivity* activity) { - struct android_app* android_app = (struct android_app*)activity->instance; - LOGV("ConfigurationChanged: %p\n", activity); - android_app_write_cmd(android_app, APP_CMD_CONFIG_CHANGED); -} - -static void onLowMemory(ANativeActivity* activity) { - struct android_app* android_app = (struct android_app*)activity->instance; - LOGV("LowMemory: %p\n", activity); - android_app_write_cmd(android_app, APP_CMD_LOW_MEMORY); -} - -static void onWindowFocusChanged(ANativeActivity* activity, int focused) { - LOGV("WindowFocusChanged: %p -- %d\n", activity, focused); - android_app_write_cmd((struct android_app*)activity->instance, - focused ? APP_CMD_GAINED_FOCUS : APP_CMD_LOST_FOCUS); -} - -static void onNativeWindowCreated(ANativeActivity* activity, ANativeWindow* window) { - LOGV("NativeWindowCreated: %p -- %p\n", activity, window); - android_app_set_window((struct android_app*)activity->instance, window); -} - -static void onNativeWindowDestroyed(ANativeActivity* activity, ANativeWindow* window) { - LOGV("NativeWindowDestroyed: %p -- %p\n", activity, window); - android_app_set_window((struct android_app*)activity->instance, NULL); -} - -static void onInputQueueCreated(ANativeActivity* activity, AInputQueue* queue) { - LOGV("InputQueueCreated: %p -- %p\n", activity, queue); - android_app_set_input((struct android_app*)activity->instance, queue); -} - -static void onInputQueueDestroyed(ANativeActivity* activity, AInputQueue* queue) { - LOGV("InputQueueDestroyed: %p -- %p\n", activity, queue); - android_app_set_input((struct android_app*)activity->instance, NULL); -} - -void ANativeActivity_onCreate(ANativeActivity* activity, - void* savedState, size_t savedStateSize) { - LOGV("Creating: %p\n", activity); - activity->callbacks->onDestroy = onDestroy; - activity->callbacks->onStart = onStart; - activity->callbacks->onResume = onResume; - activity->callbacks->onSaveInstanceState = onSaveInstanceState; - activity->callbacks->onPause = onPause; - activity->callbacks->onStop = onStop; - activity->callbacks->onConfigurationChanged = onConfigurationChanged; - activity->callbacks->onLowMemory = onLowMemory; - activity->callbacks->onWindowFocusChanged = onWindowFocusChanged; - activity->callbacks->onNativeWindowCreated = onNativeWindowCreated; - activity->callbacks->onNativeWindowDestroyed = onNativeWindowDestroyed; - activity->callbacks->onInputQueueCreated = onInputQueueCreated; - activity->callbacks->onInputQueueDestroyed = onInputQueueDestroyed; - - activity->instance = android_app_create(activity, savedState, savedStateSize); -} diff --git a/projects/VS2019-Android/raylib_android/raylib_android.NativeActivity/android_native_app_glue.h b/projects/VS2019-Android/raylib_android/raylib_android.NativeActivity/android_native_app_glue.h deleted file mode 100644 index c7269a444..000000000 --- a/projects/VS2019-Android/raylib_android/raylib_android.NativeActivity/android_native_app_glue.h +++ /dev/null @@ -1,344 +0,0 @@ -/* - * © 2010 The Android Open Source Project - * - * Лицензировано по лицензии Apache License, версия 2.0 ( "Лицензия"); - *этот файл можно использовать только в соответствии с лицензией. - *Копию лицензии можно получить на веб-сайте - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - *Если только не требуется в соответствии с применимым законодательством или согласовано в письменном виде, программное обеспечение - * распространяется в рамках лицензии на УСЛОВИЯХ "КАК ЕСТЬ", - * БЕЗ ГАРАНТИЙ И УСЛОВИЙ ЛЮБОГО РОДА, явно выраженных и подразумеваемых. - * См. лицензию для получения информации об определенных разрешениях по использованию языка и - * ограничениях в рамках лицензии. - * - */ - -#ifndef _ANDROID_NATIVE_APP_GLUE_H -#define _ANDROID_NATIVE_APP_GLUE_H - -#include -#include -#include - -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * Интерфейс NativeActivity, предоставленный , - * основан на наборе предоставленных приложением обратных вызовов, которые вызываются - *основным потоком действия при возникновении определенных событий. - * - * Это означает, что ни один из данных обратных вызовов _не_ _должен_ блокироваться, иначе - * существует риск принудительного закрытия приложения системой. Эта модель программирования - * прямая, простая, но имеет ограничения. - * - * Статическая библиотека threaded_native_app используется для обеспечения другой - * модели выполнения, в которой приложение может реализовать свой собственный цикл главного события - * в другом потоке вместо этого. Это работает так: - * - * 1/ Приложение должно предоставить функцию с именем android_main(), которая - * будет вызываться при создании действия в новом потоке, - * отличающемся от основного потока действия. - * - * 2/ android_main() получает указатель на допустимую структуру android_app, - * которая содержит ссылки на другие важные объекты, например экземпляр объекта - * ANativeActivity, где выполняется приложение. - * - * 3/ Объект android_app содержит экземпляр ALooper, который уже - * ожидает две важных вещи: - * - * - событий жизненного цикла действия (например, "pause", "resume"). См. объявления APP_CMD_XXX - * ниже. - * - * - входных событий, поступающих из очереди AInputQueue, присоединенной к действию. - * - * Каждое из этих событий соответствует идентификатору ALooper, возвращенному - * ALooper_pollOnce со значениями LOOPER_ID_MAIN и LOOPER_ID_INPUT, - *, соответственно. - * - * Ваше приложение может использовать тот же ALooper для прослушивания дополнительных - * дескрипторов файла. Они могут быть основаны либо на обратных вызовах, либо поступают с идентификаторами возврата, - * начинающимися с LOOPER_ID_USER. - * - * 4/ При получении события LOOPER_ID_MAIN или LOOPER_ID_INPUT - * возвращенные данные будут указывать на структуру android_poll_source. Для нее - * можно вызвать функцию process() и заполнить android_app->onAppCmd - * и android_app->onInputEvent, для того чтобы они вызывались для вашей собственной обработки - * события. - * - * Вместо этого можно вызвать функции нижнего уровня для чтения и обработки - * данных непосредственно... посмотрите на реализации process_cmd() и process_input() - * в приклеивании, чтобы выяснить, как это делается. - * - * См. пример "native-activity" в NDK с - * полной демонстрацией использования. Также посмотрите JavaDoc в NativeActivity. - */ - -struct android_app; - -/** - * Данные, связанные с ALooper fd, которые будут возвращаться как outData - * при готовности данных в этом источнике. - */ -struct android_poll_source { - // Идентификатор данного источника. Может быть LOOPER_ID_MAIN или - // LOOPER_ID_INPUT. - int32_t id; - - // android_app, с которым связан данный идентификатор. - struct android_app* app; - - // Функция, вызываемая для стандартной обработки данных из - // этого источника. - void (*process)(struct android_app* app, struct android_poll_source* source); -}; - -/** - * Это интерфейс стандартного кода приклеивания поточного - * приложения. В этой модели код приложения выполняется - * в своем собственном потоке, отдельном от основного потока процесса. - * Не требуется связь данного потока с ВМ Java - *, хотя это необходимо для выполнения вызовов JNI любых - * объектов Java. - */ -struct android_app { - // Приложение может поместить указатель на свой собственный объект состояния - // здесь, если нужно. - void* userData; - - // Введите здесь код функции для обработки основных команд приложения (APP_CMD_*) - void (*onAppCmd)(struct android_app* app, int32_t cmd); - - // Введите здесь код функции для обработки входных событий. Сейчас - // событие уже было предварительно отправлено и будет завершено при - // возврате. Верните 1, если событие обработано, 0 — для любой диспетчеризации - // по умолчанию. - int32_t (*onInputEvent)(struct android_app* app, AInputEvent* event); - - // Экземпляр объекта ANativeActivity, в котором выполняется это приложение. - ANativeActivity* activity; - - // Текущая конфигурация, в которой выполняется это приложение. - AConfiguration* config; - - // Это последнее сохраненное состояние экземпляра, предоставленное во время создания. - // Значение равно NULL, если состояния не было. Можно использовать это по мере необходимости; - // память останется доступной до вызова android_app_exec_cmd() для - // APP_CMD_RESUME, после чего она будет освобождена, а savedState получит значение NULL. - // Эти переменные необходимо изменять только при обработке APP_CMD_SAVE_STATE, - // когда их значения будут инициализироваться в NULL и можно будет выполнить malloc для - // состояния и поместить здесь информацию. В этом случае память будет - // освобождена позднее. - void* savedState; - size_t savedStateSize; - - // ALooper, связанный с потоком приложения. - ALooper* looper; - - // Если значение не равно NULL, то это входная очередь, из которой приложение будет - // получать входные события пользователя. - AInputQueue* inputQueue; - - // Если значение не равно NULL, то это поверхность окна, в котором приложение может рисовать. - ANativeWindow* window; - - // Текущий прямоугольник содержимого окна. Это область, в которой - // должно помещаться содержимое окна, чтобы его видел пользователь. - ARect contentRect; - - // Текущее состояние действия приложения. Может быть APP_CMD_START, - // APP_CMD_RESUME, APP_CMD_PAUSE или APP_CMD_STOP; см. ниже. - int activityState; - - // Значение не равно нулю, когда NativeActivity приложения - // разрушается и ожидает завершения потока приложения. - int destroyRequested; - - // ------------------------------------------------- - // Ниже показан "частная" реализация кода прилипания. - - pthread_mutex_t mutex; - pthread_cond_t cond; - - int msgread; - int msgwrite; - - pthread_t thread; - - struct android_poll_source cmdPollSource; - struct android_poll_source inputPollSource; - - int running; - int stateSaved; - int destroyed; - int redrawNeeded; - AInputQueue* pendingInputQueue; - ANativeWindow* pendingWindow; - ARect pendingContentRect; -}; - -enum { - /** - * Идентификатор данных Looper команд, поступающих из основного потока приложения, который - * возвращается как идентификатор от ALooper_pollOnce(). Данные для этого идентификатора - * являются указателем на структуру android_poll_source. - * Их можно извлечь и обработать с помощью android_app_read_cmd() - * и android_app_exec_cmd(). - */ - LOOPER_ID_MAIN = 1, - - /** - * Идентификатор данных Looper событий, поступающий из AInputQueue окна - * приложения, который возвращается как идентификатор из - * ALooper_pollOnce(). Данные этого идентификатора являются указателем на структуру - * android_poll_source. Их можно прочитать через объект inputQueue - * приложения android_app. - */ - LOOPER_ID_INPUT = 2, - - /** - * Запуск определяемых пользователем идентификаторов ALooper. - */ - LOOPER_ID_USER = 3, -}; - -enum { - /** - * Команда из основного потока: AInputQueue изменена. После обработки - * этой команды android_app->inputQueue будет обновлена в новую очередь - * (или NULL). - */ - APP_CMD_INPUT_CHANGED, - - /** - * Команда из основного потока: новое окно ANativeWindow готово к использованию. После - * получения этой команды окно android_app-> будет содержать новую поверхность - *окна. - */ - APP_CMD_INIT_WINDOW, - - /** - * Команда из основного потока: существующее окно ANativeWindow необходимо - * прекратить. После получения этой команды окно android_app->по-прежнему - * содержит существующее окно; после вызова android_app_exec_cmd - * оно получит значение NULL. - */ - APP_CMD_TERM_WINDOW, - - /** - * Команда из основного потока: текущее окно ANativeWindow изменило размер. - * Перерисуйте согласно новом размеру. - */ - APP_CMD_WINDOW_RESIZED, - - /** - * Команда из основного потока: системе необходимо, чтобы текущее окно ANativeWindow - * было перерисовано. Необходимо перерисовать окно перед ее передачей в - * android_app_exec_cmd(), чтобы избежать переходных сбоев рисования. - */ - APP_CMD_WINDOW_REDRAW_NEEDED, - - /** - * Команда из основного потока: область содержимого окна изменена - * таким образом, что из функционального ввода окно показывается или скрывается. Можно - * найти новый прямоугольник содержимого в android_app::contentRect. - */ - APP_CMD_CONTENT_RECT_CHANGED, - - /** - * Команда из основного потока: окно действия приложения получило - * фокус ввода. - */ - APP_CMD_GAINED_FOCUS, - - /** - * Команда из основного потока: окно действия приложения потеряло - * фокус ввода. - */ - APP_CMD_LOST_FOCUS, - - /** - * Команда из основного потока: изменена текущая конфигурация устройства. - */ - APP_CMD_CONFIG_CHANGED, - - /** - * Команда из основного потока: системе не хватает памяти. - * Попробуйте уменьшить использование памяти. - */ - APP_CMD_LOW_MEMORY, - - /** - * Команда из основного потока: действие приложения было запущено. - */ - APP_CMD_START, - - /** - * Команда из основного потока: действие приложения было возобновлено. - */ - APP_CMD_RESUME, - - /** - * Команда из основного потока: приложение должно создать новое сохраненное состояние - * для себя, чтобы восстанавливаться из него позднее в случае необходимости. Если вы сохранили состояние, - * выделите его с использованием malloc и поместите в android_app.savedState с - * размером android_app.savedStateSize. Память будет освобождена - * позднее. - */ - APP_CMD_SAVE_STATE, - - /** - * Команда из основного потока: пауза в действии приложения. - */ - APP_CMD_PAUSE, - - /** - * Команда из основного потока: действие приложения было остановлено. - */ - APP_CMD_STOP, - - /** - * Команда из основного потока: действие приложения уничтожается, - * и ожидает очистки потока приложения и выхода перед обработкой. - */ - APP_CMD_DESTROY, -}; - -/** - * Вызовите, когда ALooper_pollAll() возвращает LOOPER_ID_MAIN, при чтении следующего сообщения команды - *приложения. - */ -int8_t android_app_read_cmd(struct android_app* android_app); - -/** - * Вызовите с помощью команды, возвращенной android_app_read_cmd() для выполнения - * начальной предварительной обработки данной команды. Можно выполнить собственные - * действия для команды после вызова этой функции. - */ -void android_app_pre_exec_cmd(struct android_app* android_app, int8_t cmd); - -/** - * Вызовите с помощью команды, возвращенной android_app_read_cmd(), для - * окончательной предварительной обработки данной команды. Необходимо завершить собственные - * действия с командой до вызова этой функции. - */ -void android_app_post_exec_cmd(struct android_app* android_app, int8_t cmd); - -/** - * Это функция, которую должен реализовать код приложения, представляет собой - * главный вход в приложение. - */ -extern void android_main(struct android_app* app); - -#ifdef __cplusplus -} -#endif - -#endif /* _ANDROID_NATIVE_APP_GLUE_H */ diff --git a/projects/VS2019-Android/raylib_android/raylib_android.NativeActivity/main.c b/projects/VS2019-Android/raylib_android/raylib_android.NativeActivity/main.c deleted file mode 100644 index dce3f503c..000000000 --- a/projects/VS2019-Android/raylib_android/raylib_android.NativeActivity/main.c +++ /dev/null @@ -1,64 +0,0 @@ -/******************************************************************************************* -* -* raylib [core] example - Basic window -* -* This example has been created using raylib 3.8 (www.raylib.com) -* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details) -* -* Example contributed by (@) and reviewed by Ramon Santamaria (@raysan5) -* -* Copyright (c) 2021 (@) - -* Adapt for Visual Studio: Vadim Boev (Kronka Dev) -* -********************************************************************************************/ -#include "android_native_app_glue.h" - -#include "../../../../src/raylib.h" - -int main(void) -{ - // Initialization - //-------------------------------------------------------------------------------------- - const int screenWidth = 800; - const int screenHeight = 450; - - InitWindow(screenWidth, screenHeight, "raylib [core] example - basic window"); - - // TODO: Load resources / Initialize variables at this point - - SetTargetFPS(60); - //-------------------------------------------------------------------------------------- - - // Main game loop - while (!WindowShouldClose()) // Detect window close button or ESC key - { - // Update - //---------------------------------------------------------------------------------- - // TODO: Update variables / Implement example logic at this point - //---------------------------------------------------------------------------------- - - // Draw - //---------------------------------------------------------------------------------- - BeginDrawing(); - - ClearBackground(RAYWHITE); - - // TODO: Draw everything that requires to be drawn at this point: - - DrawText("Congrats! You created your first window!", 190, 200, 20, LIGHTGRAY); // Example - - EndDrawing(); - //---------------------------------------------------------------------------------- - } - - // De-Initialization - //-------------------------------------------------------------------------------------- - - // TODO: Unload all loaded resources at this point - - CloseWindow(); // Close window and OpenGL context - //-------------------------------------------------------------------------------------- - - return 0; -} diff --git a/projects/VS2019-Android/raylib_android/raylib_android.NativeActivity/raylib_android.NativeActivity.vcxproj b/projects/VS2019-Android/raylib_android/raylib_android.NativeActivity/raylib_android.NativeActivity.vcxproj deleted file mode 100644 index 6b7b5a085..000000000 --- a/projects/VS2019-Android/raylib_android/raylib_android.NativeActivity/raylib_android.NativeActivity.vcxproj +++ /dev/null @@ -1,226 +0,0 @@ - - - - - Debug - ARM - - - Release - ARM - - - Debug - ARM64 - - - Release - ARM64 - - - Debug - x64 - - - Release - x64 - - - Debug - x86 - - - Release - x86 - - - - {bfb31759-4fca-4503-bc7c-a97f705efdb2} - Android - raylib_android - en-US - 14.0 - Android - 3.0 - - - - DynamicLibrary - true - Clang_5_0 - - - DynamicLibrary - false - Clang_5_0 - - - DynamicLibrary - true - Clang_5_0 - - - DynamicLibrary - false - Clang_5_0 - - - DynamicLibrary - true - Clang_5_0 - android-29 - - - DynamicLibrary - false - Clang_5_0 - - - DynamicLibrary - true - Clang_5_0 - - - DynamicLibrary - false - Clang_5_0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - libmain - - - - - - - - - - - NotUsing - pch.h - CompileAsC - c99 - Default - CompileAsC - - - %(LibraryDependencies);EGL;GLESv2;log;android;c;m;raylib - ../../../../src/;%(AdditionalLibraryDirectories) - - - - - NotUsing - pch.h - CompileAsC - c99 - Default - CompileAsC - - - %(LibraryDependencies);GLESv1_CM;EGL; - .;%(AdditionalLibraryDirectories) - - - - - Use - pch.h - CompileAsCpp - - - %(LibraryDependencies);GLESv1_CM;EGL; - - - - - Use - pch.h - CompileAsCpp - - - %(LibraryDependencies);GLESv1_CM;EGL; - - - - - Use - pch.h - CompileAsCpp - - - %(LibraryDependencies);GLESv1_CM;EGL; - - - - - Use - pch.h - CompileAsCpp - - - %(LibraryDependencies);GLESv1_CM;EGL; - - - - - Use - pch.h - CompileAsCpp - - - %(LibraryDependencies);GLESv1_CM;EGL; - - - - - Use - pch.h - CompileAsCpp - - - %(LibraryDependencies);GLESv1_CM;EGL; - - - - - - - - - - - - - \ No newline at end of file diff --git a/projects/VS2019-Android/raylib_android/raylib_android.NativeActivity/raylib_android.NativeActivity.vcxproj.filters b/projects/VS2019-Android/raylib_android/raylib_android.NativeActivity/raylib_android.NativeActivity.vcxproj.filters deleted file mode 100644 index e9a26e2dd..000000000 --- a/projects/VS2019-Android/raylib_android/raylib_android.NativeActivity/raylib_android.NativeActivity.vcxproj.filters +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/projects/VS2019-Android/raylib_android/raylib_android.NativeActivity/raylib_android.NativeActivity.vcxproj.user b/projects/VS2019-Android/raylib_android/raylib_android.NativeActivity/raylib_android.NativeActivity.vcxproj.user deleted file mode 100644 index 0f14913f3..000000000 --- a/projects/VS2019-Android/raylib_android/raylib_android.NativeActivity/raylib_android.NativeActivity.vcxproj.user +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/projects/VS2019-Android/raylib_android/raylib_android.Packaging/AndroidManifest.xml b/projects/VS2019-Android/raylib_android/raylib_android.Packaging/AndroidManifest.xml deleted file mode 100644 index 8d58d3756..000000000 --- a/projects/VS2019-Android/raylib_android/raylib_android.Packaging/AndroidManifest.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/projects/VS2019-Android/raylib_android/raylib_android.Packaging/build.xml b/projects/VS2019-Android/raylib_android/raylib_android.Packaging/build.xml deleted file mode 100644 index 4dd78480d..000000000 --- a/projects/VS2019-Android/raylib_android/raylib_android.Packaging/build.xml +++ /dev/null @@ -1,90 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/projects/VS2019-Android/raylib_android/raylib_android.Packaging/project.properties b/projects/VS2019-Android/raylib_android/raylib_android.Packaging/project.properties deleted file mode 100644 index 3c100376c..000000000 --- a/projects/VS2019-Android/raylib_android/raylib_android.Packaging/project.properties +++ /dev/null @@ -1,3 +0,0 @@ -# Project target -target=$(androidapilevel) -# Provide path to the directory where prebuilt external jar files are by setting jar.libs.dir= diff --git a/projects/VS2019-Android/raylib_android/raylib_android.Packaging/raylib_android.Packaging.androidproj b/projects/VS2019-Android/raylib_android/raylib_android.Packaging/raylib_android.Packaging.androidproj deleted file mode 100644 index 030d71747..000000000 --- a/projects/VS2019-Android/raylib_android/raylib_android.Packaging/raylib_android.Packaging.androidproj +++ /dev/null @@ -1,134 +0,0 @@ - - - - - Debug - ARM - - - Release - ARM - - - Debug - ARM64 - - - Release - ARM64 - - - Debug - x64 - - - Release - x64 - - - Debug - x86 - - - Release - x86 - - - - raylib_android - 14.0 - 1.0 - {b2231f0d-52da-4c55-8998-5886f766553c} - - - - true - Application - - - false - Application - - - true - Application - - - false - Application - - - true - Application - - - false - Application - - - true - Application - - - false - Application - - - - - - - - - $(RootNamespace) - - - - - $(RootNamespace) - - - - - $(RootNamespace) - - - - - $(RootNamespace) - - - - - $(RootNamespace) - - - - - $(RootNamespace) - - - - - $(RootNamespace) - - - - - $(RootNamespace) - - - - - - - - - - - {bfb31759-4fca-4503-bc7c-a97f705efdb2} - - - - - \ No newline at end of file diff --git a/projects/VS2019-Android/raylib_android/raylib_android.Packaging/res/values/strings.xml b/projects/VS2019-Android/raylib_android/raylib_android.Packaging/res/values/strings.xml deleted file mode 100644 index 98afc4675..000000000 --- a/projects/VS2019-Android/raylib_android/raylib_android.Packaging/res/values/strings.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - raylib_android.Packaging - diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 55428e882..bdf3207f3 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -107,6 +107,20 @@ endif () target_link_libraries(raylib PRIVATE $) target_link_libraries(raylib PUBLIC ${LIBS_PUBLIC}) +# Static libraries must export their private link dependencies for installed consumers. +# LINK_ONLY keeps those dependencies out of the compile interface. +if (NOT BUILD_SHARED_LIBS) + set(raylib_install_private_libs ${LIBS_PRIVATE}) + + if (NOT glfw3_FOUND) + list(REMOVE_ITEM raylib_install_private_libs glfw) + endif() + + foreach(lib IN LISTS raylib_install_private_libs) + target_link_libraries(raylib INTERFACE $>) + endforeach() +endif() + # Sets some compile time definitions for the pre-processor # If CUSTOMIZE_BUILD option is on you will not use config.h by default # and you will be able to select more build options diff --git a/src/config.h b/src/config.h index 97f5ba544..e77089b68 100644 --- a/src/config.h +++ b/src/config.h @@ -173,20 +173,22 @@ //#define RL_CULL_DISTANCE_FAR 4000.0 // Default projection matrix far cull distance // Default shader vertex attribute locations -//#define RL_DEFAULT_SHADER_ATTRIB_LOCATION_POSITION 0 -//#define RL_DEFAULT_SHADER_ATTRIB_LOCATION_TEXCOORD 1 -//#define RL_DEFAULT_SHADER_ATTRIB_LOCATION_NORMAL 2 -//#define RL_DEFAULT_SHADER_ATTRIB_LOCATION_COLOR 3 -//#define RL_DEFAULT_SHADER_ATTRIB_LOCATION_TANGENT 4 -//#define RL_DEFAULT_SHADER_ATTRIB_LOCATION_TEXCOORD2 5 -//#define RL_DEFAULT_SHADER_ATTRIB_LOCATION_INDICES 6 -//#define RL_DEFAULT_SHADER_ATTRIB_LOCATION_BONEINDICES 7 -//#define RL_DEFAULT_SHADER_ATTRIB_LOCATION_BONEWEIGHTS 8 +// NOTE: Locations can be redefined by user if required +//#define RL_DEFAULT_SHADER_ATTRIB_LOCATION_POSITION 0 +//#define RL_DEFAULT_SHADER_ATTRIB_LOCATION_TEXCOORD 1 +//#define RL_DEFAULT_SHADER_ATTRIB_LOCATION_NORMAL 2 +//#define RL_DEFAULT_SHADER_ATTRIB_LOCATION_COLOR 3 +//#define RL_DEFAULT_SHADER_ATTRIB_LOCATION_TANGENT 4 +//#define RL_DEFAULT_SHADER_ATTRIB_LOCATION_TEXCOORD2 5 +//#define RL_DEFAULT_SHADER_ATTRIB_LOCATION_INDICES 6 +//#define RL_DEFAULT_SHADER_ATTRIB_LOCATION_BONEINDICES 7 +//#define RL_DEFAULT_SHADER_ATTRIB_LOCATION_BONEWEIGHTS 8 //#define RL_DEFAULT_SHADER_ATTRIB_LOCATION_INSTANCETRANSFORM 9 // Default shader vertex attribute/uniform names to set location points // NOTE: When a new shader is loaded, locations are tried to be set for convenience, looking for the names defined here -// In case custom shader names are used, it's up to the user to set locations with GetShaderLocation*() functions +// WARNING: Location pre-defined names can not be changed, they are used by default shaders and all raylib examples shaders, they are just listed here for reference +// WARNING: In case custom shader names are used, it's up to the user to set locations with GetShaderLocation*() functions //#define RL_DEFAULT_SHADER_ATTRIB_NAME_POSITION "vertexPosition" // Bound by default to shader location: RL_DEFAULT_SHADER_ATTRIB_LOCATION_POSITION //#define RL_DEFAULT_SHADER_ATTRIB_NAME_TEXCOORD "vertexTexCoord" // Bound by default to shader location: RL_DEFAULT_SHADER_ATTRIB_LOCATION_TEXCOORD //#define RL_DEFAULT_SHADER_ATTRIB_NAME_NORMAL "vertexNormal" // Bound by default to shader location: RL_DEFAULT_SHADER_ATTRIB_LOCATION_NORMAL @@ -196,6 +198,7 @@ //#define RL_DEFAULT_SHADER_ATTRIB_NAME_BONEINDICES "vertexBoneIndices" // Bound by default to shader location: RL_DEFAULT_SHADER_ATTRIB_LOCATION_BONEINDICES //#define RL_DEFAULT_SHADER_ATTRIB_NAME_BONEWEIGHTS "vertexBoneWeights" // Bound by default to shader location: RL_DEFAULT_SHADER_ATTRIB_LOCATION_BONEWEIGHTS //#define RL_DEFAULT_SHADER_ATTRIB_NAME_INSTANCETRANSFORM "instanceTransform" // Bound by default to shader location: RL_DEFAULT_SHADER_ATTRIB_LOCATION_INSTANCETRANSFORM + //#define RL_DEFAULT_SHADER_UNIFORM_NAME_MVP "mvp" // model-view-projection matrix //#define RL_DEFAULT_SHADER_UNIFORM_NAME_VIEW "matView" // view matrix //#define RL_DEFAULT_SHADER_UNIFORM_NAME_PROJECTION "matProjection" // projection matrix @@ -203,6 +206,7 @@ //#define RL_DEFAULT_SHADER_UNIFORM_NAME_NORMAL "matNormal" // normal matrix (transpose(inverse(matModelView)) //#define RL_DEFAULT_SHADER_UNIFORM_NAME_COLOR "colDiffuse" // color diffuse (tint color, multiplied by texture color) //#define RL_DEFAULT_SHADER_UNIFORM_NAME_BONEMATRICES "boneMatrices" // bone matrices + //#define RL_DEFAULT_SHADER_SAMPLER2D_NAME_TEXTURE0 "texture0" // texture0 (texture slot active 0) //#define RL_DEFAULT_SHADER_SAMPLER2D_NAME_TEXTURE1 "texture1" // texture1 (texture slot active 1) //#define RL_DEFAULT_SHADER_SAMPLER2D_NAME_TEXTURE2 "texture2" // texture2 (texture slot active 2) @@ -240,6 +244,9 @@ #ifndef SUPPORT_FILEFORMAT_QOI #define SUPPORT_FILEFORMAT_QOI 1 #endif +#ifndef SUPPORT_FILEFORMAT_PEP + #define SUPPORT_FILEFORMAT_PEP 0 +#endif #ifndef SUPPORT_FILEFORMAT_PSD #define SUPPORT_FILEFORMAT_PSD 0 // Disabled by default #endif diff --git a/src/external/pep.h b/src/external/pep.h new file mode 100644 index 000000000..bc8a793b1 --- /dev/null +++ b/src/external/pep.h @@ -0,0 +1,1328 @@ +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// +// Prediction-Encoded Pixels (pep) +// +// author(s): +// ENDESGA - https://x.com/ENDESGA | https://bsky.app/profile/endesga.bsky.social +// +// contributer(s): +// Mariusz Dzikowski - https://github.com/demurzasty +// Akreson - https://github.com/Akreson +// Alepacho - https://github.com/Alepacho +// +// https://github.com/ENDESGA/pep +// 2026 - CC0 - FOSS forever +// + +// The .pep type is a pixel art format made to compress as small as possible. +// It uses a custom "Prediction by Partial Matching" compression method +// designed from the ground up for palettized pixel art. + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +#pragma region - DEPENDENCIES +// + +#pragma once + +#ifndef _GNU_SOURCE + #define _GNU_SOURCE +#endif + +#include // uint*_t +#include // mem-alloc +#include // FILE +#include // memset + +#pragma endregion dependencies + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +#pragma region - MACROS +// + +#define __PEP_STRINGIFY( VALUE ) #VALUE +#define _PEP_STRINGIFY( VALUE ) __PEP_STRINGIFY( VALUE ) + +//////////////////////////////////////////////////////////////// +#pragma region - memory + +// This defines a set of macros that serve as wrappers for the standard +// C library memory management functions: `malloc`, `realloc`, and `free`. +// These macros can be used to easily replace the underlying memory allocation +// implementation in a project, for example, with a custom allocator or a +// debug-enabled version, without modifying all call sites. +#ifndef PEP_MALLOC + #define PEP_MALLOC( size ) malloc( size ) + #define PEP_REALLOC( ptr, size ) realloc( ptr, size ) + #define PEP_FREE( ptr ) free( ptr ) +#endif + +#pragma endregion memory + +//////////////////////////////////////////////////////////////// +#pragma region - bits + +// Provides a cross-platform macro to count leading zeros in a 32-bit integer. +#ifndef PEP_COUNT_LEADING_ZEROS + #ifdef _MSC_VER + // Microsoft Visual C++ compiler. + #define PEP_COUNT_LEADING_ZEROS( x ) __lzcnt( x ) + #else + // GCC/Clang compilers. + #define PEP_COUNT_LEADING_ZEROS( x ) __builtin_clz( x ) + #endif +#endif + +// How many bits do we need to fit N values? +#define PEP_BITS_TO_FIT( N ) ( ( ( N ) <= 1 ) ? 1 : ( 32 - PEP_COUNT_LEADING_ZEROS( ( N ) - 1 ) ) ) + +#pragma endregion bits + +//////////////////////////////////////////////////////////////// +#pragma region - hash + +// Standard hash multipliers, there might be better ones: +#define _PEP_HASH_N 1540483477u // 0x5BD1E995 MurmurHash2 +#define _PEP_HASH_W 3332679571u // 0xC6A4A793 MurmurHash64A +#define _PEP_HASH_NW 3432918353u // 0xCC9E2D51 MurmurHash3 +#define _PEP_HASH_NE 2246822507u // 0x85EBCA6B MurmurHash3 +// Hash-prospector, avalanche-optimized, by Chris Wellons: +#define _PEP_HASH_NN 2146121005u // 0x7FEB352D lowbias32 +#define _PEP_HASH_WW 2890668881u // 0xAC4C1B51 triple32 round-2 +#define _PEP_HASH_NNW 830770091u // 0x31848BAB triple32 round-3 +#define _PEP_HASH_NNE 1935289751u // 0x735A2D97 prospector +#define _PEP_HASH_NWW 2943497623u // 0xAF723597 prospector + +#pragma endregion hash + +#pragma endregion macros + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +#pragma region - CONSTANTS +// + +#define PEP_NAME "pep" + +//////////////////////////////////////////////////////////////// +#pragma region - version + +#define PEP_VERSION_MAJOR 0 +#define PEP_VERSION_MINOR 6 +#define PEP_VERSION_PATCH 0 +#define PEP_VERSION _PEP_STRINGIFY( PEP_VERSION_MAJOR ) "." _PEP_STRINGIFY( PEP_VERSION_MINOR ) "." _PEP_STRINGIFY( PEP_VERSION_PATCH ) + +#pragma endregion version + +//////////////////////////////////////////////////////////////// +#pragma region - frequency + +// This is the amount of frequencies per context, and the amount of contexts, +// with [256] being the order0 context. +// Originally there were 256*256 contexts, but I found the image didn't get +// much bigger with the same amount of frequencies. Theoretically the more +// contexts you have the smaller the image is... +#define PEP_FREQ_N 257 +#define PEP_FREQ_END ( PEP_FREQ_N - 1 ) +#define PEP_CONTEXTS_MAX PEP_FREQ_END + +// PEP_FREQ_MAX is the maximum accumulative frequency. +// This is the starting maximum, and is scaled as the image compresses, via +// the palette-delta; which seems to roughly correlate with the complexity. +// This value works better for low-res images. +#define PEP_FREQ_MAX ( PEP_FREQ_END >> 1 ) + +#pragma endregion frequency + +//////////////////////////////////////////////////////////////// +#pragma region - arithmetic -coding + +// These constants are for the 63bit arithmetic-coding, specifically not 64bit +// because of overflow. +#define PEP_CODE_BITS 24lu +#define PEP_CODE_BITS_INV ( 32lu - PEP_CODE_BITS ) +#define PEP_FREQ_MAX_BITS 14lu +#define PEP_PROB_MAX_VALUE ( 1 << PEP_FREQ_MAX_BITS ) +#define PEP_CODE_MAX_VALUE ( ( 1 << PEP_CODE_BITS ) - 1 ) + +#pragma endregion arithmetic -coding + +#pragma endregion defaults + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +#pragma region - DECLARATIONS +// + +//////////////////////////////////////////////////////////////// +#pragma region - formats + +// .pep can automatically convert from RGBA to BGRA (little/big endian), +// which is often for low-level/backend rendering pipelines. +// Windows only supports ARGB for example, and so sometimes it's easier to +// make the whole application use that format. +typedef enum +{ + pep_rgba, + pep_bgra, + + pep_abgr, + pep_argb +} +pep_format; + +// Palette colors can be restricted in the serialization phase to a maximum +// amount of bits per channel. +// The default is 8 bits per channel (standard 32 bit colors). +// This is NOT bits-per-pixel and does NOT cap palette_size. +typedef enum +{ + pep_1bit, + pep_2bit, + pep_4bit, + pep_8bit +} +pep_channel_bits; + +#pragma endregion formats + +//////////////////////////////////////////////////////////////// +#pragma region - arithmetic -coding + +// During the compression process the context per frequency-group needs to be +// tracked, with the sum of all frequencies being stored. +typedef struct +{ + uint16_t freq[ PEP_FREQ_N ]; + uint32_t sum; +} +_pep_context; + +// Arithmetic coding structures: +typedef struct +{ + uint8_t* data_ref; + uint32_t low; + uint32_t range; +} +_pep_ac_encode; + +typedef struct +{ + uint8_t* data_ref; + uint8_t* end_of_data; + uint32_t low; + uint32_t range; + uint32_t code; +} +_pep_ac_decode; + +typedef struct +{ + uint32_t high; + uint32_t low; + uint32_t scale; +} +_pep_prob; + +typedef struct +{ + _pep_prob prob; + uint32_t symbol; +} +_pep_sym_decode; + +#pragma endregion arithmetic -coding + +//////////////////////////////////////////////////////////////// +#pragma region - pep + +// This is the main struct-type that contains values for using this format. +// +// `channel_bits` controls how many bits each R/G/B/A component of every +// palette entry is quantized to during serialization. It does NOT limit +// the number of palette entries (that's `palette_size`, up to 256). +// For example, pep_2bit means each channel has 4 possible values (0/85/170/255), +// so the palette can only draw from 4*4*4 = 64 distinct RGB colors. +typedef struct +{ + uint8_t* bytes; + uint64_t bytes_size; + uint16_t width; + uint16_t height; + pep_format format; + uint32_t palette[ 256 ]; + uint8_t palette_size; + pep_channel_bits channel_bits; + uint8_t model; +} +pep; + +#pragma endregion pep + +//////////////////////////////////////////////////////////////// +#pragma region - functions + +pep pep_compress( const uint32_t* in_pixels, const uint16_t width, const uint16_t height, const pep_format in_format, const pep_channel_bits in_channel_bits ); +uint32_t* pep_decompress( const pep* const in_pep, const pep_format out_format, const uint8_t first_color_transparent, uint8_t const pre_multiply ); +void pep_free( pep* in_pep ); +uint8_t* pep_serialize( const pep* in_pep, uint32_t* const out_size ); +pep pep_deserialize( const uint8_t* const in_bytes, const uint32_t in_bytes_size ); +uint8_t pep_save( const pep* const in_pep, const char* const file_path ); +pep pep_load( const char* const file_path ); + +#pragma endregion functions + +#pragma endregion declarations + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +#pragma region - DEFINITIONS +// + +#ifdef PEP_IMPLEMENTATION + +#pragma region - private / functions + +static _pep_prob _pep_get_prob_from_context( const _pep_context* const context, const uint32_t symbol ); +static void _pep_arith_encode( _pep_ac_encode* const ac, const _pep_prob prob ); +static void _pep_arith_encode_normalize( _pep_ac_encode* const ac ); +static uint32_t _pep_arith_decode_curr_freq( _pep_ac_decode* const ac, const uint32_t scale ); +static void _pep_arith_decode_update( _pep_ac_decode* const ac, const _pep_prob prob ); +static _pep_sym_decode _pep_get_sym_from_freq( const _pep_context* const context, const uint32_t target_freq ); +static uint32_t _pep_pre_multiply( const uint32_t pixel, const pep_format format ); +static uint32_t _pep_reformat( const uint32_t in_color, const pep_format in_format, const pep_format out_format ); + +#pragma endregion private / functions + +#ifdef _MSC_VER + // Intrin header is only needed for implementation. + #include // __lzcnt + + // Disable unsafe fopen usage warning on MSVC compiler. + #pragma warning( push ) + #pragma warning( disable : 4996 ) +#endif + +//////////////////////////////////////////////////////////////// +#pragma region - arithmetic + +//////////////////////////////// +#pragma region | encode + +// Getting cumulative frequnce of symbol +static _pep_prob _pep_get_prob_from_context( const _pep_context* const context, const uint32_t symbol ) +{ + _pep_prob prob = { 0 }; + prob.scale = context->sum; + + for( uint32_t index = 0; index < symbol; ++index ) + { + prob.low += context->freq[ index ]; + } + + prob.high = prob.low + context->freq[ symbol ]; + return prob; +} + +// This encodes a symbol into the arithmetic-coding range. It scales the +// current range based on the symbol's frequency and total frequency count. +static void _pep_arith_encode( _pep_ac_encode* const ac, const _pep_prob prob ) +{ + ac->range /= prob.scale; + ac->low += prob.low * ac->range; + ac->range *= prob.high - prob.low; +} + +// Adjusts the arithmetic-coding range by removing a boundary value +// Main goal of this process is to keep our range from getting +// too small. +static void _pep_arith_encode_normalize( _pep_ac_encode* const ac ) +{ + while( 1 ) + { + if( ( ac->low ^ ( ac->low + ac->range ) ) >= PEP_CODE_MAX_VALUE ) + { + if( ac->range >= PEP_PROB_MAX_VALUE ) break; + + ac->range = PEP_PROB_MAX_VALUE - ( ac->low & ( PEP_PROB_MAX_VALUE - 1 ) ); + } + + uint8_t byte = ac->low >> PEP_CODE_BITS; + ac->low <<= PEP_CODE_BITS_INV; + ac->range <<= PEP_CODE_BITS_INV; + *ac->data_ref++= byte; + } +} + +#pragma endregion encode + +//////////////////////////////// +#pragma region | decode + +// Getting current frequency by doing reverse trasformation +static uint32_t _pep_arith_decode_curr_freq( _pep_ac_decode* const ac, const uint32_t scale ) +{ + ac->range /= scale; + uint32_t result = ( ac->code - ac->low ) / ( ac->range ); + return result; +} + +// Same as with the encode_normalize, only on decode we reading in value +static void _pep_arith_decode_update( _pep_ac_decode* const ac, const _pep_prob prob ) +{ + ac->low += ac->range * prob.low; + ac->range *= prob.high - prob.low; + + while( 1 ) + { + if( ( ac->low ^ ( ac->low + ac->range ) ) >= PEP_CODE_MAX_VALUE ) + { + if( ac->range < PEP_PROB_MAX_VALUE ) + { + ac->range = PEP_PROB_MAX_VALUE - ( ac->low & ( PEP_PROB_MAX_VALUE - 1 ) ); + } + else break; + } + + uint8_t in_byte = 0; + if( ac->data_ref != ac->end_of_data ) + { + in_byte = *ac->data_ref++; + } + + ac->code = ( ac->code << 8 ) | in_byte; + ac->range <<= 8; + ac->low <<= 8; + } +} + +static _pep_sym_decode _pep_get_sym_from_freq( const _pep_context* const context, const uint32_t target_freq ) +{ + _pep_sym_decode result = { 0 }; + + uint32_t s = 0; + uint32_t freq = 0; + for( ; s <= PEP_FREQ_END; ++s ) + { + freq += context->freq[ s ]; + if( freq > target_freq ) break; + } + if( s > PEP_FREQ_END ) s = PEP_FREQ_END; + + result.prob.high = freq; + result.prob.low = freq - context->freq[ s ]; + result.prob.scale = context->sum; + result.symbol = s; + + return result; +} + +#pragma endregion decode + +#pragma endregion arithmetic + +//////////////////////////////////////////////////////////////// +#pragma region - compression + +//////////////////////////////// +#pragma region | compression / hidden + +// pep supports pre-multiplying the RGB channels with the A channel. +static uint32_t _pep_pre_multiply( const uint32_t pixel, const pep_format format ) +{ + uint8_t* bytes = ( uint8_t* )( &pixel ); + + if( format <= pep_bgra ) + { + uint32_t scaled_a = ( uint32_t )( bytes[ 3 ] ) * 257; + bytes[ 1 ] = ( uint8_t )( ( ( uint32_t )( bytes[ 1 ] ) * scaled_a + 32896 ) >> 16 ); + bytes[ 2 ] = ( uint8_t )( ( ( uint32_t )( bytes[ 2 ] ) * scaled_a + 32896 ) >> 16 ); + bytes[ 3 ] = ( uint8_t )( ( ( uint32_t )( bytes[ 3 ] ) * scaled_a + 32896 ) >> 16 ); + } + else + { + uint32_t scaled_a = ( uint32_t )( bytes[ 0 ] ) * 257; + bytes[ 0 ] = ( uint8_t )( ( ( uint32_t )( bytes[ 0 ] ) * scaled_a + 32896 ) >> 16 ); + bytes[ 1 ] = ( uint8_t )( ( ( uint32_t )( bytes[ 1 ] ) * scaled_a + 32896 ) >> 16 ); + bytes[ 2 ] = ( uint8_t )( ( ( uint32_t )( bytes[ 2 ] ) * scaled_a + 32896 ) >> 16 ); + } + + return pixel; +} + +// pep supports "dynamic formats", where you can specify what the in-bytes are, +// and reformat to a different channel-order. +// This means two "identical" pep files can have different formats, but you +// can choose how to reformat it when it decompresses! +static uint32_t _pep_reformat( const uint32_t in_color, const pep_format in_format, const pep_format out_format ) +{ + if( in_format == out_format ) return in_color; + + if( in_format <= pep_bgra && out_format <= pep_bgra ) + { // RGBA <-> BGRA: swap R and B + return( in_color & 0xff00ff00 ) | ( ( in_color & 0x000000ff ) << 16 ) | ( ( in_color & 0x00ff0000 ) >> 16 ); + } + else if( in_format >= pep_abgr && out_format >= pep_abgr ) + { // ABGR <-> ARGB: swap R and B + return( in_color & 0x00ff00ff ) | ( ( in_color & 0x0000ff00 ) << 16 ) | ( ( in_color & 0xff000000 ) >> 16 ); + } + else if( ( in_format ^ out_format ) == 2 ) + { // Alpha flip: RGBA <-> ARGB or BGRA <-> ABGR + return( ( in_color & 0x000000ff ) << 24 ) | ( ( in_color & 0x0000ff00 ) << 8 ) | ( ( in_color & 0x00ff0000 ) >> 8 ) | ( ( in_color & 0xff000000 ) >> 24 ); + } + else if( in_format < out_format ) + { // Flip: RGBA/BGRA -> ABGR/ARGB + return( ( in_color & 0xff000000 ) >> 24 ) | ( ( in_color & 0x00ffffff ) << 8 ); + } + else + { // Flip: ABGR/ARGB -> RGBA/BGRA + return( ( in_color & 0x000000ff ) << 24 ) | ( ( in_color & 0xffffff00 ) >> 8 ); + } +} + +// Update the frequency table after encoding/decoding a symbol. +// This increments the symbol's frequency and the total sum. +// When we hit freq_max, we increase the freq_max via a complexity +// approximation via the palette-size, then we scale everything down +// to a quarter to keep the frequencies manageable. +// This dynamic part helps the compression adapt to the image's patterns. +#define _PEP_UPDATE( CONTEXT, SYMBOL, FREQ_MAX, PALETTE_SIZE )\ + do\ + {\ + CONTEXT->freq[ SYMBOL ] += 2;\ + CONTEXT->sum += 2;\ + if( CONTEXT->freq[ SYMBOL ] >= FREQ_MAX || CONTEXT->sum >= PEP_PROB_MAX_VALUE )\ + {\ + FREQ_MAX += ( PEP_FREQ_END - PALETTE_SIZE ) >> 1;\ + CONTEXT->sum = 0;\ + for( uint64_t f = 0; f < PEP_FREQ_N; f++ )\ + {\ + const uint16_t _f = CONTEXT->freq[ f ];\ + if( _f == 0 ) continue;\ + const uint16_t scaled = ( _f + 1 ) >> 1;\ + CONTEXT->freq[ f ] = scaled;\ + CONTEXT->sum += scaled;\ + }\ + }\ + }\ + while( 0 ) + +#pragma endregion hidden + +//////////////////////////////// +#pragma region | compression / visible + +#define PEP_HASH_BIT_CONTEXT ( 1u << 16 ) + +enum +{ + _PEP_TAP_HASH, + _PEP_TAP_NW, + _PEP_TAP_W +}; + +// Different context models perform differently depending on the pixel data. +// From lots of testing it seems these 3 structures give the best results +// across the 3 major types of pixel art. +// Pep will sacrifice some time to ensure the file is as small as possible +// by testing all 3 of these without assumptions. +static const int8_t _pep_models[] = + { + _PEP_TAP_HASH, // typically for ~2 colors + _PEP_TAP_NW, // typically for ~4-8 colors + _PEP_TAP_W // typically for >=64 colors + }; +#define PEP_NUM_MODELS ( ( uint8_t )( sizeof( _pep_models ) / sizeof( _pep_models[ 0 ] ) ) ) + +typedef struct +{ + _pep_context* contexts; + uint32_t index_end; + uint32_t index_escape; + int8_t kind; +} +_pep_model_context; + +// Allocate only the context regions a given model uses, then seed order-0. +static uint8_t _pep_model_init( _pep_model_context* m, int8_t kind, uint32_t pcount ) +{ + memset( m, 0, sizeof( *m ) ); + m->kind = kind; + m->index_escape = pcount; + m->index_end = pcount + 1; + + // order0 starts at offset 0, followed by the specific context level + uint32_t off = 1; + switch( kind ) + { + case _PEP_TAP_HASH: + { + off += PEP_HASH_BIT_CONTEXT; + break; + } + case _PEP_TAP_NW: + { + off += m->index_end * m->index_end; + break; + } + case _PEP_TAP_W: + { + off += m->index_end; + break; + } + } + + m->contexts = ( _pep_context* )calloc( off, sizeof( _pep_context ) ); + if( !m->contexts ) return 0; + + _pep_context* order0 = &m->contexts[ 0 ]; + for( uint32_t index = 0; index < pcount; index++ ) order0->freq[ index ] = 1; + order0->sum = pcount; + return 1; +} + +static void _pep_model_free( _pep_model_context* m ) +{ + if( m->contexts ) + { + free( m->contexts ); + m->contexts = NULL; + } +} + +// Resolve the context pointer for the specific level of this pixel. +static _pep_context* _pep_build_level( const _pep_model_context* m, const uint8_t* idx, uint32_t pos, uint32_t x, uint32_t y, uint16_t width ) +{ + // It's only possible to tap previous values: + /* + - NNW NN NNE + NWW NW N NE + WW W [x] + */ + // The 10th NNWW tap has dimishing returns + + const uint32_t SENT = m->index_escape; + const uint32_t index_end = m->index_end; + const uint32_t Wv = ( x > 0 ) ? idx[ pos - 1 ] : SENT; + const uint32_t Nv = ( y > 0 ) ? idx[ pos - width ] : SENT; + + switch( m->kind ) + { + case _PEP_TAP_HASH: + { + const uint32_t NWv = ( x > 0 && y > 0 ) ? idx[ pos - width - 1 ] : SENT; + const uint32_t NNv = ( y > 1 ) ? idx[ pos - 2 * width ] : SENT; + const uint32_t WWv = ( x > 1 ) ? idx[ pos - 2 ] : SENT; + const uint32_t NEv = ( ( x + 1 ) < width && y > 0 ) ? idx[ pos - width + 1 ] : SENT; + const uint32_t NNWv = ( y > 1 && x > 0 ) ? idx[ pos - 2 * width - 1 ] : SENT; + const uint32_t NNEv = ( y > 1 && ( x + 1 ) < width ) ? idx[ pos - 2 * width + 1 ] : SENT; + const uint32_t NWWv = ( x > 1 && y > 0 ) ? idx[ pos - width - 2 ] : SENT; + + uint32_t h = Nv * _PEP_HASH_N + Wv * _PEP_HASH_W + NWv * _PEP_HASH_NW + NEv * _PEP_HASH_NE + NNv * _PEP_HASH_NN + WWv * _PEP_HASH_WW + NNWv * _PEP_HASH_NNW + NNEv * _PEP_HASH_NNE + NWWv * _PEP_HASH_NWW; + h ^= h >> 15; + return &m->contexts[ 1 + ( h & ( PEP_HASH_BIT_CONTEXT - 1 ) ) ]; + } + case _PEP_TAP_NW: + { + return &m->contexts[ 1 + Nv * index_end + Wv ]; + } + case _PEP_TAP_W: + { + return &m->contexts[ 1 + Wv ]; + } + } + return NULL; +} + +// Encode all pixels with one model and return the size of the byte stream. +static uint64_t _pep_encode_model( const uint8_t* idx, uint16_t width, uint16_t height, uint32_t pcount, uint8_t model, uint8_t* out ) +{ + _pep_model_context m; + if( !_pep_model_init( &m, _pep_models[ model ], pcount ) ) return 0; + const uint32_t index_escape = m.index_escape; + + _pep_ac_encode ac = { 0 }; + ac.range = ( uint32_t )( ( 1llu << 32 ) - 1 ); + ac.data_ref = out; + uint16_t freq_max = PEP_FREQ_MAX; + _pep_context* order0 = &m.contexts[ 0 ]; + + uint32_t pos = 0; + for( uint32_t y = 0; y < height; y++ ) + { + for( uint32_t x = 0; x < width; x++, pos++ ) + { + const uint32_t symbol = idx[ pos ]; + _pep_context* context = _pep_build_level( &m, idx, pos, x, y, width ); + uint8_t encoded_in_level = 0; + + if( context->sum != 0 ) + { + if( context->freq[ symbol ] != 0 ) + { + _pep_prob prob = _pep_get_prob_from_context( context, symbol ); + _pep_arith_encode( &ac, prob ); + _pep_arith_encode_normalize( &ac ); + _PEP_UPDATE( context, symbol, freq_max, pcount ); + encoded_in_level = 1; + } + else + { + _pep_prob prob = _pep_get_prob_from_context( context, index_escape ); + _pep_arith_encode( &ac, prob ); + _pep_arith_encode_normalize( &ac ); + context->freq[ index_escape ] += 1; + context->sum += 1; + } + } + + if( !encoded_in_level ) + { + _pep_prob prob = _pep_get_prob_from_context( order0, symbol ); + _pep_arith_encode( &ac, prob ); + _pep_arith_encode_normalize( &ac ); + _PEP_UPDATE( order0, symbol, freq_max, pcount ); + + if( context->sum == 0 ) + { + context->freq[ index_escape ] = 1; + context->sum = 1; + } + context->freq[ symbol ] = 1; + context->sum += 1; + } + } + } + + for( uint8_t index = 0; index < 4; index++ ) + { + uint8_t byte = ac.low >> PEP_CODE_BITS; + ac.low <<= PEP_CODE_BITS_INV; + *ac.data_ref++= byte; + } + + uint64_t size = ( uint64_t ) ( ac.data_ref - out ); + _pep_model_free( &m ); + return size; +} + +// The format of the in_pixels has to be the same as in_format. +// out_format is the one applied to the newly compressed pep + +// Compresses raw pixels into a pep, trying each context model and keeping the +// smallest result (the winning model index is stored in out.model). +pep pep_compress( const uint32_t* in_pixels, const uint16_t width, const uint16_t height, const pep_format in_format, const pep_channel_bits in_channel_bits ) +{ + pep out_pep = { 0 }; + uint32_t area = ( uint32_t )width * height; + if( in_pixels == NULL || area == 0 ) return out_pep; + + out_pep.width = width; + out_pep.height = height; + out_pep.format = in_format; + out_pep.channel_bits = in_channel_bits; + + uint8_t* idx = ( uint8_t* )PEP_MALLOC( area ); + + uint32_t palette[ 256 ]; + uint16_t count = 0; // 1-256 distinct colours + const uint32_t* p = in_pixels; + const uint32_t* p_end = p + area; + uint32_t last_p = 0, + this_p = 0; + while( p < p_end ) + { + this_p = *p; + if( p > in_pixels && this_p == last_p ) + { + p++; + continue; + } + uint16_t n = 0; + while( n < count && this_p != palette[ n ] ) n++; + if( n >= count && count < 256 ) palette[ count++ ] = this_p; + last_p = this_p; + p++; + } + memcpy( out_pep.palette, palette, ( size_t ) count * sizeof( uint32_t ) ); + out_pep.palette_size = ( uint8_t )count; + for( uint32_t index = 0; index < area; index++ ) + { + uint32_t c = in_pixels[ index ]; + uint16_t k = 0; + while( k < count && palette[ k ] != c ) k++; + idx[ index ] = ( uint8_t )( k < count ? k : 0 ); + } + const uint32_t pcount = out_pep.palette_size ? out_pep.palette_size : 256; + + uint8_t* best = ( uint8_t* )PEP_MALLOC( ( size_t ) area * sizeof( uint32_t ) + 64 ); + uint8_t* tmp = ( uint8_t* )PEP_MALLOC( ( size_t ) area * sizeof( uint32_t ) + 64 ); + uint64_t best_size = 0; + uint8_t best_model = 0; + + for( uint8_t model = 0; model < PEP_NUM_MODELS; model++ ) + { + uint64_t size = _pep_encode_model( idx, width, height, pcount, model, tmp ); + if( size == 0 ) continue; + + if( best_size == 0 || size < best_size ) + { + best_size = size; + best_model = model; + memcpy( best, tmp, size ); + } + } + + out_pep.bytes = ( uint8_t* )PEP_REALLOC( best, best_size ); + out_pep.bytes_size = best_size; + out_pep.model = ( uint8_t )best_model; + + PEP_FREE( tmp ); + PEP_FREE( idx ); + return out_pep; +} + +// Decode all pixels with one model (mirror of _pep_encode_model). +static void _pep_decode_model( const uint8_t* in_bytes, uint64_t in_size, uint16_t width, uint16_t height, uint32_t pcount, uint8_t model, const uint32_t* palette, pep_format in_format, pep_format out_format, uint8_t pre_multiply, uint8_t* idx, uint32_t* out_pixels ) +{ + _pep_model_context m; + if( !_pep_model_init( &m, _pep_models[ model ], pcount ) ) return; + const uint32_t index_escape = m.index_escape; + + _pep_ac_decode ac = { 0 }; + ac.range = ( uint32_t )( ( 1llu << 32 ) - 1 ); + ac.data_ref = ( uint8_t* )in_bytes; + ac.end_of_data = ( uint8_t* )in_bytes + in_size; + for( uint8_t index = 0; index < 4; ++index ) + { + uint8_t b = 0; + if( ac.data_ref != ac.end_of_data ) b = *ac.data_ref++; + ac.code = ( ac.code << 8 ) | b; + } + + uint16_t freq_max = PEP_FREQ_MAX; + _pep_context* order0 = &m.contexts[ 0 ]; + uint32_t pos = 0; + + for( uint32_t y = 0; y < height; y++ ) + { + for( uint32_t x = 0; x < width; x++, pos++ ) + { + _pep_context* context = _pep_build_level( &m, idx, pos, x, y, width ); + uint32_t symbol = 0; + uint8_t decoded_in_level = 0; + + if( context->sum != 0 ) + { + uint32_t f = _pep_arith_decode_curr_freq( &ac, context->sum ); + _pep_sym_decode r = _pep_get_sym_from_freq( context, f ); + _pep_arith_decode_update( &ac, r.prob ); + + if( r.symbol != index_escape ) + { + symbol = r.symbol; + _PEP_UPDATE( context, symbol, freq_max, pcount ); + decoded_in_level = 1; + } + else + { + context->freq[ index_escape ] += 1; + context->sum += 1; + } + } + + if( !decoded_in_level ) + { + uint32_t f = _pep_arith_decode_curr_freq( &ac, order0->sum ); + _pep_sym_decode r = _pep_get_sym_from_freq( order0, f ); + _pep_arith_decode_update( &ac, r.prob ); + symbol = r.symbol; + _PEP_UPDATE( order0, symbol, freq_max, pcount ); + + if( context->sum == 0 ) + { + context->freq[ index_escape ] = 1; + context->sum = 1; + } + context->freq[ symbol ] = 1; + context->sum += 1; + } + + idx[ pos ] = ( uint8_t )symbol; + uint32_t pixel = ( symbol < pcount ) ? _pep_reformat( palette[ symbol ], in_format, out_format ) : 0; + if( pre_multiply != 0 ) pixel = _pep_pre_multiply( pixel, out_format ); + out_pixels[ pos ] = pixel; + } + } + _pep_model_free( &m ); +} + +uint32_t* pep_decompress( const pep* const in_pep, const pep_format out_format, const uint8_t transparent_first_color, uint8_t const pre_multiply ) +{ + if( in_pep == NULL ) return NULL; + if( in_pep->bytes == NULL || in_pep->bytes_size == 0 || in_pep->width == 0 || in_pep->height == 0 ) return NULL; + + const uint16_t width = in_pep->width, + height = in_pep->height; + const uint32_t area = ( uint32_t )width * height; + uint32_t* out_pixels = ( uint32_t* )PEP_MALLOC( area * sizeof( uint32_t ) ); + uint8_t* idx = ( uint8_t* )PEP_MALLOC( area ); + + const uint32_t pcount = in_pep->palette_size ? in_pep->palette_size : 256; + static uint32_t palette[ 256 ]; + memcpy( palette, in_pep->palette, pcount * sizeof( uint32_t ) ); + if( transparent_first_color != 0 ) + { + if( in_pep->format <= pep_bgra ) palette[ 0 ] &= 0x00ffffff; + else palette[ 0 ] &= 0xffffff00; + } + + uint8_t model = in_pep->model; + if( model >= PEP_NUM_MODELS ) model = 0; + + _pep_decode_model( in_pep->bytes, in_pep->bytes_size, width, height, pcount, model, palette, in_pep->format, out_format, pre_multiply, idx, out_pixels ); + + PEP_FREE( idx ); + return out_pixels; +} + +void pep_free( pep* in_pep ) +{ + if( in_pep && in_pep->bytes ) + { + free( in_pep->bytes ); + in_pep->bytes = NULL; + in_pep->bytes_size = 0; + } +} + +#pragma endregion visible + +#pragma endregion compression + +//////////////////////////////////////////////////////////////// +#pragma region - serialization + +uint8_t* pep_serialize( const pep* in_pep, uint32_t* const out_size ) +{ + if( !in_pep || !in_pep->width || !in_pep->height || !in_pep->bytes_size || !in_pep->bytes ) + { + *out_size = 0; + return NULL; + } + + uint16_t palette_count = in_pep->palette_size ? in_pep->palette_size : 256; + + const uint16_t w = in_pep->width - 1; + const uint16_t h = in_pep->height - 1; + const uint8_t is_small = ( w <= 255 && h <= 255 ) ? 1 : 0; + const uint8_t dim_bytes = is_small ? 2 : 3; + + // calculate variable-length size bytes + uint8_t size_bytes = 0; + uint32_t temp_size = in_pep->bytes_size; + while( temp_size >= 0x80 ) + { + size_bytes++; + temp_size >>= 7; + } + ++size_bytes; + + // check if bitmap (black and white) + uint8_t is_bitmap = 0; + if( palette_count == 2 ) + { + const uint8_t* const color0 = ( uint8_t* )( &in_pep->palette[ 0 ] ); + const uint8_t* const color1 = ( uint8_t* )( &in_pep->palette[ 1 ] ); + + const uint8_t is_white0 = ( color0[ 0 ] == 255 && color0[ 1 ] == 255 && color0[ 2 ] == 255 && color0[ 3 ] == 255 ); + const uint8_t is_white1 = ( color1[ 0 ] == 255 && color1[ 1 ] == 255 && color1[ 2 ] == 255 && color1[ 3 ] == 255 ); + + if( in_pep->format <= pep_bgra ) + { + is_bitmap = ( ( is_white0 && color1[ 0 ] == 0 && color1[ 1 ] == 0 && color1[ 2 ] == 0 && color1[ 3 ] == 255 ) || ( color0[ 0 ] == 0 && color0[ 1 ] == 0 && color0[ 2 ] == 0 && color0[ 3 ] == 255 && is_white1 ) ); + } + else + { + is_bitmap = ( ( is_white0 && color1[ 0 ] == 255 && color1[ 1 ] == 0 && color1[ 2 ] == 0 && color1[ 3 ] == 0 ) || ( color0[ 0 ] == 255 && color0[ 1 ] == 0 && color0[ 2 ] == 0 && color0[ 3 ] == 0 && is_white1 ) ); + } + } + + // check if all palette alphas are 255 + uint8_t only_rgb = 1; + if( !is_bitmap ) + { + for( uint16_t index = 0; index < palette_count; index++ ) + { + if( ( ( ( uint8_t* )( &in_pep->palette[ index ] ) )[ 3 ] ) != 0xff ) + { + only_rgb = 0; + break; + } + } + } + + // calculate palette bytes + uint16_t palette_bytes = 0; + if( !is_bitmap ) + { + const uint16_t channel_bits = 1 << in_pep->channel_bits; + if( channel_bits == 8 ) + { + palette_bytes = palette_count * ( only_rgb ? 3 : 4 ); + } + else + { + const uint16_t channels = only_rgb ? 3 : 4; + palette_bytes = ( channel_bits * channels * palette_count + 7 ) >> 3; + } + } + + // allocate the exact size (subtract 1 for palette_size byte if bitmap) + const uint64_t total_size = dim_bytes + size_bytes + ( is_bitmap ? 0 : 1 ) + palette_bytes + in_pep->bytes_size + 4 + 1; + uint8_t* out_bytes = ( uint8_t* )PEP_MALLOC( total_size ); + uint8_t* out_bytes_ref = out_bytes; + + // flags: format (2), channel_bits (2), is_small (1), only_rgb (1), is_bitmap (1) + *out_bytes_ref++= ( in_pep->format & 0x3 ) | ( ( in_pep->channel_bits & 0x3 ) << 2 ) | ( ( is_small & 0x1 ) << 4 ) | ( ( only_rgb & 0x1 ) << 5 ) | ( ( is_bitmap & 0x1 ) << 6 ); + *out_bytes_ref++= in_pep->model; // takes the last extra byte + + // width/height + if( is_small ) + { + *out_bytes_ref++= w & 0xff; + *out_bytes_ref++= h & 0xff; + } + else + { + const uint32_t packed_dims = ( ( w & 0xfff ) << 12 ) | ( h & 0xfff ); + *out_bytes_ref++= ( packed_dims >> 16 ) & 0xff; + *out_bytes_ref++= ( packed_dims >> 8 ) & 0xff; + *out_bytes_ref++= packed_dims & 0xff; + } + + // variable-length size + uint32_t size = in_pep->bytes_size; + while( size >= 0x80 ) + { + *out_bytes_ref++= ( size | 0x80 ) & 0xff; + size >>= 7; + } + *out_bytes_ref++= size; + + if( !is_bitmap ) + { + // palette size + *out_bytes_ref++= in_pep->palette_size; + + // palette + const uint16_t channel_bits = 1 << in_pep->channel_bits; + const uint8_t shift = 8 - channel_bits; + const uint8_t mask = ( 1 << channel_bits ) - 1; + + if( channel_bits == 8 ) + { + for( uint16_t index = 0; index < palette_count; index++ ) + { + uint8_t* color = ( uint8_t* )( &( in_pep->palette[ index ] ) ); + *out_bytes_ref++= color[ 0 ]; + *out_bytes_ref++= color[ 1 ]; + *out_bytes_ref++= color[ 2 ]; + if( !only_rgb ) *out_bytes_ref++= color[ 3 ]; + } + } + else + { + uint32_t bit_buffer = 0; + uint8_t bit_count = 0; + + for( uint16_t index = 0; index < palette_count; index++ ) + { + uint8_t* color = ( uint8_t* )( &( in_pep->palette[ index ] ) ); + + bit_buffer = ( bit_buffer << channel_bits ) | ( ( color[ 0 ] >> shift ) &mask ); + bit_buffer = ( bit_buffer << channel_bits ) | ( ( color[ 1 ] >> shift ) &mask ); + bit_buffer = ( bit_buffer << channel_bits ) | ( ( color[ 2 ] >> shift ) &mask ); + bit_count += channel_bits * 3; + + if( !only_rgb ) + { + bit_buffer = ( bit_buffer << channel_bits ) | ( ( color[ 3 ] >> shift ) &mask ); + bit_count += channel_bits; + } + + while( bit_count >= 8 ) + { + bit_count -= 8; + *out_bytes_ref++= ( bit_buffer >> bit_count ) & 0xff; + } + } + + if( bit_count > 0 ) + { + *out_bytes_ref++= ( bit_buffer << ( 8 - bit_count ) ) & 0xff; + } + } + } + + memcpy( out_bytes_ref, in_pep->bytes, in_pep->bytes_size ); + out_bytes_ref += in_pep->bytes_size; + *out_bytes_ref = '\0'; + + *out_size = out_bytes_ref - out_bytes; + return out_bytes; +} + +pep pep_deserialize( const uint8_t* const in_bytes, const uint32_t in_bytes_size ) +{ + pep out_pep = { 0 }; + + if( !in_bytes || in_bytes_size == 0 ) return out_pep; + + const uint8_t* bytes_ref = in_bytes; + const uint8_t* const bytes_end = in_bytes + in_bytes_size; + + // packed flags + if( bytes_ref + 1 > bytes_end ) return out_pep; + uint8_t packed_flags = *bytes_ref++; + if( bytes_ref + 1 > bytes_end ) return out_pep; + out_pep.model = *bytes_ref++; + out_pep.format = ( pep_format ) ( packed_flags & 0x3 ); + out_pep.channel_bits = ( pep_channel_bits ) ( ( packed_flags >> 2 ) & 0x3 ); + uint8_t is_small = ( packed_flags >> 4 ) & 0x1; + uint8_t only_rgb = ( packed_flags >> 5 ) & 0x1; + uint8_t is_bitmap = ( packed_flags >> 6 ) & 0x1; + + // width/height + uint8_t dim_bytes = is_small ? 2 : 3; + if( bytes_ref + dim_bytes > bytes_end ) return out_pep; + uint16_t w, + h; + if( is_small ) + { + w = *bytes_ref++; + h = *bytes_ref++; + } + else + { + uint32_t packed_dims = ( *bytes_ref++ << 16 ); + packed_dims |= ( *bytes_ref++ << 8 ); + packed_dims |= *bytes_ref++; + w = ( packed_dims >> 12 ) & 0xfff; + h = packed_dims & 0xfff; + } + out_pep.width = w + 1; + out_pep.height = h + 1; + + // variable-length size + uint32_t bytes_size = 0; + uint8_t shift = 0; + uint8_t byte_val; + do + { + if( bytes_ref >= bytes_end ) return out_pep; + byte_val = *bytes_ref++; + if( shift < 32 ) bytes_size |= ( ( uint32_t )( byte_val &0x7f ) ) << shift; + shift += 7; + } + while( ( byte_val & 0x80 ) && shift < 35 ); + out_pep.bytes_size = bytes_size; + + // handle bitmap or read palette + uint32_t remaining = ( uint32_t )( bytes_end - bytes_ref ); + + if( is_bitmap ) + { + if( remaining < bytes_size ) return out_pep; + + out_pep.palette_size = 2; + out_pep.palette[ 0 ] = out_pep.format <= pep_bgra ? 0xff000000 : 0x000000ff; + out_pep.palette[ 1 ] = 0xffffffff; + } + else + { + // palette size + if( remaining < 1 ) return out_pep; + out_pep.palette_size = *bytes_ref++; + remaining--; + + uint16_t palette_count = out_pep.palette_size ? out_pep.palette_size : 256; + + // palette + const uint8_t channel_bits = 1 << out_pep.channel_bits; + const uint8_t mask = ( 1 << channel_bits ) - 1; + uint32_t palette_bytes; + if( channel_bits == 8 ) + { + palette_bytes = palette_count * ( only_rgb ? 3 : 4 ); + } + else + { + uint16_t channels = only_rgb ? 3 : 4; + palette_bytes = ( channel_bits * channels * palette_count + 7 ) >> 3; + } + + if( remaining < palette_bytes || remaining - palette_bytes < bytes_size ) return out_pep; + + if( channel_bits == 8 ) + { + for( uint16_t index = 0; index < palette_count; index++ ) + { + uint8_t* color = ( uint8_t* )( &( out_pep.palette[ index ] ) ); + color[ 0 ] = *bytes_ref++; + color[ 1 ] = *bytes_ref++; + color[ 2 ] = *bytes_ref++; + color[ 3 ] = only_rgb ? 0xff : *bytes_ref++; + } + } + else + { + uint32_t bit_buffer = 0; + uint8_t bit_count = 0; + + for( uint16_t index = 0; index < palette_count; index++ ) + { + uint8_t channels = only_rgb ? 3 : 4; + uint8_t channel_values[ 4 ]; + + for( uint8_t c = 0; c < channels; c++ ) + { + while( bit_count < channel_bits ) + { + bit_buffer = ( bit_buffer << 8 ) | *bytes_ref++; + bit_count += 8; + } + bit_count -= channel_bits; + channel_values[ c ] = ( bit_buffer >> bit_count ) & mask; + + uint8_t scaled = channel_values[ c ] << ( 8 - channel_bits ); + if( channel_bits < 8 ) + { + scaled |= ( scaled >> channel_bits ); + if( channel_bits < 4 ) + { + scaled |= ( scaled >> ( 2 * channel_bits ) ); + } + } + channel_values[ c ] = scaled; + } + + uint8_t* color = ( uint8_t* )( &( out_pep.palette[ index ] ) ); + color[ 0 ] = channel_values[ 0 ]; + color[ 1 ] = channel_values[ 1 ]; + color[ 2 ] = channel_values[ 2 ]; + color[ 3 ] = only_rgb ? 0xff : channel_values[ 3 ]; + } + } + } + + // copy image data + out_pep.bytes = ( uint8_t* )PEP_MALLOC( bytes_size ); + if( out_pep.bytes ) + { + memcpy( out_pep.bytes, bytes_ref, bytes_size ); + } + + return out_pep; +} + +#pragma endregion serialization + +//////////////////////////////////////////////////////////////// +#pragma region - file + +// For both save/load, file_path should end in ".pep": +// e.g. "texture.pep", "assets/image.pep" + +// Saves pep into a file. +// Returns 0 on failure, 1 on success +uint8_t pep_save( const pep* const in_pep, const char* const file_path ) +{ + if( !in_pep || !file_path ) + { + return 0; + } + + uint32_t bytes_size = 0; + uint8_t* bytes = pep_serialize( in_pep, &bytes_size ); + + if( !bytes || bytes_size == 0 ) + { + return 0; + } + + FILE * file = fopen( file_path, "wb" ); + if( !file ) + { + PEP_FREE( bytes ); + return 0; + } + + size_t written = fwrite( bytes, 1, bytes_size, file ); + + fclose( file ); + PEP_FREE( bytes ); + + #ifdef PEP_DEBUG + printf( "pep: %lld\nfile: %zu\nmodel: %d\n", in_pep->bytes_size, written, in_pep->model ); + #endif + + return written == bytes_size; +} + +// Loads .pep file into returned pep struct +pep pep_load( const char* const file_path ) +{ + pep out_pep = { 0 }; + + if( !file_path ) + { + return out_pep; + } + + FILE * file = fopen( file_path, "rb" ); + if( !file ) + { + return out_pep; + } + + fseek( file, 0, SEEK_END ); + long file_size = ftell( file ); + fseek( file, 0, SEEK_SET ); + + if( file_size <= 0 ) + { + fclose( file ); + return out_pep; + } + + uint8_t* bytes = ( uint8_t* )PEP_MALLOC( file_size ); + + size_t read = fread( bytes, 1, file_size, file ); + fclose( file ); + + if( read != ( size_t ) file_size ) + { + PEP_FREE( bytes ); + return out_pep; + } + + out_pep = pep_deserialize( bytes, ( uint32_t )read ); + PEP_FREE( bytes ); + + #ifdef PEP_DEBUG + printf( "\npep: %lld\nfile: %ld\n", out_pep.bytes_size, file_size ); + #endif + + return out_pep; +} + +#pragma endregion file + +#ifdef _MSC_VER + #pragma warning( pop ) +#endif + +#endif // PEP_IMPLEMENTATION + + +#pragma endregion definitions + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/external/rlsw.h b/src/external/rlsw.h index 67011c966..36e4760c5 100644 --- a/src/external/rlsw.h +++ b/src/external/rlsw.h @@ -3924,7 +3924,6 @@ static void sw_immediate_set_color(const float color[4]) RLSW.primitive.color[2] = color[2]; RLSW.primitive.color[3] = color[3]; - RLSW.primitive.hasColorAlpha |= (color[3] < 1.0f); } static void sw_immediate_set_texcoord(const float texcoord[2]) @@ -3963,6 +3962,9 @@ static void sw_immediate_push_vertex(const float position[4]) for (int i = 0; i < 4; i++) vertex->color[i] = RLSW.primitive.color[i]; for (int i = 0; i < 2; i++) vertex->texcoord[i] = RLSW.primitive.texcoord[i]; + // Track whether any vertex in this primitive has alpha < 1.0 + RLSW.primitive.hasColorAlpha |= (vertex->color[3] < 1.0f); + // Immediate rendering of the primitive if the required number is reached if (RLSW.primitive.vertexCount == SW_PRIMITIVE_VERTEX_COUNT[RLSW.drawMode]) { @@ -4341,8 +4343,8 @@ void swScissor(int x, int y, int width, int height) RLSW.scClipMin[0] = (2.0f*(float)RLSW.scMin[0]/(float)RLSW.vpSize[0]) - 1.0f; RLSW.scClipMax[0] = (2.0f*(float)RLSW.scMax[0]/(float)RLSW.vpSize[0]) - 1.0f; - RLSW.scClipMax[1] = 1.0f - (2.0f*(float)RLSW.scMin[1]/(float)RLSW.vpSize[1]); - RLSW.scClipMin[1] = 1.0f - (2.0f*(float)RLSW.scMax[1]/(float)RLSW.vpSize[1]); + RLSW.scClipMin[1] = (2.0f*(float)RLSW.scMin[1]/(float)RLSW.vpSize[1]) - 1.0f; + RLSW.scClipMax[1] = (2.0f*(float)RLSW.scMax[1]/(float)RLSW.vpSize[1]) - 1.0f; } void swClearColor(float r, float g, float b, float a) diff --git a/src/external/tinyobj_loader_c.h b/src/external/tinyobj_loader_c.h index 88b2acbdc..8d077d665 100644 --- a/src/external/tinyobj_loader_c.h +++ b/src/external/tinyobj_loader_c.h @@ -1020,7 +1020,12 @@ static int parseLine(Command *command, const char *p, unsigned int p_len, int triangulate) { char linebuf[4096]; const char *token; - assert(p_len < 4095); + + // @raysan5: + // WARNING: If -DNDEBUG is set when compiling, assertions will not + // be present in the compiled binary, replacing by a runtime check + //assert(p_len < 4095); + if (p_len > 4095) return 0; memcpy(linebuf, p, p_len); linebuf[p_len] = '\0'; @@ -1102,8 +1107,12 @@ static int parseLine(Command *command, const char *p, unsigned int p_len, tinyobj_vertex_index_t i1; tinyobj_vertex_index_t i2 = f[1]; - assert(3 * num_f < TINYOBJ_MAX_FACES_PER_F_LINE); - + // @raysan5: + // WARNING: If -DNDEBUG is set when compiling, assertions will not + // be present in the compiled binary, replacing by a runtime check + //assert(3 * num_f < TINYOBJ_MAX_FACES_PER_F_LINE); + if (3*num_f > TINYOBJ_MAX_FACES_PER_F_LINE) return 0; + for (k = 2; k < num_f; k++) { i1 = i2; i2 = f[k]; @@ -1119,7 +1128,13 @@ static int parseLine(Command *command, const char *p, unsigned int p_len, } else { unsigned int k = 0; - assert(num_f < TINYOBJ_MAX_FACES_PER_F_LINE); + + // @raysan5: + // WARNING: If -DNDEBUG is set when compiling, assertions will not + // be present in the compiled binary, replacing by a runtime check + //assert(num_f < TINYOBJ_MAX_FACES_PER_F_LINE); + if (num_f > TINYOBJ_MAX_FACES_PER_F_LINE) return 0; + for (k = 0; k < num_f; k++) { command->f[k] = f[k]; } diff --git a/src/platforms/rcore_android.c b/src/platforms/rcore_android.c index 78abe9ed6..7fb080153 100644 --- a/src/platforms/rcore_android.c +++ b/src/platforms/rcore_android.c @@ -663,13 +663,22 @@ double GetTime(void) } // Open URL with default system browser (if available) -// NOTE: This function is only safe to use if the provided URL is safe -// A user could craft a malicious string performing another action -// Avoid calling this function with user input non-validated strings +// WARNING: This function is only safe to use if you control the URL given, +// a user could craft a malicious string to perform and undesired action +// NOTE: Some safety checks have been added to mitigate security issues void OpenURL(const char *url) { // Security check to (partially) avoid malicious code - if (strchr(url, '\'') != NULL) TRACELOG(LOG_WARNING, "SYSTEM: Provided URL could be potentially malicious, avoid [\'] character"); + if ((strchr(url, '\'') != NULL) || (strchr(url, '\"') != NULL)) + { + // Filter characters: ' and " + TRACELOG(LOG_WARNING, "SYSTEM: Provided URL could be potentially malicious, avoid [\'\"] characters"); + } + else if ((strncmp(url, "http://", 7) != 0) && (strncmp(url, "https://", 8) != 0)) + { + // Only allow URL starting with "http://" or "https://" protocols + TRACELOG(LOG_WARNING, "SYSTEM: Provided URL must start with 'http://' or 'https://' protocols"); + } else { JNIEnv *env = NULL; @@ -717,7 +726,6 @@ void SetGamepadVibration(int gamepad, float leftMotor, float rightMotor, float d void SetMousePosition(int x, int y) { CORE.Input.Mouse.currentPosition = (Vector2){ (float)x, (float)y }; - CORE.Input.Mouse.previousPosition = CORE.Input.Mouse.currentPosition; } // Set mouse cursor diff --git a/src/platforms/rcore_desktop_glfw.c b/src/platforms/rcore_desktop_glfw.c index 55b92ac79..934815c0f 100644 --- a/src/platforms/rcore_desktop_glfw.c +++ b/src/platforms/rcore_desktop_glfw.c @@ -151,7 +151,7 @@ static void CharCallback(GLFWwindow *window, unsigned int codepoint); static void MouseButtonCallback(GLFWwindow *window, int button, int action, int mods); // GLFW3 Mouse Button Callback, runs on mouse button pressed static void MouseCursorPosCallback(GLFWwindow *window, double x, double y); // GLFW3 Cursor Position Callback, runs on mouse move static void MouseScrollCallback(GLFWwindow *window, double xoffset, double yoffset); // GLFW3 Scrolling Callback, runs on mouse wheel -static void CursorEnterCallback(GLFWwindow *window, int enter); // GLFW3 Cursor Enter Callback, cursor enters client area +static void CursorEnterCallback(GLFWwindow *window, int entered); // GLFW3 Cursor Enter Callback, cursor enters client area static void JoystickCallback(int jid, int event); // GLFW3 Joystick Connected/Disconnected Callback // Memory allocator wrappers [used by glfwInitAllocator()] @@ -1181,17 +1181,25 @@ double GetTime(void) } // Open URL with default system browser (if available) -// NOTE: This function is only safe to use if you control the URL given -// A user could craft a malicious string performing another action -// Only call this function yourself not with user input or make sure to check the string yourself -// REF: https://github.com/raysan5/raylib/issues/686 +// WARNING: This function is only safe to use if you control the URL given, +// a user could craft a malicious string to perform and undesired action +// NOTE: Some safety checks have been added to mitigate security issues void OpenURL(const char *url) { // Security check to (partially) avoid malicious code - if (strchr(url, '\'') != NULL) TRACELOG(LOG_WARNING, "SYSTEM: Provided URL could be potentially malicious, avoid [\'] character"); - else + if ((strchr(url, '\'') != NULL) || (strchr(url, '\"') != NULL)) { - char *cmd = (char *)RL_CALLOC(strlen(url) + 32, sizeof(char)); + // Filter characters: ' and " + TRACELOG(LOG_WARNING, "SYSTEM: Provided URL could be potentially malicious, avoid [\'\"] characters"); + } + else if ((strncmp(url, "http://", 7) != 0) && (strncmp(url, "https://", 8) != 0)) + { + // Only allow URL starting with "http://" or "https://" protocols + TRACELOG(LOG_WARNING, "SYSTEM: Provided URL must start with 'http://' or 'https://' protocols"); + } + else + { + char *cmd = (char *)RL_CALLOC(strlen(url) + 16, sizeof(char)); #if defined(_WIN32) sprintf(cmd, "explorer \"%s\"", url); #endif @@ -1201,7 +1209,9 @@ void OpenURL(const char *url) #if defined(__APPLE__) sprintf(cmd, "open '%s'", url); #endif + // TODO: Replace system() call by custom process int result = system(cmd); + if (result == -1) TRACELOG(LOG_WARNING, "OpenURL() child process could not be created"); RL_FREE(cmd); } @@ -1227,7 +1237,6 @@ void SetGamepadVibration(int gamepad, float leftMotor, float rightMotor, float d void SetMousePosition(int x, int y) { CORE.Input.Mouse.currentPosition = (Vector2){ (float)x, (float)y }; - CORE.Input.Mouse.previousPosition = CORE.Input.Mouse.currentPosition; // NOTE: emscripten not implemented glfwSetCursorPos(platform.handle, CORE.Input.Mouse.currentPosition.x, CORE.Input.Mouse.currentPosition.y); @@ -1316,7 +1325,7 @@ void PollInputEvents(void) // Register previous gamepad states for (int k = 0; k < MAX_GAMEPAD_BUTTONS; k++) CORE.Input.Gamepad.previousButtonState[i][k] = CORE.Input.Gamepad.currentButtonState[i][k]; - // Get current gamepad state + // Get current gamepad state using internal GLFW mapping, instead of the immediate joystick API // NOTE: There is no callback available, getting it manually GLFWgamepadstate state = { 0 }; int result = glfwGetGamepadState(i, &state); // This remaps all gamepads so they have their buttons mapped like an xbox controller @@ -1331,7 +1340,7 @@ void PollInputEvents(void) for (int k = 0; (buttons != NULL) && (k < MAX_GAMEPAD_BUTTONS); k++) { - int button = -1; // GamepadButton enum values assigned + int button = -1; // GamepadButton enum values assigned switch (k) { @@ -1357,7 +1366,7 @@ void PollInputEvents(void) default: break; } - if (button != -1) // Check for valid button + if (button != -1) // Check for valid button { if (buttons[k] == GLFW_PRESS) { @@ -1399,10 +1408,10 @@ void PollInputEvents(void) if ((CORE.Window.eventWaiting) || (FLAG_IS_SET(CORE.Window.flags, FLAG_WINDOW_MINIMIZED) && !FLAG_IS_SET(CORE.Window.flags, FLAG_WINDOW_ALWAYS_RUN))) { - glfwWaitEvents(); // Wait for in input events before continue (drawing is paused) + glfwWaitEvents(); // Wait for in input events before continue (drawing is paused) CORE.Time.previous = GetTime(); } - else glfwPollEvents(); // Poll input events: keyboard/mouse/window events (callbacks) -> Update keys state + else glfwPollEvents(); // Poll input events: keyboard/mouse/window events (callbacks) -> Update keys state CORE.Window.shouldClose = glfwWindowShouldClose(platform.handle); @@ -1683,6 +1692,14 @@ int InitPlatform(void) return -1; } +#if defined(__APPLE__) + // AppKit can constrain the requested window size to the visible work area during creation + int windowWidth = 0; + int windowHeight = 0; + glfwGetWindowSize(platform.handle, &windowWidth, &windowHeight); + if ((windowWidth > 0) && (windowHeight > 0)) CORE.Window.screen = (Size){ windowWidth, windowHeight }; +#endif + // NOTE: Not considering scale factor now, considered below CORE.Window.render.width = CORE.Window.screen.width; CORE.Window.render.height = CORE.Window.screen.height; @@ -1829,7 +1846,7 @@ int InitPlatform(void) { CORE.Input.Gamepad.ready[i] = true; CORE.Input.Gamepad.axisCount[i] = GLFW_GAMEPAD_AXIS_LAST + 1; - strncpy(CORE.Input.Gamepad.name[i], glfwGetJoystickName(i), MAX_GAMEPAD_NAME_LENGTH - 1); + snprintf(CORE.Input.Gamepad.name[i], MAX_GAMEPAD_NAME_LENGTH, "%s", glfwGetJoystickName(i)); } } //---------------------------------------------------------------------------- @@ -2044,7 +2061,7 @@ static void WindowDropCallback(GLFWwindow *window, int count, const char **paths for (unsigned int i = 0; i < CORE.Window.dropFileCount; i++) { CORE.Window.dropFilepaths[i] = (char *)RL_CALLOC(MAX_FILEPATH_LENGTH, sizeof(char)); - strncpy(CORE.Window.dropFilepaths[i], paths[i], MAX_FILEPATH_LENGTH - 1); + snprintf(CORE.Window.dropFilepaths[i], MAX_FILEPATH_LENGTH, "%s", paths[i]); } } } @@ -2167,10 +2184,18 @@ static void MouseScrollCallback(GLFWwindow *window, double xoffset, double yoffs } // GLFW3: Cursor ennter callback, when cursor enters the window -static void CursorEnterCallback(GLFWwindow *window, int enter) +static void CursorEnterCallback(GLFWwindow *window, int entered) { - if (enter) CORE.Input.Mouse.cursorOnScreen = true; - else CORE.Input.Mouse.cursorOnScreen = false; + if (entered) + { + // NOTE: Mouse position updated by MouseCursorPosCallback() + CORE.Input.Mouse.cursorOnScreen = true; + } + else + { + CORE.Input.Mouse.cursorOnScreen = false; + CORE.Input.Mouse.currentPosition = (Vector2){ 0 }; + } } // GLFW3: Joystick connected/disconnected callback @@ -2183,7 +2208,7 @@ static void JoystickCallback(int jid, int event) // WARNING: If glfwGetJoystickName() is longer than MAX_GAMEPAD_NAME_LENGTH, // only copy up to (MAX_GAMEPAD_NAME_LENGTH -1) to destination string memset(CORE.Input.Gamepad.name[jid], 0, MAX_GAMEPAD_NAME_LENGTH); - strncpy(CORE.Input.Gamepad.name[jid], glfwGetJoystickName(jid), MAX_GAMEPAD_NAME_LENGTH - 1); + snprintf(CORE.Input.Gamepad.name[jid], MAX_GAMEPAD_NAME_LENGTH, "%s", glfwGetJoystickName(jid)); } else if (event == GLFW_DISCONNECTED) { diff --git a/src/platforms/rcore_desktop_rgfw.c b/src/platforms/rcore_desktop_rgfw.c index 211917359..9907e8a60 100644 --- a/src/platforms/rcore_desktop_rgfw.c +++ b/src/platforms/rcore_desktop_rgfw.c @@ -486,14 +486,14 @@ static void RGFW_cb_dropfunc(const RGFW_event *e) CORE.Window.dropFilepaths = (char **)RL_CALLOC(1024, sizeof(char *)); CORE.Window.dropFilepaths[CORE.Window.dropFileCount] = (char *)RL_CALLOC(MAX_FILEPATH_LENGTH, sizeof(char)); - strcpy(CORE.Window.dropFilepaths[CORE.Window.dropFileCount], e->drop.value->data); + snprintf(CORE.Window.dropFilepaths[CORE.Window.dropFileCount], MAX_FILEPATH_LENGTH, "%s", e->drop.value->data); CORE.Window.dropFileCount++; } else if (CORE.Window.dropFileCount < 1024) { CORE.Window.dropFilepaths[CORE.Window.dropFileCount] = (char *)RL_CALLOC(MAX_FILEPATH_LENGTH, sizeof(char)); - strcpy(CORE.Window.dropFilepaths[CORE.Window.dropFileCount], e->drop.value->data); + snprintf(CORE.Window.dropFilepaths[CORE.Window.dropFileCount], MAX_FILEPATH_LENGTH, "%s", e->drop.value->data); CORE.Window.dropFileCount++; } @@ -1471,15 +1471,25 @@ double GetTime(void) } // Open URL with default system browser (if available) -// NOTE: This function is only safe to use if you control the URL given -// A user could craft a malicious string performing another action +// WARNING: This function is only safe to use if you control the URL given, +// a user could craft a malicious string to perform and undesired action +// NOTE: Some safety checks have been added to mitigate security issues void OpenURL(const char *url) { - // Security check to (partially) avoid malicious code on target platform - if (strchr(url, '\'') != NULL) TRACELOG(LOG_WARNING, "SYSTEM: Provided URL could be potentially malicious, avoid [\'] character"); - else + // Security check to (partially) avoid malicious code + if ((strchr(url, '\'') != NULL) || (strchr(url, '\"') != NULL)) { - char *cmd = (char *)RL_CALLOC(strlen(url) + 32, sizeof(char)); + // Filter characters: ' and " + TRACELOG(LOG_WARNING, "SYSTEM: Provided URL could be potentially malicious, avoid [\'\"] characters"); + } + else if ((strncmp(url, "http://", 7) != 0) && (strncmp(url, "https://", 8) != 0)) + { + // Only allow URL starting with "http://" or "https://" protocols + TRACELOG(LOG_WARNING, "SYSTEM: Provided URL must start with 'http://' or 'https://' protocols"); + } + else + { + char *cmd = (char *)RL_CALLOC(strlen(url) + 16, sizeof(char)); #if defined(_WIN32) sprintf(cmd, "explorer \"%s\"", url); #endif @@ -1516,7 +1526,6 @@ void SetMousePosition(int x, int y) { RGFW_window_moveMouse(platform.window, x, y); CORE.Input.Mouse.currentPosition = (Vector2){ (float)x, (float)y }; - CORE.Input.Mouse.previousPosition = CORE.Input.Mouse.currentPosition; } // Set mouse cursor @@ -1609,74 +1618,76 @@ void PollInputEvents(void) //----------------------------------------------------------------------------- mg_event gamepad_event; - while (mg_gamepads_check_event(&platform.minigamepad, &gamepad_event)) { + while (mg_gamepads_check_event(&platform.minigamepad, &gamepad_event)) + { int gamepadIndex = gamepad_event.gamepad->index; - switch (gamepad_event.type) { + + switch (gamepad_event.type) + { case MG_EVENT_BUTTON_PRESS: + { + int button = mg_buttonConvertTable[gamepad_event.button]; + if (button >= 0) { - int button = mg_buttonConvertTable[gamepad_event.button]; - if (button >= 0) - { - CORE.Input.Gamepad.currentButtonState[gamepadIndex][button] = 1; - CORE.Input.Gamepad.lastButtonPressed = button; - } - } break; + CORE.Input.Gamepad.currentButtonState[gamepadIndex][button] = 1; + CORE.Input.Gamepad.lastButtonPressed = button; + } + } break; case MG_EVENT_BUTTON_RELEASE: + { + int button = mg_buttonConvertTable[gamepad_event.button]; + if (button >= 0) { - int button = mg_buttonConvertTable[gamepad_event.button]; - if (button >= 0) - { - CORE.Input.Gamepad.currentButtonState[gamepadIndex][button] = 0; - if (CORE.Input.Gamepad.lastButtonPressed == button) CORE.Input.Gamepad.lastButtonPressed = 0; - } - } break; + CORE.Input.Gamepad.currentButtonState[gamepadIndex][button] = 0; + if (CORE.Input.Gamepad.lastButtonPressed == button) CORE.Input.Gamepad.lastButtonPressed = 0; + } + } break; case MG_EVENT_AXIS_MOVE: - { - int axis = mg_axisConvertTable[gamepad_event.axis]; + { + int axis = mg_axisConvertTable[gamepad_event.axis]; - switch (axis) { - case GAMEPAD_AXIS_LEFT_X: - case GAMEPAD_AXIS_LEFT_Y: - case GAMEPAD_AXIS_RIGHT_X: - case GAMEPAD_AXIS_RIGHT_Y: - CORE.Input.Gamepad.axisState[gamepadIndex][axis] = platform.minigamepad.gamepads[gamepadIndex].axes[gamepad_event.axis].value; - break; - case GAMEPAD_AXIS_LEFT_TRIGGER: - case GAMEPAD_AXIS_RIGHT_TRIGGER: - CORE.Input.Gamepad.axisState[gamepadIndex][axis] = platform.minigamepad.gamepads[gamepadIndex].axes[gamepad_event.axis].value; + switch (axis) { + case GAMEPAD_AXIS_LEFT_X: + case GAMEPAD_AXIS_LEFT_Y: + case GAMEPAD_AXIS_RIGHT_X: + case GAMEPAD_AXIS_RIGHT_Y: + { + CORE.Input.Gamepad.axisState[gamepadIndex][axis] = platform.minigamepad.gamepads[gamepadIndex].axes[gamepad_event.axis].value; + } break; + case GAMEPAD_AXIS_LEFT_TRIGGER: + case GAMEPAD_AXIS_RIGHT_TRIGGER: + { + CORE.Input.Gamepad.axisState[gamepadIndex][axis] = platform.minigamepad.gamepads[gamepadIndex].axes[gamepad_event.axis].value; - // Trigger button press when axis is all the way - int button = (axis == GAMEPAD_AXIS_LEFT_TRIGGER) ? GAMEPAD_BUTTON_LEFT_TRIGGER_2 : GAMEPAD_BUTTON_RIGHT_TRIGGER_2; - int pressed = (platform.minigamepad.gamepads[gamepadIndex].axes[gamepad_event.axis].value >= 1.0f); + // Trigger button press when axis is all the way + int button = (axis == GAMEPAD_AXIS_LEFT_TRIGGER) ? GAMEPAD_BUTTON_LEFT_TRIGGER_2 : GAMEPAD_BUTTON_RIGHT_TRIGGER_2; + int pressed = (platform.minigamepad.gamepads[gamepadIndex].axes[gamepad_event.axis].value >= 1.0f); - CORE.Input.Gamepad.currentButtonState[gamepadIndex][button] = pressed; - if (pressed) CORE.Input.Gamepad.lastButtonPressed = button; - else if (CORE.Input.Gamepad.lastButtonPressed == button) CORE.Input.Gamepad.lastButtonPressed = 0; - break; - } - } break; + CORE.Input.Gamepad.currentButtonState[gamepadIndex][button] = pressed; + if (pressed) CORE.Input.Gamepad.lastButtonPressed = button; + else if (CORE.Input.Gamepad.lastButtonPressed == button) CORE.Input.Gamepad.lastButtonPressed = 0; + } break; + default: break; + } + } break; case MG_EVENT_GAMEPAD_CONNECT: + { CORE.Input.Gamepad.ready[gamepadIndex] = true; CORE.Input.Gamepad.axisState[gamepadIndex][GAMEPAD_AXIS_LEFT_TRIGGER] = -1.0f; CORE.Input.Gamepad.axisState[gamepadIndex][GAMEPAD_AXIS_RIGHT_TRIGGER] = -1.0f; int axisCount = 0; - for (int i = 0; i < MG_AXIS_COUNT; i += 1) { - if (platform.minigamepad.gamepads[gamepadIndex].axes[i].supported) - { - axisCount += 1; - } - else - { - break; - } + for (int i = 0; i < MG_AXIS_COUNT; i += 1) + { + if (platform.minigamepad.gamepads[gamepadIndex].axes[i].supported) axisCount += 1; + else break; } + CORE.Input.Gamepad.axisCount[gamepadIndex] = axisCount; - strcpy(CORE.Input.Gamepad.name[gamepadIndex], platform.minigamepad.gamepads[gamepadIndex].name); - break; - case MG_EVENT_GAMEPAD_DISCONNECT: - CORE.Input.Gamepad.ready[gamepadIndex] = false; - break; + snprintf(CORE.Input.Gamepad.name[gamepadIndex], MAX_GAMEPAD_NAME_LENGTH, "%s", platform.minigamepad.gamepads[gamepadIndex].name); + + } break; + case MG_EVENT_GAMEPAD_DISCONNECT: CORE.Input.Gamepad.ready[gamepadIndex] = false; break; default: break; } } diff --git a/src/platforms/rcore_desktop_sdl.c b/src/platforms/rcore_desktop_sdl.c index 8ff17271f..bca579e41 100644 --- a/src/platforms/rcore_desktop_sdl.c +++ b/src/platforms/rcore_desktop_sdl.c @@ -863,7 +863,7 @@ void SetWindowMonitor(int monitor) // ending up positioned partly outside the target display // NOTE 2: The workaround for that is, previously to moving the window, // setting the window size to the target display size, so they match - // NOTE 3: It wasn't done here because it can not bee assumed that changing + // NOTE 3: It wasn't done here because it can not be assumed that changing // the window size automatically is acceptable behavior by the user SDL_SetWindowPosition(platform.window, usableBounds.x, usableBounds.y); CORE.Window.position.x = usableBounds.x; @@ -1255,12 +1255,14 @@ Image GetClipboardImage(void) for (int i = 0; i < SDL_arraysize(imageFormats); i++) { - // NOTE: This pointer should be free with SDL_free() at some point fileData = SDL_GetClipboardData(imageFormats[i], &dataSize); if (fileData) { image = LoadImageFromMemory(imageExtensions[i], fileData, (int)dataSize); + + SDL_free(fileData); + if (IsImageValid(image)) { TRACELOG(LOG_INFO, "Clipboard: Got image from clipboard successfully: %s", imageExtensions[i]); @@ -1341,14 +1343,22 @@ double GetTime(void) } // Open URL with default system browser (if available) -// NOTE: This function is only safe to use if the provided URL is safe -// A user could craft a malicious string performing another action -// Avoid calling this function with user input non-validated strings -// REF: https://github.com/raysan5/raylib/issues/686 +// WARNING: This function is only safe to use if you control the URL given, +// a user could craft a malicious string to perform and undesired action +// NOTE: Some safety checks have been added to mitigate security issues void OpenURL(const char *url) { // Security check to (partially) avoid malicious code - if (strchr(url, '\'') != NULL) TRACELOG(LOG_WARNING, "SYSTEM: Provided URL could be potentially malicious, avoid [\'] character"); + if ((strchr(url, '\'') != NULL) || (strchr(url, '\"') != NULL)) + { + // Filter characters: ' and " + TRACELOG(LOG_WARNING, "SYSTEM: Provided URL could be potentially malicious, avoid [\'\"] characters"); + } + else if ((strncmp(url, "http://", 7) != 0) && (strncmp(url, "https://", 8) != 0)) + { + // Only allow URL starting with "http://" or "https://" protocols + TRACELOG(LOG_WARNING, "SYSTEM: Provided URL must start with 'http://' or 'https://' protocols"); + } else SDL_OpenURL(url); } @@ -1401,7 +1411,6 @@ void SetMousePosition(int x, int y) SDL_WarpMouseInWindow(platform.window, x, y); CORE.Input.Mouse.currentPosition = (Vector2){ (float)x, (float)y }; - CORE.Input.Mouse.previousPosition = CORE.Input.Mouse.currentPosition; } // Set mouse cursor @@ -1512,9 +1521,9 @@ void PollInputEvents(void) // Event memory is now managed by SDL, so it should not be freed in SDL_EVENT_DROP_FILE, // in case data needs to be hold onto the text in SDL_EVENT_TEXT_EDITING and SDL_EVENT_TEXT_INPUT events, // a copy is required, SDL_TEXTINPUTEVENT_TEXT_SIZE is no longer necessary and has been removed - strncpy(CORE.Window.dropFilepaths[CORE.Window.dropFileCount], event.drop.data, MAX_FILEPATH_LENGTH - 1); + snprintf(CORE.Window.dropFilepaths[CORE.Window.dropFileCount], MAX_FILEPATH_LENGTH, "%s", event.drop.data); #else - strncpy(CORE.Window.dropFilepaths[CORE.Window.dropFileCount], event.drop.file, MAX_FILEPATH_LENGTH - 1); + snprintf(CORE.Window.dropFilepaths[CORE.Window.dropFileCount], MAX_FILEPATH_LENGTH, "%s", event.drop.file); SDL_free(event.drop.file); #endif @@ -1525,9 +1534,9 @@ void PollInputEvents(void) CORE.Window.dropFilepaths[CORE.Window.dropFileCount] = (char *)RL_CALLOC(MAX_FILEPATH_LENGTH, sizeof(char)); #if defined(USING_VERSION_SDL3) - strncpy(CORE.Window.dropFilepaths[CORE.Window.dropFileCount], event.drop.data, MAX_FILEPATH_LENGTH - 1); + snprintf(CORE.Window.dropFilepaths[CORE.Window.dropFileCount], MAX_FILEPATH_LENGTH, "%s", event.drop.data); #else - strncpy(CORE.Window.dropFilepaths[CORE.Window.dropFileCount], event.drop.file, MAX_FILEPATH_LENGTH - 1); + snprintf(CORE.Window.dropFilepaths[CORE.Window.dropFileCount], MAX_FILEPATH_LENGTH, "%s", event.drop.file); SDL_free(event.drop.file); #endif @@ -1812,8 +1821,8 @@ void PollInputEvents(void) CORE.Input.Gamepad.axisState[nextAvailableSlot][GAMEPAD_AXIS_RIGHT_TRIGGER] = -1.0f; memset(CORE.Input.Gamepad.name[nextAvailableSlot], 0, MAX_GAMEPAD_NAME_LENGTH); const char *controllerName = SDL_GameControllerNameForIndex(nextAvailableSlot); - if (controllerName != NULL) strncpy(CORE.Input.Gamepad.name[nextAvailableSlot], controllerName, MAX_GAMEPAD_NAME_LENGTH - 1); - else strncpy(CORE.Input.Gamepad.name[nextAvailableSlot], "noname", 6); + if (controllerName != NULL) snprintf(CORE.Input.Gamepad.name[nextAvailableSlot], MAX_GAMEPAD_NAME_LENGTH, "%s", controllerName); + else memcpy(CORE.Input.Gamepad.name[nextAvailableSlot], "noname", 6); } else TRACELOG(LOG_WARNING, "PLATFORM: Unable to open game controller [ERROR: %s]", SDL_GetError()); } @@ -2164,11 +2173,20 @@ int InitPlatform(void) platform.gamepadId[i] = -1; // Set all gamepad initial instance ids as invalid to not conflict with instance id zero } +#if defined(USING_VERSION_SDL3) + int numJoysticks; + SDL_JoystickID *joysticks = SDL_GetJoysticks(&numJoysticks); +#else int numJoysticks = SDL_NumJoysticks(); +#endif for (int i = 0; (i < numJoysticks) && (i < MAX_GAMEPADS); i++) { +#if defined(USING_VERSION_SDL3) + platform.gamepad[i] = SDL_OpenGamepad(joysticks[i]); +#else platform.gamepad[i] = SDL_GameControllerOpen(i); +#endif platform.gamepadId[i] = SDL_JoystickInstanceID(SDL_GameControllerGetJoystick(platform.gamepad[i])); if (platform.gamepad[i]) @@ -2177,7 +2195,12 @@ int InitPlatform(void) CORE.Input.Gamepad.axisCount[i] = SDL_JoystickNumAxes(SDL_GameControllerGetJoystick(platform.gamepad[i])); CORE.Input.Gamepad.axisState[i][GAMEPAD_AXIS_LEFT_TRIGGER] = -1.0f; CORE.Input.Gamepad.axisState[i][GAMEPAD_AXIS_RIGHT_TRIGGER] = -1.0f; - strncpy(CORE.Input.Gamepad.name[i], SDL_GameControllerNameForIndex(i), MAX_GAMEPAD_NAME_LENGTH - 1); +#if defined(USING_VERSION_SDL3) + const char *joystickName = SDL_GetJoystickNameForID(joysticks[i]); +#else + const char *joystickName = SDL_GameControllerNameForIndex(i); +#endif + snprintf(CORE.Input.Gamepad.name[i], MAX_GAMEPAD_NAME_LENGTH, "%s", joystickName); CORE.Input.Gamepad.name[i][MAX_GAMEPAD_NAME_LENGTH - 1] = '\0'; } else TRACELOG(LOG_WARNING, "PLATFORM: Unable to open game controller [ERROR: %s]", SDL_GetError()); diff --git a/src/platforms/rcore_desktop_win32.c b/src/platforms/rcore_desktop_win32.c index ef40caa9e..a6e85a657 100644 --- a/src/platforms/rcore_desktop_win32.c +++ b/src/platforms/rcore_desktop_win32.c @@ -1247,19 +1247,28 @@ double GetTime(void) } // Open URL with default system browser (if available) -// NOTE: This function is only safe to use if the provided URL is safe -// A user could craft a malicious string performing another action -// Avoid calling this function with user input non-validated strings -// REF: https://github.com/raysan5/raylib/issues/686 +// WARNING: This function is only safe to use if you control the URL given, +// a user could craft a malicious string to perform and undesired action +// NOTE: Some safety checks have been added to mitigate security issues void OpenURL(const char *url) { - // Security check to (partially) avoid malicious code on target platform - if (strchr(url, '\'') != NULL) TRACELOG(LOG_WARNING, "SYSTEM: Provided URL could be potentially malicious, avoid [\'] character"); - else + // Security check to (partially) avoid malicious code + if ((strchr(url, '\'') != NULL) || (strchr(url, '\"') != NULL)) { - int len = strlen(url) + 32; + // Filter characters: ' and " + TRACELOG(LOG_WARNING, "SYSTEM: Provided URL could be potentially malicious, avoid [\'\"] characters"); + } + else if ((strncmp(url, "http://", 7) != 0) && (strncmp(url, "https://", 8) != 0)) + { + // Only allow URL starting with "http://" or "https://" protocols + TRACELOG(LOG_WARNING, "SYSTEM: Provided URL must start with 'http://' or 'https://' protocols"); + } + else + { + int len = strlen(url) + 16; char *cmd = (char *)RL_CALLOC(len, sizeof(char)); snprintf(cmd, len, "explorer \"%s\"", url); + int result = system(cmd); if (result == -1) TRACELOG(LOG_WARNING, "OpenURL() child process could not be created"); RL_FREE(cmd); @@ -1290,8 +1299,8 @@ void SetMousePosition(int x, int y) if (!CORE.Input.Mouse.cursorLocked) { CORE.Input.Mouse.currentPosition = (Vector2){ (float)x, (float)y }; - CORE.Input.Mouse.previousPosition = CORE.Input.Mouse.currentPosition; - TRACELOG(LOG_WARNING, "SetMousePosition not implemented"); + + TRACELOG(LOG_WARNING, "SetMousePosition not implemented at platform level"); } else TRACELOG(LOG_WARNING, "INPUT: MOUSE: Cursor not enabled"); } @@ -2213,7 +2222,7 @@ static unsigned SanitizeFlags(int mode, unsigned flags) // // This design takes care of many odd corner cases. For example, in case of restoring // a window that was previously maximized AND minimized and those two flags need to be removed, -// ShowWindow with SW_RESTORE twice need to bee actually calleed. Another example is +// ShowWindow with SW_RESTORE twice need to be actually calleed. Another example is // wheen having a maximized window, if the undecorated flag is modified then the window style // needs to be updated, but updating the style would mean the window size would change // causing the window to lose its Maximized state which would mean the window size diff --git a/src/platforms/rcore_drm.c b/src/platforms/rcore_drm.c index 659c80011..4d4a4d3bf 100644 --- a/src/platforms/rcore_drm.c +++ b/src/platforms/rcore_drm.c @@ -1014,9 +1014,8 @@ double GetTime(void) } // Open URL with default system browser (if available) -// NOTE: This function is only safe to use if the provided URL is safe -// A user could craft a malicious string performing another action -// Avoid calling this function with user input non-validated strings +// WARNING: This function is only safe to use if you control the URL given, +// a user could craft a malicious string to perform and undesired action void OpenURL(const char *url) { TRACELOG(LOG_WARNING, "OpenURL() not implemented on target platform"); @@ -1043,7 +1042,6 @@ void SetGamepadVibration(int gamepad, float leftMotor, float rightMotor, float d void SetMousePosition(int x, int y) { CORE.Input.Mouse.currentPosition = (Vector2){ (float)x, (float)y }; - CORE.Input.Mouse.previousPosition = CORE.Input.Mouse.currentPosition; } // Set mouse cursor @@ -1446,7 +1444,9 @@ int InitPlatform(void) return -1; } - if (!eglChooseConfig(platform.device, NULL, NULL, 0, &numConfigs)) + // WARNING: Providing framebufferAttribs is not logically necessary, + // but it may prevent segfaults on some nvidia drivers + if (!eglChooseConfig(platform.device, framebufferAttribs, NULL, 0, &numConfigs)) { TRACELOG(LOG_WARNING, "DISPLAY: Failed to get EGL config count: 0x%x", eglGetError()); return -1; @@ -2732,4 +2732,4 @@ static void SetupFramebuffer(int width, int height) } } -// EOF \ No newline at end of file +// EOF diff --git a/src/platforms/rcore_memory.c b/src/platforms/rcore_memory.c index 14c56a591..03b787da6 100644 --- a/src/platforms/rcore_memory.c +++ b/src/platforms/rcore_memory.c @@ -420,7 +420,6 @@ void SetGamepadVibration(int gamepad, float leftMotor, float rightMotor, float d void SetMousePosition(int x, int y) { CORE.Input.Mouse.currentPosition = (Vector2){ (float)x, (float)y }; - CORE.Input.Mouse.previousPosition = CORE.Input.Mouse.currentPosition; } // Set mouse cursor diff --git a/src/platforms/rcore_template.c b/src/platforms/rcore_template.c index 353d32d11..1866059e8 100644 --- a/src/platforms/rcore_template.c +++ b/src/platforms/rcore_template.c @@ -352,14 +352,22 @@ double GetTime(void) } // Open URL with default system browser (if available) -// NOTE: This function is only safe to use if you control the URL given. -// A user could craft a malicious string performing another action. -// Only call this function yourself not with user input or make sure to check the string yourself. -// Ref: https://github.com/raysan5/raylib/issues/686 +// WARNING: This function is only safe to use if you control the URL given, +// a user could craft a malicious string to perform and undesired action +// NOTE: Some safety checks have been added to mitigate security issues void OpenURL(const char *url) { - // Security check to (partially) avoid malicious code on target platform - if (strchr(url, '\'') != NULL) TRACELOG(LOG_WARNING, "SYSTEM: Provided URL could be potentially malicious, avoid [\'] character"); + // Security check to (partially) avoid malicious code + if ((strchr(url, '\'') != NULL) || (strchr(url, '\"') != NULL)) + { + // Filter characters: ' and " + TRACELOG(LOG_WARNING, "SYSTEM: Provided URL could be potentially malicious, avoid [\'\"] characters"); + } + else if ((strncmp(url, "http://", 7) != 0) && (strncmp(url, "https://", 8) != 0)) + { + // Only allow URL starting with "http://" or "https://" protocols + TRACELOG(LOG_WARNING, "SYSTEM: Provided URL must start with 'http://' or 'https://' protocols"); + } else { // TODO: Load url using default browser @@ -387,7 +395,6 @@ void SetGamepadVibration(int gamepad, float leftMotor, float rightMotor, float d void SetMousePosition(int x, int y) { CORE.Input.Mouse.currentPosition = (Vector2){ (float)x, (float)y }; - CORE.Input.Mouse.previousPosition = CORE.Input.Mouse.currentPosition; } // Set mouse cursor diff --git a/src/platforms/rcore_web.c b/src/platforms/rcore_web.c index 9d16c3e87..b95121d2c 100644 --- a/src/platforms/rcore_web.c +++ b/src/platforms/rcore_web.c @@ -1047,7 +1047,6 @@ void SetGamepadVibration(int gamepad, float leftMotor, float rightMotor, float d void SetMousePosition(int x, int y) { CORE.Input.Mouse.currentPosition = (Vector2){ (float)x, (float)y }; - CORE.Input.Mouse.previousPosition = CORE.Input.Mouse.currentPosition; if (CORE.Input.Mouse.cursorLocked) CORE.Input.Mouse.lockedPosition = CORE.Input.Mouse.currentPosition; @@ -1579,7 +1578,7 @@ static void WindowDropCallback(GLFWwindow *window, int count, const char **paths for (unsigned int i = 0; i < CORE.Window.dropFileCount; i++) { CORE.Window.dropFilepaths[i] = (char *)RL_CALLOC(MAX_FILEPATH_LENGTH, sizeof(char)); - strncpy(CORE.Window.dropFilepaths[i], paths[i], MAX_FILEPATH_LENGTH - 1); + snprintf(CORE.Window.dropFilepaths[i], MAX_FILEPATH_LENGTH, "%s", paths[i]); } } } diff --git a/src/platforms/rcore_web_emscripten.c b/src/platforms/rcore_web_emscripten.c index ff78ac547..fa967057a 100644 --- a/src/platforms/rcore_web_emscripten.c +++ b/src/platforms/rcore_web_emscripten.c @@ -968,13 +968,22 @@ double GetTime(void) } // Open URL with default system browser (if available) -// NOTE: This function is only safe to use if the provided URL is safe -// A user could craft a malicious string performing another action -// Avoid calling this function with user input non-validated strings +// WARNING: This function is only safe to use if you control the URL given, +// a user could craft a malicious string to perform and undesired action +// NOTE: Some safety checks have been added to mitigate security issues void OpenURL(const char *url) { - // Security check to (partially) avoid malicious code on target platform - if (strchr(url, '\'') != NULL) TRACELOG(LOG_WARNING, "SYSTEM: Provided URL could be potentially malicious, avoid [\'] character"); + // Security check to (partially) avoid malicious code + if ((strchr(url, '\'') != NULL) || (strchr(url, '\"') != NULL)) + { + // Filter characters: ' and " + TRACELOG(LOG_WARNING, "SYSTEM: Provided URL could be potentially malicious, avoid [\'\"] characters"); + } + else if ((strncmp(url, "http://", 7) != 0) && (strncmp(url, "https://", 8) != 0)) + { + // Only allow URL starting with "http://" or "https://" protocols + TRACELOG(LOG_WARNING, "SYSTEM: Provided URL must start with 'http://' or 'https://' protocols"); + } else emscripten_run_script(TextFormat("window.open('%s', '_blank')", url)); } @@ -1439,7 +1448,7 @@ static void WindowDropCallback(GLFWwindow *window, int count, const char **paths for (unsigned int i = 0; i < CORE.Window.dropFileCount; i++) { CORE.Window.dropFilepaths[i] = (char *)RL_CALLOC(MAX_FILEPATH_LENGTH, sizeof(char)); - strncpy(CORE.Window.dropFilepaths[i], paths[i], MAX_FILEPATH_LENGTH - 1); + snprintf(CORE.Window.dropFilepaths[i], MAX_FILEPATH_LENGTH, "%s", paths[i]); } } } @@ -1498,8 +1507,16 @@ static EM_BOOL EmscriptenMouseCallback(int eventType, const EmscriptenMouseEvent { switch (eventType) { - case EMSCRIPTEN_EVENT_MOUSEENTER: CORE.Input.Mouse.cursorOnScreen = true; break; - case EMSCRIPTEN_EVENT_MOUSELEAVE: CORE.Input.Mouse.cursorOnScreen = false; break; + case EMSCRIPTEN_EVENT_MOUSEENTER: { + // NOTE: Mouse position updated by EmscriptenMouseMoveCallback(), + // EmscriptenPointerlockCallback(), and EmscriptenTouchCallback() + CORE.Input.Mouse.cursorOnScreen = true; + } break; + case EMSCRIPTEN_EVENT_MOUSELEAVE: + { + CORE.Input.Mouse.cursorOnScreen = false; + CORE.Input.Mouse.currentPosition = (Vector2){ 0 }; + } break; case EMSCRIPTEN_EVENT_MOUSEDOWN: { // NOTE: Emscripten and raylib buttons indices are not aligned diff --git a/src/raudio.c b/src/raudio.c index 094ea7533..42ea410c8 100644 --- a/src/raudio.c +++ b/src/raudio.c @@ -822,7 +822,7 @@ Wave LoadWaveFromMemory(const char *fileType, const unsigned char *fileData, int wave.sampleRate = wav.sampleRate; wave.sampleSize = 16; wave.channels = wav.channels; - wave.data = (short *)RL_MALLOC((size_t)wave.frameCount*wave.channels*sizeof(short)); + wave.data = (short *)RL_CALLOC((size_t)wave.frameCount*wave.channels, sizeof(short)); // NOTE: Forcing conversion to 16bit sample size on reading drwav_read_pcm_frames_s16(&wav, wave.frameCount, (drwav_int16 *)wave.data); @@ -845,7 +845,7 @@ Wave LoadWaveFromMemory(const char *fileType, const unsigned char *fileData, int wave.sampleSize = 16; // By default, ogg data is 16 bit per sample (short) wave.channels = info.channels; wave.frameCount = (unsigned int)stb_vorbis_stream_length_in_samples(oggData); // NOTE: It returns frames! - wave.data = (short *)RL_MALLOC(wave.frameCount*wave.channels*sizeof(short)); + wave.data = (short *)RL_CALLOC(wave.frameCount*wave.channels, sizeof(short)); // NOTE: Get the number of samples to process (be careful! asking for number of shorts, not bytes!) stb_vorbis_get_samples_short_interleaved(oggData, info.channels, (short *)wave.data, wave.frameCount*wave.channels); @@ -1154,7 +1154,7 @@ bool ExportWaveAsCode(Wave wave, const char *fileName) // Get file name from path and convert variable name to uppercase char varFileName[256] = { 0 }; - strncpy(varFileName, GetFileNameWithoutExt(fileName), 256 - 1); + snprintf(varFileName, 256, "%s", GetFileNameWithoutExt(fileName)); // NOTE: Using function provided by [rcore] module for (int i = 0; varFileName[i] != '\0'; i++) if (varFileName[i] >= 'a' && varFileName[i] <= 'z') { varFileName[i] = varFileName[i] - 32; } // Add wave information @@ -1258,7 +1258,7 @@ void WaveFormat(Wave *wave, int sampleRate, int sampleSize, int channels) return; } - void *data = RL_MALLOC(frameCount*channels*(sampleSize/8)); + void *data = RL_CALLOC(frameCount*channels*(sampleSize/8), 1); frameCount = (ma_uint32)ma_convert_frames(data, frameCount, formatOut, channels, sampleRate, wave->data, frameCountIn, formatIn, wave->channels, wave->sampleRate); if (frameCount == 0) @@ -1772,7 +1772,7 @@ void UnloadMusicStream(Music music) { if (false) { } #if SUPPORT_FILEFORMAT_WAV - else if (music.ctxType == MUSIC_AUDIO_WAV) drwav_uninit((drwav *)music.ctxData); + else if (music.ctxType == MUSIC_AUDIO_WAV) { drwav_uninit((drwav *)music.ctxData); RL_FREE(music.ctxData); } #endif #if SUPPORT_FILEFORMAT_OGG else if (music.ctxType == MUSIC_AUDIO_OGG) stb_vorbis_close((stb_vorbis *)music.ctxData); @@ -2827,7 +2827,7 @@ static const char *GetFileNameWithoutExt(const char *filePath) static char fileName[MAX_FILENAMEWITHOUTEXT_LENGTH] = { 0 }; memset(fileName, 0, MAX_FILENAMEWITHOUTEXT_LENGTH); - if (filePath != NULL) strncpy(fileName, GetFileName(filePath), MAX_FILENAMEWITHOUTEXT_LENGTH - 1); // Get filename with extension + if (filePath != NULL) snprintf(fileName, MAX_FILENAMEWITHOUTEXT_LENGTH, "%s", GetFileName(filePath)); int fileNameLength = (int)strlen(fileName); // Get size in bytes diff --git a/src/raylib.h b/src/raylib.h index e49d6b2f7..154158131 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -409,7 +409,7 @@ typedef struct BoneInfo { // Skeleton, animation bones hierarchy typedef struct ModelSkeleton { - int boneCount; // Number of bones + unsigned int boneCount; // Number of bones BoneInfo *bones; // Bones information (skeleton) ModelAnimPose bindPose; // Bones base transformation (Transform[]) } ModelSkeleton; @@ -436,7 +436,7 @@ typedef struct Model { typedef struct ModelAnimation { char name[32]; // Animation name - int boneCount; // Number of bones (per pose) + unsigned int boneCount; // Number of bones (per pose) int keyframeCount; // Number of animation key frames ModelAnimPose *keyframePoses; // Animation sequence keyframe poses [keyframe][pose] } ModelAnimation; @@ -1154,13 +1154,15 @@ RLAPI long GetFileModTime(const char *fileName); // Get file RLAPI const char *GetFileExtension(const char *fileName); // Get pointer to extension for a filename string (includes dot: '.png') RLAPI const char *GetFileName(const char *filePath); // Get pointer to filename for a path string RLAPI const char *GetFileNameWithoutExt(const char *filePath); // Get filename string without extension (uses static string) -RLAPI const char *GetDirectoryPath(const char *filePath); // Get full path for a given fileName with path (uses static string) -RLAPI const char *GetPrevDirectoryPath(const char *dirPath); // Get previous directory path for a given path (uses static string) +RLAPI const char *GetDirectoryPath(const char *filePath); // Get full path for a provided fileName with path (uses static string) +RLAPI const char *GetPrevDirectoryPath(const char *dirPath); // Get previous directory path for a provided path (uses static string) RLAPI const char *GetWorkingDirectory(void); // Get current working directory (uses static string) RLAPI const char *GetApplicationDirectory(void); // Get the directory of the running application (uses static string) RLAPI int MakeDirectory(const char *dirPath); // Create directories (including full path requested), returns 0 on success RLAPI int ChangeDirectory(const char *dirPath); // Change working directory, returns 0 on success -RLAPI bool IsPathFile(const char *path); // Check if given path is a file or a directory +RLAPI bool IsPathFile(const char *path); // Check if provided path points to a file +RLAPI bool IsPathDirectory(const char *path); // Check if provided path points to a directory +RLAPI bool IsPathAbsolute(const char *path); // Check if provided path is an absolute path RLAPI bool IsFileNameValid(const char *fileName); // Check if fileName is valid for the platform/OS RLAPI FilePathList LoadDirectoryFiles(const char *dirPath); // Load directory filepaths, files and directories, no subdirs scan RLAPI FilePathList LoadDirectoryFilesEx(const char *basePath, const char *filter, bool scanSubdirs); // Load directory filepaths with extension filtering and subdir scan; some filters available: '*.*','FILES*','DIRS*' @@ -1239,7 +1241,7 @@ RLAPI void SetMouseCursor(int cursor); // Set mouse curso RLAPI int GetTouchX(void); // Get touch position X for touch point 0 (relative to screen size) RLAPI int GetTouchY(void); // Get touch position Y for touch point 0 (relative to screen size) RLAPI Vector2 GetTouchPosition(int index); // Get touch position XY for a touch point index (relative to screen size) -RLAPI int GetTouchPointId(int index); // Get touch point identifier for given index +RLAPI int GetTouchPointId(int index); // Get touch point identifier for provided index RLAPI int GetTouchPointCount(void); // Get number of touch points //------------------------------------------------------------------------------------ @@ -1326,7 +1328,7 @@ RLAPI void DrawSplineSegmentCatmullRom(Vector2 p1, Vector2 p2, Vector2 p3, Vecto RLAPI void DrawSplineSegmentBezierQuadratic(Vector2 p1, Vector2 c2, Vector2 p3, float thick, Color color); // Draw spline segment: Quadratic Bezier, 2 points, 1 control point RLAPI void DrawSplineSegmentBezierCubic(Vector2 p1, Vector2 c2, Vector2 c3, Vector2 p4, float thick, Color color); // Draw spline segment: Cubic Bezier, 2 points, 2 control points -// Spline segment point evaluation functions, for a given t [0.0f .. 1.0f] +// Spline segment point evaluation functions, for a provided t [0.0f .. 1.0f] RLAPI Vector2 GetSplinePointLinear(Vector2 startPos, Vector2 endPos, float t); // Get (evaluate) spline point: Linear RLAPI Vector2 GetSplinePointBasis(Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, float t); // Get (evaluate) spline point: B-Spline RLAPI Vector2 GetSplinePointCatmullRom(Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, float t); // Get (evaluate) spline point: Catmull-Rom @@ -1416,7 +1418,7 @@ RLAPI Color GetImageColor(Image image, int x, int y); // Image drawing functions // NOTE: Image software-rendering functions (CPU) -RLAPI void ImageClearBackground(Image *dst, Color color); // Clear image background with given color +RLAPI void ImageClearBackground(Image *dst, Color color); // Clear image background with provided color RLAPI void ImageDrawPixel(Image *dst, int posX, int posY, Color color); // Draw pixel within an image RLAPI void ImageDrawPixelV(Image *dst, Vector2 position, Color color); // Draw pixel within an image (Vector version) RLAPI void ImageDrawLine(Image *dst, int startPosX, int startPosY, int endPosX, int endPosY, Color color); // Draw line within an image @@ -1431,8 +1433,10 @@ RLAPI void ImageDrawTriangleStrip(Image *dst, const Vector2 *points, int pointCo RLAPI void ImageDrawRectangle(Image *dst, int posX, int posY, int width, int height, Color color); // Draw rectangle within an image RLAPI void ImageDrawRectangleV(Image *dst, Vector2 position, Vector2 size, Color color); // Draw rectangle within an image (Vector version) RLAPI void ImageDrawRectangleRec(Image *dst, Rectangle rec, Color color); // Draw rectangle within an image +RLAPI void ImageDrawRectanglePro(Image *dst, Rectangle rec, Vector2 origin, float rotation, Color color); // Draw a color-filled rectangle with pro parameters within and image RLAPI void ImageDrawRectangleLines(Image *dst, int posX, int posY, int width, int height, Color color); // Draw rectangle lines within an image RLAPI void ImageDrawRectangleLinesEx(Image *dst, Rectangle rec, int thick, Color color); // Draw rectangle lines within an image with line thickness +RLAPI void ImageDrawRectangleGradientEx(Image *dst, Rectangle rec, Color col1, Color col2, Color col3, Color col4); // Draw rectangle with gradient colors within an image, counter-clockwise color order RLAPI void ImageDrawCircle(Image *dst, int centerX, int centerY, int radius, Color color); // Draw a filled circle within an image RLAPI void ImageDrawCircleV(Image *dst, Vector2 center, int radius, Color color); // Draw a filled circle within an image (Vector version) RLAPI void ImageDrawCircleLines(Image *dst, int centerX, int centerY, int radius, Color color); // Draw circle outline within an image @@ -1440,10 +1444,12 @@ RLAPI void ImageDrawCircleLinesV(Image *dst, Vector2 center, int radius, Color c RLAPI void ImageDrawCircleGradient(Image *dst, Vector2 center, float radius, Color inner, Color outer); // Draw a gradient-filled circle within an image RLAPI void ImageDrawImage(Image *dst, Image src, int posX, int posY, Color tint); // Draw an image within an image +RLAPI void ImageDrawImageEx(Image *dst, Image src, Vector2 position, float rotation, float scale, Color tint); // Draw an image with scaling and rotation within an image RLAPI void ImageDrawImageRec(Image *dst, Image src, Rectangle srcRec, Vector2 position, Color tint); // Draw a part of an image defined by a rectangle within an image RLAPI void ImageDrawImagePro(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec, Vector2 origin, float rotation, Color tint); // Draw a part of an image defined by a rectangle into destination rectangle, with scaling and rotation, within an image RLAPI void ImageDrawText(Image *dst, const char *text, int posX, int posY, int fontSize, Color color); // Draw text (using default font) within an image (destination) RLAPI void ImageDrawTextEx(Image *dst, Font font, const char *text, Vector2 position, float fontSize, float spacing, Color tint); // Draw text (custom sprite font) within an image (destination) +RLAPI void ImageDrawTextPro(Image *dst, Font font, const char *text, Vector2 position, Vector2 origin, float rotation, float fontSize, float spacing, Color tint); // Draw text using Font and pro parameters (rotation) // Texture loading functions // NOTE: These functions require GPU access diff --git a/src/rcore.c b/src/rcore.c index e26917606..c956b4503 100644 --- a/src/rcore.c +++ b/src/rcore.c @@ -108,7 +108,7 @@ #include // Required for: srand(), rand(), exit() #include // Required for: FILE, fopen(), fseek(), ftell(), fread(), fwrite(), fprintf(), vprintf(), fclose(), sprintf() [Used in OpenURL()] -#include // Required for: strlen(), strncpy(), strcmp(), strrchr(), memset(), strcat() +#include // Required for: strlen(), strcmp(), strrchr(), memset(), memcpy(), strcat() #include // Required for: va_list, va_start(), va_end() [Used in TraceLog()] #ifndef PICO_RP2350 @@ -1813,7 +1813,6 @@ void UnloadRandomSequence(int *sequence) } // Takes a screenshot of current screen -// NOTE: Provided fileName should not contain paths, saving to working directory void TakeScreenshot(const char *fileName) { #if SUPPORT_MODULE_RTEXTURES @@ -1828,7 +1827,8 @@ void TakeScreenshot(const char *fileName) Image image = { imgData, (int)((float)CORE.Window.render.width*scale.x), (int)((float)CORE.Window.render.height*scale.y), 1, PIXELFORMAT_UNCOMPRESSED_R8G8B8A8 }; char path[MAX_FILEPATH_LENGTH] = { 0 }; - strncpy(path, TextFormat("%s/%s", CORE.Storage.basePath, fileName), MAX_FILEPATH_LENGTH - 1); + if (!IsPathAbsolute(fileName)) snprintf(path, MAX_FILEPATH_LENGTH, "%s", TextFormat("%s/%s", CORE.Storage.basePath, fileName)); + else snprintf(path, MAX_FILEPATH_LENGTH, "%s", fileName); ExportImage(image, path); // WARNING: Module required: rtextures RL_FREE(imgData); @@ -1853,8 +1853,6 @@ void SetConfigFlags(unsigned int flags) FLAG_SET(CORE.Window.flags, flags); } -// void OpenURL(const char *url); // Defined per platform - //---------------------------------------------------------------------------------- // Module Functions Definition: Logging system //---------------------------------------------------------------------------------- @@ -1894,12 +1892,12 @@ void TraceLog(int logType, const char *text, ...) switch (logType) { - case LOG_TRACE: strncpy(buffer, "TRACE: ", 8); break; - case LOG_DEBUG: strncpy(buffer, "DEBUG: ", 8); break; - case LOG_INFO: strncpy(buffer, "INFO: ", 7); break; - case LOG_WARNING: strncpy(buffer, "WARNING: ", 10); break; - case LOG_ERROR: strncpy(buffer, "ERROR: ", 8); break; - case LOG_FATAL: strncpy(buffer, "FATAL: ", 8); break; + case LOG_TRACE: memcpy(buffer, "TRACE: ", 7); break; + case LOG_DEBUG: memcpy(buffer, "DEBUG: ", 7); break; + case LOG_INFO: memcpy(buffer, "INFO: ", 6); break; + case LOG_WARNING: memcpy(buffer, "WARNING: ", 9); break; + case LOG_ERROR: memcpy(buffer, "ERROR: ", 7); break; + case LOG_FATAL: memcpy(buffer, "FATAL: ", 7); break; default: break; } @@ -2072,7 +2070,7 @@ bool ExportDataAsCode(const unsigned char *data, int dataSize, const char *fileN // Get file name from path char varFileName[256] = { 0 }; - strncpy(varFileName, GetFileNameWithoutExt(fileName), 256 - 1); + snprintf(varFileName, 256, "%s", GetFileNameWithoutExt(fileName)); for (int i = 0; varFileName[i] != '\0'; i++) { // Convert variable name to uppercase @@ -2516,7 +2514,7 @@ const char *GetFileNameWithoutExt(const char *filePath) if (filePath != NULL) { - strncpy(fileName, GetFileName(filePath), MAX_FILENAME_LENGTH - 1); // Get filename.ext without path + snprintf(fileName, MAX_FILENAME_LENGTH, "%s", GetFileName(filePath)); // Get filename.ext without path int fileNameLength = (int)strlen(fileName); // Get size in bytes for (int i = fileNameLength; i > 0; i--) // Reverse search '.' @@ -2533,7 +2531,7 @@ const char *GetFileNameWithoutExt(const char *filePath) return fileName; } -// Get directory for a given filePath +// Get directory for a provided filePath const char *GetDirectoryPath(const char *filePath) { /* @@ -2570,7 +2568,6 @@ const char *GetDirectoryPath(const char *filePath) } else { - // NOTE: Be careful, strncpy() is not safe, it does not care about '\0' char *dirPathPtr = dirPath; if ((filePath[1] != ':') && (filePath[0] != '\\') && (filePath[0] != '/')) dirPathPtr += 2; // Skip drive letter, "C:" memcpy(dirPathPtr, filePath, strlen(filePath) - (strlen(lastSlash) - 1)); @@ -2581,14 +2578,14 @@ const char *GetDirectoryPath(const char *filePath) return dirPath; } -// Get previous directory path for a given path +// Get previous directory path for a provided path const char *GetPrevDirectoryPath(const char *dirPath) { static char prevDirPath[MAX_FILEPATH_LENGTH] = { 0 }; memset(prevDirPath, 0, MAX_FILEPATH_LENGTH); int dirPathLength = (int)strlen(dirPath); - if (dirPathLength <= 3) strncpy(prevDirPath, dirPath, MAX_FILEPATH_LENGTH - 1); + if (dirPathLength <= 3) snprintf(prevDirPath, MAX_FILEPATH_LENGTH, "%s", dirPath); for (int i = (dirPathLength - 1); (i >= 0) && (dirPathLength > 3); i--) { @@ -2597,7 +2594,7 @@ const char *GetPrevDirectoryPath(const char *dirPath) // Check for root: "C:\" or "/" if (((i == 2) && (dirPath[1] ==':')) || (i == 0)) i++; - strncpy(prevDirPath, dirPath, i); + memcpy(prevDirPath, dirPath, i); break; } } @@ -2831,13 +2828,49 @@ int ChangeDirectory(const char *dirPath) return result; } -// Check if given path point to a file +// Check if provided path point to a file bool IsPathFile(const char *path) { - struct stat result = { 0 }; - stat(path, &result); + bool result = false; - return S_ISREG(result.st_mode); + struct stat info = { 0 }; + stat(path, &info); + + if (S_ISREG(info.st_mode)) result = true; + + return result; +} + +// Check if provided path point to a directory +bool IsPathDirectory(const char *path) +{ + bool result = false; + + if (!IsPathFile(path)) result = true; + + return result; +} + +// Check if provided path is an absolute path +bool IsPathAbsolute(const char *path) +{ + int result = false; + + if ((path != NULL) && (path[0] != '\0')) + { +#if defined(_WIN32) + // UNC path (\\server\share) + if ((path[0] == '\\') && (path[1] == '\\')) result = true; + // Drive letter (e.g. C:\ or D:/) + else if (isalpha((unsigned char)path[0]) && (path[1] == ':') && + ((path[2] == '\\') || (path[2] == '/'))) result = true; +#else + // POSIX: must start with / + if (path[0] == '/') result = true; +#endif + } + + return result; } // Check if fileName is valid for the platform/OS @@ -3271,7 +3304,7 @@ unsigned int *ComputeMD5(const unsigned char *data, int dataSize) memcpy(msg + newDataSize, &bitsLen, 4); // Append the len in bits at the end of the buffer // Process the message in successive 512-bit chunks for each 512-bit chunk of message - for (int offset = 0; offset < newDataSize; offset += (512/8)) + for (int offset = 0; offset < newDataSize; offset += 64) // 512/8 { // Break chunk into sixteen 32-bit words w[j], 0 <= j <= 15 unsigned int *w = (unsigned int *)(msg + offset); @@ -3368,16 +3401,16 @@ unsigned int *ComputeSHA1(const unsigned char *data, int dataSize) msg[newDataSize - 8] = (unsigned char)(bitsLen >> 56); // Process the message in successive 512-bit chunks - for (int offset = 0; offset < newDataSize; offset += (512/8)) + for (int offset = 0; offset < newDataSize; offset += 64) // 512/8 { // Break chunk into sixteen 32-bit words w[j], 0 <= j <= 15 unsigned int w[80] = { 0 }; for (int i = 0; i < 16; i++) { - w[i] = (msg[offset + (i*4) + 0] << 24) | - (msg[offset + (i*4) + 1] << 16) | - (msg[offset + (i*4) + 2] << 8) | - (msg[offset + (i*4) + 3]); + w[i] = ((unsigned int)msg[offset + (i*4) + 0] << 24) | + ((unsigned int)msg[offset + (i*4) + 1] << 16) | + ((unsigned int)msg[offset + (i*4) + 2] << 8) | + ((unsigned int)msg[offset + (i*4) + 3]); } // Message schedule: extend the sixteen 32-bit words into eighty 32-bit words: @@ -3599,10 +3632,14 @@ AutomationEventList LoadAutomationEventList(const char *fileName) case 'c': sscanf(buffer, "c %i", &list.count); break; case 'e': { - sscanf(buffer, "e %d %d %d %d %d %d %[^\n]s", &list.events[counter].frame, &list.events[counter].type, - &list.events[counter].params[0], &list.events[counter].params[1], &list.events[counter].params[2], &list.events[counter].params[3], eventDesc); + if (counter < list.capacity) + { + sscanf(buffer, "e %d %d %d %d %d %d %63[^\n]s", &list.events[counter].frame, &list.events[counter].type, + &list.events[counter].params[0], &list.events[counter].params[1], &list.events[counter].params[2], &list.events[counter].params[3], eventDesc); - counter++; + counter++; + } + else TRACELOG(LOG_WARNING, "AUTOMATION: Event goes beyond automated list capacity (MAX: %u): %s", list.capacity, buffer); } break; default: break; } @@ -3935,7 +3972,7 @@ bool IsGamepadAvailable(int gamepad) { bool result = false; - if ((gamepad < MAX_GAMEPADS) && CORE.Input.Gamepad.ready[gamepad]) result = true; + if ((gamepad >= 0) && (gamepad < MAX_GAMEPADS) && CORE.Input.Gamepad.ready[gamepad]) result = true; return result; } @@ -3955,7 +3992,7 @@ bool IsGamepadButtonPressed(int gamepad, int button) { bool pressed = false; - if ((gamepad < MAX_GAMEPADS) && CORE.Input.Gamepad.ready[gamepad] && (button < MAX_GAMEPAD_BUTTONS)) + if ((gamepad >= 0) && (gamepad < MAX_GAMEPADS) && CORE.Input.Gamepad.ready[gamepad] && (button < MAX_GAMEPAD_BUTTONS)) { if ((CORE.Input.Gamepad.previousButtonState[gamepad][button] == 0) && (CORE.Input.Gamepad.currentButtonState[gamepad][button] == 1)) pressed = true; } @@ -3968,7 +4005,7 @@ bool IsGamepadButtonDown(int gamepad, int button) { bool down = false; - if ((gamepad < MAX_GAMEPADS) && CORE.Input.Gamepad.ready[gamepad] && (button < MAX_GAMEPAD_BUTTONS)) + if ((gamepad >= 0) && (gamepad < MAX_GAMEPADS) && CORE.Input.Gamepad.ready[gamepad] && (button < MAX_GAMEPAD_BUTTONS)) { if (CORE.Input.Gamepad.currentButtonState[gamepad][button] == 1) down = true; } @@ -3981,7 +4018,7 @@ bool IsGamepadButtonReleased(int gamepad, int button) { bool released = false; - if ((gamepad < MAX_GAMEPADS) && CORE.Input.Gamepad.ready[gamepad] && (button < MAX_GAMEPAD_BUTTONS)) + if ((gamepad >= 0) && (gamepad < MAX_GAMEPADS) && CORE.Input.Gamepad.ready[gamepad] && (button < MAX_GAMEPAD_BUTTONS)) { if ((CORE.Input.Gamepad.previousButtonState[gamepad][button] == 1) && (CORE.Input.Gamepad.currentButtonState[gamepad][button] == 0)) released = true; } @@ -3994,7 +4031,7 @@ bool IsGamepadButtonUp(int gamepad, int button) { bool up = false; - if ((gamepad < MAX_GAMEPADS) && CORE.Input.Gamepad.ready[gamepad] && (button < MAX_GAMEPAD_BUTTONS)) + if ((gamepad >= 0) && (gamepad < MAX_GAMEPADS) && CORE.Input.Gamepad.ready[gamepad] && (button < MAX_GAMEPAD_BUTTONS)) { if (CORE.Input.Gamepad.currentButtonState[gamepad][button] == 0) up = true; } @@ -4024,7 +4061,7 @@ float GetGamepadAxisMovement(int gamepad, int axis) { float value = ((axis == GAMEPAD_AXIS_LEFT_TRIGGER) || (axis == GAMEPAD_AXIS_RIGHT_TRIGGER))? -1.0f : 0.0f; - if ((gamepad < MAX_GAMEPADS) && CORE.Input.Gamepad.ready[gamepad] && (axis < MAX_GAMEPAD_AXES)) + if ((gamepad >= 0) && (gamepad < MAX_GAMEPADS) && CORE.Input.Gamepad.ready[gamepad] && (axis < MAX_GAMEPAD_AXES)) { float movement = (value < 0.0f)? CORE.Input.Gamepad.axisState[gamepad][axis] : fabsf(CORE.Input.Gamepad.axisState[gamepad][axis]); @@ -4208,7 +4245,7 @@ Vector2 GetTouchPosition(int index) return position; } -// Get touch point identifier for given index +// Get touch point identifier for provided index int GetTouchPointId(int index) { int id = -1; diff --git a/src/rlgl.h b/src/rlgl.h index 8c529a4e0..7f3fe54cd 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -56,8 +56,8 @@ * #define RL_CULL_DISTANCE_NEAR 0.05 // Default projection matrix near cull distance * #define RL_CULL_DISTANCE_FAR 4000.0 // Default projection matrix far cull distance * -* When loading a shader, the following vertex attributes and uniform -* location names are tried to be set automatically: +* When loading a shader, the following vertex attributes and uniform location names are tried to be set automatically: +* WARNING: Pre-defined names can not be changed, they are used by default shaders and all raylib examples shaders, they are just listed here for reference * * #define RL_DEFAULT_SHADER_ATTRIB_NAME_POSITION "vertexPosition" // Bound by default to shader location: RL_DEFAULT_SHADER_ATTRIB_LOCATION_POSITION * #define RL_DEFAULT_SHADER_ATTRIB_NAME_TEXCOORD "vertexTexCoord" // Bound by default to shader location: RL_DEFAULT_SHADER_ATTRIB_LOCATION_TEXCOORD @@ -67,6 +67,8 @@ * #define RL_DEFAULT_SHADER_ATTRIB_NAME_TEXCOORD2 "vertexTexCoord2" // Bound by default to shader location: RL_DEFAULT_SHADER_ATTRIB_LOCATION_TEXCOORD2 * #define RL_DEFAULT_SHADER_ATTRIB_NAME_BONEINDICES "vertexBoneIndices" // Bound by default to shader location: RL_DEFAULT_SHADER_ATTRIB_LOCATION_BONEINDICES * #define RL_DEFAULT_SHADER_ATTRIB_NAME_BONEWEIGHTS "vertexBoneWeights" // Bound by default to shader location: RL_DEFAULT_SHADER_ATTRIB_LOCATION_BONEWEIGHTS +* #define RL_DEFAULT_SHADER_ATTRIB_NAME_INSTANCETRANSFORM "instanceTransform" // Bound by default to shader location: RL_DEFAULT_SHADER_ATTRIB_LOCATION_INSTANCETRANSFORM +* * #define RL_DEFAULT_SHADER_UNIFORM_NAME_MVP "mvp" // model-view-projection matrix * #define RL_DEFAULT_SHADER_UNIFORM_NAME_VIEW "matView" // view matrix * #define RL_DEFAULT_SHADER_UNIFORM_NAME_PROJECTION "matProjection" // projection matrix @@ -74,6 +76,7 @@ * #define RL_DEFAULT_SHADER_UNIFORM_NAME_NORMAL "matNormal" // normal matrix (transpose(inverse(matModelView))) * #define RL_DEFAULT_SHADER_UNIFORM_NAME_COLOR "colDiffuse" // color diffuse (base tint color, multiplied by texture color) * #define RL_DEFAULT_SHADER_UNIFORM_NAME_BONEMATRICES "boneMatrices" // bone matrices +* * #define RL_DEFAULT_SHADER_SAMPLER2D_NAME_TEXTURE0 "texture0" // texture0 (texture slot active 0) * #define RL_DEFAULT_SHADER_SAMPLER2D_NAME_TEXTURE1 "texture1" // texture1 (texture slot active 1) * #define RL_DEFAULT_SHADER_SAMPLER2D_NAME_TEXTURE2 "texture2" // texture2 (texture slot active 2) @@ -324,6 +327,7 @@ #define RL_DRAW_FRAMEBUFFER 0x8CA9 // GL_DRAW_FRAMEBUFFER // Default shader vertex attribute locations +// NOTE: Locations can be redefined by user if required #ifndef RL_DEFAULT_SHADER_ATTRIB_LOCATION_POSITION #define RL_DEFAULT_SHADER_ATTRIB_LOCATION_POSITION 0 #endif @@ -843,11 +847,11 @@ RLAPI void rlLoadDrawQuad(void); // Load and draw a quad #define SW_CALLOC(n,sz) RL_CALLOC(n, sz) #define SW_REALLOC(ptr, newSz) RL_REALLOC(ptr, newSz) #define SW_FREE(ptr) RL_FREE(ptr) - #include "external/rlsw.h" // OpenGL 1.1 software implementation + #include "external/rlsw.h" // OpenGL 1.1 software implementation #else #if defined(__APPLE__) - #include // OpenGL 1.1 library for OSX - #include // OpenGL extensions library + #include // OpenGL 1.1 library for OSX + #include // OpenGL extensions library #else // APIENTRY for OpenGL function pointer declarations is required #if !defined(APIENTRY) @@ -862,7 +866,7 @@ RLAPI void rlLoadDrawQuad(void); // Load and draw a quad #define WINGDIAPI __declspec(dllimport) #endif - #include // OpenGL 1.1 library + #include // OpenGL 1.1 library #endif #endif #endif @@ -903,9 +907,10 @@ RLAPI void rlLoadDrawQuad(void); // Load and draw a quad #endif #endif -#include // Required for: calloc(), free() -#include // Required for: strcmp(), strlen() [Used in rlglInit(), on extensions loading] -#include // Required for: sqrtf(), sinf(), cosf(), floor(), log() +#include // Required for: calloc(), free() +#include // Required for: strcmp(), strlen() [Used in rlglInit(), on extensions loading] +#include // Required for: sqrtf(), sinf(), cosf(), floor(), log() +#include // Required for: INT_MAX //---------------------------------------------------------------------------------- // Defines and Macros @@ -993,65 +998,28 @@ RLAPI void rlLoadDrawQuad(void); // Load and draw a quad #endif // Default shader vertex attribute names to set location points -#ifndef RL_DEFAULT_SHADER_ATTRIB_NAME_POSITION - #define RL_DEFAULT_SHADER_ATTRIB_NAME_POSITION "vertexPosition" // Bound by default to shader location: RL_DEFAULT_SHADER_ATTRIB_LOCATION_POSITION -#endif -#ifndef RL_DEFAULT_SHADER_ATTRIB_NAME_TEXCOORD - #define RL_DEFAULT_SHADER_ATTRIB_NAME_TEXCOORD "vertexTexCoord" // Bound by default to shader location: RL_DEFAULT_SHADER_ATTRIB_LOCATION_TEXCOORD -#endif -#ifndef RL_DEFAULT_SHADER_ATTRIB_NAME_NORMAL - #define RL_DEFAULT_SHADER_ATTRIB_NAME_NORMAL "vertexNormal" // Bound by default to shader location: RL_DEFAULT_SHADER_ATTRIB_LOCATION_NORMAL -#endif -#ifndef RL_DEFAULT_SHADER_ATTRIB_NAME_COLOR - #define RL_DEFAULT_SHADER_ATTRIB_NAME_COLOR "vertexColor" // Bound by default to shader location: RL_DEFAULT_SHADER_ATTRIB_LOCATION_COLOR -#endif -#ifndef RL_DEFAULT_SHADER_ATTRIB_NAME_TANGENT - #define RL_DEFAULT_SHADER_ATTRIB_NAME_TANGENT "vertexTangent" // Bound by default to shader location: RL_DEFAULT_SHADER_ATTRIB_LOCATION_TANGENT -#endif -#ifndef RL_DEFAULT_SHADER_ATTRIB_NAME_TEXCOORD2 - #define RL_DEFAULT_SHADER_ATTRIB_NAME_TEXCOORD2 "vertexTexCoord2" // Bound by default to shader location: RL_DEFAULT_SHADER_ATTRIB_LOCATION_TEXCOORD2 -#endif -#ifndef RL_DEFAULT_SHADER_ATTRIB_NAME_BONEINDICES - #define RL_DEFAULT_SHADER_ATTRIB_NAME_BONEINDICES "vertexBoneIndices" // Bound by default to shader location: RL_DEFAULT_SHADER_ATTRIB_LOCATION_BONEINDICES -#endif -#ifndef RL_DEFAULT_SHADER_ATTRIB_NAME_BONEWEIGHTS - #define RL_DEFAULT_SHADER_ATTRIB_NAME_BONEWEIGHTS "vertexBoneWeights" // Bound by default to shader location: RL_DEFAULT_SHADER_ATTRIB_LOCATION_BONEWEIGHTS -#endif +// WARNING: Pre-defined names can not be changed, they are used by default shaders and all raylib examples shaders, they are just listed here for reference +#define RL_DEFAULT_SHADER_ATTRIB_NAME_POSITION "vertexPosition" // Bound by default to shader location: RL_DEFAULT_SHADER_ATTRIB_LOCATION_POSITION +#define RL_DEFAULT_SHADER_ATTRIB_NAME_TEXCOORD "vertexTexCoord" // Bound by default to shader location: RL_DEFAULT_SHADER_ATTRIB_LOCATION_TEXCOORD +#define RL_DEFAULT_SHADER_ATTRIB_NAME_NORMAL "vertexNormal" // Bound by default to shader location: RL_DEFAULT_SHADER_ATTRIB_LOCATION_NORMAL +#define RL_DEFAULT_SHADER_ATTRIB_NAME_COLOR "vertexColor" // Bound by default to shader location: RL_DEFAULT_SHADER_ATTRIB_LOCATION_COLOR +#define RL_DEFAULT_SHADER_ATTRIB_NAME_TANGENT "vertexTangent" // Bound by default to shader location: RL_DEFAULT_SHADER_ATTRIB_LOCATION_TANGENT +#define RL_DEFAULT_SHADER_ATTRIB_NAME_TEXCOORD2 "vertexTexCoord2" // Bound by default to shader location: RL_DEFAULT_SHADER_ATTRIB_LOCATION_TEXCOORD2 +#define RL_DEFAULT_SHADER_ATTRIB_NAME_BONEINDICES "vertexBoneIndices" // Bound by default to shader location: RL_DEFAULT_SHADER_ATTRIB_LOCATION_BONEINDICES +#define RL_DEFAULT_SHADER_ATTRIB_NAME_BONEWEIGHTS "vertexBoneWeights" // Bound by default to shader location: RL_DEFAULT_SHADER_ATTRIB_LOCATION_BONEWEIGHTS +#define RL_DEFAULT_SHADER_ATTRIB_NAME_INSTANCETRANSFORM "instanceTransform" // Bound by default to shader location: RL_DEFAULT_SHADER_ATTRIB_LOCATION_INSTANCETRANSFORM -#ifndef RL_DEFAULT_SHADER_ATTRIB_NAME_INSTANCETRANSFORM - #define RL_DEFAULT_SHADER_ATTRIB_NAME_INSTANCETRANSFORM "instanceTransform" // Bound by default to shader location: RL_DEFAULT_SHADER_ATTRIB_LOCATION_INSTANCETRANSFORM -#endif +#define RL_DEFAULT_SHADER_UNIFORM_NAME_MVP "mvp" // model-view-projection matrix +#define RL_DEFAULT_SHADER_UNIFORM_NAME_VIEW "matView" // view matrix +#define RL_DEFAULT_SHADER_UNIFORM_NAME_PROJECTION "matProjection" // projection matrix +#define RL_DEFAULT_SHADER_UNIFORM_NAME_MODEL "matModel" // model matrix +#define RL_DEFAULT_SHADER_UNIFORM_NAME_NORMAL "matNormal" // normal matrix (transpose(inverse(matModelView)) +#define RL_DEFAULT_SHADER_UNIFORM_NAME_COLOR "colDiffuse" // color diffuse (base tint color, multiplied by texture color) +#define RL_DEFAULT_SHADER_UNIFORM_NAME_BONEMATRICES "boneMatrices" // bone matrices (required for GPU skinning) -#ifndef RL_DEFAULT_SHADER_UNIFORM_NAME_MVP - #define RL_DEFAULT_SHADER_UNIFORM_NAME_MVP "mvp" // model-view-projection matrix -#endif -#ifndef RL_DEFAULT_SHADER_UNIFORM_NAME_VIEW - #define RL_DEFAULT_SHADER_UNIFORM_NAME_VIEW "matView" // view matrix -#endif -#ifndef RL_DEFAULT_SHADER_UNIFORM_NAME_PROJECTION - #define RL_DEFAULT_SHADER_UNIFORM_NAME_PROJECTION "matProjection" // projection matrix -#endif -#ifndef RL_DEFAULT_SHADER_UNIFORM_NAME_MODEL - #define RL_DEFAULT_SHADER_UNIFORM_NAME_MODEL "matModel" // model matrix -#endif -#ifndef RL_DEFAULT_SHADER_UNIFORM_NAME_NORMAL - #define RL_DEFAULT_SHADER_UNIFORM_NAME_NORMAL "matNormal" // normal matrix (transpose(inverse(matModelView)) -#endif -#ifndef RL_DEFAULT_SHADER_UNIFORM_NAME_COLOR - #define RL_DEFAULT_SHADER_UNIFORM_NAME_COLOR "colDiffuse" // color diffuse (base tint color, multiplied by texture color) -#endif -#ifndef RL_DEFAULT_SHADER_SAMPLER2D_NAME_TEXTURE0 - #define RL_DEFAULT_SHADER_SAMPLER2D_NAME_TEXTURE0 "texture0" // texture0 (texture slot active 0) -#endif -#ifndef RL_DEFAULT_SHADER_SAMPLER2D_NAME_TEXTURE1 - #define RL_DEFAULT_SHADER_SAMPLER2D_NAME_TEXTURE1 "texture1" // texture1 (texture slot active 1) -#endif -#ifndef RL_DEFAULT_SHADER_SAMPLER2D_NAME_TEXTURE2 - #define RL_DEFAULT_SHADER_SAMPLER2D_NAME_TEXTURE2 "texture2" // texture2 (texture slot active 2) -#endif -#ifndef RL_DEFAULT_SHADER_UNIFORM_NAME_BONEMATRICES - #define RL_DEFAULT_SHADER_UNIFORM_NAME_BONEMATRICES "boneMatrices" // bone matrices (required for GPU skinning) -#endif +#define RL_DEFAULT_SHADER_SAMPLER2D_NAME_TEXTURE0 "texture0" // texture0 (texture slot active 0) +#define RL_DEFAULT_SHADER_SAMPLER2D_NAME_TEXTURE1 "texture1" // texture1 (texture slot active 1) +#define RL_DEFAULT_SHADER_SAMPLER2D_NAME_TEXTURE2 "texture2" // texture2 (texture slot active 2) //---------------------------------------------------------------------------------- // Module Types and Structures Definition @@ -2502,7 +2470,7 @@ void rlLoadExtensions(void *loader) // NOTE: String duplication rquired because glGetString() returns a const string int extensionsLength = (int)strlen(extensions); // Get extensions string size in bytes char *extensionsDup = (char *)RL_CALLOC(extensionsLength + 1, sizeof(char)); // Allocate space for copy with additional EOL byte - strncpy(extensionsDup, extensions, extensionsLength); + snprintf(extensionsDup, extensionsLength, "%s", extensions); extList[numExt] = extensionsDup; for (int i = 0; i < extensionsLength; i++) @@ -3022,7 +2990,7 @@ void rlDrawRenderBatch(rlRenderBatch *batch) // NOTE: glMapBuffer() causes sync issue // If GPU is working with this buffer, glMapBuffer() will wait(stall) until GPU to finish its job - // To avoid waiting (idle), glBufferData() can bee called first with NULL pointer before glMapBuffer() + // To avoid waiting (idle), glBufferData() can be called first with NULL pointer before glMapBuffer() // Doing that, the previous data in PBO will be discarded and glMapBuffer() returns a new // allocated pointer immediately even if GPU is still working with the previous data @@ -3825,6 +3793,10 @@ unsigned char *rlReadScreenPixels(int width, int height) { unsigned char *imgData = (unsigned char *)RL_CALLOC(width*height*4, sizeof(unsigned char)); + // NOTE: Buffer retrieved is GL_FRONT in single-buffered configurations + // and GL_BACK in double-buffered configurations, make sure to call it at the end of frame + //glReadBuffer(GL_BACK); + // NOTE: glReadPixels() returns image flipped vertically -> (0,0) is the bottom left corner of the framebuffer // WARNING: Getting alpha channel! Be careful, it can be transparent if not cleared properly! glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, imgData); @@ -5269,7 +5241,9 @@ static int rlGetPixelDataSize(int width, int height, int format) { int blockWidth = (width + 3)/4; int blockHeight = (height + 3)/4; - dataSize = blockWidth*blockHeight*8; + unsigned long long dataSizeBytes = (unsigned long long)blockWidth*blockHeight*8; + if (dataSizeBytes < INT_MAX) dataSize = (int)dataSizeBytes; + } break; case RL_PIXELFORMAT_COMPRESSED_DXT3_RGBA: case RL_PIXELFORMAT_COMPRESSED_DXT5_RGBA: @@ -5278,13 +5252,17 @@ static int rlGetPixelDataSize(int width, int height, int format) { int blockWidth = (width + 3)/4; int blockHeight = (height + 3)/4; - dataSize = blockWidth*blockHeight*16; + unsigned long long dataSizeBytes = (unsigned long long)blockWidth*blockHeight*16; + if (dataSizeBytes < INT_MAX) dataSize = (int)dataSizeBytes; + } break; case RL_PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA: // 4 bytes per each 4x4 block { int blockWidth = (width + 3)/4; int blockHeight = (height + 3)/4; - dataSize = blockWidth*blockHeight*4; + unsigned long long dataSizeBytes = (unsigned long long)blockWidth*blockHeight*4; + if (dataSizeBytes < INT_MAX) dataSize = (int)dataSizeBytes; + } break; default: break; } @@ -5293,9 +5271,11 @@ static int rlGetPixelDataSize(int width, int height, int format) if ((format >= RL_PIXELFORMAT_UNCOMPRESSED_GRAYSCALE) && (format <= RL_PIXELFORMAT_UNCOMPRESSED_R16G16B16A16)) { - double bytesPerPixel = (double)bpp/8.0; - dataSize = (int)(bytesPerPixel*width*height); // Total data size in bytes + unsigned long long dataSizeBytes = ((unsigned long long)width*height*bpp) >> 3; // Get size in bytes (dividing by 8) + if (dataSizeBytes < INT_MAX) dataSize = (int)dataSizeBytes; } + + if (dataSize == 0) TRACELOG(LOG_WARNING, "Requested image size is larger than 2GB, it can not be allocated"); return dataSize; } diff --git a/src/rmodels.c b/src/rmodels.c index 28fb3c9ec..0325f9b1b 100644 --- a/src/rmodels.c +++ b/src/rmodels.c @@ -50,9 +50,9 @@ #include "rlgl.h" // OpenGL abstraction layer to OpenGL 1.1, 2.1, 3.3+ or ES2 #include "raymath.h" // Required for: Vector3, Quaternion and Matrix functionality -#include // Required for: sprintf() +#include // Required for: sprintf(), snprintf() #include // Required for: malloc(), calloc(), free() -#include // Required for: memcmp(), strlen(), strncpy() +#include // Required for: strlen(), memcmp() #include // Required for: sinf(), cosf(), sqrtf(), fabsf() #if SUPPORT_FILEFORMAT_OBJ || SUPPORT_FILEFORMAT_MTL @@ -2073,7 +2073,7 @@ bool ExportMeshAsCode(Mesh mesh, const char *fileName) // Get file name from path and convert variable name to uppercase char varFileName[256] = { 0 }; - strncpy(varFileName, GetFileNameWithoutExt(fileName), 256 - 1); // NOTE: Using function provided by [rcore] module + snprintf(varFileName, 256, "%s", GetFileNameWithoutExt(fileName)); // NOTE: Using function provided by [rcore] module for (int i = 0; varFileName[i] != '\0'; i++) if ((varFileName[i] >= 'a') && (varFileName[i] <= 'z')) { varFileName[i] = varFileName[i] - 32; } // Add image information @@ -2320,7 +2320,7 @@ void UpdateModelAnimation(Model model, ModelAnimation anim, float frame) Matrix currentPoseMatrix = { 0 }; // Update all bones and bone matrices of model - for (int boneIndex = 0; boneIndex < model.skeleton.boneCount; boneIndex++) + for (unsigned int boneIndex = 0; boneIndex < model.skeleton.boneCount; boneIndex++) { // Compute interpolated pose between current and next frame // NOTE: Storing animation frame data in model.currentPose @@ -2390,7 +2390,7 @@ void UpdateModelAnimationEx(Model model, ModelAnimation animA, float frameA, Mod Matrix bindPoseMatrix = { 0 }; Matrix currentPoseMatrix = { 0 }; - for (int boneIndex = 0; boneIndex < model.skeleton.boneCount; boneIndex++) + for (unsigned int boneIndex = 0; boneIndex < model.skeleton.boneCount; boneIndex++) { // Get frame-interpolation for first animation Vector3 frameATranslation = Vector3Lerp( @@ -4421,7 +4421,7 @@ static Model LoadOBJ(const char *fileName) } char currentDir[MAX_FILEPATH_LENGTH] = { 0 }; - strncpy(currentDir, GetWorkingDirectory(), MAX_FILEPATH_LENGTH - 1); // Save current working directory + snprintf(currentDir, MAX_FILEPATH_LENGTH, "%s", GetWorkingDirectory()); // Save current working directory const char *workingDir = GetDirectoryPath(fileName); // Switch to OBJ directory for material path correctness if (CHDIR(workingDir) != 0) TRACELOG(LOG_WARNING, "MODEL: [%s] Failed to change working directory", workingDir); @@ -5013,7 +5013,7 @@ static Model LoadIQM(const char *fileName) // Initialize runtime animation data: current pose and bone matrices model.currentPose = (Transform *)RL_CALLOC(model.skeleton.boneCount, sizeof(Transform)); model.boneMatrices = (Matrix *)RL_CALLOC(model.skeleton.boneCount, sizeof(Matrix)); - for (int j = 0; j < model.skeleton.boneCount; j++) model.boneMatrices[j] = MatrixIdentity(); + for (unsigned int j = 0; j < model.skeleton.boneCount; j++) model.boneMatrices[j] = MatrixIdentity(); UnloadFileData(fileData); @@ -5241,7 +5241,7 @@ static ModelAnimation *LoadModelAnimationsIQM(const char *fileName, int *animCou // Build frameposes for (unsigned int frame = 0; frame < anim[a].num_frames; frame++) { - for (int i = 0; i < animations[a].boneCount; i++) + for (unsigned int i = 0; i < animations[a].boneCount; i++) { if (bones[i].parent >= 0) { @@ -5316,8 +5316,8 @@ static Image LoadImageFromCgltfImage(cgltf_image *cgltfImage, const char *texPat { int base64Size = (int)strlen(cgltfImage->uri + i + 1); while (cgltfImage->uri[i + base64Size] == '=') base64Size--; // Ignore optional paddings - int numberOfEncodedBits = base64Size*6 - (base64Size*6) % 8 ; // Encoded bits minus extra bits, so it becomes a multiple of 8 bits - int outSize = numberOfEncodedBits/8 ; // Actual encoded bytes + int numberOfEncodedBits = base64Size*6 - (base64Size*6)%8; // Encoded bits minus extra bits, so it becomes a multiple of 8 bits + int outSize = numberOfEncodedBits >> 3; // Actual encoded bytes void *data = NULL; cgltf_options options = { 0 }; @@ -5369,15 +5369,15 @@ static Image LoadImageFromCgltfImage(cgltf_image *cgltfImage, const char *texPat } // Load bone info from GLTF skin data -static BoneInfo *LoadBoneInfoGLTF(cgltf_skin skin, int *boneCount) +static BoneInfo *LoadBoneInfoGLTF(cgltf_skin skin, unsigned int *boneCount) { - *boneCount = (int)skin.joints_count; + *boneCount = (unsigned int)skin.joints_count; BoneInfo *bones = (BoneInfo *)RL_CALLOC(skin.joints_count, sizeof(BoneInfo)); for (unsigned int i = 0; i < skin.joints_count; i++) { cgltf_node node = *skin.joints[i]; - if (node.name != NULL) strncpy(bones[i].name, node.name, sizeof(bones[i].name) - 1); + if (node.name != NULL) snprintf(bones[i].name, sizeof(bones[i].name), "%s", node.name); // Find parent bone index by walking up the node tree past any // non-joint ancestors (intermediate transform nodes used by some @@ -6144,7 +6144,7 @@ static Model LoadGLTF(const char *fileName) model.skeleton.bones = LoadBoneInfoGLTF(skin, &model.skeleton.boneCount); model.skeleton.bindPose = (Transform *)RL_CALLOC(model.skeleton.boneCount, sizeof(Transform)); - for (int i = 0; i < model.skeleton.boneCount; i++) + for (unsigned int i = 0; i < model.skeleton.boneCount; i++) { Matrix bindMatrix = { 0 }; cgltf_float inverseBindTransform[16] = { 0 }; @@ -6309,7 +6309,7 @@ static Model LoadGLTF(const char *fileName) if ((data->skins_count > 0) && !hasJoints && (node->parent != NULL) && (node->parent->mesh == NULL)) { int parentBoneId = -1; - for (int joint = 0; joint < model.skeleton.boneCount; joint++) + for (unsigned int joint = 0; joint < model.skeleton.boneCount; joint++) { if (data->skins[0].joints[joint] == node->parent) { @@ -6347,7 +6347,7 @@ static Model LoadGLTF(const char *fileName) // Initialize runtime animation data: current pose and bone matrices model.currentPose = (Transform *)RL_CALLOC(model.skeleton.boneCount, sizeof(Transform)); model.boneMatrices = (Matrix *)RL_CALLOC(model.skeleton.boneCount, sizeof(Matrix)); - for (int j = 0; j < model.skeleton.boneCount; j++) model.boneMatrices[j] = MatrixIdentity(); + for (unsigned int j = 0; j < model.skeleton.boneCount; j++) model.boneMatrices[j] = MatrixIdentity(); //---------------------------------------------------------------------------------------------------- // Free unused allocated memory in case of no bones defined @@ -6660,7 +6660,7 @@ static ModelAnimation *LoadModelAnimationsGLTF(const char *fileName, int *animCo animDuration = (time > animDuration)? time : animDuration; } - if (animData.name != NULL) strncpy(animations[a].name, animData.name, sizeof(animations[a].name) - 1); + if (animData.name != NULL) snprintf(animations[a].name, sizeof(animations[a].name), "%s", animData.name); animations[a].keyframeCount = (int)(animDuration*GLTF_FRAMERATE) + 1; animations[a].keyframePoses = (Transform **)RL_CALLOC(animations[a].keyframeCount, sizeof(Transform *)); @@ -6670,7 +6670,7 @@ static ModelAnimation *LoadModelAnimationsGLTF(const char *fileName, int *animCo animations[a].keyframePoses[j] = (Transform *)RL_CALLOC(animations[a].boneCount, sizeof(Transform)); float time = (float)j / GLTF_FRAMERATE; - for (int k = 0; k < animations[a].boneCount; k++) + for (unsigned int k = 0; k < animations[a].boneCount; k++) { Vector3 translation = {skin.joints[k]->translation[0], skin.joints[k]->translation[1], skin.joints[k]->translation[2]}; Quaternion rotation = {skin.joints[k]->rotation[0], skin.joints[k]->rotation[1], skin.joints[k]->rotation[2], skin.joints[k]->rotation[3]}; @@ -7150,7 +7150,7 @@ static Model LoadM3D(const char *fileName) for (i = 0; i < (int)m3d->numbone; i++) { model.skeleton.bones[i].parent = m3d->bone[i].parent; - strncpy(model.skeleton.bones[i].name, m3d->bone[i].name, sizeof(model.skeleton.bones[i].name) - 1); + snprintf(model.skeleton.bones[i].name, sizeof(model.skeleton.bones[i].name), "%s", m3d->bone[i].name); model.skeleton.bindPose[i].translation.x = m3d->vertex[m3d->bone[i].pos].x*m3d->scale; model.skeleton.bindPose[i].translation.y = m3d->vertex[m3d->bone[i].pos].y*m3d->scale; model.skeleton.bindPose[i].translation.z = m3d->vertex[m3d->bone[i].pos].z*m3d->scale; @@ -7204,7 +7204,7 @@ static Model LoadM3D(const char *fileName) // Initialize runtime animation data: current pose and bone matrices model.currentPose = (Transform *)RL_CALLOC(model.skeleton.boneCount, sizeof(Transform)); model.boneMatrices = (Matrix *)RL_CALLOC(model.skeleton.boneCount, sizeof(Matrix)); - for (int j = 0; j < model.skeleton.boneCount; j++) model.boneMatrices[j] = MatrixIdentity(); + for (unsigned int j = 0; j < model.skeleton.boneCount; j++) model.boneMatrices[j] = MatrixIdentity(); } m3d_free(m3d); @@ -7258,14 +7258,14 @@ static ModelAnimation *LoadModelAnimationsM3D(const char *fileName, int *animCou animations[a].keyframeCount = m3d->action[a].durationmsec/M3D_ANIMDELAY; animations[a].keyframePoses = (Transform **)RL_CALLOC(animations[a].keyframeCount, sizeof(Transform *)); - strncpy(animations[a].name, m3d->action[a].name, sizeof(animations[a].name) - 1); + snprintf(animations[a].name, sizeof(animations[a].name), "%s", m3d->action[a].name); TRACELOG(LOG_INFO, "MODEL: [%s] Loaded animation: %s | Frames: %d | Duration: %fs", fileName, animations[a].name, animations[a].keyframeCount, m3d->action[a].durationmsec); for (i = 0; i < (int)m3d->numbone; i++) { bones[i].parent = m3d->bone[i].parent; - strncpy(bones[i].name, m3d->bone[i].name, sizeof(bones[i].name) - 1); + snprintf(bones[i].name, sizeof(bones[i].name), "%s", m3d->bone[i].name); } // A special, never transformed "no bone" bone, used for boneless vertices diff --git a/src/rshapes.c b/src/rshapes.c index 12ae6a164..def6d36b2 100644 --- a/src/rshapes.c +++ b/src/rshapes.c @@ -888,14 +888,13 @@ void DrawRectangleRounded(Rectangle rec, float roundness, int segments, Color co // Draw rectangle with rounded edges void DrawRectangleRoundedLines(Rectangle rec, float roundness, int segments, Color color) { - // NOTE: For line thicknes <=1.0f using RL_LINES, otherwise using RL_QUADS/RL_TRIANGLES DrawRectangleRoundedLinesEx(rec, roundness, segments, 1.0f, color); } // Draw rectangle with rounded edges outline with line thickness void DrawRectangleRoundedLinesEx(Rectangle rec, float roundness, int segments, float thick, Color color) { - if (thick < 0) thick = 0; + if (thick <= 0) return; // Not a rounded rectangle if (roundness <= 0.0f) @@ -966,176 +965,145 @@ void DrawRectangleRoundedLinesEx(Rectangle rec, float roundness, int segments, f const float angles[4] = { 180.0f, 270.0f, 0.0f, 90.0f }; - if (thick > 1) - { #if SUPPORT_QUADS_DRAW_MODE - rlSetTexture(GetShapesTexture().id); - Rectangle shapeRect = GetShapesTextureRectangle(); + rlSetTexture(GetShapesTexture().id); + Rectangle shapeRect = GetShapesTextureRectangle(); - rlBegin(RL_QUADS); + rlBegin(RL_QUADS); - // Draw all the 4 corners first: Upper Left Corner, Upper Right Corner, Lower Right Corner, Lower Left Corner - for (int k = 0; k < 4; ++k) // Hope the compiler is smart enough to unroll this loop - { - float angle = angles[k]; - const Vector2 center = centers[k]; - for (int i = 0; i < segments; i++) - { - rlColor4ub(color.r, color.g, color.b, color.a); - - rlTexCoord2f(shapeRect.x/texShapes.width, shapeRect.y/texShapes.height); - rlVertex2f(center.x + cosf(DEG2RAD*angle)*innerRadius, center.y + sinf(DEG2RAD*angle)*innerRadius); - - rlTexCoord2f((shapeRect.x + shapeRect.width)/texShapes.width, shapeRect.y/texShapes.height); - rlVertex2f(center.x + cosf(DEG2RAD*(angle + stepLength))*innerRadius, center.y + sinf(DEG2RAD*(angle + stepLength))*innerRadius); - - rlTexCoord2f((shapeRect.x + shapeRect.width)/texShapes.width, (shapeRect.y + shapeRect.height)/texShapes.height); - rlVertex2f(center.x + cosf(DEG2RAD*(angle + stepLength))*outerRadius, center.y + sinf(DEG2RAD*(angle + stepLength))*outerRadius); - - rlTexCoord2f(shapeRect.x/texShapes.width, (shapeRect.y + shapeRect.height)/texShapes.height); - rlVertex2f(center.x + cosf(DEG2RAD*angle)*outerRadius, center.y + sinf(DEG2RAD*angle)*outerRadius); - - angle += stepLength; - } - } - - // Upper rectangle - rlColor4ub(color.r, color.g, color.b, color.a); - rlTexCoord2f(shapeRect.x/texShapes.width, shapeRect.y/texShapes.height); - rlVertex2f(point[0].x, point[0].y); - rlTexCoord2f(shapeRect.x/texShapes.width, (shapeRect.y + shapeRect.height)/texShapes.height); - rlVertex2f(point[8].x, point[8].y); - rlTexCoord2f((shapeRect.x + shapeRect.width)/texShapes.width, (shapeRect.y + shapeRect.height)/texShapes.height); - rlVertex2f(point[9].x, point[9].y); - rlTexCoord2f((shapeRect.x + shapeRect.width)/texShapes.width, shapeRect.y/texShapes.height); - rlVertex2f(point[1].x, point[1].y); - - // Right rectangle - rlColor4ub(color.r, color.g, color.b, color.a); - rlTexCoord2f(shapeRect.x/texShapes.width, shapeRect.y/texShapes.height); - rlVertex2f(point[2].x, point[2].y); - rlTexCoord2f(shapeRect.x/texShapes.width, (shapeRect.y + shapeRect.height)/texShapes.height); - rlVertex2f(point[10].x, point[10].y); - rlTexCoord2f((shapeRect.x + shapeRect.width)/texShapes.width, (shapeRect.y + shapeRect.height)/texShapes.height); - rlVertex2f(point[11].x, point[11].y); - rlTexCoord2f((shapeRect.x + shapeRect.width)/texShapes.width, shapeRect.y/texShapes.height); - rlVertex2f(point[3].x, point[3].y); - - // Lower rectangle - rlColor4ub(color.r, color.g, color.b, color.a); - rlTexCoord2f(shapeRect.x/texShapes.width, shapeRect.y/texShapes.height); - rlVertex2f(point[13].x, point[13].y); - rlTexCoord2f(shapeRect.x/texShapes.width, (shapeRect.y + shapeRect.height)/texShapes.height); - rlVertex2f(point[5].x, point[5].y); - rlTexCoord2f((shapeRect.x + shapeRect.width)/texShapes.width, (shapeRect.y + shapeRect.height)/texShapes.height); - rlVertex2f(point[4].x, point[4].y); - rlTexCoord2f((shapeRect.x + shapeRect.width)/texShapes.width, shapeRect.y/texShapes.height); - rlVertex2f(point[12].x, point[12].y); - - // Left rectangle - rlColor4ub(color.r, color.g, color.b, color.a); - rlTexCoord2f(shapeRect.x/texShapes.width, shapeRect.y/texShapes.height); - rlVertex2f(point[15].x, point[15].y); - rlTexCoord2f(shapeRect.x/texShapes.width, (shapeRect.y + shapeRect.height)/texShapes.height); - rlVertex2f(point[7].x, point[7].y); - rlTexCoord2f((shapeRect.x + shapeRect.width)/texShapes.width, (shapeRect.y + shapeRect.height)/texShapes.height); - rlVertex2f(point[6].x, point[6].y); - rlTexCoord2f((shapeRect.x + shapeRect.width)/texShapes.width, shapeRect.y/texShapes.height); - rlVertex2f(point[14].x, point[14].y); - - rlEnd(); - rlSetTexture(0); -#else - rlBegin(RL_TRIANGLES); - - // Draw all of the 4 corners first: Upper Left Corner, Upper Right Corner, Lower Right Corner, Lower Left Corner - for (int k = 0; k < 4; ++k) // Hope the compiler is smart enough to unroll this loop - { - float angle = angles[k]; - const Vector2 center = centers[k]; - - for (int i = 0; i < segments; i++) - { - rlColor4ub(color.r, color.g, color.b, color.a); - - rlVertex2f(center.x + cosf(DEG2RAD*angle)*innerRadius, center.y + sinf(DEG2RAD*angle)*innerRadius); - rlVertex2f(center.x + cosf(DEG2RAD*(angle + stepLength))*innerRadius, center.y + sinf(DEG2RAD*(angle + stepLength))*innerRadius); - rlVertex2f(center.x + cosf(DEG2RAD*angle)*outerRadius, center.y + sinf(DEG2RAD*angle)*outerRadius); - - rlVertex2f(center.x + cosf(DEG2RAD*(angle + stepLength))*innerRadius, center.y + sinf(DEG2RAD*(angle + stepLength))*innerRadius); - rlVertex2f(center.x + cosf(DEG2RAD*(angle + stepLength))*outerRadius, center.y + sinf(DEG2RAD*(angle + stepLength))*outerRadius); - rlVertex2f(center.x + cosf(DEG2RAD*angle)*outerRadius, center.y + sinf(DEG2RAD*angle)*outerRadius); - - angle += stepLength; - } - } - - // Upper rectangle - rlColor4ub(color.r, color.g, color.b, color.a); - rlVertex2f(point[0].x, point[0].y); - rlVertex2f(point[8].x, point[8].y); - rlVertex2f(point[9].x, point[9].y); - rlVertex2f(point[1].x, point[1].y); - rlVertex2f(point[0].x, point[0].y); - rlVertex2f(point[9].x, point[9].y); - - // Right rectangle - rlColor4ub(color.r, color.g, color.b, color.a); - rlVertex2f(point[10].x, point[10].y); - rlVertex2f(point[11].x, point[11].y); - rlVertex2f(point[3].x, point[3].y); - rlVertex2f(point[2].x, point[2].y); - rlVertex2f(point[10].x, point[10].y); - rlVertex2f(point[3].x, point[3].y); - - // Lower rectangle - rlColor4ub(color.r, color.g, color.b, color.a); - rlVertex2f(point[13].x, point[13].y); - rlVertex2f(point[5].x, point[5].y); - rlVertex2f(point[4].x, point[4].y); - rlVertex2f(point[12].x, point[12].y); - rlVertex2f(point[13].x, point[13].y); - rlVertex2f(point[4].x, point[4].y); - - // Left rectangle - rlColor4ub(color.r, color.g, color.b, color.a); - rlVertex2f(point[7].x, point[7].y); - rlVertex2f(point[6].x, point[6].y); - rlVertex2f(point[14].x, point[14].y); - rlVertex2f(point[15].x, point[15].y); - rlVertex2f(point[7].x, point[7].y); - rlVertex2f(point[14].x, point[14].y); - rlEnd(); -#endif - } - else - { - // Use LINES to draw the outline - rlBegin(RL_LINES); - // Draw all the 4 corners first: Upper Left Corner, Upper Right Corner, Lower Right Corner, Lower Left Corner - for (int k = 0; k < 4; ++k) // Hope the compiler is smart enough to unroll this loop - { - float angle = angles[k]; - const Vector2 center = centers[k]; - - for (int i = 0; i < segments; i++) - { - rlColor4ub(color.r, color.g, color.b, color.a); - rlVertex2f(center.x + cosf(DEG2RAD*angle)*outerRadius, center.y + sinf(DEG2RAD*angle)*outerRadius); - rlVertex2f(center.x + cosf(DEG2RAD*(angle + stepLength))*outerRadius, center.y + sinf(DEG2RAD*(angle + stepLength))*outerRadius); - angle += stepLength; - } - } - - // And now the remaining 4 lines - for (int i = 0; i < 8; i += 2) + // Draw all the 4 corners first: Upper Left Corner, Upper Right Corner, Lower Right Corner, Lower Left Corner + for (int k = 0; k < 4; ++k) // Hope the compiler is smart enough to unroll this loop + { + float angle = angles[k]; + const Vector2 center = centers[k]; + for (int i = 0; i < segments; i++) { rlColor4ub(color.r, color.g, color.b, color.a); - rlVertex2f(point[i].x, point[i].y); - rlVertex2f(point[i + 1].x, point[i + 1].y); + + rlTexCoord2f(shapeRect.x/texShapes.width, shapeRect.y/texShapes.height); + rlVertex2f(center.x + cosf(DEG2RAD*angle)*innerRadius, center.y + sinf(DEG2RAD*angle)*innerRadius); + + rlTexCoord2f((shapeRect.x + shapeRect.width)/texShapes.width, shapeRect.y/texShapes.height); + rlVertex2f(center.x + cosf(DEG2RAD*(angle + stepLength))*innerRadius, center.y + sinf(DEG2RAD*(angle + stepLength))*innerRadius); + + rlTexCoord2f((shapeRect.x + shapeRect.width)/texShapes.width, (shapeRect.y + shapeRect.height)/texShapes.height); + rlVertex2f(center.x + cosf(DEG2RAD*(angle + stepLength))*outerRadius, center.y + sinf(DEG2RAD*(angle + stepLength))*outerRadius); + + rlTexCoord2f(shapeRect.x/texShapes.width, (shapeRect.y + shapeRect.height)/texShapes.height); + rlVertex2f(center.x + cosf(DEG2RAD*angle)*outerRadius, center.y + sinf(DEG2RAD*angle)*outerRadius); + + angle += stepLength; } - rlEnd(); - } + } + + // Upper rectangle + rlColor4ub(color.r, color.g, color.b, color.a); + rlTexCoord2f(shapeRect.x/texShapes.width, shapeRect.y/texShapes.height); + rlVertex2f(point[0].x, point[0].y); + rlTexCoord2f(shapeRect.x/texShapes.width, (shapeRect.y + shapeRect.height)/texShapes.height); + rlVertex2f(point[8].x, point[8].y); + rlTexCoord2f((shapeRect.x + shapeRect.width)/texShapes.width, (shapeRect.y + shapeRect.height)/texShapes.height); + rlVertex2f(point[9].x, point[9].y); + rlTexCoord2f((shapeRect.x + shapeRect.width)/texShapes.width, shapeRect.y/texShapes.height); + rlVertex2f(point[1].x, point[1].y); + + // Right rectangle + rlColor4ub(color.r, color.g, color.b, color.a); + rlTexCoord2f(shapeRect.x/texShapes.width, shapeRect.y/texShapes.height); + rlVertex2f(point[2].x, point[2].y); + rlTexCoord2f(shapeRect.x/texShapes.width, (shapeRect.y + shapeRect.height)/texShapes.height); + rlVertex2f(point[10].x, point[10].y); + rlTexCoord2f((shapeRect.x + shapeRect.width)/texShapes.width, (shapeRect.y + shapeRect.height)/texShapes.height); + rlVertex2f(point[11].x, point[11].y); + rlTexCoord2f((shapeRect.x + shapeRect.width)/texShapes.width, shapeRect.y/texShapes.height); + rlVertex2f(point[3].x, point[3].y); + + // Lower rectangle + rlColor4ub(color.r, color.g, color.b, color.a); + rlTexCoord2f(shapeRect.x/texShapes.width, shapeRect.y/texShapes.height); + rlVertex2f(point[13].x, point[13].y); + rlTexCoord2f(shapeRect.x/texShapes.width, (shapeRect.y + shapeRect.height)/texShapes.height); + rlVertex2f(point[5].x, point[5].y); + rlTexCoord2f((shapeRect.x + shapeRect.width)/texShapes.width, (shapeRect.y + shapeRect.height)/texShapes.height); + rlVertex2f(point[4].x, point[4].y); + rlTexCoord2f((shapeRect.x + shapeRect.width)/texShapes.width, shapeRect.y/texShapes.height); + rlVertex2f(point[12].x, point[12].y); + + // Left rectangle + rlColor4ub(color.r, color.g, color.b, color.a); + rlTexCoord2f(shapeRect.x/texShapes.width, shapeRect.y/texShapes.height); + rlVertex2f(point[15].x, point[15].y); + rlTexCoord2f(shapeRect.x/texShapes.width, (shapeRect.y + shapeRect.height)/texShapes.height); + rlVertex2f(point[7].x, point[7].y); + rlTexCoord2f((shapeRect.x + shapeRect.width)/texShapes.width, (shapeRect.y + shapeRect.height)/texShapes.height); + rlVertex2f(point[6].x, point[6].y); + rlTexCoord2f((shapeRect.x + shapeRect.width)/texShapes.width, shapeRect.y/texShapes.height); + rlVertex2f(point[14].x, point[14].y); + + rlEnd(); + rlSetTexture(0); +#else + rlBegin(RL_TRIANGLES); + + // Draw all of the 4 corners first: Upper Left Corner, Upper Right Corner, Lower Right Corner, Lower Left Corner + for (int k = 0; k < 4; ++k) // Hope the compiler is smart enough to unroll this loop + { + float angle = angles[k]; + const Vector2 center = centers[k]; + + for (int i = 0; i < segments; i++) + { + rlColor4ub(color.r, color.g, color.b, color.a); + + rlVertex2f(center.x + cosf(DEG2RAD*angle)*innerRadius, center.y + sinf(DEG2RAD*angle)*innerRadius); + rlVertex2f(center.x + cosf(DEG2RAD*(angle + stepLength))*innerRadius, center.y + sinf(DEG2RAD*(angle + stepLength))*innerRadius); + rlVertex2f(center.x + cosf(DEG2RAD*angle)*outerRadius, center.y + sinf(DEG2RAD*angle)*outerRadius); + + rlVertex2f(center.x + cosf(DEG2RAD*(angle + stepLength))*innerRadius, center.y + sinf(DEG2RAD*(angle + stepLength))*innerRadius); + rlVertex2f(center.x + cosf(DEG2RAD*(angle + stepLength))*outerRadius, center.y + sinf(DEG2RAD*(angle + stepLength))*outerRadius); + rlVertex2f(center.x + cosf(DEG2RAD*angle)*outerRadius, center.y + sinf(DEG2RAD*angle)*outerRadius); + + angle += stepLength; + } + } + + // Upper rectangle + rlColor4ub(color.r, color.g, color.b, color.a); + rlVertex2f(point[0].x, point[0].y); + rlVertex2f(point[8].x, point[8].y); + rlVertex2f(point[9].x, point[9].y); + rlVertex2f(point[1].x, point[1].y); + rlVertex2f(point[0].x, point[0].y); + rlVertex2f(point[9].x, point[9].y); + + // Right rectangle + rlColor4ub(color.r, color.g, color.b, color.a); + rlVertex2f(point[10].x, point[10].y); + rlVertex2f(point[11].x, point[11].y); + rlVertex2f(point[3].x, point[3].y); + rlVertex2f(point[2].x, point[2].y); + rlVertex2f(point[10].x, point[10].y); + rlVertex2f(point[3].x, point[3].y); + + // Lower rectangle + rlColor4ub(color.r, color.g, color.b, color.a); + rlVertex2f(point[13].x, point[13].y); + rlVertex2f(point[5].x, point[5].y); + rlVertex2f(point[4].x, point[4].y); + rlVertex2f(point[12].x, point[12].y); + rlVertex2f(point[13].x, point[13].y); + rlVertex2f(point[4].x, point[4].y); + + // Left rectangle + rlColor4ub(color.r, color.g, color.b, color.a); + rlVertex2f(point[7].x, point[7].y); + rlVertex2f(point[6].x, point[6].y); + rlVertex2f(point[14].x, point[14].y); + rlVertex2f(point[15].x, point[15].y); + rlVertex2f(point[7].x, point[7].y); + rlVertex2f(point[14].x, point[14].y); + rlEnd(); +#endif } // Draw a polygon of n sides diff --git a/src/rtext.c b/src/rtext.c index dda08b11e..0431a6f57 100644 --- a/src/rtext.c +++ b/src/rtext.c @@ -58,8 +58,8 @@ #include "rlgl.h" // OpenGL abstraction layer to OpenGL 1.1, 2.1, 3.3+ or ES2 -> Only DrawTextPro() #include // Required for: malloc(), free() -#include // Required for: vsprintf() -#include // Required for: strcmp(), strstr(), strncpy() [Used in TextReplace()], sscanf() [Used in LoadBMFont()] +#include // Required for: vsprintf(), snprintf() +#include // Required for: strcmp(), strstr(), strncpy(), sscanf() [Used in LoadBMFont()] #include // Required for: va_list, va_start(), vsprintf(), va_end() [Used in TextFormat()] #include // Required for: toupper(), tolower() [Used in TextToUpper(), TextToLower()] @@ -536,7 +536,7 @@ Font LoadFontFromMemory(const char *fileType, const unsigned char *fileData, int Font font = { 0 }; char fileExtLower[16] = { 0 }; - strncpy(fileExtLower, TextToLower(fileType), 16 - 1); + snprintf(fileExtLower, 16, "%s", TextToLower(fileType)); font.baseSize = fontSize; font.glyphPadding = 0; @@ -1030,7 +1030,7 @@ bool ExportFontAsCode(Font font, const char *fileName) // Get file name from path char fileNamePascal[256] = { 0 }; - strncpy(fileNamePascal, TextToPascal(GetFileNameWithoutExt(fileName)), 256 - 1); + snprintf(fileNamePascal, 256, "%s", TextToPascal(GetFileNameWithoutExt(fileName))); // Get font atlas image and size, required to estimate code file size // NOTE: This mechanism is highly coupled to raylib @@ -1532,7 +1532,7 @@ char **LoadTextLines(const char *text, int *count) if ((text[i] == '\n') || (text[i] == '\0')) { lines[l] = (char *)RL_CALLOC(lineLen + 1, 1); - strncpy(lines[l], &text[i - lineLen], lineLen); + memcpy(lines[l], &text[i - lineLen], lineLen); lineLen = 0; l++; } @@ -1699,7 +1699,7 @@ const char *TextSubtext(const char *text, int position, int length) static char buffer[MAX_TEXT_BUFFER_LENGTH] = { 0 }; memset(buffer, 0, MAX_TEXT_BUFFER_LENGTH); - if (text != NULL) + if ((text != NULL) && (position >= 0) && (length > 0)) { int textLength = TextLength(text); @@ -1755,8 +1755,8 @@ char *GetTextBetween(const char *text, const char *begin, const char *end) { endIndex += (beginIndex + beginLen); int len = (endIndex - beginIndex - beginLen); - if (len < (MAX_TEXT_BUFFER_LENGTH - 1)) strncpy(buffer, text + beginIndex + beginLen, len); - else strncpy(buffer, text + beginIndex + beginLen, MAX_TEXT_BUFFER_LENGTH - 1); + if (len < (MAX_TEXT_BUFFER_LENGTH - 1)) memcpy(buffer, text + beginIndex + beginLen, len); + else snprintf(buffer, MAX_TEXT_BUFFER_LENGTH, "%s", text + beginIndex + beginLen); } } @@ -1764,7 +1764,7 @@ char *GetTextBetween(const char *text, const char *begin, const char *end) } // Replace text string -// REQUIRES: strstr(), strncpy() +// REQUIRES: strstr(), memcpy() // NOTE: Limited text replace functionality, using static string char *TextReplace(const char *text, const char *search, const char *replacement) { @@ -1821,7 +1821,7 @@ char *TextReplace(const char *text, const char *search, const char *replacement) // Copy remaind text part after replacement to result (pointed by moving temp) // NOTE: Text pointer internal copy has been updated along the process - strncpy(tempPtr, text, TextLength(text)); + memcpy(tempPtr, text, TextLength(text)); } else TRACELOG(LOG_WARNING, "Text with replacement is longer than internal buffer, use TextReplaceAlloc()"); } @@ -1830,7 +1830,7 @@ char *TextReplace(const char *text, const char *search, const char *replacement) } // Replace text string -// REQUIRES: strstr(), strncpy() +// REQUIRES: strstr(), memcpy() // WARNING: Allocated memory must be manually freed char *TextReplaceAlloc(const char *text, const char *search, const char *replacement) { @@ -1887,7 +1887,7 @@ char *TextReplaceAlloc(const char *text, const char *search, const char *replace // Copy remaind text part after replacement to result (pointed by moving temp) // NOTE: Text pointer internal copy has been updated along the process - strncpy(temp, text, TextLength(text)); + memcpy(temp, text, TextLength(text)); } } @@ -1975,10 +1975,11 @@ char *TextInsert(const char *text, const char *insert, int position) { static char buffer[MAX_TEXT_BUFFER_LENGTH] = { 0 }; memset(buffer, 0, MAX_TEXT_BUFFER_LENGTH); + int textLen = TextLength(text); - if ((text != NULL) && (insert != NULL)) + if ((text != NULL) && (insert != NULL) && (position >= 0)) { - int textLen = TextLength(text); + if (position > textLen) position = textLen; // End of text string int insertLen = TextLength(insert); if ((textLen + insertLen) < (MAX_TEXT_BUFFER_LENGTH - 1)) @@ -1987,7 +1988,7 @@ char *TextInsert(const char *text, const char *insert, int position) for (int i = 0; i < position; i++) buffer[i] = text[i]; for (int i = position; i < insertLen + position; i++) buffer[i] = insert[i - position]; - for (int i = (insertLen + position); i < (textLen + insertLen); i++) buffer[i] = text[i]; + for (int i = (insertLen + position); i < (textLen + insertLen); i++) buffer[i] = text[i - insertLen]; buffer[textLen + insertLen] = '\0'; // Add EOL } @@ -2002,17 +2003,18 @@ char *TextInsert(const char *text, const char *insert, int position) char *TextInsertAlloc(const char *text, const char *insert, int position) { char *result = NULL; + int textLen = TextLength(text); - if ((text != NULL) && (insert != NULL)) + if ((text != NULL) && (insert != NULL) && (position >= 0)) { - int textLen = TextLength(text); + if (position > textLen) position = textLen; // End of text string int insertLen = TextLength(insert); result = (char *)RL_MALLOC(textLen + insertLen + 1); for (int i = 0; i < position; i++) result[i] = text[i]; - for (int i = position; i < insertLen + position; i++) result[i] = insert[i - position]; - for (int i = (insertLen + position); i < (textLen + insertLen); i++) result[i] = text[i]; + for (int i = position; i < (insertLen + position); i++) result[i] = insert[i - position]; + for (int i = (insertLen + position); i < (textLen + insertLen); i++) result[i] = text[i - insertLen]; result[textLen + insertLen] = '\0'; // Add EOL } @@ -2036,7 +2038,7 @@ char *TextJoin(char **textList, int count, const char *delimiter) int textLength = TextLength(textList[i]); // Make sure joined text could fit inside MAX_TEXT_BUFFER_LENGTH - if ((totalLength + textLength) < MAX_TEXT_BUFFER_LENGTH) + if ((totalLength + textLength + delimiterLen) < MAX_TEXT_BUFFER_LENGTH) { memcpy(textPtr, textList[i], textLength); totalLength += textLength; @@ -2200,18 +2202,43 @@ char *TextToSnake(const char *text) if (text != NULL) { // Check for next separator to upper case another character - for (int i = 0, j = 0; (i < MAX_TEXT_BUFFER_LENGTH - 1) && (text[j] != '\0'); i++, j++) + for (int i = 0, j = 0; (i < MAX_TEXT_BUFFER_LENGTH - 1) && (text[j] != '\0'); j++) { - if ((text[j] >= 'A') && (text[j] <= 'Z')) + if (text[j] == ' ') { - if (i >= 1) + if ((i > 0) && (buffer[i - 1] != '_')) { buffer[i] = '_'; i++; } - buffer[i] = text[j] + 32; } - else buffer[i] = text[j]; + else if ((text[j] >= 'A') && (text[j] <= 'Z')) + { + if ((i > 0) && (buffer[i - 1] != '_')) + { + char prev = text[j - 1]; + char next = text[j + 1]; + + // Considering multiple cap leters to be on single word (HTTPRequest --> http_request) + if (((prev >= 'a') && (prev <= 'z')) || + (((prev >= 'A') && (prev <= 'Z')) && ((next >= 'a') && (next <= 'z')))) + { + if (i < MAX_TEXT_BUFFER_LENGTH - 2) + { + buffer[i] = '_'; + i++; + } + } + } + + buffer[i] = text[j] + 32; + i++; + } + else + { + buffer[i] = text[j]; + i++; + } } } diff --git a/src/rtextures.c b/src/rtextures.c index 724fe73cd..15f009354 100644 --- a/src/rtextures.c +++ b/src/rtextures.c @@ -12,6 +12,7 @@ * #define SUPPORT_FILEFORMAT_JPG 0 * #define SUPPORT_FILEFORMAT_GIF 1 * #define SUPPORT_FILEFORMAT_QOI 1 +* #define SUPPORT_FILEFORMAT_PEP 1 * #define SUPPORT_FILEFORMAT_PSD 0 * #define SUPPORT_FILEFORMAT_HDR 0 * #define SUPPORT_FILEFORMAT_PIC 0 @@ -69,6 +70,7 @@ #include // Required for: strlen() [Used in ImageTextEx()], strcmp() [Used in LoadImageFromMemory()/LoadImageAnimFromMemory()/ExportImageToMemory()] #include // Required for: fabsf() [Used in DrawTextureRec()] #include // Required for: sprintf() [Used in ExportImageAsCode()] +#include // Required for: INT_MAX // Support only desired texture formats on stb_image #if !SUPPORT_FILEFORMAT_BMP @@ -188,7 +190,15 @@ #if defined(_MSC_VER) #pragma warning(pop) // Disable MSVC warning suppression #endif +#endif +#if SUPPORT_FILEFORMAT_PEP + #define PEP_MALLOC RL_MALLOC + #define PEP_REALLOC RL_REALLOC + #define PEP_FREE RL_FREE + + #define PEP_IMPLEMENTATION + #include "external/pep.h" #endif #if SUPPORT_IMAGE_EXPORT @@ -510,6 +520,31 @@ Image LoadImageFromMemory(const char *fileType, const unsigned char *fileData, i } } #endif +#if SUPPORT_FILEFORMAT_PEP + else if ((strcmp(fileType, ".pep") == 0) || (strcmp(fileType, ".PEP") == 0)) + { + if (fileData != NULL) + { + // Deserialize file data into pep structure + pep p = pep_deserialize(fileData, dataSize); + + // Decompress pep data for image struct + // Decompression options: + // - First color transparent, 3rd parameter: 1 + // - Premultiply alpha on loading, 4th parameter: 1 + unsigned int *pepData = pep_decompress(&p, pep_rgba, 1, 1); + + image.data = pepData; + image.width = p.width; + image.height = p.height; + image.format = PIXELFORMAT_UNCOMPRESSED_R8G8B8A8; + image.mipmaps = 1; + + PEP_FREE(pepData); + pep_free(&p); + } + } +#endif #if SUPPORT_FILEFORMAT_DDS else if ((strcmp(fileType, ".dds") == 0) || (strcmp(fileType, ".DDS") == 0)) { @@ -681,6 +716,25 @@ bool ExportImage(Image image, const char *fileName) } } #endif +#if SUPPORT_FILEFORMAT_PEP + else if (IsFileExtension(fileName, ".pep")) + { + if (image.format == PIXELFORMAT_UNCOMPRESSED_R8G8B8A8) + { + // NOTE: Only RGBA 32bit (8bit per channel) image format supported + pep p = pep_compress(image.data, image.width, image.height, pep_rgba, pep_8bit); + + unsigned int pepDataSize = 0; + unsigned char *pepData = pep_serialize(&p, &pepDataSize); + + result = SaveFileData(fileName, pepData, pepDataSize); + + PEP_FREE(pepData); + pep_free(&p); + } + else TRACELOG(LOG_WARNING, "IMAGE: Image can not be exported, .pep requires RGBA 32bit input"); + } +#endif #if SUPPORT_FILEFORMAT_KTX else if (IsFileExtension(fileName, ".ktx")) { @@ -760,7 +814,7 @@ bool ExportImageAsCode(Image image, const char *fileName) // Get file name from path and convert variable name to uppercase char varFileName[256] = { 0 }; - strncpy(varFileName, GetFileNameWithoutExt(fileName), 256 - 1); // NOTE: Using function provided by [rcore] module + snprintf(varFileName, 256, "%s", GetFileNameWithoutExt(fileName)); // NOTE: Using function provided by [rcore] module for (int i = 0; varFileName[i] != '\0'; i++) if ((varFileName[i] >= 'a') && (varFileName[i] <= 'z')) { varFileName[i] = varFileName[i] - 32; } // Add image information @@ -790,9 +844,10 @@ bool ExportImageAsCode(Image image, const char *fileName) // Generate image: plain color Image GenImageColor(int width, int height, Color color) { - Color *pixels = (Color *)RL_CALLOC(width*height, sizeof(Color)); + int dataSize = GetPixelDataSize(width, height, PIXELFORMAT_UNCOMPRESSED_R8G8B8A8); + Color *pixels = (Color *)RL_CALLOC(dataSize, 1); - for (int i = 0; i < width*height; i++) pixels[i] = color; + for (int i = 0; (pixels != NULL) && (i < width*height); i++) pixels[i] = color; Image image = { .data = pixels, @@ -1175,18 +1230,34 @@ Image ImageFromImage(Image image, Rectangle rec) { Image result = { 0 }; - int bytesPerPixel = GetPixelDataSize(1, 1, image.format); + // Security check to avoid program crash + if ((image.data == NULL) || (image.width == 0) || (image.height == 0)) return result; - result.width = (int)rec.width; - result.height = (int)rec.height; - result.data = RL_CALLOC((int)rec.width*(int)rec.height*bytesPerPixel, 1); - result.format = image.format; - result.mipmaps = 1; + if (image.format < PIXELFORMAT_COMPRESSED_DXT1_RGB) + { + // Basic rectangle validation: size smaller than image size + if ((rec.x >= 0) && (rec.y >= 0) && (rec.width > 0) && (rec.height > 0) && + (((int)rec.x + (int)rec.width) <= image.width) && + (((int)rec.y + (int)rec.height) <= image.height)) + { + int bytesPerPixel = GetPixelDataSize(1, 1, image.format); - for (int y = 0; y < (int)rec.height; y++) - { - memcpy(((unsigned char *)result.data) + y*(int)rec.width*bytesPerPixel, ((unsigned char *)image.data) + ((y + (int)rec.y)*image.width + (int)rec.x)*bytesPerPixel, (int)rec.width*bytesPerPixel); - } + result.width = (int)rec.width; + result.height = (int)rec.height; + result.data = RL_CALLOC((int)rec.width*(int)rec.height*bytesPerPixel, 1); + result.format = image.format; + result.mipmaps = 1; + + for (int y = 0; y < (int)rec.height; y++) + { + memcpy(((unsigned char *)result.data) + y*(int)rec.width*bytesPerPixel, + ((unsigned char *)image.data) + ((y + (int)rec.y)*image.width + (int)rec.x)*bytesPerPixel, + (int)rec.width*bytesPerPixel); + } + } + else TRACELOG(LOG_WARNING, "IMAGE: ImageToImage(), rectangle provided not valid"); + } + else TRACELOG(LOG_WARNING, "IMAGE: Image manipulation not supported for compressed formats"); return result; } @@ -2631,45 +2702,49 @@ void ImageRotate(Image *image, int degrees) int width = (int)(fabsf(image->width*cosRadius) + fabsf(image->height*sinRadius)); int height = (int)(fabsf(image->height*cosRadius) + fabsf(image->width*sinRadius)); + int dataSize = GetPixelDataSize(width, height, image->format); int bytesPerPixel = GetPixelDataSize(1, 1, image->format); - unsigned char *rotatedData = (unsigned char *)RL_CALLOC(width*height, bytesPerPixel); + unsigned char *rotatedData = (unsigned char *)RL_CALLOC(dataSize, 1); - for (int y = 0; y < height; y++) + if (rotatedData != NULL) { - for (int x = 0; x < width; x++) + for (int y = 0; y < height; y++) { - float oldX = ((x - width/2.0f)*cosRadius + (y - height/2.0f)*sinRadius) + image->width/2.0f; - float oldY = ((y - height/2.0f)*cosRadius - (x - width/2.0f)*sinRadius) + image->height/2.0f; - - if ((oldX >= 0) && (oldX < image->width) && (oldY >= 0) && (oldY < image->height)) + for (int x = 0; x < width; x++) { - int x1 = (int)floorf(oldX); - int y1 = (int)floorf(oldY); - int x2 = MIN(x1 + 1, image->width - 1); - int y2 = MIN(y1 + 1, image->height - 1); + float oldX = ((x - width/2.0f)*cosRadius + (y - height/2.0f)*sinRadius) + image->width/2.0f; + float oldY = ((y - height/2.0f)*cosRadius - (x - width/2.0f)*sinRadius) + image->height/2.0f; - float px = oldX - x1; - float py = oldY - y1; - - for (int i = 0; i < bytesPerPixel; i++) + if ((oldX >= 0) && (oldX < image->width) && (oldY >= 0) && (oldY < image->height)) { - float f1 = ((unsigned char *)image->data)[(y1*image->width + x1)*bytesPerPixel + i]; - float f2 = ((unsigned char *)image->data)[(y1*image->width + x2)*bytesPerPixel + i]; - float f3 = ((unsigned char *)image->data)[(y2*image->width + x1)*bytesPerPixel + i]; - float f4 = ((unsigned char *)image->data)[(y2*image->width + x2)*bytesPerPixel + i]; + int x1 = (int)floorf(oldX); + int y1 = (int)floorf(oldY); + int x2 = MIN(x1 + 1, image->width - 1); + int y2 = MIN(y1 + 1, image->height - 1); - float val = f1*(1 - px)*(1 - py) + f2*px*(1 - py) + f3*(1 - px)*py + f4*px*py; + float px = oldX - x1; + float py = oldY - y1; - rotatedData[(y*width + x)*bytesPerPixel + i] = (unsigned char)val; + for (int i = 0; i < bytesPerPixel; i++) + { + float f1 = ((unsigned char *)image->data)[(y1*image->width + x1)*bytesPerPixel + i]; + float f2 = ((unsigned char *)image->data)[(y1*image->width + x2)*bytesPerPixel + i]; + float f3 = ((unsigned char *)image->data)[(y2*image->width + x1)*bytesPerPixel + i]; + float f4 = ((unsigned char *)image->data)[(y2*image->width + x2)*bytesPerPixel + i]; + + float val = f1*(1 - px)*(1 - py) + f2*px*(1 - py) + f3*(1 - px)*py + f4*px*py; + + rotatedData[(y*width + x)*bytesPerPixel + i] = (unsigned char)val; + } } } } - } - RL_FREE(image->data); - image->data = rotatedData; - image->width = width; - image->height = height; + RL_FREE(image->data); + image->data = rotatedData; + image->width = width; + image->height = height; + } } } @@ -3865,10 +3940,16 @@ void ImageDrawRectangleRec(Image *dst, Rectangle rec, Color color) } } +// Draw a color-filled rectangle with pro parameters within and image +void ImageDrawRectanglePro(Image *dst, Rectangle rec, Vector2 origin, float rotation, Color color) +{ + // TODO: NEW: Implement ImageDrawRectanglePro() +} + // Draw rectangle lines within an image void ImageDrawRectangleLines(Image *dst, int posX, int posY, int width, int height, Color color) { - Rectangle rec = { posX, posY, width, height }; + Rectangle rec = { (float)posX, (float)posY, (float)width, (float)height }; ImageDrawRectangleLinesEx(dst, rec, 1, color); } @@ -3881,6 +3962,12 @@ void ImageDrawRectangleLinesEx(Image *dst, Rectangle rec, int thick, Color color ImageDrawRectangle(dst, (int)rec.x, (int)(rec.y + rec.height - thick), (int)rec.width, thick, color); } +// Draw rectangle with gradient colors within an image, counter-clockwise color order +void ImageDrawRectangleGradientEx(Image *dst, Rectangle rec, Color col1, Color col2, Color col3, Color col4) +{ + // TODO: NEW: Implement ImageDrawRectangleGradientEx() +} + // Draw circle within an image void ImageDrawCircle(Image *dst, int centerX, int centerY, int radius, Color color) { @@ -3948,17 +4035,23 @@ void ImageDrawCircleLinesV(Image *dst, Vector2 center, int radius, Color color) // Draw a gradient-filled circle within an image void ImageDrawCircleGradient(Image *dst, Vector2 center, float radius, Color inner, Color outer) { - // TODO: Implement gradient circle drawing + // TODO: NEW: Implement ImageDrawCircleGradient() } // Draw an image within an image void ImageDrawImage(Image *dst, Image src, int posX, int posY, Color tint) { - Rectangle srcRec = { 0, 0, src.width, src.height }; - Rectangle dstRec = { posX, posY, srcRec.width, srcRec.height }; + Rectangle srcRec = { 0.0f, 0.0f, (float)src.width, (float)src.height }; + Rectangle dstRec = { (float)posX, (float)posY, srcRec.width, srcRec.height }; ImageDrawImagePro(dst, src, srcRec, dstRec, (Vector2){ 0 }, 0.0f, tint); } +// Draw an image with scaling and rotation within an image +void ImageDrawImageEx(Image *dst, Image src, Vector2 position, float rotation, float scale, Color tint) +{ + // TODO: NEW: Implement ImageDrawImageEx() +} + // Draw a part of an image defined by a rectangle within an image void ImageDrawImageRec(Image *dst, Image src, Rectangle srcRec, Vector2 position, Color tint) { @@ -3967,8 +4060,7 @@ void ImageDrawImageRec(Image *dst, Image src, Rectangle srcRec, Vector2 position } // Draw a part of an image defined by a rectangle into destination rectangle, with scaling and rotation, within an image -// NOTE: Color tint is applied to source image -// TODO: WARNING: origin and rotation are not implemented +// TODO: REVIEW: ImageDrawImagePro(), implement origin and rotation for image drawing void ImageDrawImagePro(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec, Vector2 origin, float rotation, Color tint) { // Security check to avoid program crash @@ -4146,6 +4238,12 @@ void ImageDrawTextEx(Image *dst, Font font, const char *text, Vector2 position, UnloadImage(imText); } +// Draw text using Font and pro parameters (rotation) +void ImageDrawTextPro(Image *dst, Font font, const char *text, Vector2 position, Vector2 origin, float rotation, float fontSize, float spacing, Color tint) +{ + // TODO: NEW: Implement ImageDrawTextPro() +} + //------------------------------------------------------------------------------------ // Texture loading functions //------------------------------------------------------------------------------------ @@ -5425,17 +5523,24 @@ int GetPixelDataSize(int width, int height, int format) case PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA: bpp = 2; break; default: break; } + + unsigned long long dataSizeBytes = ((unsigned long long)width*height*bpp) >> 3; // Get size in bytes (dividing by 8) - double bytesPerPixel = (double)bpp/8.0; - dataSize = (int)(bytesPerPixel*width*height); // Total data size in bytes - - // Most compressed formats works on 4x4 blocks, - // if texture is smaller, minimum dataSize is 8 or 16 - if ((width < 4) && (height < 4)) + if (dataSizeBytes < INT_MAX) { - if ((format >= PIXELFORMAT_COMPRESSED_DXT1_RGB) && (format < PIXELFORMAT_COMPRESSED_DXT3_RGBA)) dataSize = 8; - else if ((format >= PIXELFORMAT_COMPRESSED_DXT3_RGBA) && (format < PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA)) dataSize = 16; + dataSize = (int)dataSizeBytes; + + // Most compressed formats works on 4x4 blocks, + // if texture is smaller, minimum dataSize is 8 or 16 + if ((width < 4) && (height < 4)) + { + if ((format >= PIXELFORMAT_COMPRESSED_DXT1_RGB) && (format < PIXELFORMAT_COMPRESSED_DXT3_RGBA)) dataSize = 8; + else if ((format >= PIXELFORMAT_COMPRESSED_DXT3_RGBA) && (format < PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA)) dataSize = 16; + } } + + // NOTE: In case required image data larger than 2GB, no memory allocated at all (NULL) + if (dataSize == 0) TRACELOG(LOG_WARNING, "Requested image size is larger than 2GB, it can not be allocated"); return dataSize; } diff --git a/tools/rexm/rexm.c b/tools/rexm/rexm.c index f268a7d44..cb753e031 100644 --- a/tools/rexm/rexm.c +++ b/tools/rexm/rexm.c @@ -2331,7 +2331,7 @@ static rlExampleInfo *LoadExampleInfo(const char *exFileName) // Example found in collection exInfo = (rlExampleInfo *)RL_CALLOC(1, sizeof(rlExampleInfo)); - strncpy(exInfo->name, GetFileNameWithoutExt(exFileName), 128 - 1); + snprintf(exInfo->name, 128, "%s", GetFileNameWithoutExt(exFileName)); strncpy(exInfo->category, exInfo->name, TextFindIndex(exInfo->name, "_")); char *exText = LoadFileText(exFileName); @@ -2377,7 +2377,7 @@ static rlExampleInfo *LoadExampleInfo(const char *exFileName) int copyrightIndex = TextFindIndex(exText, "Copyright (c) "); int yearStartIndex = copyrightIndex + 14; char yearText[5] = { 0 }; - strncpy(yearText, exText + yearStartIndex, 4); + snprintf(yearText, 5, "%s", exText + yearStartIndex); exInfo->yearCreated = TextToInteger(yearText); // Check for review year included (or just use creation year) if (exText[yearStartIndex + 4] == '-') strncpy(yearText, exText + yearStartIndex + 5, 4); @@ -2425,7 +2425,7 @@ static int ParseExampleInfoLine(const char *line, rlExampleInfo *entry) #define MAX_EXAMPLE_INFO_LINE_LEN 512 char temp[MAX_EXAMPLE_INFO_LINE_LEN] = { 0 }; - strncpy(temp, line, MAX_EXAMPLE_INFO_LINE_LEN); + snprintf(temp, MAX_EXAMPLE_INFO_LINE_LEN, "%s", line); temp[MAX_EXAMPLE_INFO_LINE_LEN - 1] = '\0'; // Ensure null termination int tokenCount = 0; @@ -2902,7 +2902,7 @@ static void UpdateWebMetadata(const char *exHtmlPath, const char *exFilePath) char exTitle[64] = { 0 }; // Example title: fileName without extension, replacing underscores by spaces // Get example name: replace underscore by spaces - strncpy(exName, GetFileNameWithoutExt(exHtmlPathCopy), 64 - 1); + snprintf(exName, 64, "%s", GetFileNameWithoutExt(exHtmlPathCopy)); strcpy(exTitle, exName); for (int i = 0; (i < 64) && (exTitle[i] != '\0'); i++) { if (exTitle[i] == '_') exTitle[i] = ' '; } diff --git a/tools/rlparser/Makefile b/tools/rlparser/Makefile index a645f7f41..a79900691 100644 --- a/tools/rlparser/Makefile +++ b/tools/rlparser/Makefile @@ -79,6 +79,7 @@ raylib_api: ../../src/raylib.h rlparser FORMAT=JSON EXTENSION=json $(MAKE) raylib_api.json FORMAT=XML EXTENSION=xml $(MAKE) raylib_api.xml FORMAT=LUA EXTENSION=lua $(MAKE) raylib_api.lua + FORMAT=SEXPR EXTENSION=sexpr $(MAKE) raylib_api.sexpr # rlparser execution: [raylib.h] parse, generating some output files raylib_api.$(EXTENSION): ../../src/raylib.h rlparser @@ -112,7 +113,8 @@ all: rlparser FORMAT=JSON EXTENSION=json $(MAKE) parse FORMAT=XML EXTENSION=xml $(MAKE) parse FORMAT=LUA EXTENSION=lua $(MAKE) parse + FORMAT=SEXPR EXTENSION=sexpr $(MAKE) parse # Clean rlparser and generated output files clean: - rm -f rlparser *.json *.txt *.xml *.lua + rm -f rlparser *.json *.txt *.xml *.lua *.sexpr diff --git a/tools/rlparser/output/raylib_api.json b/tools/rlparser/output/raylib_api.json index f26dac263..cc6f210e4 100644 --- a/tools/rlparser/output/raylib_api.json +++ b/tools/rlparser/output/raylib_api.json @@ -968,7 +968,7 @@ "description": "Skeleton, animation bones hierarchy", "fields": [ { - "type": "int", + "type": "unsigned int", "name": "boneCount", "description": "Number of bones" }, @@ -1045,7 +1045,7 @@ "description": "Animation name" }, { - "type": "int", + "type": "unsigned int", "name": "boneCount", "description": "Number of bones (per pose)" }, @@ -4603,7 +4603,7 @@ }, { "name": "GetDirectoryPath", - "description": "Get full path for a given fileName with path (uses static string)", + "description": "Get full path for a provided fileName with path (uses static string)", "returnType": "const char *", "params": [ { @@ -4614,7 +4614,7 @@ }, { "name": "GetPrevDirectoryPath", - "description": "Get previous directory path for a given path (uses static string)", + "description": "Get previous directory path for a provided path (uses static string)", "returnType": "const char *", "params": [ { @@ -4657,7 +4657,29 @@ }, { "name": "IsPathFile", - "description": "Check if given path is a file or a directory", + "description": "Check if provided path points to a file", + "returnType": "bool", + "params": [ + { + "type": "const char *", + "name": "path" + } + ] + }, + { + "name": "IsPathDirectory", + "description": "Check if provided path points to a directory", + "returnType": "bool", + "params": [ + { + "type": "const char *", + "name": "path" + } + ] + }, + { + "name": "IsPathAbsolute", + "description": "Check if provided path is an absolute path", "returnType": "bool", "params": [ { @@ -5368,7 +5390,7 @@ }, { "name": "GetTouchPointId", - "description": "Get touch point identifier for given index", + "description": "Get touch point identifier for provided index", "returnType": "int", "params": [ { @@ -8088,7 +8110,7 @@ }, { "name": "ImageClearBackground", - "description": "Clear image background with given color", + "description": "Clear image background with provided color", "returnType": "void", "params": [ { @@ -8455,6 +8477,33 @@ } ] }, + { + "name": "ImageDrawRectanglePro", + "description": "Draw a color-filled rectangle with pro parameters within and image", + "returnType": "void", + "params": [ + { + "type": "Image *", + "name": "dst" + }, + { + "type": "Rectangle", + "name": "rec" + }, + { + "type": "Vector2", + "name": "origin" + }, + { + "type": "float", + "name": "rotation" + }, + { + "type": "Color", + "name": "color" + } + ] + }, { "name": "ImageDrawRectangleLines", "description": "Draw rectangle lines within an image", @@ -8509,6 +8558,37 @@ } ] }, + { + "name": "ImageDrawRectangleGradientEx", + "description": "Draw rectangle with gradient colors within an image, counter-clockwise color order", + "returnType": "void", + "params": [ + { + "type": "Image *", + "name": "dst" + }, + { + "type": "Rectangle", + "name": "rec" + }, + { + "type": "Color", + "name": "col1" + }, + { + "type": "Color", + "name": "col2" + }, + { + "type": "Color", + "name": "col3" + }, + { + "type": "Color", + "name": "col4" + } + ] + }, { "name": "ImageDrawCircle", "description": "Draw a filled circle within an image", @@ -8663,6 +8743,37 @@ } ] }, + { + "name": "ImageDrawImageEx", + "description": "Draw an image with scaling and rotation within an image", + "returnType": "void", + "params": [ + { + "type": "Image *", + "name": "dst" + }, + { + "type": "Image", + "name": "src" + }, + { + "type": "Vector2", + "name": "position" + }, + { + "type": "float", + "name": "rotation" + }, + { + "type": "float", + "name": "scale" + }, + { + "type": "Color", + "name": "tint" + } + ] + }, { "name": "ImageDrawImageRec", "description": "Draw a part of an image defined by a rectangle within an image", @@ -8791,6 +8902,49 @@ } ] }, + { + "name": "ImageDrawTextPro", + "description": "Draw text using Font and pro parameters (rotation)", + "returnType": "void", + "params": [ + { + "type": "Image *", + "name": "dst" + }, + { + "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": "LoadTexture", "description": "Load texture from file into GPU memory (VRAM)", diff --git a/tools/rlparser/output/raylib_api.lua b/tools/rlparser/output/raylib_api.lua index 8c26fcac6..5cdd5ebfc 100644 --- a/tools/rlparser/output/raylib_api.lua +++ b/tools/rlparser/output/raylib_api.lua @@ -968,7 +968,7 @@ return { description = "Skeleton, animation bones hierarchy", fields = { { - type = "int", + type = "unsigned int", name = "boneCount", description = "Number of bones" }, @@ -1045,7 +1045,7 @@ return { description = "Animation name" }, { - type = "int", + type = "unsigned int", name = "boneCount", description = "Number of bones (per pose)" }, @@ -4135,7 +4135,7 @@ return { }, { name = "GetDirectoryPath", - description = "Get full path for a given fileName with path (uses static string)", + description = "Get full path for a provided fileName with path (uses static string)", returnType = "const char *", params = { {type = "const char *", name = "filePath"} @@ -4143,7 +4143,7 @@ return { }, { name = "GetPrevDirectoryPath", - description = "Get previous directory path for a given path (uses static string)", + description = "Get previous directory path for a provided path (uses static string)", returnType = "const char *", params = { {type = "const char *", name = "dirPath"} @@ -4177,7 +4177,23 @@ return { }, { name = "IsPathFile", - description = "Check if given path is a file or a directory", + description = "Check if provided path points to a file", + returnType = "bool", + params = { + {type = "const char *", name = "path"} + } + }, + { + name = "IsPathDirectory", + description = "Check if provided path points to a directory", + returnType = "bool", + params = { + {type = "const char *", name = "path"} + } + }, + { + name = "IsPathAbsolute", + description = "Check if provided path is an absolute path", returnType = "bool", params = { {type = "const char *", name = "path"} @@ -4663,7 +4679,7 @@ return { }, { name = "GetTouchPointId", - description = "Get touch point identifier for given index", + description = "Get touch point identifier for provided index", returnType = "int", params = { {type = "int", name = "index"} @@ -6063,7 +6079,7 @@ return { }, { name = "ImageClearBackground", - description = "Clear image background with given color", + description = "Clear image background with provided color", returnType = "void", params = { {type = "Image *", name = "dst"}, @@ -6232,6 +6248,18 @@ return { {type = "Color", name = "color"} } }, + { + name = "ImageDrawRectanglePro", + description = "Draw a color-filled rectangle with pro parameters within and image", + returnType = "void", + params = { + {type = "Image *", name = "dst"}, + {type = "Rectangle", name = "rec"}, + {type = "Vector2", name = "origin"}, + {type = "float", name = "rotation"}, + {type = "Color", name = "color"} + } + }, { name = "ImageDrawRectangleLines", description = "Draw rectangle lines within an image", @@ -6256,6 +6284,19 @@ return { {type = "Color", name = "color"} } }, + { + name = "ImageDrawRectangleGradientEx", + description = "Draw rectangle with gradient colors within an image, counter-clockwise color order", + returnType = "void", + params = { + {type = "Image *", name = "dst"}, + {type = "Rectangle", name = "rec"}, + {type = "Color", name = "col1"}, + {type = "Color", name = "col2"}, + {type = "Color", name = "col3"}, + {type = "Color", name = "col4"} + } + }, { name = "ImageDrawCircle", description = "Draw a filled circle within an image", @@ -6326,6 +6367,19 @@ return { {type = "Color", name = "tint"} } }, + { + name = "ImageDrawImageEx", + description = "Draw an image with scaling and rotation within an image", + returnType = "void", + params = { + {type = "Image *", name = "dst"}, + {type = "Image", name = "src"}, + {type = "Vector2", name = "position"}, + {type = "float", name = "rotation"}, + {type = "float", name = "scale"}, + {type = "Color", name = "tint"} + } + }, { name = "ImageDrawImageRec", description = "Draw a part of an image defined by a rectangle within an image", @@ -6379,6 +6433,22 @@ return { {type = "Color", name = "tint"} } }, + { + name = "ImageDrawTextPro", + description = "Draw text using Font and pro parameters (rotation)", + returnType = "void", + params = { + {type = "Image *", name = "dst"}, + {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 = "LoadTexture", description = "Load texture from file into GPU memory (VRAM)", diff --git a/tools/rlparser/output/raylib_api.sexpr b/tools/rlparser/output/raylib_api.sexpr new file mode 100644 index 000000000..387b64c68 --- /dev/null +++ b/tools/rlparser/output/raylib_api.sexpr @@ -0,0 +1,6594 @@ +((defines + ((name "RAYLIB_H") + (type "GUARD") + (value "") + (description "")) + ((name "RAYLIB_VERSION_MAJOR") + (type "INT") + (value 6) + (description "")) + ((name "RAYLIB_VERSION_MINOR") + (type "INT") + (value 1) + (description "")) + ((name "RAYLIB_VERSION_PATCH") + (type "INT") + (value 0) + (description "")) + ((name "RAYLIB_VERSION") + (type "STRING") + (value "6.1-dev") + (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 ""))) + + (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 "unsigned 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 "unsigned 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") + (return-type "void") + (params + ((type "int") (name "logLevel")) + ((type "const char *") (name "text")) + ((type "va_list") (name "args")))) + + ((name "LoadFileDataCallback") + (description "FileIO: Load binary data") + (return-type "unsigned char *") + (params + ((type "const char *") (name "fileName")) + ((type "int *") (name "dataSize")))) + + ((name "SaveFileDataCallback") + (description "FileIO: Save binary data") + (return-type "bool") + (params + ((type "const char *") (name "fileName")) + ((type "const void *") (name "data")) + ((type "int") (name "dataSize")))) + + ((name "LoadFileTextCallback") + (description "FileIO: Load text data") + (return-type "char *") + (params + ((type "const char *") (name "fileName")))) + + ((name "SaveFileTextCallback") + (description "FileIO: Save text data") + (return-type "bool") + (params + ((type "const char *") (name "fileName")) + ((type "const char *") (name "text")))) + + ((name "AudioCallback") + (description "") + (return-type "void") + (params + ((type "void *") (name "bufferData")) + ((type "unsigned int") (name "frames"))))) + + (functions + ((name "InitWindow") + (description "Initialize window and OpenGL context") + (return-type "void") + (params + ((type "int") (name "width")) + ((type "int") (name "height")) + ((type "const char *") (name "title")))) + + ((name "CloseWindow") + (description "Close window and unload OpenGL context") + (return-type "void")) + + ((name "WindowShouldClose") + (description "Check if application should close (KEY_ESCAPE pressed or windows close icon clicked)") + (return-type "bool")) + + ((name "IsWindowReady") + (description "Check if window has been initialized successfully") + (return-type "bool")) + + ((name "IsWindowFullscreen") + (description "Check if window is currently fullscreen") + (return-type "bool")) + + ((name "IsWindowHidden") + (description "Check if window is currently hidden") + (return-type "bool")) + + ((name "IsWindowMinimized") + (description "Check if window is currently minimized") + (return-type "bool")) + + ((name "IsWindowMaximized") + (description "Check if window is currently maximized") + (return-type "bool")) + + ((name "IsWindowFocused") + (description "Check if window is currently focused") + (return-type "bool")) + + ((name "IsWindowResized") + (description "Check if window has been resized last frame") + (return-type "bool")) + + ((name "IsWindowState") + (description "Check if one specific window flag is enabled") + (return-type "bool") + (params + ((type "unsigned int") (name "flag")))) + + ((name "SetWindowState") + (description "Set window configuration state using flags") + (return-type "void") + (params + ((type "unsigned int") (name "flags")))) + + ((name "ClearWindowState") + (description "Clear window configuration state flags") + (return-type "void") + (params + ((type "unsigned int") (name "flags")))) + + ((name "ToggleFullscreen") + (description "Toggle window state: fullscreen/windowed, resizes monitor to match window resolution") + (return-type "void")) + + ((name "ToggleBorderlessWindowed") + (description "Toggle window state: borderless windowed, resizes window to match monitor resolution") + (return-type "void")) + + ((name "MaximizeWindow") + (description "Set window state: maximized, if resizable") + (return-type "void")) + + ((name "MinimizeWindow") + (description "Set window state: minimized, if resizable") + (return-type "void")) + + ((name "RestoreWindow") + (description "Restore window from being minimized/maximized") + (return-type "void")) + + ((name "SetWindowIcon") + (description "Set icon for window (single image, RGBA 32bit)") + (return-type "void") + (params + ((type "Image") (name "image")))) + + ((name "SetWindowIcons") + (description "Set icon for window (multiple images, RGBA 32bit)") + (return-type "void") + (params + ((type "Image *") (name "images")) + ((type "int") (name "count")))) + + ((name "SetWindowTitle") + (description "Set title for window") + (return-type "void") + (params + ((type "const char *") (name "title")))) + + ((name "SetWindowPosition") + (description "Set window position on screen") + (return-type "void") + (params + ((type "int") (name "x")) + ((type "int") (name "y")))) + + ((name "SetWindowMonitor") + (description "Set monitor for the current window") + (return-type "void") + (params + ((type "int") (name "monitor")))) + + ((name "SetWindowMinSize") + (description "Set window minimum dimensions (for FLAG_WINDOW_RESIZABLE)") + (return-type "void") + (params + ((type "int") (name "width")) + ((type "int") (name "height")))) + + ((name "SetWindowMaxSize") + (description "Set window maximum dimensions (for FLAG_WINDOW_RESIZABLE)") + (return-type "void") + (params + ((type "int") (name "width")) + ((type "int") (name "height")))) + + ((name "SetWindowSize") + (description "Set window dimensions") + (return-type "void") + (params + ((type "int") (name "width")) + ((type "int") (name "height")))) + + ((name "SetWindowOpacity") + (description "Set window opacity [0.0f..1.0f]") + (return-type "void") + (params + ((type "float") (name "opacity")))) + + ((name "SetWindowFocused") + (description "Set window focused") + (return-type "void")) + + ((name "GetWindowHandle") + (description "Get native window handle") + (return-type "void *")) + + ((name "GetScreenWidth") + (description "Get current screen width") + (return-type "int")) + + ((name "GetScreenHeight") + (description "Get current screen height") + (return-type "int")) + + ((name "GetRenderWidth") + (description "Get current render width (it considers HiDPI)") + (return-type "int")) + + ((name "GetRenderHeight") + (description "Get current render height (it considers HiDPI)") + (return-type "int")) + + ((name "GetMonitorCount") + (description "Get number of connected monitors") + (return-type "int")) + + ((name "GetCurrentMonitor") + (description "Get current monitor where window is placed") + (return-type "int")) + + ((name "GetMonitorPosition") + (description "Get specified monitor position") + (return-type "Vector2") + (params + ((type "int") (name "monitor")))) + + ((name "GetMonitorWidth") + (description "Get specified monitor width (current video mode used by monitor)") + (return-type "int") + (params + ((type "int") (name "monitor")))) + + ((name "GetMonitorHeight") + (description "Get specified monitor height (current video mode used by monitor)") + (return-type "int") + (params + ((type "int") (name "monitor")))) + + ((name "GetMonitorPhysicalWidth") + (description "Get specified monitor physical width in millimetres") + (return-type "int") + (params + ((type "int") (name "monitor")))) + + ((name "GetMonitorPhysicalHeight") + (description "Get specified monitor physical height in millimetres") + (return-type "int") + (params + ((type "int") (name "monitor")))) + + ((name "GetMonitorRefreshRate") + (description "Get specified monitor refresh rate") + (return-type "int") + (params + ((type "int") (name "monitor")))) + + ((name "GetWindowPosition") + (description "Get window position XY on monitor") + (return-type "Vector2")) + + ((name "GetWindowScaleDPI") + (description "Get window scale DPI factor") + (return-type "Vector2")) + + ((name "GetMonitorName") + (description "Get the human-readable, UTF-8 encoded name of the specified monitor") + (return-type "const char *") + (params + ((type "int") (name "monitor")))) + + ((name "SetClipboardText") + (description "Set clipboard text content") + (return-type "void") + (params + ((type "const char *") (name "text")))) + + ((name "GetClipboardText") + (description "Get clipboard text content") + (return-type "const char *")) + + ((name "GetClipboardImage") + (description "Get clipboard image content") + (return-type "Image")) + + ((name "EnableEventWaiting") + (description "Enable waiting for events on EndDrawing(), no automatic event polling") + (return-type "void")) + + ((name "DisableEventWaiting") + (description "Disable waiting for events on EndDrawing(), automatic events polling") + (return-type "void")) + + ((name "ShowCursor") + (description "Show cursor") + (return-type "void")) + + ((name "HideCursor") + (description "Hide cursor") + (return-type "void")) + + ((name "IsCursorHidden") + (description "Check if cursor is not visible") + (return-type "bool")) + + ((name "EnableCursor") + (description "Enable cursor (unlock cursor)") + (return-type "void")) + + ((name "DisableCursor") + (description "Disable cursor (lock cursor)") + (return-type "void")) + + ((name "IsCursorOnScreen") + (description "Check if cursor is on the screen") + (return-type "bool")) + + ((name "ClearBackground") + (description "Clear background (framebuffer) to color") + (return-type "void") + (params + ((type "Color") (name "color")))) + + ((name "BeginDrawing") + (description "Begin canvas (framebuffer) drawing") + (return-type "void")) + + ((name "EndDrawing") + (description "End canvas (framebuffer) drawing and swap buffers (double buffering)") + (return-type "void")) + + ((name "BeginMode2D") + (description "Begin 2D mode with custom camera (2D)") + (return-type "void") + (params + ((type "Camera2D") (name "camera")))) + + ((name "EndMode2D") + (description "End 2D mode with custom camera") + (return-type "void")) + + ((name "BeginMode3D") + (description "Begin 3D mode with custom camera (3D)") + (return-type "void") + (params + ((type "Camera3D") (name "camera")))) + + ((name "EndMode3D") + (description "End 3D mode and returns to default 2D orthographic mode") + (return-type "void")) + + ((name "BeginTextureMode") + (description "Begin drawing to render texture") + (return-type "void") + (params + ((type "RenderTexture2D") (name "target")))) + + ((name "EndTextureMode") + (description "End drawing to render texture") + (return-type "void")) + + ((name "BeginShaderMode") + (description "Begin custom shader drawing") + (return-type "void") + (params + ((type "Shader") (name "shader")))) + + ((name "EndShaderMode") + (description "End custom shader drawing (use default shader)") + (return-type "void")) + + ((name "BeginBlendMode") + (description "Begin blending mode (alpha, additive, multiplied, subtract, custom)") + (return-type "void") + (params + ((type "int") (name "mode")))) + + ((name "EndBlendMode") + (description "End blending mode (reset to default: alpha blending)") + (return-type "void")) + + ((name "BeginScissorMode") + (description "Begin scissor mode (define screen area for following drawing)") + (return-type "void") + (params + ((type "int") (name "x")) + ((type "int") (name "y")) + ((type "int") (name "width")) + ((type "int") (name "height")))) + + ((name "EndScissorMode") + (description "End scissor mode") + (return-type "void")) + + ((name "BeginVrStereoMode") + (description "Begin stereo rendering (requires VR simulator)") + (return-type "void") + (params + ((type "VrStereoConfig") (name "config")))) + + ((name "EndVrStereoMode") + (description "End stereo rendering (requires VR simulator)") + (return-type "void")) + + ((name "LoadVrStereoConfig") + (description "Load VR stereo config for VR simulator device parameters") + (return-type "VrStereoConfig") + (params + ((type "VrDeviceInfo") (name "device")))) + + ((name "UnloadVrStereoConfig") + (description "Unload VR stereo config") + (return-type "void") + (params + ((type "VrStereoConfig") (name "config")))) + + ((name "LoadShader") + (description "Load shader from files and bind default locations") + (return-type "Shader") + (params + ((type "const char *") (name "vsFileName")) + ((type "const char *") (name "fsFileName")))) + + ((name "LoadShaderFromMemory") + (description "Load shader from code strings and bind default locations") + (return-type "Shader") + (params + ((type "const char *") (name "vsCode")) + ((type "const char *") (name "fsCode")))) + + ((name "IsShaderValid") + (description "Check if shader is valid (loaded on GPU)") + (return-type "bool") + (params + ((type "Shader") (name "shader")))) + + ((name "GetShaderLocation") + (description "Get shader uniform location") + (return-type "int") + (params + ((type "Shader") (name "shader")) + ((type "const char *") (name "uniformName")))) + + ((name "GetShaderLocationAttrib") + (description "Get shader attribute location") + (return-type "int") + (params + ((type "Shader") (name "shader")) + ((type "const char *") (name "attribName")))) + + ((name "SetShaderValue") + (description "Set shader uniform value") + (return-type "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") + (return-type "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)") + (return-type "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)") + (return-type "void") + (params + ((type "Shader") (name "shader")) + ((type "int") (name "locIndex")) + ((type "Texture2D") (name "texture")))) + + ((name "UnloadShader") + (description "Unload shader from GPU memory (VRAM)") + (return-type "void") + (params + ((type "Shader") (name "shader")))) + + ((name "GetScreenToWorldRay") + (description "Get a ray trace from screen position (i.e mouse)") + (return-type "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") + (return-type "Ray") + (params + ((type "Vector2") (name "position")) + ((type "Camera") (name "camera")) + ((type "int") (name "width")) + ((type "int") (name "height")))) + + ((name "GetWorldToScreen") + (description "Get screen space position for a 3d world space position") + (return-type "Vector2") + (params + ((type "Vector3") (name "position")) + ((type "Camera") (name "camera")))) + + ((name "GetWorldToScreenEx") + (description "Get sized screen space position for a 3d world space position") + (return-type "Vector2") + (params + ((type "Vector3") (name "position")) + ((type "Camera") (name "camera")) + ((type "int") (name "width")) + ((type "int") (name "height")))) + + ((name "GetWorldToScreen2D") + (description "Get screen space position for a 2d camera world space position") + (return-type "Vector2") + (params + ((type "Vector2") (name "position")) + ((type "Camera2D") (name "camera")))) + + ((name "GetScreenToWorld2D") + (description "Get world space position for a 2d camera screen space position") + (return-type "Vector2") + (params + ((type "Vector2") (name "position")) + ((type "Camera2D") (name "camera")))) + + ((name "GetCameraMatrix") + (description "Get camera transform matrix (view matrix)") + (return-type "Matrix") + (params + ((type "Camera") (name "camera")))) + + ((name "GetCameraMatrix2D") + (description "Get camera 2d transform matrix") + (return-type "Matrix") + (params + ((type "Camera2D") (name "camera")))) + + ((name "SetTargetFPS") + (description "Set target FPS (maximum)") + (return-type "void") + (params + ((type "int") (name "fps")))) + + ((name "GetFrameTime") + (description "Get time in seconds for last frame drawn (delta time)") + (return-type "float")) + + ((name "GetTime") + (description "Get elapsed time in seconds since InitWindow()") + (return-type "double")) + + ((name "GetFPS") + (description "Get current FPS") + (return-type "int")) + + ((name "SwapScreenBuffer") + (description "Swap back buffer with front buffer (screen drawing)") + (return-type "void")) + + ((name "PollInputEvents") + (description "Register all input events") + (return-type "void")) + + ((name "WaitTime") + (description "Wait for some time (halt program execution)") + (return-type "void") + (params + ((type "double") (name "seconds")))) + + ((name "SetRandomSeed") + (description "Set the seed for the random number generator") + (return-type "void") + (params + ((type "unsigned int") (name "seed")))) + + ((name "GetRandomValue") + (description "Get a random value between min and max (both included)") + (return-type "int") + (params + ((type "int") (name "min")) + ((type "int") (name "max")))) + + ((name "LoadRandomSequence") + (description "Load random values sequence, no values repeated") + (return-type "int *") + (params + ((type "unsigned int") (name "count")) + ((type "int") (name "min")) + ((type "int") (name "max")))) + + ((name "UnloadRandomSequence") + (description "Unload random values sequence") + (return-type "void") + (params + ((type "int *") (name "sequence")))) + + ((name "TakeScreenshot") + (description "Takes a screenshot of current screen (filename extension defines format)") + (return-type "void") + (params + ((type "const char *") (name "fileName")))) + + ((name "SetConfigFlags") + (description "Set up init configuration flags (view FLAGS)") + (return-type "void") + (params + ((type "unsigned int") (name "flags")))) + + ((name "OpenURL") + (description "Open URL with default system browser (if available)") + (return-type "void") + (params + ((type "const char *") (name "url")))) + + ((name "SetTraceLogLevel") + (description "Set the current threshold (minimum) log level") + (return-type "void") + (params + ((type "int") (name "logLevel")))) + + ((name "TraceLog") + (description "Show trace log messages (LOG_DEBUG, LOG_INFO, LOG_WARNING, LOG_ERROR...)") + (return-type "void") + (params + ((type "int") (name "logLevel")) + ((type "const char *") (name "text")) + ((type "...") (name "args")))) + + ((name "SetTraceLogCallback") + (description "Set custom trace log") + (return-type "void") + (params + ((type "TraceLogCallback") (name "callback")))) + + ((name "MemAlloc") + (description "Internal memory allocator") + (return-type "void *") + (params + ((type "unsigned int") (name "size")))) + + ((name "MemRealloc") + (description "Internal memory reallocator") + (return-type "void *") + (params + ((type "void *") (name "ptr")) + ((type "unsigned int") (name "size")))) + + ((name "MemFree") + (description "Internal memory free") + (return-type "void") + (params + ((type "void *") (name "ptr")))) + + ((name "LoadFileData") + (description "Load file data as byte array (read)") + (return-type "unsigned char *") + (params + ((type "const char *") (name "fileName")) + ((type "int *") (name "dataSize")))) + + ((name "UnloadFileData") + (description "Unload file data allocated by LoadFileData()") + (return-type "void") + (params + ((type "unsigned char *") (name "data")))) + + ((name "SaveFileData") + (description "Save data to file from byte array (write), returns true on success") + (return-type "bool") + (params + ((type "const char *") (name "fileName")) + ((type "const void *") (name "data")) + ((type "int") (name "dataSize")))) + + ((name "ExportDataAsCode") + (description "Export data to code (.h), returns true on success") + (return-type "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") + (return-type "char *") + (params + ((type "const char *") (name "fileName")))) + + ((name "UnloadFileText") + (description "Unload file text data allocated by LoadFileText()") + (return-type "void") + (params + ((type "char *") (name "text")))) + + ((name "SaveFileText") + (description "Save text data to file (write), string must be '\\0' terminated, returns true on success") + (return-type "bool") + (params + ((type "const char *") (name "fileName")) + ((type "const char *") (name "text")))) + + ((name "SetLoadFileDataCallback") + (description "Set custom file binary data loader") + (return-type "void") + (params + ((type "LoadFileDataCallback") (name "callback")))) + + ((name "SetSaveFileDataCallback") + (description "Set custom file binary data saver") + (return-type "void") + (params + ((type "SaveFileDataCallback") (name "callback")))) + + ((name "SetLoadFileTextCallback") + (description "Set custom file text data loader") + (return-type "void") + (params + ((type "LoadFileTextCallback") (name "callback")))) + + ((name "SetSaveFileTextCallback") + (description "Set custom file text data saver") + (return-type "void") + (params + ((type "SaveFileTextCallback") (name "callback")))) + + ((name "FileRename") + (description "Rename file (if exists), returns 0 on success") + (return-type "int") + (params + ((type "const char *") (name "fileName")) + ((type "const char *") (name "fileRename")))) + + ((name "FileRemove") + (description "Remove file (if exists), returns 0 on success") + (return-type "int") + (params + ((type "const char *") (name "fileName")))) + + ((name "FileCopy") + (description "Copy file from one path to another, dstPath created if it doesn't exist, returns 0 on success") + (return-type "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, returns 0 on success") + (return-type "int") + (params + ((type "const char *") (name "srcPath")) + ((type "const char *") (name "dstPath")))) + + ((name "FileTextReplace") + (description "Replace text in an existing file, returns 0 on success") + (return-type "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, returns -1 if index not found or index otherwise") + (return-type "int") + (params + ((type "const char *") (name "fileName")) + ((type "const char *") (name "search")))) + + ((name "FileExists") + (description "Check if file exists") + (return-type "bool") + (params + ((type "const char *") (name "fileName")))) + + ((name "DirectoryExists") + (description "Check if directory path exists") + (return-type "bool") + (params + ((type "const char *") (name "dirPath")))) + + ((name "IsFileExtension") + (description "Check file extension (recommended include point: .png, .wav)") + (return-type "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)") + (return-type "int") + (params + ((type "const char *") (name "fileName")))) + + ((name "GetFileModTime") + (description "Get file modification time (last write time)") + (return-type "long") + (params + ((type "const char *") (name "fileName")))) + + ((name "GetFileExtension") + (description "Get pointer to extension for a filename string (includes dot: '.png')") + (return-type "const char *") + (params + ((type "const char *") (name "fileName")))) + + ((name "GetFileName") + (description "Get pointer to filename for a path string") + (return-type "const char *") + (params + ((type "const char *") (name "filePath")))) + + ((name "GetFileNameWithoutExt") + (description "Get filename string without extension (uses static string)") + (return-type "const char *") + (params + ((type "const char *") (name "filePath")))) + + ((name "GetDirectoryPath") + (description "Get full path for a provided fileName with path (uses static string)") + (return-type "const char *") + (params + ((type "const char *") (name "filePath")))) + + ((name "GetPrevDirectoryPath") + (description "Get previous directory path for a provided path (uses static string)") + (return-type "const char *") + (params + ((type "const char *") (name "dirPath")))) + + ((name "GetWorkingDirectory") + (description "Get current working directory (uses static string)") + (return-type "const char *")) + + ((name "GetApplicationDirectory") + (description "Get the directory of the running application (uses static string)") + (return-type "const char *")) + + ((name "MakeDirectory") + (description "Create directories (including full path requested), returns 0 on success") + (return-type "int") + (params + ((type "const char *") (name "dirPath")))) + + ((name "ChangeDirectory") + (description "Change working directory, returns 0 on success") + (return-type "int") + (params + ((type "const char *") (name "dirPath")))) + + ((name "IsPathFile") + (description "Check if provided path points to a file") + (return-type "bool") + (params + ((type "const char *") (name "path")))) + + ((name "IsPathDirectory") + (description "Check if provided path points to a directory") + (return-type "bool") + (params + ((type "const char *") (name "path")))) + + ((name "IsPathAbsolute") + (description "Check if provided path is an absolute path") + (return-type "bool") + (params + ((type "const char *") (name "path")))) + + ((name "IsFileNameValid") + (description "Check if fileName is valid for the platform/OS") + (return-type "bool") + (params + ((type "const char *") (name "fileName")))) + + ((name "LoadDirectoryFiles") + (description "Load directory filepaths, files and directories, no subdirs scan") + (return-type "FilePathList") + (params + ((type "const char *") (name "dirPath")))) + + ((name "LoadDirectoryFilesEx") + (description "Load directory filepaths with extension filtering and subdir scan; some filters available: '*.*','FILES*','DIRS*'") + (return-type "FilePathList") + (params + ((type "const char *") (name "basePath")) + ((type "const char *") (name "filter")) + ((type "bool") (name "scanSubdirs")))) + + ((name "UnloadDirectoryFiles") + (description "Unload filepaths") + (return-type "void") + (params + ((type "FilePathList") (name "files")))) + + ((name "IsFileDropped") + (description "Check if file has been dropped into window") + (return-type "bool")) + + ((name "LoadDroppedFiles") + (description "Load dropped filepaths") + (return-type "FilePathList")) + + ((name "UnloadDroppedFiles") + (description "Unload dropped filepaths") + (return-type "void") + (params + ((type "FilePathList") (name "files")))) + + ((name "GetDirectoryFileCount") + (description "Get the file count in a directory") + (return-type "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") + (return-type "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()") + (return-type "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()") + (return-type "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()") + (return-type "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()") + (return-type "unsigned char *") + (params + ((type "const char *") (name "text")) + ((type "int *") (name "outputSize")))) + + ((name "ComputeCRC32") + (description "Compute CRC32 hash code") + (return-type "unsigned int") + (params + ((type "const unsigned char *") (name "data")) + ((type "int") (name "dataSize")))) + + ((name "ComputeMD5") + (description "Compute MD5 hash code, returns static int[4] (16 bytes)") + (return-type "unsigned int *") + (params + ((type "const unsigned char *") (name "data")) + ((type "int") (name "dataSize")))) + + ((name "ComputeSHA1") + (description "Compute SHA1 hash code, returns static int[5] (20 bytes)") + (return-type "unsigned int *") + (params + ((type "const unsigned char *") (name "data")) + ((type "int") (name "dataSize")))) + + ((name "ComputeSHA256") + (description "Compute SHA256 hash code, returns static int[8] (32 bytes)") + (return-type "unsigned int *") + (params + ((type "const 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") + (return-type "AutomationEventList") + (params + ((type "const char *") (name "fileName")))) + + ((name "UnloadAutomationEventList") + (description "Unload automation events list from file") + (return-type "void") + (params + ((type "AutomationEventList") (name "list")))) + + ((name "ExportAutomationEventList") + (description "Export automation events list as text file") + (return-type "bool") + (params + ((type "AutomationEventList") (name "list")) + ((type "const char *") (name "fileName")))) + + ((name "SetAutomationEventList") + (description "Set automation event list to record to") + (return-type "void") + (params + ((type "AutomationEventList *") (name "list")))) + + ((name "SetAutomationEventBaseFrame") + (description "Set automation event internal base frame to start recording") + (return-type "void") + (params + ((type "int") (name "frame")))) + + ((name "StartAutomationEventRecording") + (description "Start recording automation events (AutomationEventList must be set)") + (return-type "void")) + + ((name "StopAutomationEventRecording") + (description "Stop recording automation events") + (return-type "void")) + + ((name "PlayAutomationEvent") + (description "Play a recorded automation event") + (return-type "void") + (params + ((type "AutomationEvent") (name "event")))) + + ((name "IsKeyPressed") + (description "Check if key has been pressed once") + (return-type "bool") + (params + ((type "int") (name "key")))) + + ((name "IsKeyPressedRepeat") + (description "Check if key has been pressed again") + (return-type "bool") + (params + ((type "int") (name "key")))) + + ((name "IsKeyDown") + (description "Check if key is being pressed") + (return-type "bool") + (params + ((type "int") (name "key")))) + + ((name "IsKeyReleased") + (description "Check if key has been released once") + (return-type "bool") + (params + ((type "int") (name "key")))) + + ((name "IsKeyUp") + (description "Check if key is NOT being pressed") + (return-type "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") + (return-type "int")) + + ((name "GetCharPressed") + (description "Get char pressed (unicode), call it multiple times for chars queued, returns 0 when the queue is empty") + (return-type "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)") + (return-type "const char *") + (params + ((type "int") (name "key")))) + + ((name "SetExitKey") + (description "Set a custom key to exit program (default is ESC)") + (return-type "void") + (params + ((type "int") (name "key")))) + + ((name "IsGamepadAvailable") + (description "Check if gamepad is available") + (return-type "bool") + (params + ((type "int") (name "gamepad")))) + + ((name "GetGamepadName") + (description "Get gamepad internal name id") + (return-type "const char *") + (params + ((type "int") (name "gamepad")))) + + ((name "IsGamepadButtonPressed") + (description "Check if gamepad button has been pressed once") + (return-type "bool") + (params + ((type "int") (name "gamepad")) + ((type "int") (name "button")))) + + ((name "IsGamepadButtonDown") + (description "Check if gamepad button is being pressed") + (return-type "bool") + (params + ((type "int") (name "gamepad")) + ((type "int") (name "button")))) + + ((name "IsGamepadButtonReleased") + (description "Check if gamepad button has been released once") + (return-type "bool") + (params + ((type "int") (name "gamepad")) + ((type "int") (name "button")))) + + ((name "IsGamepadButtonUp") + (description "Check if gamepad button is NOT being pressed") + (return-type "bool") + (params + ((type "int") (name "gamepad")) + ((type "int") (name "button")))) + + ((name "GetGamepadButtonPressed") + (description "Get the last gamepad button pressed") + (return-type "int")) + + ((name "GetGamepadAxisCount") + (description "Get axis count for a gamepad") + (return-type "int") + (params + ((type "int") (name "gamepad")))) + + ((name "GetGamepadAxisMovement") + (description "Get movement value for a gamepad axis") + (return-type "float") + (params + ((type "int") (name "gamepad")) + ((type "int") (name "axis")))) + + ((name "SetGamepadMappings") + (description "Set internal gamepad mappings (SDL_GameControllerDB)") + (return-type "int") + (params + ((type "const char *") (name "mappings")))) + + ((name "SetGamepadVibration") + (description "Set gamepad vibration for both motors (duration in seconds)") + (return-type "void") + (params + ((type "int") (name "gamepad")) + ((type "float") (name "leftMotor")) + ((type "float") (name "rightMotor")) + ((type "float") (name "duration")))) + + ((name "IsMouseButtonPressed") + (description "Check if mouse button has been pressed once") + (return-type "bool") + (params + ((type "int") (name "button")))) + + ((name "IsMouseButtonDown") + (description "Check if mouse button is being pressed") + (return-type "bool") + (params + ((type "int") (name "button")))) + + ((name "IsMouseButtonReleased") + (description "Check if mouse button has been released once") + (return-type "bool") + (params + ((type "int") (name "button")))) + + ((name "IsMouseButtonUp") + (description "Check if mouse button is NOT being pressed") + (return-type "bool") + (params + ((type "int") (name "button")))) + + ((name "GetMouseX") + (description "Get mouse position X") + (return-type "int")) + + ((name "GetMouseY") + (description "Get mouse position Y") + (return-type "int")) + + ((name "GetMousePosition") + (description "Get mouse position XY") + (return-type "Vector2")) + + ((name "GetMouseDelta") + (description "Get mouse delta between frames") + (return-type "Vector2")) + + ((name "SetMousePosition") + (description "Set mouse position XY") + (return-type "void") + (params + ((type "int") (name "x")) + ((type "int") (name "y")))) + + ((name "SetMouseOffset") + (description "Set mouse offset") + (return-type "void") + (params + ((type "int") (name "offsetX")) + ((type "int") (name "offsetY")))) + + ((name "SetMouseScale") + (description "Set mouse scaling") + (return-type "void") + (params + ((type "float") (name "scaleX")) + ((type "float") (name "scaleY")))) + + ((name "GetMouseWheelMove") + (description "Get mouse wheel movement for X or Y, whichever is larger") + (return-type "float")) + + ((name "GetMouseWheelMoveV") + (description "Get mouse wheel movement for both X and Y") + (return-type "Vector2")) + + ((name "SetMouseCursor") + (description "Set mouse cursor") + (return-type "void") + (params + ((type "int") (name "cursor")))) + + ((name "GetTouchX") + (description "Get touch position X for touch point 0 (relative to screen size)") + (return-type "int")) + + ((name "GetTouchY") + (description "Get touch position Y for touch point 0 (relative to screen size)") + (return-type "int")) + + ((name "GetTouchPosition") + (description "Get touch position XY for a touch point index (relative to screen size)") + (return-type "Vector2") + (params + ((type "int") (name "index")))) + + ((name "GetTouchPointId") + (description "Get touch point identifier for provided index") + (return-type "int") + (params + ((type "int") (name "index")))) + + ((name "GetTouchPointCount") + (description "Get number of touch points") + (return-type "int")) + + ((name "SetGesturesEnabled") + (description "Enable a set of gestures using flags") + (return-type "void") + (params + ((type "unsigned int") (name "flags")))) + + ((name "IsGestureDetected") + (description "Check if gesture has been detected") + (return-type "bool") + (params + ((type "unsigned int") (name "gesture")))) + + ((name "GetGestureDetected") + (description "Get latest detected gesture") + (return-type "int")) + + ((name "GetGestureHoldDuration") + (description "Get gesture hold time in seconds") + (return-type "float")) + + ((name "GetGestureDragVector") + (description "Get gesture drag vector") + (return-type "Vector2")) + + ((name "GetGestureDragAngle") + (description "Get gesture drag angle") + (return-type "float")) + + ((name "GetGesturePinchVector") + (description "Get gesture pinch delta") + (return-type "Vector2")) + + ((name "GetGesturePinchAngle") + (description "Get gesture pinch angle") + (return-type "float")) + + ((name "UpdateCamera") + (description "Update camera position for selected mode") + (return-type "void") + (params + ((type "Camera *") (name "camera")) + ((type "int") (name "mode")))) + + ((name "UpdateCameraPro") + (description "Update camera movement/rotation") + (return-type "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") + (return-type "void") + (params + ((type "Texture2D") (name "texture")) + ((type "Rectangle") (name "rec")))) + + ((name "GetShapesTexture") + (description "Get texture that is used for shapes drawing") + (return-type "Texture2D")) + + ((name "GetShapesTextureRectangle") + (description "Get texture source rectangle that is used for shapes drawing") + (return-type "Rectangle")) + + ((name "DrawPixel") + (description "Draw a pixel using geometry [Can be slow, use with care]") + (return-type "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]") + (return-type "void") + (params + ((type "Vector2") (name "position")) + ((type "Color") (name "color")))) + + ((name "DrawLine") + (description "Draw a line") + (return-type "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)") + (return-type "void") + (params + ((type "Vector2") (name "startPos")) + ((type "Vector2") (name "endPos")) + ((type "Color") (name "color")))) + + ((name "DrawLineEx") + (description "Draw a line (using triangles/quads)") + (return-type "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)") + (return-type "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") + (return-type "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") + (return-type "void") + (params + ((type "Vector2") (name "startPos")) + ((type "Vector2") (name "endPos")) + ((type "int") (name "dashSize")) + ((type "int") (name "spaceSize")) + ((type "Color") (name "color")))) + + ((name "DrawTriangle") + (description "Draw a color-filled triangle, counter-clockwise vertex order") + (return-type "void") + (params + ((type "Vector2") (name "v1")) + ((type "Vector2") (name "v2")) + ((type "Vector2") (name "v3")) + ((type "Color") (name "color")))) + + ((name "DrawTriangleGradient") + (description "Draw triangle with interpolated colors, counter-clockwise vertex/color order") + (return-type "void") + (params + ((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 "DrawTriangleLines") + (description "Draw triangle outline, counter-clockwise vertex order") + (return-type "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)") + (return-type "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") + (return-type "void") + (params + ((type "const Vector2 *") (name "points")) + ((type "int") (name "pointCount")) + ((type "Color") (name "color")))) + + ((name "DrawRectangle") + (description "Draw a color-filled rectangle") + (return-type "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)") + (return-type "void") + (params + ((type "Vector2") (name "position")) + ((type "Vector2") (name "size")) + ((type "Color") (name "color")))) + + ((name "DrawRectangleRec") + (description "Draw a color-filled rectangle") + (return-type "void") + (params + ((type "Rectangle") (name "rec")) + ((type "Color") (name "color")))) + + ((name "DrawRectanglePro") + (description "Draw a color-filled rectangle with pro parameters") + (return-type "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") + (return-type "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") + (return-type "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, counter-clockwise color order") + (return-type "void") + (params + ((type "Rectangle") (name "rec")) + ((type "Color") (name "col1")) + ((type "Color") (name "col2")) + ((type "Color") (name "col3")) + ((type "Color") (name "col4")))) + + ((name "DrawRectangleLines") + (description "Draw rectangle outline") + (return-type "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 line thickness") + (return-type "void") + (params + ((type "Rectangle") (name "rec")) + ((type "float") (name "thick")) + ((type "Color") (name "color")))) + + ((name "DrawRectangleRounded") + (description "Draw rectangle with rounded edges") + (return-type "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") + (return-type "void") + (params + ((type "Rectangle") (name "rec")) + ((type "float") (name "roundness")) + ((type "int") (name "segments")) + ((type "Color") (name "color")))) + + ((name "DrawRectangleRoundedLinesEx") + (description "Draw rectangle lines with rounded edges outline and line thickness") + (return-type "void") + (params + ((type "Rectangle") (name "rec")) + ((type "float") (name "roundness")) + ((type "int") (name "segments")) + ((type "float") (name "thick")) + ((type "Color") (name "color")))) + + ((name "DrawPoly") + (description "Draw a polygon of n sides") + (return-type "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") + (return-type "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 line thickness") + (return-type "void") + (params + ((type "Vector2") (name "center")) + ((type "int") (name "sides")) + ((type "float") (name "radius")) + ((type "float") (name "rotation")) + ((type "float") (name "thick")) + ((type "Color") (name "color")))) + + ((name "DrawCircle") + (description "Draw a color-filled circle") + (return-type "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)") + (return-type "void") + (params + ((type "Vector2") (name "center")) + ((type "float") (name "radius")) + ((type "Color") (name "color")))) + + ((name "DrawCircleGradient") + (description "Draw a gradient-filled circle") + (return-type "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") + (return-type "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") + (return-type "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") + (return-type "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)") + (return-type "void") + (params + ((type "Vector2") (name "center")) + ((type "float") (name "radius")) + ((type "Color") (name "color")))) + + ((name "DrawCircleLinesEx") + (description "Draw circle outline with line thickness") + (return-type "void") + (params + ((type "Vector2") (name "center")) + ((type "float") (name "radius")) + ((type "float") (name "thick")) + ((type "Color") (name "color")))) + + ((name "DrawEllipse") + (description "Draw ellipse") + (return-type "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)") + (return-type "void") + (params + ((type "Vector2") (name "center")) + ((type "float") (name "radiusH")) + ((type "float") (name "radiusV")) + ((type "Color") (name "color")))) + + ((name "DrawEllipseLines") + (description "Draw ellipse outline") + (return-type "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)") + (return-type "void") + (params + ((type "Vector2") (name "center")) + ((type "float") (name "radiusH")) + ((type "float") (name "radiusV")) + ((type "Color") (name "color")))) + + ((name "DrawRing") + (description "Draw ring") + (return-type "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") + (return-type "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 "DrawSplineLinear") + (description "Draw spline: Linear, minimum 2 points") + (return-type "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") + (return-type "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") + (return-type "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...]") + (return-type "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...]") + (return-type "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") + (return-type "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") + (return-type "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") + (return-type "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") + (return-type "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") + (return-type "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") + (return-type "Vector2") + (params + ((type "Vector2") (name "startPos")) + ((type "Vector2") (name "endPos")) + ((type "float") (name "t")))) + + ((name "GetSplinePointBasis") + (description "Get (evaluate) spline point: B-Spline") + (return-type "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") + (return-type "Vector2") + (params + ((type "Vector2") (name "p1")) + ((type "Vector2") (name "p2")) + ((type "Vector2") (name "p3")) + ((type "Vector2") (name "p4")) + ((type "float") (name "t")))) + + ((name "GetSplinePointBezierQuadratic") + (description "Get (evaluate) spline point: Quadratic Bezier") + (return-type "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") + (return-type "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") + (return-type "bool") + (params + ((type "Rectangle") (name "rec1")) + ((type "Rectangle") (name "rec2")))) + + ((name "CheckCollisionCircles") + (description "Check collision between two circles") + (return-type "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") + (return-type "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 between two points [p1] and [p2]") + (return-type "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") + (return-type "bool") + (params + ((type "Vector2") (name "point")) + ((type "Rectangle") (name "rec")))) + + ((name "CheckCollisionPointCircle") + (description "Check if point is inside circle") + (return-type "bool") + (params + ((type "Vector2") (name "point")) + ((type "Vector2") (name "center")) + ((type "float") (name "radius")))) + + ((name "CheckCollisionPointTriangle") + (description "Check if point is inside a triangle") + (return-type "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]") + (return-type "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") + (return-type "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") + (return-type "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") + (return-type "Rectangle") + (params + ((type "Rectangle") (name "rec1")) + ((type "Rectangle") (name "rec2")))) + + ((name "LoadImage") + (description "Load image from file into CPU memory (RAM)") + (return-type "Image") + (params + ((type "const char *") (name "fileName")))) + + ((name "LoadImageRaw") + (description "Load image from RAW file data") + (return-type "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)") + (return-type "Image") + (params + ((type "const char *") (name "fileName")) + ((type "int *") (name "frames")))) + + ((name "LoadImageAnimFromMemory") + (description "Load image sequence from memory buffer") + (return-type "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'") + (return-type "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") + (return-type "Image") + (params + ((type "Texture2D") (name "texture")))) + + ((name "LoadImageFromScreen") + (description "Load image from screen buffer (screenshot)") + (return-type "Image")) + + ((name "IsImageValid") + (description "Check if an image is valid (data and parameters)") + (return-type "bool") + (params + ((type "Image") (name "image")))) + + ((name "UnloadImage") + (description "Unload image from CPU memory (RAM)") + (return-type "void") + (params + ((type "Image") (name "image")))) + + ((name "ExportImage") + (description "Export image data to file, returns true on success") + (return-type "bool") + (params + ((type "Image") (name "image")) + ((type "const char *") (name "fileName")))) + + ((name "ExportImageToMemory") + (description "Export image to memory buffer, memory must be MemFree()") + (return-type "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") + (return-type "bool") + (params + ((type "Image") (name "image")) + ((type "const char *") (name "fileName")))) + + ((name "GenImageColor") + (description "Generate image: plain color") + (return-type "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") + (return-type "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") + (return-type "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") + (return-type "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") + (return-type "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") + (return-type "Image") + (params + ((type "int") (name "width")) + ((type "int") (name "height")) + ((type "float") (name "factor")))) + + ((name "GenImagePerlinNoise") + (description "Generate image: perlin noise") + (return-type "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") + (return-type "Image") + (params + ((type "int") (name "width")) + ((type "int") (name "height")) + ((type "int") (name "tileSize")))) + + ((name "GenImageText") + (description "Generate image: grayscale image from text data") + (return-type "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)") + (return-type "Image") + (params + ((type "Image") (name "image")))) + + ((name "ImageFromImage") + (description "Create an image from another image piece") + (return-type "Image") + (params + ((type "Image") (name "image")) + ((type "Rectangle") (name "rec")))) + + ((name "ImageFromChannel") + (description "Create an image from a selected channel of another image (GRAYSCALE)") + (return-type "Image") + (params + ((type "Image") (name "image")) + ((type "int") (name "selectedChannel")))) + + ((name "ImageText") + (description "Create an image from text (default font)") + (return-type "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)") + (return-type "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") + (return-type "void") + (params + ((type "Image *") (name "image")) + ((type "int") (name "newFormat")))) + + ((name "ImageToPOT") + (description "Convert image to POT (power-of-two)") + (return-type "void") + (params + ((type "Image *") (name "image")) + ((type "Color") (name "fill")))) + + ((name "ImageCrop") + (description "Crop an image to a defined rectangle") + (return-type "void") + (params + ((type "Image *") (name "image")) + ((type "Rectangle") (name "crop")))) + + ((name "ImageAlphaCrop") + (description "Crop image depending on alpha value") + (return-type "void") + (params + ((type "Image *") (name "image")) + ((type "float") (name "threshold")))) + + ((name "ImageAlphaClear") + (description "Clear alpha channel to desired color") + (return-type "void") + (params + ((type "Image *") (name "image")) + ((type "Color") (name "color")) + ((type "float") (name "threshold")))) + + ((name "ImageAlphaMask") + (description "Apply alpha mask to image") + (return-type "void") + (params + ((type "Image *") (name "image")) + ((type "Image") (name "alphaMask")))) + + ((name "ImageAlphaPremultiply") + (description "Premultiply alpha channel") + (return-type "void") + (params + ((type "Image *") (name "image")))) + + ((name "ImageBlurGaussian") + (description "Apply Gaussian blur using a box blur approximation") + (return-type "void") + (params + ((type "Image *") (name "image")) + ((type "int") (name "blurSize")))) + + ((name "ImageKernelConvolution") + (description "Apply custom square convolution kernel to image") + (return-type "void") + (params + ((type "Image *") (name "image")) + ((type "const float *") (name "kernel")) + ((type "int") (name "kernelSize")))) + + ((name "ImageResize") + (description "Resize image (Bicubic scaling algorithm)") + (return-type "void") + (params + ((type "Image *") (name "image")) + ((type "int") (name "newWidth")) + ((type "int") (name "newHeight")))) + + ((name "ImageResizeNN") + (description "Resize image (Nearest-Neighbor scaling algorithm)") + (return-type "void") + (params + ((type "Image *") (name "image")) + ((type "int") (name "newWidth")) + ((type "int") (name "newHeight")))) + + ((name "ImageResizeCanvas") + (description "Resize canvas and fill with color") + (return-type "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") + (return-type "void") + (params + ((type "Image *") (name "image")))) + + ((name "ImageDither") + (description "Dither image data to 16bpp or lower (Floyd-Steinberg dithering)") + (return-type "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") + (return-type "void") + (params + ((type "Image *") (name "image")))) + + ((name "ImageFlipHorizontal") + (description "Flip image horizontally") + (return-type "void") + (params + ((type "Image *") (name "image")))) + + ((name "ImageRotate") + (description "Rotate image by input angle in degrees (-359 to 359)") + (return-type "void") + (params + ((type "Image *") (name "image")) + ((type "int") (name "degrees")))) + + ((name "ImageRotateCW") + (description "Rotate image clockwise 90deg") + (return-type "void") + (params + ((type "Image *") (name "image")))) + + ((name "ImageRotateCCW") + (description "Rotate image counter-clockwise 90deg") + (return-type "void") + (params + ((type "Image *") (name "image")))) + + ((name "ImageColorTint") + (description "Modify image color: tint") + (return-type "void") + (params + ((type "Image *") (name "image")) + ((type "Color") (name "color")))) + + ((name "ImageColorInvert") + (description "Modify image color: invert") + (return-type "void") + (params + ((type "Image *") (name "image")))) + + ((name "ImageColorGrayscale") + (description "Modify image color: grayscale") + (return-type "void") + (params + ((type "Image *") (name "image")))) + + ((name "ImageColorContrast") + (description "Modify image color: contrast (-100 to 100)") + (return-type "void") + (params + ((type "Image *") (name "image")) + ((type "int") (name "contrast")))) + + ((name "ImageColorBrightness") + (description "Modify image color: brightness (-255 to 255)") + (return-type "void") + (params + ((type "Image *") (name "image")) + ((type "int") (name "brightness")))) + + ((name "ImageColorReplace") + (description "Modify image color: replace color") + (return-type "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)") + (return-type "Color *") + (params + ((type "Image") (name "image")))) + + ((name "LoadImagePalette") + (description "Load colors palette from image as a Color array (RGBA - 32bit)") + (return-type "Color *") + (params + ((type "Image") (name "image")) + ((type "int") (name "maxPaletteSize")) + ((type "int *") (name "colorCount")))) + + ((name "UnloadImageColors") + (description "Unload color data loaded with LoadImageColors()") + (return-type "void") + (params + ((type "Color *") (name "colors")))) + + ((name "UnloadImagePalette") + (description "Unload colors palette loaded with LoadImagePalette()") + (return-type "void") + (params + ((type "Color *") (name "colors")))) + + ((name "GetImageAlphaBorder") + (description "Get image alpha border rectangle") + (return-type "Rectangle") + (params + ((type "Image") (name "image")) + ((type "float") (name "threshold")))) + + ((name "GetImageColor") + (description "Get image pixel color at (x, y) position") + (return-type "Color") + (params + ((type "Image") (name "image")) + ((type "int") (name "x")) + ((type "int") (name "y")))) + + ((name "ImageClearBackground") + (description "Clear image background with provided color") + (return-type "void") + (params + ((type "Image *") (name "dst")) + ((type "Color") (name "color")))) + + ((name "ImageDrawPixel") + (description "Draw pixel within an image") + (return-type "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)") + (return-type "void") + (params + ((type "Image *") (name "dst")) + ((type "Vector2") (name "position")) + ((type "Color") (name "color")))) + + ((name "ImageDrawLine") + (description "Draw line within an image") + (return-type "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)") + (return-type "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") + (return-type "void") + (params + ((type "Image *") (name "dst")) + ((type "Vector2") (name "start")) + ((type "Vector2") (name "end")) + ((type "int") (name "thick")) + ((type "Color") (name "color")))) + + ((name "ImageDrawLineStrip") + (description "Draw a lines sequence within an image") + (return-type "void") + (params + ((type "Image *") (name "dst")) + ((type "const Vector2 *") (name "points")) + ((type "int") (name "pointCount")) + ((type "Color") (name "color")))) + + ((name "ImageDrawTriangle") + (description "Draw triangle within an image") + (return-type "void") + (params + ((type "Image *") (name "dst")) + ((type "Vector2") (name "v1")) + ((type "Vector2") (name "v2")) + ((type "Vector2") (name "v3")) + ((type "Color") (name "color")))) + + ((name "ImageDrawTriangleGradient") + (description "Draw triangle with interpolated colors within an image") + (return-type "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") + (return-type "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)") + (return-type "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") + (return-type "void") + (params + ((type "Image *") (name "dst")) + ((type "const Vector2 *") (name "points")) + ((type "int") (name "pointCount")) + ((type "Color") (name "color")))) + + ((name "ImageDrawRectangle") + (description "Draw rectangle within an image") + (return-type "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)") + (return-type "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") + (return-type "void") + (params + ((type "Image *") (name "dst")) + ((type "Rectangle") (name "rec")) + ((type "Color") (name "color")))) + + ((name "ImageDrawRectanglePro") + (description "Draw a color-filled rectangle with pro parameters within and image") + (return-type "void") + (params + ((type "Image *") (name "dst")) + ((type "Rectangle") (name "rec")) + ((type "Vector2") (name "origin")) + ((type "float") (name "rotation")) + ((type "Color") (name "color")))) + + ((name "ImageDrawRectangleLines") + (description "Draw rectangle lines within an image") + (return-type "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 "ImageDrawRectangleLinesEx") + (description "Draw rectangle lines within an image with line thickness") + (return-type "void") + (params + ((type "Image *") (name "dst")) + ((type "Rectangle") (name "rec")) + ((type "int") (name "thick")) + ((type "Color") (name "color")))) + + ((name "ImageDrawRectangleGradientEx") + (description "Draw rectangle with gradient colors within an image, counter-clockwise color order") + (return-type "void") + (params + ((type "Image *") (name "dst")) + ((type "Rectangle") (name "rec")) + ((type "Color") (name "col1")) + ((type "Color") (name "col2")) + ((type "Color") (name "col3")) + ((type "Color") (name "col4")))) + + ((name "ImageDrawCircle") + (description "Draw a filled circle within an image") + (return-type "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)") + (return-type "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") + (return-type "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)") + (return-type "void") + (params + ((type "Image *") (name "dst")) + ((type "Vector2") (name "center")) + ((type "int") (name "radius")) + ((type "Color") (name "color")))) + + ((name "ImageDrawCircleGradient") + (description "Draw a gradient-filled circle within an image") + (return-type "void") + (params + ((type "Image *") (name "dst")) + ((type "Vector2") (name "center")) + ((type "float") (name "radius")) + ((type "Color") (name "inner")) + ((type "Color") (name "outer")))) + + ((name "ImageDrawImage") + (description "Draw an image within an image") + (return-type "void") + (params + ((type "Image *") (name "dst")) + ((type "Image") (name "src")) + ((type "int") (name "posX")) + ((type "int") (name "posY")) + ((type "Color") (name "tint")))) + + ((name "ImageDrawImageEx") + (description "Draw an image with scaling and rotation within an image") + (return-type "void") + (params + ((type "Image *") (name "dst")) + ((type "Image") (name "src")) + ((type "Vector2") (name "position")) + ((type "float") (name "rotation")) + ((type "float") (name "scale")) + ((type "Color") (name "tint")))) + + ((name "ImageDrawImageRec") + (description "Draw a part of an image defined by a rectangle within an image") + (return-type "void") + (params + ((type "Image *") (name "dst")) + ((type "Image") (name "src")) + ((type "Rectangle") (name "srcRec")) + ((type "Vector2") (name "position")) + ((type "Color") (name "tint")))) + + ((name "ImageDrawImagePro") + (description "Draw a part of an image defined by a rectangle into destination rectangle, with scaling and rotation, within an image") + (return-type "void") + (params + ((type "Image *") (name "dst")) + ((type "Image") (name "src")) + ((type "Rectangle") (name "srcRec")) + ((type "Rectangle") (name "dstRec")) + ((type "Vector2") (name "origin")) + ((type "float") (name "rotation")) + ((type "Color") (name "tint")))) + + ((name "ImageDrawText") + (description "Draw text (using default font) within an image (destination)") + (return-type "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)") + (return-type "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 "ImageDrawTextPro") + (description "Draw text using Font and pro parameters (rotation)") + (return-type "void") + (params + ((type "Image *") (name "dst")) + ((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 "LoadTexture") + (description "Load texture from file into GPU memory (VRAM)") + (return-type "Texture2D") + (params + ((type "const char *") (name "fileName")))) + + ((name "LoadTextureFromImage") + (description "Load texture from image data") + (return-type "Texture2D") + (params + ((type "Image") (name "image")))) + + ((name "LoadTextureCubemap") + (description "Load cubemap from image, multiple image cubemap layouts supported") + (return-type "TextureCubemap") + (params + ((type "Image") (name "image")) + ((type "int") (name "layout")))) + + ((name "LoadRenderTexture") + (description "Load texture for rendering (framebuffer)") + (return-type "RenderTexture2D") + (params + ((type "int") (name "width")) + ((type "int") (name "height")))) + + ((name "IsTextureValid") + (description "Check if texture is valid (loaded in GPU)") + (return-type "bool") + (params + ((type "Texture2D") (name "texture")))) + + ((name "UnloadTexture") + (description "Unload texture from GPU memory (VRAM)") + (return-type "void") + (params + ((type "Texture2D") (name "texture")))) + + ((name "IsRenderTextureValid") + (description "Check if render texture is valid (loaded in GPU)") + (return-type "bool") + (params + ((type "RenderTexture2D") (name "target")))) + + ((name "UnloadRenderTexture") + (description "Unload render texture from GPU memory (VRAM)") + (return-type "void") + (params + ((type "RenderTexture2D") (name "target")))) + + ((name "UpdateTexture") + (description "Update GPU texture with new data (pixels should be able to fill texture)") + (return-type "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)") + (return-type "void") + (params + ((type "Texture2D") (name "texture")) + ((type "Rectangle") (name "rec")) + ((type "const void *") (name "pixels")))) + + ((name "GenTextureMipmaps") + (description "Generate GPU mipmaps for a texture") + (return-type "void") + (params + ((type "Texture2D *") (name "texture")))) + + ((name "SetTextureFilter") + (description "Set texture scaling filter mode") + (return-type "void") + (params + ((type "Texture2D") (name "texture")) + ((type "int") (name "filter")))) + + ((name "SetTextureWrap") + (description "Set texture wrapping mode") + (return-type "void") + (params + ((type "Texture2D") (name "texture")) + ((type "int") (name "wrap")))) + + ((name "DrawTexture") + (description "Draw a Texture2D") + (return-type "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") + (return-type "void") + (params + ((type "Texture2D") (name "texture")) + ((type "Vector2") (name "position")) + ((type "Color") (name "tint")))) + + ((name "DrawTextureEx") + (description "Draw a Texture2D with rotation and scale") + (return-type "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") + (return-type "void") + (params + ((type "Texture2D") (name "texture")) + ((type "Rectangle") (name "rec")) + ((type "Vector2") (name "position")) + ((type "Color") (name "tint")))) + + ((name "DrawTexturePro") + (description "Draw a part of a texture defined by a source rectangle to destination rectangle, with scaling and rotation") + (return-type "void") + (params + ((type "Texture2D") (name "texture")) + ((type "Rectangle") (name "srcrec")) + ((type "Rectangle") (name "dstrec")) + ((type "Vector2") (name "origin")) + ((type "float") (name "rotation")) + ((type "Color") (name "tint")))) + + ((name "DrawTextureNPatch") + (description "Draw a texture (or part of it) that stretches or shrinks nicely") + (return-type "void") + (params + ((type "Texture2D") (name "texture")) + ((type "NPatchInfo") (name "nPatchInfo")) + ((type "Rectangle") (name "dstrec")) + ((type "Vector2") (name "origin")) + ((type "float") (name "rotation")) + ((type "Color") (name "tint")))) + + ((name "ColorIsEqual") + (description "Check if two colors are equal") + (return-type "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") + (return-type "Color") + (params + ((type "Color") (name "color")) + ((type "float") (name "alpha")))) + + ((name "ColorToInt") + (description "Get hexadecimal value for a Color (0xRRGGBBAA)") + (return-type "int") + (params + ((type "Color") (name "color")))) + + ((name "ColorNormalize") + (description "Get Color normalized as float [0..1]") + (return-type "Vector4") + (params + ((type "Color") (name "color")))) + + ((name "ColorFromNormalized") + (description "Get Color from normalized values [0..1]") + (return-type "Color") + (params + ((type "Vector4") (name "normalized")))) + + ((name "ColorToHSV") + (description "Get HSV values for a Color, hue [0..360], saturation/value [0..1]") + (return-type "Vector3") + (params + ((type "Color") (name "color")))) + + ((name "ColorFromHSV") + (description "Get a Color from HSV values, hue [0..360], saturation/value [0..1]") + (return-type "Color") + (params + ((type "float") (name "hue")) + ((type "float") (name "saturation")) + ((type "float") (name "value")))) + + ((name "ColorTint") + (description "Get color multiplied with another color") + (return-type "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") + (return-type "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") + (return-type "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") + (return-type "Color") + (params + ((type "Color") (name "color")) + ((type "float") (name "alpha")))) + + ((name "ColorAlphaBlend") + (description "Get src alpha-blended into dst color with tint") + (return-type "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]") + (return-type "Color") + (params + ((type "Color") (name "color1")) + ((type "Color") (name "color2")) + ((type "float") (name "factor")))) + + ((name "GetColor") + (description "Get Color structure from hexadecimal value") + (return-type "Color") + (params + ((type "unsigned int") (name "hexValue")))) + + ((name "GetPixelColor") + (description "Get Color from a source pixel pointer of certain format") + (return-type "Color") + (params + ((type "const void *") (name "srcPtr")) + ((type "int") (name "format")))) + + ((name "SetPixelColor") + (description "Set color formatted into destination pixel pointer") + (return-type "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") + (return-type "int") + (params + ((type "int") (name "width")) + ((type "int") (name "height")) + ((type "int") (name "format")))) + + ((name "GetFontDefault") + (description "Get the default Font") + (return-type "Font")) + + ((name "LoadFont") + (description "Load font from file into GPU memory (VRAM)") + (return-type "Font") + (params + ((type "const char *") (name "fileName")))) + + ((name "LoadFontEx") + (description "Load font from file with defined codepoints and generation size, use NULL for codepoints and 0 for codepointCount to load the default character set, font size is provided in pixels height") + (return-type "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)") + (return-type "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'") + (return-type "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 font is valid (font data loaded, WARNING: GPU texture not checked)") + (return-type "bool") + (params + ((type "Font") (name "font")))) + + ((name "LoadFontData") + (description "Load font data for further use") + (return-type "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") + (return-type "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)") + (return-type "void") + (params + ((type "GlyphInfo *") (name "glyphs")) + ((type "int") (name "glyphCount")))) + + ((name "UnloadFont") + (description "Unload font from GPU memory (VRAM)") + (return-type "void") + (params + ((type "Font") (name "font")))) + + ((name "ExportFontAsCode") + (description "Export font as code file, returns true on success") + (return-type "bool") + (params + ((type "Font") (name "font")) + ((type "const char *") (name "fileName")))) + + ((name "DrawFPS") + (description "Draw current FPS") + (return-type "void") + (params + ((type "int") (name "posX")) + ((type "int") (name "posY")))) + + ((name "DrawText") + (description "Draw text (using default font)") + (return-type "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") + (return-type "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)") + (return-type "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)") + (return-type "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 characters (codepoint)") + (return-type "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") + (return-type "void") + (params + ((type "int") (name "spacing")))) + + ((name "MeasureText") + (description "Measure string width for default font") + (return-type "int") + (params + ((type "const char *") (name "text")) + ((type "int") (name "fontSize")))) + + ((name "MeasureTextEx") + (description "Measure string size for Font") + (return-type "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") + (return-type "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") + (return-type "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") + (return-type "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") + (return-type "Rectangle") + (params + ((type "Font") (name "font")) + ((type "int") (name "codepoint")))) + + ((name "LoadUTF8") + (description "Load UTF-8 text encoded from codepoints array") + (return-type "char *") + (params + ((type "const int *") (name "codepoints")) + ((type "int") (name "length")))) + + ((name "UnloadUTF8") + (description "Unload UTF-8 text encoded from codepoints array") + (return-type "void") + (params + ((type "char *") (name "text")))) + + ((name "LoadCodepoints") + (description "Load all codepoints from a UTF-8 text string, codepoints count returned by parameter") + (return-type "int *") + (params + ((type "const char *") (name "text")) + ((type "int *") (name "count")))) + + ((name "UnloadCodepoints") + (description "Unload codepoints data from memory") + (return-type "void") + (params + ((type "int *") (name "codepoints")))) + + ((name "GetCodepointCount") + (description "Get total number of codepoints in a UTF-8 encoded string") + (return-type "int") + (params + ((type "const char *") (name "text")))) + + ((name "GetCodepoint") + (description "Get next codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure") + (return-type "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") + (return-type "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") + (return-type "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)") + (return-type "const char *") + (params + ((type "int") (name "codepoint")) + ((type "int *") (name "utf8Size")))) + + ((name "LoadTextLines") + (description "Load text as separate lines ('\\n')") + (return-type "char **") + (params + ((type "const char *") (name "text")) + ((type "int *") (name "count")))) + + ((name "UnloadTextLines") + (description "Unload text lines") + (return-type "void") + (params + ((type "char **") (name "text")) + ((type "int") (name "lineCount")))) + + ((name "TextCopy") + (description "Copy one string to another, returns bytes copied") + (return-type "int") + (params + ((type "char *") (name "dst")) + ((type "const char *") (name "src")))) + + ((name "TextIsEqual") + (description "Check if two text strings are equal") + (return-type "bool") + (params + ((type "const char *") (name "text1")) + ((type "const char *") (name "text2")))) + + ((name "TextLength") + (description "Get text length, checks for '\\0' ending") + (return-type "unsigned int") + (params + ((type "const char *") (name "text")))) + + ((name "TextFormat") + (description "Text formatting with variables (sprintf() style)") + (return-type "const char *") + (params + ((type "const char *") (name "text")) + ((type "...") (name "args")))) + + ((name "TextSubtext") + (description "Get a piece of a text string") + (return-type "const char *") + (params + ((type "const char *") (name "text")) + ((type "int") (name "position")) + ((type "int") (name "length")))) + + ((name "TextRemoveSpaces") + (description "Remove text spaces, concat words") + (return-type "const char *") + (params + ((type "const char *") (name "text")))) + + ((name "GetTextBetween") + (description "Get text between two strings") + (return-type "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") + (return-type "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()") + (return-type "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") + (return-type "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()") + (return-type "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") + (return-type "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()") + (return-type "char *") + (params + ((type "const char *") (name "text")) + ((type "const char *") (name "insert")) + ((type "int") (name "position")))) + + ((name "TextJoin") + (description "Join text strings with delimiter") + (return-type "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") + (return-type "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") + (return-type "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") + (return-type "int") + (params + ((type "const char *") (name "text")) + ((type "const char *") (name "search")))) + + ((name "TextToUpper") + (description "Get upper case version of provided string") + (return-type "char *") + (params + ((type "const char *") (name "text")))) + + ((name "TextToLower") + (description "Get lower case version of provided string") + (return-type "char *") + (params + ((type "const char *") (name "text")))) + + ((name "TextToPascal") + (description "Get Pascal case notation version of provided string") + (return-type "char *") + (params + ((type "const char *") (name "text")))) + + ((name "TextToSnake") + (description "Get Snake case notation version of provided string") + (return-type "char *") + (params + ((type "const char *") (name "text")))) + + ((name "TextToCamel") + (description "Get Camel case notation version of provided string") + (return-type "char *") + (params + ((type "const char *") (name "text")))) + + ((name "TextToInteger") + (description "Get integer value from text") + (return-type "int") + (params + ((type "const char *") (name "text")))) + + ((name "TextToFloat") + (description "Get float value from text") + (return-type "float") + (params + ((type "const char *") (name "text")))) + + ((name "DrawLine3D") + (description "Draw a line in 3D world space") + (return-type "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") + (return-type "void") + (params + ((type "Vector3") (name "position")) + ((type "Color") (name "color")))) + + ((name "DrawCircle3D") + (description "Draw a circle in 3D world space") + (return-type "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, counter-clockwise vertex order") + (return-type "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") + (return-type "void") + (params + ((type "const Vector3 *") (name "points")) + ((type "int") (name "pointCount")) + ((type "Color") (name "color")))) + + ((name "DrawCube") + (description "Draw cube") + (return-type "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)") + (return-type "void") + (params + ((type "Vector3") (name "position")) + ((type "Vector3") (name "size")) + ((type "Color") (name "color")))) + + ((name "DrawCubeWires") + (description "Draw cube wires") + (return-type "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)") + (return-type "void") + (params + ((type "Vector3") (name "position")) + ((type "Vector3") (name "size")) + ((type "Color") (name "color")))) + + ((name "DrawSphere") + (description "Draw sphere") + (return-type "void") + (params + ((type "Vector3") (name "centerPos")) + ((type "float") (name "radius")) + ((type "Color") (name "color")))) + + ((name "DrawSphereEx") + (description "Draw sphere with defined rings and slices") + (return-type "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") + (return-type "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") + (return-type "void") + (params + ((type "Vector3") (name "position")) + ((type "float") (name "radiusTop")) + ((type "float") (name "radiusBottom")) + ((type "float") (name "height")) + ((type "int") (name "sides")) + ((type "Color") (name "color")))) + + ((name "DrawCylinderEx") + (description "Draw a cylinder with base at startPos and top at endPos") + (return-type "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") + (return-type "void") + (params + ((type "Vector3") (name "position")) + ((type "float") (name "radiusTop")) + ((type "float") (name "radiusBottom")) + ((type "float") (name "height")) + ((type "int") (name "sides")) + ((type "Color") (name "color")))) + + ((name "DrawCylinderWiresEx") + (description "Draw a cylinder wires with base at startPos and top at endPos") + (return-type "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") + (return-type "void") + (params + ((type "Vector3") (name "startPos")) + ((type "Vector3") (name "endPos")) + ((type "float") (name "radius")) + ((type "int") (name "rings")) + ((type "int") (name "slices")) + ((type "Color") (name "color")))) + + ((name "DrawCapsuleWires") + (description "Draw capsule wireframe with the center of its sphere caps at startPos and endPos") + (return-type "void") + (params + ((type "Vector3") (name "startPos")) + ((type "Vector3") (name "endPos")) + ((type "float") (name "radius")) + ((type "int") (name "rings")) + ((type "int") (name "slices")) + ((type "Color") (name "color")))) + + ((name "DrawPlane") + (description "Draw a plane XZ") + (return-type "void") + (params + ((type "Vector3") (name "centerPos")) + ((type "Vector2") (name "size")) + ((type "Color") (name "color")))) + + ((name "DrawRay") + (description "Draw a ray line") + (return-type "void") + (params + ((type "Ray") (name "ray")) + ((type "Color") (name "color")))) + + ((name "DrawGrid") + (description "Draw a grid (centered at (0, 0, 0))") + (return-type "void") + (params + ((type "int") (name "slices")) + ((type "float") (name "spacing")))) + + ((name "LoadModel") + (description "Load model from files (meshes and materials)") + (return-type "Model") + (params + ((type "const char *") (name "fileName")))) + + ((name "LoadModelFromMesh") + (description "Load model from generated mesh (default material)") + (return-type "Model") + (params + ((type "Mesh") (name "mesh")))) + + ((name "IsModelValid") + (description "Check if model is valid (loaded in GPU, VAO/VBOs)") + (return-type "bool") + (params + ((type "Model") (name "model")))) + + ((name "UnloadModel") + (description "Unload model (including meshes) from memory (RAM and/or VRAM)") + (return-type "void") + (params + ((type "Model") (name "model")))) + + ((name "GetModelBoundingBox") + (description "Compute model bounding box limits (considers all meshes)") + (return-type "BoundingBox") + (params + ((type "Model") (name "model")))) + + ((name "DrawModel") + (description "Draw a model (with texture if set)") + (return-type "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 custom transform") + (return-type "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)") + (return-type "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 custom transform") + (return-type "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)") + (return-type "void") + (params + ((type "BoundingBox") (name "box")) + ((type "Color") (name "color")))) + + ((name "DrawBillboard") + (description "Draw a billboard texture") + (return-type "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 rectangle") + (return-type "void") + (params + ((type "Camera") (name "camera")) + ((type "Texture2D") (name "texture")) + ((type "Rectangle") (name "rec")) + ((type "Vector3") (name "position")) + ((type "Vector2") (name "size")) + ((type "Color") (name "tint")))) + + ((name "DrawBillboardPro") + (description "Draw a billboard texture defined by source rectangle with scaling and rotation") + (return-type "void") + (params + ((type "Camera") (name "camera")) + ((type "Texture2D") (name "texture")) + ((type "Rectangle") (name "rec")) + ((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") + (return-type "void") + (params + ((type "Mesh *") (name "mesh")) + ((type "bool") (name "dynamic")))) + + ((name "UpdateMeshBuffer") + (description "Update mesh vertex data in GPU for a specific buffer index") + (return-type "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") + (return-type "void") + (params + ((type "Mesh") (name "mesh")))) + + ((name "DrawMesh") + (description "Draw a 3d mesh with material and transform") + (return-type "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") + (return-type "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") + (return-type "BoundingBox") + (params + ((type "Mesh") (name "mesh")))) + + ((name "GenMeshTangents") + (description "Compute mesh tangents") + (return-type "void") + (params + ((type "Mesh *") (name "mesh")))) + + ((name "ExportMesh") + (description "Export mesh data to file, returns true on success") + (return-type "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") + (return-type "bool") + (params + ((type "Mesh") (name "mesh")) + ((type "const char *") (name "fileName")))) + + ((name "GenMeshPoly") + (description "Generate polygonal mesh") + (return-type "Mesh") + (params + ((type "int") (name "sides")) + ((type "float") (name "radius")))) + + ((name "GenMeshPlane") + (description "Generate plane mesh (with subdivisions)") + (return-type "Mesh") + (params + ((type "float") (name "width")) + ((type "float") (name "length")) + ((type "int") (name "resX")) + ((type "int") (name "resZ")))) + + ((name "GenMeshCube") + (description "Generate cuboid mesh") + (return-type "Mesh") + (params + ((type "float") (name "width")) + ((type "float") (name "height")) + ((type "float") (name "length")))) + + ((name "GenMeshSphere") + (description "Generate sphere mesh (standard sphere)") + (return-type "Mesh") + (params + ((type "float") (name "radius")) + ((type "int") (name "rings")) + ((type "int") (name "slices")))) + + ((name "GenMeshHemiSphere") + (description "Generate half-sphere mesh (no bottom cap)") + (return-type "Mesh") + (params + ((type "float") (name "radius")) + ((type "int") (name "rings")) + ((type "int") (name "slices")))) + + ((name "GenMeshCylinder") + (description "Generate cylinder mesh") + (return-type "Mesh") + (params + ((type "float") (name "radius")) + ((type "float") (name "height")) + ((type "int") (name "slices")))) + + ((name "GenMeshCone") + (description "Generate cone/pyramid mesh") + (return-type "Mesh") + (params + ((type "float") (name "radius")) + ((type "float") (name "height")) + ((type "int") (name "slices")))) + + ((name "GenMeshTorus") + (description "Generate torus mesh") + (return-type "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") + (return-type "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") + (return-type "Mesh") + (params + ((type "Image") (name "heightmap")) + ((type "Vector3") (name "size")))) + + ((name "GenMeshCubicmap") + (description "Generate cubes-based map mesh from image data") + (return-type "Mesh") + (params + ((type "Image") (name "cubicmap")) + ((type "Vector3") (name "cubeSize")))) + + ((name "LoadMaterials") + (description "Load materials from model file") + (return-type "Material *") + (params + ((type "const char *") (name "fileName")) + ((type "int *") (name "materialCount")))) + + ((name "LoadMaterialDefault") + (description "Load default material (Supports: DIFFUSE, SPECULAR, NORMAL maps)") + (return-type "Material")) + + ((name "IsMaterialValid") + (description "Check if material is valid (shader assigned, map textures loaded in GPU)") + (return-type "bool") + (params + ((type "Material") (name "material")))) + + ((name "UnloadMaterial") + (description "Unload material from GPU memory (VRAM)") + (return-type "void") + (params + ((type "Material") (name "material")))) + + ((name "SetMaterialTexture") + (description "Set texture for a material map type (MATERIAL_MAP_DIFFUSE, MATERIAL_MAP_SPECULAR...)") + (return-type "void") + (params + ((type "Material *") (name "material")) + ((type "int") (name "mapType")) + ((type "Texture2D") (name "texture")))) + + ((name "SetModelMeshMaterial") + (description "Set material for a mesh") + (return-type "void") + (params + ((type "Model *") (name "model")) + ((type "int") (name "meshId")) + ((type "int") (name "materialId")))) + + ((name "LoadModelAnimations") + (description "Load model animations from file") + (return-type "ModelAnimation *") + (params + ((type "const char *") (name "fileName")) + ((type "int *") (name "animCount")))) + + ((name "UpdateModelAnimation") + (description "Update model animation pose (vertex buffers and bone matrices)") + (return-type "void") + (params + ((type "Model") (name "model")) + ((type "ModelAnimation") (name "anim")) + ((type "float") (name "frame")))) + + ((name "UpdateModelAnimationEx") + (description "Update model animation pose, blending two animations") + (return-type "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") + (return-type "void") + (params + ((type "ModelAnimation *") (name "animations")) + ((type "int") (name "animCount")))) + + ((name "IsModelAnimationValid") + (description "Check model animation skeleton match") + (return-type "bool") + (params + ((type "Model") (name "model")) + ((type "ModelAnimation") (name "anim")))) + + ((name "CheckCollisionSpheres") + (description "Check collision between two spheres") + (return-type "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") + (return-type "bool") + (params + ((type "BoundingBox") (name "box1")) + ((type "BoundingBox") (name "box2")))) + + ((name "CheckCollisionBoxSphere") + (description "Check collision between box and sphere") + (return-type "bool") + (params + ((type "BoundingBox") (name "box")) + ((type "Vector3") (name "center")) + ((type "float") (name "radius")))) + + ((name "GetRayCollisionSphere") + (description "Get collision info between ray and sphere") + (return-type "RayCollision") + (params + ((type "Ray") (name "ray")) + ((type "Vector3") (name "center")) + ((type "float") (name "radius")))) + + ((name "GetRayCollisionBox") + (description "Get collision info between ray and box") + (return-type "RayCollision") + (params + ((type "Ray") (name "ray")) + ((type "BoundingBox") (name "box")))) + + ((name "GetRayCollisionMesh") + (description "Get collision info between ray and mesh") + (return-type "RayCollision") + (params + ((type "Ray") (name "ray")) + ((type "Mesh") (name "mesh")) + ((type "Matrix") (name "transform")))) + + ((name "GetRayCollisionTriangle") + (description "Get collision info between ray and triangle") + (return-type "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") + (return-type "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") + (return-type "void")) + + ((name "CloseAudioDevice") + (description "Close the audio device and context") + (return-type "void")) + + ((name "IsAudioDeviceReady") + (description "Check if audio device has been initialized successfully") + (return-type "bool")) + + ((name "SetMasterVolume") + (description "Set master volume (listener)") + (return-type "void") + (params + ((type "float") (name "volume")))) + + ((name "GetMasterVolume") + (description "Get master volume (listener)") + (return-type "float")) + + ((name "LoadWave") + (description "Load wave data from file") + (return-type "Wave") + (params + ((type "const char *") (name "fileName")))) + + ((name "LoadWaveFromMemory") + (description "Load wave from memory buffer, fileType refers to extension: i.e. '.wav'") + (return-type "Wave") + (params + ((type "const char *") (name "fileType")) + ((type "const unsigned char *") (name "fileData")) + ((type "int") (name "dataSize")))) + + ((name "IsWaveValid") + (description "Check if wave data is valid (data loaded and parameters)") + (return-type "bool") + (params + ((type "Wave") (name "wave")))) + + ((name "LoadSound") + (description "Load sound from file") + (return-type "Sound") + (params + ((type "const char *") (name "fileName")))) + + ((name "LoadSoundFromWave") + (description "Load sound from wave data") + (return-type "Sound") + (params + ((type "Wave") (name "wave")))) + + ((name "LoadSoundAlias") + (description "Load sound alias, new sound that shares the same sample data as the source sound, does not own the sound data") + (return-type "Sound") + (params + ((type "Sound") (name "source")))) + + ((name "IsSoundValid") + (description "Check if sound is valid (data loaded and buffers initialized)") + (return-type "bool") + (params + ((type "Sound") (name "sound")))) + + ((name "UpdateSound") + (description "Update sound buffer with new data (default data format: 32 bit float, stereo)") + (return-type "void") + (params + ((type "Sound") (name "sound")) + ((type "const void *") (name "data")) + ((type "int") (name "frameCount")))) + + ((name "UnloadWave") + (description "Unload wave data") + (return-type "void") + (params + ((type "Wave") (name "wave")))) + + ((name "UnloadSound") + (description "Unload sound") + (return-type "void") + (params + ((type "Sound") (name "sound")))) + + ((name "UnloadSoundAlias") + (description "Unload sound alias (does not deallocate sample data)") + (return-type "void") + (params + ((type "Sound") (name "alias")))) + + ((name "ExportWave") + (description "Export wave data to file, returns true on success") + (return-type "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") + (return-type "bool") + (params + ((type "Wave") (name "wave")) + ((type "const char *") (name "fileName")))) + + ((name "PlaySound") + (description "Play a sound") + (return-type "void") + (params + ((type "Sound") (name "sound")))) + + ((name "StopSound") + (description "Stop playing a sound") + (return-type "void") + (params + ((type "Sound") (name "sound")))) + + ((name "PauseSound") + (description "Pause a sound") + (return-type "void") + (params + ((type "Sound") (name "sound")))) + + ((name "ResumeSound") + (description "Resume a paused sound") + (return-type "void") + (params + ((type "Sound") (name "sound")))) + + ((name "IsSoundPlaying") + (description "Check if sound is currently playing") + (return-type "bool") + (params + ((type "Sound") (name "sound")))) + + ((name "SetSoundVolume") + (description "Set volume for a sound (1.0 is max level)") + (return-type "void") + (params + ((type "Sound") (name "sound")) + ((type "float") (name "volume")))) + + ((name "SetSoundPitch") + (description "Set pitch for a sound (1.0 is base level)") + (return-type "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)") + (return-type "void") + (params + ((type "Sound") (name "sound")) + ((type "float") (name "pan")))) + + ((name "WaveCopy") + (description "Copy a wave to a new wave") + (return-type "Wave") + (params + ((type "Wave") (name "wave")))) + + ((name "WaveCrop") + (description "Crop a wave to defined frames range") + (return-type "void") + (params + ((type "Wave *") (name "wave")) + ((type "int") (name "initFrame")) + ((type "int") (name "finalFrame")))) + + ((name "WaveFormat") + (description "Convert wave data to desired format") + (return-type "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") + (return-type "float *") + (params + ((type "Wave") (name "wave")))) + + ((name "UnloadWaveSamples") + (description "Unload samples data loaded with LoadWaveSamples()") + (return-type "void") + (params + ((type "float *") (name "samples")))) + + ((name "LoadMusicStream") + (description "Load music stream from file") + (return-type "Music") + (params + ((type "const char *") (name "fileName")))) + + ((name "LoadMusicStreamFromMemory") + (description "Load music stream from data") + (return-type "Music") + (params + ((type "const char *") (name "fileType")) + ((type "const unsigned char *") (name "data")) + ((type "int") (name "dataSize")))) + + ((name "IsMusicValid") + (description "Check if music stream is valid (context and buffers initialized)") + (return-type "bool") + (params + ((type "Music") (name "music")))) + + ((name "UnloadMusicStream") + (description "Unload music stream") + (return-type "void") + (params + ((type "Music") (name "music")))) + + ((name "PlayMusicStream") + (description "Start music playing") + (return-type "void") + (params + ((type "Music") (name "music")))) + + ((name "IsMusicStreamPlaying") + (description "Check if music is playing") + (return-type "bool") + (params + ((type "Music") (name "music")))) + + ((name "UpdateMusicStream") + (description "Update buffers for music streaming") + (return-type "void") + (params + ((type "Music") (name "music")))) + + ((name "StopMusicStream") + (description "Stop music playing") + (return-type "void") + (params + ((type "Music") (name "music")))) + + ((name "PauseMusicStream") + (description "Pause music playing") + (return-type "void") + (params + ((type "Music") (name "music")))) + + ((name "ResumeMusicStream") + (description "Resume playing paused music") + (return-type "void") + (params + ((type "Music") (name "music")))) + + ((name "SeekMusicStream") + (description "Seek music to a position (in seconds)") + (return-type "void") + (params + ((type "Music") (name "music")) + ((type "float") (name "position")))) + + ((name "SetMusicVolume") + (description "Set volume for music (1.0 is max level)") + (return-type "void") + (params + ((type "Music") (name "music")) + ((type "float") (name "volume")))) + + ((name "SetMusicPitch") + (description "Set pitch for music (1.0 is base level)") + (return-type "void") + (params + ((type "Music") (name "music")) + ((type "float") (name "pitch")))) + + ((name "SetMusicPan") + (description "Set pan for music (-1.0 left, 0.0 center, 1.0 right)") + (return-type "void") + (params + ((type "Music") (name "music")) + ((type "float") (name "pan")))) + + ((name "GetMusicTimeLength") + (description "Get music time length (in seconds)") + (return-type "float") + (params + ((type "Music") (name "music")))) + + ((name "GetMusicTimePlayed") + (description "Get current music time played (in seconds)") + (return-type "float") + (params + ((type "Music") (name "music")))) + + ((name "LoadAudioStream") + (description "Load audio stream (to stream raw audio pcm data)") + (return-type "AudioStream") + (params + ((type "unsigned int") (name "sampleRate")) + ((type "unsigned int") (name "sampleSize")) + ((type "unsigned int") (name "channels")))) + + ((name "IsAudioStreamValid") + (description "Check if an audio stream is valid (buffers initialized)") + (return-type "bool") + (params + ((type "AudioStream") (name "stream")))) + + ((name "UnloadAudioStream") + (description "Unload audio stream and free memory") + (return-type "void") + (params + ((type "AudioStream") (name "stream")))) + + ((name "UpdateAudioStream") + (description "Update audio stream buffers with data") + (return-type "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") + (return-type "bool") + (params + ((type "AudioStream") (name "stream")))) + + ((name "PlayAudioStream") + (description "Play audio stream") + (return-type "void") + (params + ((type "AudioStream") (name "stream")))) + + ((name "PauseAudioStream") + (description "Pause audio stream") + (return-type "void") + (params + ((type "AudioStream") (name "stream")))) + + ((name "ResumeAudioStream") + (description "Resume audio stream") + (return-type "void") + (params + ((type "AudioStream") (name "stream")))) + + ((name "IsAudioStreamPlaying") + (description "Check if audio stream is playing") + (return-type "bool") + (params + ((type "AudioStream") (name "stream")))) + + ((name "StopAudioStream") + (description "Stop audio stream") + (return-type "void") + (params + ((type "AudioStream") (name "stream")))) + + ((name "SetAudioStreamVolume") + (description "Set volume for audio stream (1.0 is max level)") + (return-type "void") + (params + ((type "AudioStream") (name "stream")) + ((type "float") (name "volume")))) + + ((name "SetAudioStreamPitch") + (description "Set pitch for audio stream (1.0 is base level)") + (return-type "void") + (params + ((type "AudioStream") (name "stream")) + ((type "float") (name "pitch")))) + + ((name "SetAudioStreamPan") + (description "Set pan for audio stream (-1.0 left, 0.0 center, 1.0 right)") + (return-type "void") + (params + ((type "AudioStream") (name "stream")) + ((type "float") (name "pan")))) + + ((name "SetAudioStreamBufferSizeDefault") + (description "Default size for new audio streams") + (return-type "void") + (params + ((type "int") (name "size")))) + + ((name "SetAudioStreamCallback") + (description "Audio thread callback to request new data") + (return-type "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)") + (return-type "void") + (params + ((type "AudioStream") (name "stream")) + ((type "AudioCallback") (name "processor")))) + + ((name "DetachAudioStreamProcessor") + (description "Detach audio stream processor from stream") + (return-type "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)") + (return-type "void") + (params + ((type "AudioCallback") (name "processor")))) + + ((name "DetachAudioMixedProcessor") + (description "Detach audio stream processor from the entire audio pipeline") + (return-type "void") + (params + ((type "AudioCallback") (name "processor")))))) diff --git a/tools/rlparser/output/raylib_api.txt b/tools/rlparser/output/raylib_api.txt index 52fd63710..76f5c2bae 100644 --- a/tools/rlparser/output/raylib_api.txt +++ b/tools/rlparser/output/raylib_api.txt @@ -448,7 +448,7 @@ Struct 20: BoneInfo (2 fields) Struct 21: ModelSkeleton (3 fields) Name: ModelSkeleton Description: Skeleton, animation bones hierarchy - Field[1]: int boneCount // Number of bones + Field[1]: unsigned int boneCount // Number of bones Field[2]: BoneInfo * bones // Bones information (skeleton) Field[3]: ModelAnimPose bindPose // Bones base transformation (Transform[]) Struct 22: Model (9 fields) @@ -467,7 +467,7 @@ Struct 23: ModelAnimation (4 fields) Name: ModelAnimation Description: ModelAnimation, contains a full animation sequence Field[1]: char[32] name // Animation name - Field[2]: int boneCount // Number of bones (per pose) + Field[2]: unsigned int boneCount // Number of bones (per pose) Field[3]: int keyframeCount // Number of animation key frames Field[4]: ModelAnimPose * keyframePoses // Animation sequence keyframe poses [keyframe][pose] Struct 24: Ray (2 fields) @@ -995,7 +995,7 @@ Callback 006: AudioCallback() (2 input parameters) Param[1]: bufferData (type: void *) Param[2]: frames (type: unsigned int) -Functions found: 607 +Functions found: 613 Function 001: InitWindow() (3 input parameters) Name: InitWindow @@ -1739,12 +1739,12 @@ Function 137: GetFileNameWithoutExt() (1 input parameters) Function 138: GetDirectoryPath() (1 input parameters) Name: GetDirectoryPath Return type: const char * - Description: Get full path for a given fileName with path (uses static string) + Description: Get full path for a provided fileName with path (uses static string) Param[1]: filePath (type: const char *) Function 139: GetPrevDirectoryPath() (1 input parameters) Name: GetPrevDirectoryPath Return type: const char * - Description: Get previous directory path for a given path (uses static string) + Description: Get previous directory path for a provided path (uses static string) Param[1]: dirPath (type: const char *) Function 140: GetWorkingDirectory() (0 input parameters) Name: GetWorkingDirectory @@ -1769,250 +1769,260 @@ Function 143: ChangeDirectory() (1 input parameters) Function 144: IsPathFile() (1 input parameters) Name: IsPathFile Return type: bool - Description: Check if given path is a file or a directory + Description: Check if provided path points to a file Param[1]: path (type: const char *) -Function 145: IsFileNameValid() (1 input parameters) +Function 145: IsPathDirectory() (1 input parameters) + Name: IsPathDirectory + Return type: bool + Description: Check if provided path points to a directory + Param[1]: path (type: const char *) +Function 146: IsPathAbsolute() (1 input parameters) + Name: IsPathAbsolute + Return type: bool + Description: Check if provided path is an absolute path + Param[1]: path (type: const char *) +Function 147: IsFileNameValid() (1 input parameters) Name: IsFileNameValid Return type: bool Description: Check if fileName is valid for the platform/OS Param[1]: fileName (type: const char *) -Function 146: LoadDirectoryFiles() (1 input parameters) +Function 148: LoadDirectoryFiles() (1 input parameters) Name: LoadDirectoryFiles Return type: FilePathList Description: Load directory filepaths, files and directories, no subdirs scan Param[1]: dirPath (type: const char *) -Function 147: LoadDirectoryFilesEx() (3 input parameters) +Function 149: LoadDirectoryFilesEx() (3 input parameters) Name: LoadDirectoryFilesEx Return type: FilePathList Description: Load directory filepaths with extension filtering and subdir scan; some filters available: '*.*','FILES*','DIRS*' Param[1]: basePath (type: const char *) Param[2]: filter (type: const char *) Param[3]: scanSubdirs (type: bool) -Function 148: UnloadDirectoryFiles() (1 input parameters) +Function 150: UnloadDirectoryFiles() (1 input parameters) Name: UnloadDirectoryFiles Return type: void Description: Unload filepaths Param[1]: files (type: FilePathList) -Function 149: IsFileDropped() (0 input parameters) +Function 151: IsFileDropped() (0 input parameters) Name: IsFileDropped Return type: bool Description: Check if file has been dropped into window No input parameters -Function 150: LoadDroppedFiles() (0 input parameters) +Function 152: LoadDroppedFiles() (0 input parameters) Name: LoadDroppedFiles Return type: FilePathList Description: Load dropped filepaths No input parameters -Function 151: UnloadDroppedFiles() (1 input parameters) +Function 153: UnloadDroppedFiles() (1 input parameters) Name: UnloadDroppedFiles Return type: void Description: Unload dropped filepaths Param[1]: files (type: FilePathList) -Function 152: GetDirectoryFileCount() (1 input parameters) +Function 154: GetDirectoryFileCount() (1 input parameters) Name: GetDirectoryFileCount Return type: unsigned int Description: Get the file count in a directory Param[1]: dirPath (type: const char *) -Function 153: GetDirectoryFileCountEx() (3 input parameters) +Function 155: GetDirectoryFileCountEx() (3 input parameters) Name: GetDirectoryFileCountEx Return type: unsigned int 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 Param[1]: basePath (type: const char *) Param[2]: filter (type: const char *) Param[3]: scanSubdirs (type: bool) -Function 154: CompressData() (3 input parameters) +Function 156: CompressData() (3 input parameters) Name: CompressData Return type: unsigned char * Description: Compress data (DEFLATE algorithm), memory must be MemFree() Param[1]: data (type: const unsigned char *) Param[2]: dataSize (type: int) Param[3]: compDataSize (type: int *) -Function 155: DecompressData() (3 input parameters) +Function 157: DecompressData() (3 input parameters) Name: DecompressData Return type: unsigned char * Description: Decompress data (DEFLATE algorithm), memory must be MemFree() Param[1]: compData (type: const unsigned char *) Param[2]: compDataSize (type: int) Param[3]: dataSize (type: int *) -Function 156: EncodeDataBase64() (3 input parameters) +Function 158: EncodeDataBase64() (3 input parameters) Name: EncodeDataBase64 Return type: char * Description: Encode data to Base64 string (includes NULL terminator), memory must be MemFree() Param[1]: data (type: const unsigned char *) Param[2]: dataSize (type: int) Param[3]: outputSize (type: int *) -Function 157: DecodeDataBase64() (2 input parameters) +Function 159: DecodeDataBase64() (2 input parameters) Name: DecodeDataBase64 Return type: unsigned char * Description: Decode Base64 string (expected NULL terminated), memory must be MemFree() Param[1]: text (type: const char *) Param[2]: outputSize (type: int *) -Function 158: ComputeCRC32() (2 input parameters) +Function 160: ComputeCRC32() (2 input parameters) Name: ComputeCRC32 Return type: unsigned int Description: Compute CRC32 hash code Param[1]: data (type: const unsigned char *) Param[2]: dataSize (type: int) -Function 159: ComputeMD5() (2 input parameters) +Function 161: ComputeMD5() (2 input parameters) Name: ComputeMD5 Return type: unsigned int * Description: Compute MD5 hash code, returns static int[4] (16 bytes) Param[1]: data (type: const unsigned char *) Param[2]: dataSize (type: int) -Function 160: ComputeSHA1() (2 input parameters) +Function 162: ComputeSHA1() (2 input parameters) Name: ComputeSHA1 Return type: unsigned int * Description: Compute SHA1 hash code, returns static int[5] (20 bytes) Param[1]: data (type: const unsigned char *) Param[2]: dataSize (type: int) -Function 161: ComputeSHA256() (2 input parameters) +Function 163: ComputeSHA256() (2 input parameters) Name: ComputeSHA256 Return type: unsigned int * Description: Compute SHA256 hash code, returns static int[8] (32 bytes) Param[1]: data (type: const unsigned char *) Param[2]: dataSize (type: int) -Function 162: LoadAutomationEventList() (1 input parameters) +Function 164: LoadAutomationEventList() (1 input parameters) Name: LoadAutomationEventList Return type: AutomationEventList Description: Load automation events list from file, NULL for empty list, capacity = MAX_AUTOMATION_EVENTS Param[1]: fileName (type: const char *) -Function 163: UnloadAutomationEventList() (1 input parameters) +Function 165: UnloadAutomationEventList() (1 input parameters) Name: UnloadAutomationEventList Return type: void Description: Unload automation events list from file Param[1]: list (type: AutomationEventList) -Function 164: ExportAutomationEventList() (2 input parameters) +Function 166: ExportAutomationEventList() (2 input parameters) Name: ExportAutomationEventList Return type: bool Description: Export automation events list as text file Param[1]: list (type: AutomationEventList) Param[2]: fileName (type: const char *) -Function 165: SetAutomationEventList() (1 input parameters) +Function 167: SetAutomationEventList() (1 input parameters) Name: SetAutomationEventList Return type: void Description: Set automation event list to record to Param[1]: list (type: AutomationEventList *) -Function 166: SetAutomationEventBaseFrame() (1 input parameters) +Function 168: SetAutomationEventBaseFrame() (1 input parameters) Name: SetAutomationEventBaseFrame Return type: void Description: Set automation event internal base frame to start recording Param[1]: frame (type: int) -Function 167: StartAutomationEventRecording() (0 input parameters) +Function 169: StartAutomationEventRecording() (0 input parameters) Name: StartAutomationEventRecording Return type: void Description: Start recording automation events (AutomationEventList must be set) No input parameters -Function 168: StopAutomationEventRecording() (0 input parameters) +Function 170: StopAutomationEventRecording() (0 input parameters) Name: StopAutomationEventRecording Return type: void Description: Stop recording automation events No input parameters -Function 169: PlayAutomationEvent() (1 input parameters) +Function 171: PlayAutomationEvent() (1 input parameters) Name: PlayAutomationEvent Return type: void Description: Play a recorded automation event Param[1]: event (type: AutomationEvent) -Function 170: IsKeyPressed() (1 input parameters) +Function 172: IsKeyPressed() (1 input parameters) Name: IsKeyPressed Return type: bool Description: Check if key has been pressed once Param[1]: key (type: int) -Function 171: IsKeyPressedRepeat() (1 input parameters) +Function 173: IsKeyPressedRepeat() (1 input parameters) Name: IsKeyPressedRepeat Return type: bool Description: Check if key has been pressed again Param[1]: key (type: int) -Function 172: IsKeyDown() (1 input parameters) +Function 174: IsKeyDown() (1 input parameters) Name: IsKeyDown Return type: bool Description: Check if key is being pressed Param[1]: key (type: int) -Function 173: IsKeyReleased() (1 input parameters) +Function 175: IsKeyReleased() (1 input parameters) Name: IsKeyReleased Return type: bool Description: Check if key has been released once Param[1]: key (type: int) -Function 174: IsKeyUp() (1 input parameters) +Function 176: IsKeyUp() (1 input parameters) Name: IsKeyUp Return type: bool Description: Check if key is NOT being pressed Param[1]: key (type: int) -Function 175: GetKeyPressed() (0 input parameters) +Function 177: GetKeyPressed() (0 input parameters) Name: GetKeyPressed Return type: int Description: Get key pressed (keycode), call it multiple times for keys queued, returns 0 when the queue is empty No input parameters -Function 176: GetCharPressed() (0 input parameters) +Function 178: GetCharPressed() (0 input parameters) Name: GetCharPressed Return type: int Description: Get char pressed (unicode), call it multiple times for chars queued, returns 0 when the queue is empty No input parameters -Function 177: GetKeyName() (1 input parameters) +Function 179: GetKeyName() (1 input parameters) Name: GetKeyName Return type: const char * Description: Get name of a QWERTY key on the current keyboard layout (eg returns string 'q' for KEY_A on an AZERTY keyboard) Param[1]: key (type: int) -Function 178: SetExitKey() (1 input parameters) +Function 180: SetExitKey() (1 input parameters) Name: SetExitKey Return type: void Description: Set a custom key to exit program (default is ESC) Param[1]: key (type: int) -Function 179: IsGamepadAvailable() (1 input parameters) +Function 181: IsGamepadAvailable() (1 input parameters) Name: IsGamepadAvailable Return type: bool Description: Check if gamepad is available Param[1]: gamepad (type: int) -Function 180: GetGamepadName() (1 input parameters) +Function 182: GetGamepadName() (1 input parameters) Name: GetGamepadName Return type: const char * Description: Get gamepad internal name id Param[1]: gamepad (type: int) -Function 181: IsGamepadButtonPressed() (2 input parameters) +Function 183: IsGamepadButtonPressed() (2 input parameters) Name: IsGamepadButtonPressed Return type: bool Description: Check if gamepad button has been pressed once Param[1]: gamepad (type: int) Param[2]: button (type: int) -Function 182: IsGamepadButtonDown() (2 input parameters) +Function 184: IsGamepadButtonDown() (2 input parameters) Name: IsGamepadButtonDown Return type: bool Description: Check if gamepad button is being pressed Param[1]: gamepad (type: int) Param[2]: button (type: int) -Function 183: IsGamepadButtonReleased() (2 input parameters) +Function 185: IsGamepadButtonReleased() (2 input parameters) Name: IsGamepadButtonReleased Return type: bool Description: Check if gamepad button has been released once Param[1]: gamepad (type: int) Param[2]: button (type: int) -Function 184: IsGamepadButtonUp() (2 input parameters) +Function 186: IsGamepadButtonUp() (2 input parameters) Name: IsGamepadButtonUp Return type: bool Description: Check if gamepad button is NOT being pressed Param[1]: gamepad (type: int) Param[2]: button (type: int) -Function 185: GetGamepadButtonPressed() (0 input parameters) +Function 187: GetGamepadButtonPressed() (0 input parameters) Name: GetGamepadButtonPressed Return type: int Description: Get the last gamepad button pressed No input parameters -Function 186: GetGamepadAxisCount() (1 input parameters) +Function 188: GetGamepadAxisCount() (1 input parameters) Name: GetGamepadAxisCount Return type: int Description: Get axis count for a gamepad Param[1]: gamepad (type: int) -Function 187: GetGamepadAxisMovement() (2 input parameters) +Function 189: GetGamepadAxisMovement() (2 input parameters) Name: GetGamepadAxisMovement Return type: float Description: Get movement value for a gamepad axis Param[1]: gamepad (type: int) Param[2]: axis (type: int) -Function 188: SetGamepadMappings() (1 input parameters) +Function 190: SetGamepadMappings() (1 input parameters) Name: SetGamepadMappings Return type: int Description: Set internal gamepad mappings (SDL_GameControllerDB) Param[1]: mappings (type: const char *) -Function 189: SetGamepadVibration() (4 input parameters) +Function 191: SetGamepadVibration() (4 input parameters) Name: SetGamepadVibration Return type: void Description: Set gamepad vibration for both motors (duration in seconds) @@ -2020,151 +2030,151 @@ Function 189: SetGamepadVibration() (4 input parameters) Param[2]: leftMotor (type: float) Param[3]: rightMotor (type: float) Param[4]: duration (type: float) -Function 190: IsMouseButtonPressed() (1 input parameters) +Function 192: IsMouseButtonPressed() (1 input parameters) Name: IsMouseButtonPressed Return type: bool Description: Check if mouse button has been pressed once Param[1]: button (type: int) -Function 191: IsMouseButtonDown() (1 input parameters) +Function 193: IsMouseButtonDown() (1 input parameters) Name: IsMouseButtonDown Return type: bool Description: Check if mouse button is being pressed Param[1]: button (type: int) -Function 192: IsMouseButtonReleased() (1 input parameters) +Function 194: IsMouseButtonReleased() (1 input parameters) Name: IsMouseButtonReleased Return type: bool Description: Check if mouse button has been released once Param[1]: button (type: int) -Function 193: IsMouseButtonUp() (1 input parameters) +Function 195: IsMouseButtonUp() (1 input parameters) Name: IsMouseButtonUp Return type: bool Description: Check if mouse button is NOT being pressed Param[1]: button (type: int) -Function 194: GetMouseX() (0 input parameters) +Function 196: GetMouseX() (0 input parameters) Name: GetMouseX Return type: int Description: Get mouse position X No input parameters -Function 195: GetMouseY() (0 input parameters) +Function 197: GetMouseY() (0 input parameters) Name: GetMouseY Return type: int Description: Get mouse position Y No input parameters -Function 196: GetMousePosition() (0 input parameters) +Function 198: GetMousePosition() (0 input parameters) Name: GetMousePosition Return type: Vector2 Description: Get mouse position XY No input parameters -Function 197: GetMouseDelta() (0 input parameters) +Function 199: GetMouseDelta() (0 input parameters) Name: GetMouseDelta Return type: Vector2 Description: Get mouse delta between frames No input parameters -Function 198: SetMousePosition() (2 input parameters) +Function 200: SetMousePosition() (2 input parameters) Name: SetMousePosition Return type: void Description: Set mouse position XY Param[1]: x (type: int) Param[2]: y (type: int) -Function 199: SetMouseOffset() (2 input parameters) +Function 201: SetMouseOffset() (2 input parameters) Name: SetMouseOffset Return type: void Description: Set mouse offset Param[1]: offsetX (type: int) Param[2]: offsetY (type: int) -Function 200: SetMouseScale() (2 input parameters) +Function 202: SetMouseScale() (2 input parameters) Name: SetMouseScale Return type: void Description: Set mouse scaling Param[1]: scaleX (type: float) Param[2]: scaleY (type: float) -Function 201: GetMouseWheelMove() (0 input parameters) +Function 203: GetMouseWheelMove() (0 input parameters) Name: GetMouseWheelMove Return type: float Description: Get mouse wheel movement for X or Y, whichever is larger No input parameters -Function 202: GetMouseWheelMoveV() (0 input parameters) +Function 204: GetMouseWheelMoveV() (0 input parameters) Name: GetMouseWheelMoveV Return type: Vector2 Description: Get mouse wheel movement for both X and Y No input parameters -Function 203: SetMouseCursor() (1 input parameters) +Function 205: SetMouseCursor() (1 input parameters) Name: SetMouseCursor Return type: void Description: Set mouse cursor Param[1]: cursor (type: int) -Function 204: GetTouchX() (0 input parameters) +Function 206: GetTouchX() (0 input parameters) Name: GetTouchX Return type: int Description: Get touch position X for touch point 0 (relative to screen size) No input parameters -Function 205: GetTouchY() (0 input parameters) +Function 207: GetTouchY() (0 input parameters) Name: GetTouchY Return type: int Description: Get touch position Y for touch point 0 (relative to screen size) No input parameters -Function 206: GetTouchPosition() (1 input parameters) +Function 208: GetTouchPosition() (1 input parameters) Name: GetTouchPosition Return type: Vector2 Description: Get touch position XY for a touch point index (relative to screen size) Param[1]: index (type: int) -Function 207: GetTouchPointId() (1 input parameters) +Function 209: GetTouchPointId() (1 input parameters) Name: GetTouchPointId Return type: int - Description: Get touch point identifier for given index + Description: Get touch point identifier for provided index Param[1]: index (type: int) -Function 208: GetTouchPointCount() (0 input parameters) +Function 210: GetTouchPointCount() (0 input parameters) Name: GetTouchPointCount Return type: int Description: Get number of touch points No input parameters -Function 209: SetGesturesEnabled() (1 input parameters) +Function 211: SetGesturesEnabled() (1 input parameters) Name: SetGesturesEnabled Return type: void Description: Enable a set of gestures using flags Param[1]: flags (type: unsigned int) -Function 210: IsGestureDetected() (1 input parameters) +Function 212: IsGestureDetected() (1 input parameters) Name: IsGestureDetected Return type: bool Description: Check if gesture has been detected Param[1]: gesture (type: unsigned int) -Function 211: GetGestureDetected() (0 input parameters) +Function 213: GetGestureDetected() (0 input parameters) Name: GetGestureDetected Return type: int Description: Get latest detected gesture No input parameters -Function 212: GetGestureHoldDuration() (0 input parameters) +Function 214: GetGestureHoldDuration() (0 input parameters) Name: GetGestureHoldDuration Return type: float Description: Get gesture hold time in seconds No input parameters -Function 213: GetGestureDragVector() (0 input parameters) +Function 215: GetGestureDragVector() (0 input parameters) Name: GetGestureDragVector Return type: Vector2 Description: Get gesture drag vector No input parameters -Function 214: GetGestureDragAngle() (0 input parameters) +Function 216: GetGestureDragAngle() (0 input parameters) Name: GetGestureDragAngle Return type: float Description: Get gesture drag angle No input parameters -Function 215: GetGesturePinchVector() (0 input parameters) +Function 217: GetGesturePinchVector() (0 input parameters) Name: GetGesturePinchVector Return type: Vector2 Description: Get gesture pinch delta No input parameters -Function 216: GetGesturePinchAngle() (0 input parameters) +Function 218: GetGesturePinchAngle() (0 input parameters) Name: GetGesturePinchAngle Return type: float Description: Get gesture pinch angle No input parameters -Function 217: UpdateCamera() (2 input parameters) +Function 219: UpdateCamera() (2 input parameters) Name: UpdateCamera Return type: void Description: Update camera position for selected mode Param[1]: camera (type: Camera *) Param[2]: mode (type: int) -Function 218: UpdateCameraPro() (4 input parameters) +Function 220: UpdateCameraPro() (4 input parameters) Name: UpdateCameraPro Return type: void Description: Update camera movement/rotation @@ -2172,36 +2182,36 @@ Function 218: UpdateCameraPro() (4 input parameters) Param[2]: movement (type: Vector3) Param[3]: rotation (type: Vector3) Param[4]: zoom (type: float) -Function 219: SetShapesTexture() (2 input parameters) +Function 221: SetShapesTexture() (2 input parameters) Name: SetShapesTexture Return type: void Description: Set texture and rectangle to be used on shapes drawing Param[1]: texture (type: Texture2D) Param[2]: rec (type: Rectangle) -Function 220: GetShapesTexture() (0 input parameters) +Function 222: GetShapesTexture() (0 input parameters) Name: GetShapesTexture Return type: Texture2D Description: Get texture that is used for shapes drawing No input parameters -Function 221: GetShapesTextureRectangle() (0 input parameters) +Function 223: GetShapesTextureRectangle() (0 input parameters) Name: GetShapesTextureRectangle Return type: Rectangle Description: Get texture source rectangle that is used for shapes drawing No input parameters -Function 222: DrawPixel() (3 input parameters) +Function 224: DrawPixel() (3 input parameters) Name: DrawPixel Return type: void Description: Draw a pixel using geometry [Can be slow, use with care] Param[1]: posX (type: int) Param[2]: posY (type: int) Param[3]: color (type: Color) -Function 223: DrawPixelV() (2 input parameters) +Function 225: DrawPixelV() (2 input parameters) Name: DrawPixelV Return type: void Description: Draw a pixel using geometry (Vector version) [Can be slow, use with care] Param[1]: position (type: Vector2) Param[2]: color (type: Color) -Function 224: DrawLine() (5 input parameters) +Function 226: DrawLine() (5 input parameters) Name: DrawLine Return type: void Description: Draw a line @@ -2210,14 +2220,14 @@ Function 224: DrawLine() (5 input parameters) Param[3]: endPosX (type: int) Param[4]: endPosY (type: int) Param[5]: color (type: Color) -Function 225: DrawLineV() (3 input parameters) +Function 227: DrawLineV() (3 input parameters) Name: DrawLineV Return type: void Description: Draw a line (using gl lines) Param[1]: startPos (type: Vector2) Param[2]: endPos (type: Vector2) Param[3]: color (type: Color) -Function 226: DrawLineEx() (4 input parameters) +Function 228: DrawLineEx() (4 input parameters) Name: DrawLineEx Return type: void Description: Draw a line (using triangles/quads) @@ -2225,14 +2235,14 @@ Function 226: DrawLineEx() (4 input parameters) Param[2]: endPos (type: Vector2) Param[3]: thick (type: float) Param[4]: color (type: Color) -Function 227: DrawLineStrip() (3 input parameters) +Function 229: DrawLineStrip() (3 input parameters) Name: DrawLineStrip Return type: void Description: Draw lines sequence (using gl lines) Param[1]: points (type: const Vector2 *) Param[2]: pointCount (type: int) Param[3]: color (type: Color) -Function 228: DrawLineBezier() (4 input parameters) +Function 230: DrawLineBezier() (4 input parameters) Name: DrawLineBezier Return type: void Description: Draw line segment cubic-bezier in-out interpolation @@ -2240,7 +2250,7 @@ Function 228: DrawLineBezier() (4 input parameters) Param[2]: endPos (type: Vector2) Param[3]: thick (type: float) Param[4]: color (type: Color) -Function 229: DrawLineDashed() (5 input parameters) +Function 231: DrawLineDashed() (5 input parameters) Name: DrawLineDashed Return type: void Description: Draw a dashed line @@ -2249,7 +2259,7 @@ Function 229: DrawLineDashed() (5 input parameters) Param[3]: dashSize (type: int) Param[4]: spaceSize (type: int) Param[5]: color (type: Color) -Function 230: DrawTriangle() (4 input parameters) +Function 232: DrawTriangle() (4 input parameters) Name: DrawTriangle Return type: void Description: Draw a color-filled triangle, counter-clockwise vertex order @@ -2257,7 +2267,7 @@ Function 230: DrawTriangle() (4 input parameters) Param[2]: v2 (type: Vector2) Param[3]: v3 (type: Vector2) Param[4]: color (type: Color) -Function 231: DrawTriangleGradient() (6 input parameters) +Function 233: DrawTriangleGradient() (6 input parameters) Name: DrawTriangleGradient Return type: void Description: Draw triangle with interpolated colors, counter-clockwise vertex/color order @@ -2267,7 +2277,7 @@ Function 231: DrawTriangleGradient() (6 input parameters) Param[4]: c1 (type: Color) Param[5]: c2 (type: Color) Param[6]: c3 (type: Color) -Function 232: DrawTriangleLines() (4 input parameters) +Function 234: DrawTriangleLines() (4 input parameters) Name: DrawTriangleLines Return type: void Description: Draw triangle outline, counter-clockwise vertex order @@ -2275,21 +2285,21 @@ Function 232: DrawTriangleLines() (4 input parameters) Param[2]: v2 (type: Vector2) Param[3]: v3 (type: Vector2) Param[4]: color (type: Color) -Function 233: DrawTriangleFan() (3 input parameters) +Function 235: DrawTriangleFan() (3 input parameters) Name: DrawTriangleFan Return type: void Description: Draw a triangle fan defined by points (first vertex is the center) Param[1]: points (type: const Vector2 *) Param[2]: pointCount (type: int) Param[3]: color (type: Color) -Function 234: DrawTriangleStrip() (3 input parameters) +Function 236: DrawTriangleStrip() (3 input parameters) Name: DrawTriangleStrip Return type: void Description: Draw a triangle strip defined by points Param[1]: points (type: const Vector2 *) Param[2]: pointCount (type: int) Param[3]: color (type: Color) -Function 235: DrawRectangle() (5 input parameters) +Function 237: DrawRectangle() (5 input parameters) Name: DrawRectangle Return type: void Description: Draw a color-filled rectangle @@ -2298,20 +2308,20 @@ Function 235: DrawRectangle() (5 input parameters) Param[3]: width (type: int) Param[4]: height (type: int) Param[5]: color (type: Color) -Function 236: DrawRectangleV() (3 input parameters) +Function 238: DrawRectangleV() (3 input parameters) Name: DrawRectangleV Return type: void Description: Draw a color-filled rectangle (Vector version) Param[1]: position (type: Vector2) Param[2]: size (type: Vector2) Param[3]: color (type: Color) -Function 237: DrawRectangleRec() (2 input parameters) +Function 239: DrawRectangleRec() (2 input parameters) Name: DrawRectangleRec Return type: void Description: Draw a color-filled rectangle Param[1]: rec (type: Rectangle) Param[2]: color (type: Color) -Function 238: DrawRectanglePro() (4 input parameters) +Function 240: DrawRectanglePro() (4 input parameters) Name: DrawRectanglePro Return type: void Description: Draw a color-filled rectangle with pro parameters @@ -2319,7 +2329,7 @@ Function 238: DrawRectanglePro() (4 input parameters) Param[2]: origin (type: Vector2) Param[3]: rotation (type: float) Param[4]: color (type: Color) -Function 239: DrawRectangleGradientV() (6 input parameters) +Function 241: DrawRectangleGradientV() (6 input parameters) Name: DrawRectangleGradientV Return type: void Description: Draw a vertical-gradient-filled rectangle @@ -2329,7 +2339,7 @@ Function 239: DrawRectangleGradientV() (6 input parameters) Param[4]: height (type: int) Param[5]: top (type: Color) Param[6]: bottom (type: Color) -Function 240: DrawRectangleGradientH() (6 input parameters) +Function 242: DrawRectangleGradientH() (6 input parameters) Name: DrawRectangleGradientH Return type: void Description: Draw a horizontal-gradient-filled rectangle @@ -2339,7 +2349,7 @@ Function 240: DrawRectangleGradientH() (6 input parameters) Param[4]: height (type: int) Param[5]: left (type: Color) Param[6]: right (type: Color) -Function 241: DrawRectangleGradientEx() (5 input parameters) +Function 243: DrawRectangleGradientEx() (5 input parameters) Name: DrawRectangleGradientEx Return type: void Description: Draw a gradient-filled rectangle with custom vertex colors, counter-clockwise color order @@ -2348,7 +2358,7 @@ Function 241: DrawRectangleGradientEx() (5 input parameters) Param[3]: col2 (type: Color) Param[4]: col3 (type: Color) Param[5]: col4 (type: Color) -Function 242: DrawRectangleLines() (5 input parameters) +Function 244: DrawRectangleLines() (5 input parameters) Name: DrawRectangleLines Return type: void Description: Draw rectangle outline @@ -2357,14 +2367,14 @@ Function 242: DrawRectangleLines() (5 input parameters) Param[3]: width (type: int) Param[4]: height (type: int) Param[5]: color (type: Color) -Function 243: DrawRectangleLinesEx() (3 input parameters) +Function 245: DrawRectangleLinesEx() (3 input parameters) Name: DrawRectangleLinesEx Return type: void Description: Draw rectangle outline with line thickness Param[1]: rec (type: Rectangle) Param[2]: thick (type: float) Param[3]: color (type: Color) -Function 244: DrawRectangleRounded() (4 input parameters) +Function 246: DrawRectangleRounded() (4 input parameters) Name: DrawRectangleRounded Return type: void Description: Draw rectangle with rounded edges @@ -2372,7 +2382,7 @@ Function 244: DrawRectangleRounded() (4 input parameters) Param[2]: roundness (type: float) Param[3]: segments (type: int) Param[4]: color (type: Color) -Function 245: DrawRectangleRoundedLines() (4 input parameters) +Function 247: DrawRectangleRoundedLines() (4 input parameters) Name: DrawRectangleRoundedLines Return type: void Description: Draw rectangle lines with rounded edges @@ -2380,7 +2390,7 @@ Function 245: DrawRectangleRoundedLines() (4 input parameters) Param[2]: roundness (type: float) Param[3]: segments (type: int) Param[4]: color (type: Color) -Function 246: DrawRectangleRoundedLinesEx() (5 input parameters) +Function 248: DrawRectangleRoundedLinesEx() (5 input parameters) Name: DrawRectangleRoundedLinesEx Return type: void Description: Draw rectangle lines with rounded edges outline and line thickness @@ -2389,7 +2399,7 @@ Function 246: DrawRectangleRoundedLinesEx() (5 input parameters) Param[3]: segments (type: int) Param[4]: thick (type: float) Param[5]: color (type: Color) -Function 247: DrawPoly() (5 input parameters) +Function 249: DrawPoly() (5 input parameters) Name: DrawPoly Return type: void Description: Draw a polygon of n sides @@ -2398,7 +2408,7 @@ Function 247: DrawPoly() (5 input parameters) Param[3]: radius (type: float) Param[4]: rotation (type: float) Param[5]: color (type: Color) -Function 248: DrawPolyLines() (5 input parameters) +Function 250: DrawPolyLines() (5 input parameters) Name: DrawPolyLines Return type: void Description: Draw a polygon outline of n sides @@ -2407,7 +2417,7 @@ Function 248: DrawPolyLines() (5 input parameters) Param[3]: radius (type: float) Param[4]: rotation (type: float) Param[5]: color (type: Color) -Function 249: DrawPolyLinesEx() (6 input parameters) +Function 251: DrawPolyLinesEx() (6 input parameters) Name: DrawPolyLinesEx Return type: void Description: Draw a polygon outline of n sides with line thickness @@ -2417,7 +2427,7 @@ Function 249: DrawPolyLinesEx() (6 input parameters) Param[4]: rotation (type: float) Param[5]: thick (type: float) Param[6]: color (type: Color) -Function 250: DrawCircle() (4 input parameters) +Function 252: DrawCircle() (4 input parameters) Name: DrawCircle Return type: void Description: Draw a color-filled circle @@ -2425,14 +2435,14 @@ Function 250: DrawCircle() (4 input parameters) Param[2]: centerY (type: int) Param[3]: radius (type: float) Param[4]: color (type: Color) -Function 251: DrawCircleV() (3 input parameters) +Function 253: DrawCircleV() (3 input parameters) Name: DrawCircleV Return type: void Description: Draw a color-filled circle (Vector version) Param[1]: center (type: Vector2) Param[2]: radius (type: float) Param[3]: color (type: Color) -Function 252: DrawCircleGradient() (4 input parameters) +Function 254: DrawCircleGradient() (4 input parameters) Name: DrawCircleGradient Return type: void Description: Draw a gradient-filled circle @@ -2440,7 +2450,7 @@ Function 252: DrawCircleGradient() (4 input parameters) Param[2]: radius (type: float) Param[3]: inner (type: Color) Param[4]: outer (type: Color) -Function 253: DrawCircleSector() (6 input parameters) +Function 255: DrawCircleSector() (6 input parameters) Name: DrawCircleSector Return type: void Description: Draw a piece of a circle @@ -2450,7 +2460,7 @@ Function 253: DrawCircleSector() (6 input parameters) Param[4]: endAngle (type: float) Param[5]: segments (type: int) Param[6]: color (type: Color) -Function 254: DrawCircleSectorLines() (6 input parameters) +Function 256: DrawCircleSectorLines() (6 input parameters) Name: DrawCircleSectorLines Return type: void Description: Draw circle sector outline @@ -2460,7 +2470,7 @@ Function 254: DrawCircleSectorLines() (6 input parameters) Param[4]: endAngle (type: float) Param[5]: segments (type: int) Param[6]: color (type: Color) -Function 255: DrawCircleLines() (4 input parameters) +Function 257: DrawCircleLines() (4 input parameters) Name: DrawCircleLines Return type: void Description: Draw circle outline @@ -2468,14 +2478,14 @@ Function 255: DrawCircleLines() (4 input parameters) Param[2]: centerY (type: int) Param[3]: radius (type: float) Param[4]: color (type: Color) -Function 256: DrawCircleLinesV() (3 input parameters) +Function 258: DrawCircleLinesV() (3 input parameters) Name: DrawCircleLinesV Return type: void Description: Draw circle outline (Vector version) Param[1]: center (type: Vector2) Param[2]: radius (type: float) Param[3]: color (type: Color) -Function 257: DrawCircleLinesEx() (4 input parameters) +Function 259: DrawCircleLinesEx() (4 input parameters) Name: DrawCircleLinesEx Return type: void Description: Draw circle outline with line thickness @@ -2483,7 +2493,7 @@ Function 257: DrawCircleLinesEx() (4 input parameters) Param[2]: radius (type: float) Param[3]: thick (type: float) Param[4]: color (type: Color) -Function 258: DrawEllipse() (5 input parameters) +Function 260: DrawEllipse() (5 input parameters) Name: DrawEllipse Return type: void Description: Draw ellipse @@ -2492,7 +2502,7 @@ Function 258: DrawEllipse() (5 input parameters) Param[3]: radiusH (type: float) Param[4]: radiusV (type: float) Param[5]: color (type: Color) -Function 259: DrawEllipseV() (4 input parameters) +Function 261: DrawEllipseV() (4 input parameters) Name: DrawEllipseV Return type: void Description: Draw ellipse (Vector version) @@ -2500,7 +2510,7 @@ Function 259: DrawEllipseV() (4 input parameters) Param[2]: radiusH (type: float) Param[3]: radiusV (type: float) Param[4]: color (type: Color) -Function 260: DrawEllipseLines() (5 input parameters) +Function 262: DrawEllipseLines() (5 input parameters) Name: DrawEllipseLines Return type: void Description: Draw ellipse outline @@ -2509,7 +2519,7 @@ Function 260: DrawEllipseLines() (5 input parameters) Param[3]: radiusH (type: float) Param[4]: radiusV (type: float) Param[5]: color (type: Color) -Function 261: DrawEllipseLinesV() (4 input parameters) +Function 263: DrawEllipseLinesV() (4 input parameters) Name: DrawEllipseLinesV Return type: void Description: Draw ellipse outline (Vector version) @@ -2517,7 +2527,7 @@ Function 261: DrawEllipseLinesV() (4 input parameters) Param[2]: radiusH (type: float) Param[3]: radiusV (type: float) Param[4]: color (type: Color) -Function 262: DrawRing() (7 input parameters) +Function 264: DrawRing() (7 input parameters) Name: DrawRing Return type: void Description: Draw ring @@ -2528,7 +2538,7 @@ Function 262: DrawRing() (7 input parameters) Param[5]: endAngle (type: float) Param[6]: segments (type: int) Param[7]: color (type: Color) -Function 263: DrawRingLines() (7 input parameters) +Function 265: DrawRingLines() (7 input parameters) Name: DrawRingLines Return type: void Description: Draw ring outline @@ -2539,7 +2549,7 @@ Function 263: DrawRingLines() (7 input parameters) Param[5]: endAngle (type: float) Param[6]: segments (type: int) Param[7]: color (type: Color) -Function 264: DrawSplineLinear() (4 input parameters) +Function 266: DrawSplineLinear() (4 input parameters) Name: DrawSplineLinear Return type: void Description: Draw spline: Linear, minimum 2 points @@ -2547,7 +2557,7 @@ Function 264: DrawSplineLinear() (4 input parameters) Param[2]: pointCount (type: int) Param[3]: thick (type: float) Param[4]: color (type: Color) -Function 265: DrawSplineBasis() (4 input parameters) +Function 267: DrawSplineBasis() (4 input parameters) Name: DrawSplineBasis Return type: void Description: Draw spline: B-Spline, minimum 4 points @@ -2555,7 +2565,7 @@ Function 265: DrawSplineBasis() (4 input parameters) Param[2]: pointCount (type: int) Param[3]: thick (type: float) Param[4]: color (type: Color) -Function 266: DrawSplineCatmullRom() (4 input parameters) +Function 268: DrawSplineCatmullRom() (4 input parameters) Name: DrawSplineCatmullRom Return type: void Description: Draw spline: Catmull-Rom, minimum 4 points @@ -2563,7 +2573,7 @@ Function 266: DrawSplineCatmullRom() (4 input parameters) Param[2]: pointCount (type: int) Param[3]: thick (type: float) Param[4]: color (type: Color) -Function 267: DrawSplineBezierQuadratic() (4 input parameters) +Function 269: DrawSplineBezierQuadratic() (4 input parameters) Name: DrawSplineBezierQuadratic Return type: void Description: Draw spline: Quadratic Bezier, minimum 3 points (1 control point): [p1, c2, p3, c4...] @@ -2571,7 +2581,7 @@ Function 267: DrawSplineBezierQuadratic() (4 input parameters) Param[2]: pointCount (type: int) Param[3]: thick (type: float) Param[4]: color (type: Color) -Function 268: DrawSplineBezierCubic() (4 input parameters) +Function 270: DrawSplineBezierCubic() (4 input parameters) Name: DrawSplineBezierCubic Return type: void Description: Draw spline: Cubic Bezier, minimum 4 points (2 control points): [p1, c2, c3, p4, c5, c6...] @@ -2579,7 +2589,7 @@ Function 268: DrawSplineBezierCubic() (4 input parameters) Param[2]: pointCount (type: int) Param[3]: thick (type: float) Param[4]: color (type: Color) -Function 269: DrawSplineSegmentLinear() (4 input parameters) +Function 271: DrawSplineSegmentLinear() (4 input parameters) Name: DrawSplineSegmentLinear Return type: void Description: Draw spline segment: Linear, 2 points @@ -2587,7 +2597,7 @@ Function 269: DrawSplineSegmentLinear() (4 input parameters) Param[2]: p2 (type: Vector2) Param[3]: thick (type: float) Param[4]: color (type: Color) -Function 270: DrawSplineSegmentBasis() (6 input parameters) +Function 272: DrawSplineSegmentBasis() (6 input parameters) Name: DrawSplineSegmentBasis Return type: void Description: Draw spline segment: B-Spline, 4 points @@ -2597,7 +2607,7 @@ Function 270: DrawSplineSegmentBasis() (6 input parameters) Param[4]: p4 (type: Vector2) Param[5]: thick (type: float) Param[6]: color (type: Color) -Function 271: DrawSplineSegmentCatmullRom() (6 input parameters) +Function 273: DrawSplineSegmentCatmullRom() (6 input parameters) Name: DrawSplineSegmentCatmullRom Return type: void Description: Draw spline segment: Catmull-Rom, 4 points @@ -2607,7 +2617,7 @@ Function 271: DrawSplineSegmentCatmullRom() (6 input parameters) Param[4]: p4 (type: Vector2) Param[5]: thick (type: float) Param[6]: color (type: Color) -Function 272: DrawSplineSegmentBezierQuadratic() (5 input parameters) +Function 274: DrawSplineSegmentBezierQuadratic() (5 input parameters) Name: DrawSplineSegmentBezierQuadratic Return type: void Description: Draw spline segment: Quadratic Bezier, 2 points, 1 control point @@ -2616,7 +2626,7 @@ Function 272: DrawSplineSegmentBezierQuadratic() (5 input parameters) Param[3]: p3 (type: Vector2) Param[4]: thick (type: float) Param[5]: color (type: Color) -Function 273: DrawSplineSegmentBezierCubic() (6 input parameters) +Function 275: DrawSplineSegmentBezierCubic() (6 input parameters) Name: DrawSplineSegmentBezierCubic Return type: void Description: Draw spline segment: Cubic Bezier, 2 points, 2 control points @@ -2626,14 +2636,14 @@ Function 273: DrawSplineSegmentBezierCubic() (6 input parameters) Param[4]: p4 (type: Vector2) Param[5]: thick (type: float) Param[6]: color (type: Color) -Function 274: GetSplinePointLinear() (3 input parameters) +Function 276: GetSplinePointLinear() (3 input parameters) Name: GetSplinePointLinear Return type: Vector2 Description: Get (evaluate) spline point: Linear Param[1]: startPos (type: Vector2) Param[2]: endPos (type: Vector2) Param[3]: t (type: float) -Function 275: GetSplinePointBasis() (5 input parameters) +Function 277: GetSplinePointBasis() (5 input parameters) Name: GetSplinePointBasis Return type: Vector2 Description: Get (evaluate) spline point: B-Spline @@ -2642,7 +2652,7 @@ Function 275: GetSplinePointBasis() (5 input parameters) Param[3]: p3 (type: Vector2) Param[4]: p4 (type: Vector2) Param[5]: t (type: float) -Function 276: GetSplinePointCatmullRom() (5 input parameters) +Function 278: GetSplinePointCatmullRom() (5 input parameters) Name: GetSplinePointCatmullRom Return type: Vector2 Description: Get (evaluate) spline point: Catmull-Rom @@ -2651,7 +2661,7 @@ Function 276: GetSplinePointCatmullRom() (5 input parameters) Param[3]: p3 (type: Vector2) Param[4]: p4 (type: Vector2) Param[5]: t (type: float) -Function 277: GetSplinePointBezierQuadratic() (4 input parameters) +Function 279: GetSplinePointBezierQuadratic() (4 input parameters) Name: GetSplinePointBezierQuadratic Return type: Vector2 Description: Get (evaluate) spline point: Quadratic Bezier @@ -2659,7 +2669,7 @@ Function 277: GetSplinePointBezierQuadratic() (4 input parameters) Param[2]: c2 (type: Vector2) Param[3]: p3 (type: Vector2) Param[4]: t (type: float) -Function 278: GetSplinePointBezierCubic() (5 input parameters) +Function 280: GetSplinePointBezierCubic() (5 input parameters) Name: GetSplinePointBezierCubic Return type: Vector2 Description: Get (evaluate) spline point: Cubic Bezier @@ -2668,13 +2678,13 @@ Function 278: GetSplinePointBezierCubic() (5 input parameters) Param[3]: c3 (type: Vector2) Param[4]: p4 (type: Vector2) Param[5]: t (type: float) -Function 279: CheckCollisionRecs() (2 input parameters) +Function 281: CheckCollisionRecs() (2 input parameters) Name: CheckCollisionRecs Return type: bool Description: Check collision between two rectangles Param[1]: rec1 (type: Rectangle) Param[2]: rec2 (type: Rectangle) -Function 280: CheckCollisionCircles() (4 input parameters) +Function 282: CheckCollisionCircles() (4 input parameters) Name: CheckCollisionCircles Return type: bool Description: Check collision between two circles @@ -2682,14 +2692,14 @@ Function 280: CheckCollisionCircles() (4 input parameters) Param[2]: radius1 (type: float) Param[3]: center2 (type: Vector2) Param[4]: radius2 (type: float) -Function 281: CheckCollisionCircleRec() (3 input parameters) +Function 283: CheckCollisionCircleRec() (3 input parameters) Name: CheckCollisionCircleRec Return type: bool Description: Check collision between circle and rectangle Param[1]: center (type: Vector2) Param[2]: radius (type: float) Param[3]: rec (type: Rectangle) -Function 282: CheckCollisionCircleLine() (4 input parameters) +Function 284: CheckCollisionCircleLine() (4 input parameters) Name: CheckCollisionCircleLine Return type: bool Description: Check if circle collides with a line created between two points [p1] and [p2] @@ -2697,20 +2707,20 @@ Function 282: CheckCollisionCircleLine() (4 input parameters) Param[2]: radius (type: float) Param[3]: p1 (type: Vector2) Param[4]: p2 (type: Vector2) -Function 283: CheckCollisionPointRec() (2 input parameters) +Function 285: CheckCollisionPointRec() (2 input parameters) Name: CheckCollisionPointRec Return type: bool Description: Check if point is inside rectangle Param[1]: point (type: Vector2) Param[2]: rec (type: Rectangle) -Function 284: CheckCollisionPointCircle() (3 input parameters) +Function 286: CheckCollisionPointCircle() (3 input parameters) Name: CheckCollisionPointCircle Return type: bool Description: Check if point is inside circle Param[1]: point (type: Vector2) Param[2]: center (type: Vector2) Param[3]: radius (type: float) -Function 285: CheckCollisionPointTriangle() (4 input parameters) +Function 287: CheckCollisionPointTriangle() (4 input parameters) Name: CheckCollisionPointTriangle Return type: bool Description: Check if point is inside a triangle @@ -2718,7 +2728,7 @@ Function 285: CheckCollisionPointTriangle() (4 input parameters) Param[2]: p1 (type: Vector2) Param[3]: p2 (type: Vector2) Param[4]: p3 (type: Vector2) -Function 286: CheckCollisionPointLine() (4 input parameters) +Function 288: CheckCollisionPointLine() (4 input parameters) Name: CheckCollisionPointLine Return type: bool Description: Check if point belongs to line created between two points [p1] and [p2] with defined margin in pixels [threshold] @@ -2726,14 +2736,14 @@ Function 286: CheckCollisionPointLine() (4 input parameters) Param[2]: p1 (type: Vector2) Param[3]: p2 (type: Vector2) Param[4]: threshold (type: int) -Function 287: CheckCollisionPointPoly() (3 input parameters) +Function 289: CheckCollisionPointPoly() (3 input parameters) Name: CheckCollisionPointPoly Return type: bool Description: Check if point is within a polygon described by array of vertices Param[1]: point (type: Vector2) Param[2]: points (type: const Vector2 *) Param[3]: pointCount (type: int) -Function 288: CheckCollisionLines() (5 input parameters) +Function 290: CheckCollisionLines() (5 input parameters) Name: CheckCollisionLines Return type: bool Description: Check the collision between two lines defined by two points each, returns collision point by reference @@ -2742,18 +2752,18 @@ Function 288: CheckCollisionLines() (5 input parameters) Param[3]: startPos2 (type: Vector2) Param[4]: endPos2 (type: Vector2) Param[5]: collisionPoint (type: Vector2 *) -Function 289: GetCollisionRec() (2 input parameters) +Function 291: GetCollisionRec() (2 input parameters) Name: GetCollisionRec Return type: Rectangle Description: Get collision rectangle for two rectangles collision Param[1]: rec1 (type: Rectangle) Param[2]: rec2 (type: Rectangle) -Function 290: LoadImage() (1 input parameters) +Function 292: LoadImage() (1 input parameters) Name: LoadImage Return type: Image Description: Load image from file into CPU memory (RAM) Param[1]: fileName (type: const char *) -Function 291: LoadImageRaw() (5 input parameters) +Function 293: LoadImageRaw() (5 input parameters) Name: LoadImageRaw Return type: Image Description: Load image from RAW file data @@ -2762,13 +2772,13 @@ Function 291: LoadImageRaw() (5 input parameters) Param[3]: height (type: int) Param[4]: format (type: int) Param[5]: headerSize (type: int) -Function 292: LoadImageAnim() (2 input parameters) +Function 294: LoadImageAnim() (2 input parameters) Name: LoadImageAnim Return type: Image Description: Load image sequence from file (frames appended to image.data) Param[1]: fileName (type: const char *) Param[2]: frames (type: int *) -Function 293: LoadImageAnimFromMemory() (4 input parameters) +Function 295: LoadImageAnimFromMemory() (4 input parameters) Name: LoadImageAnimFromMemory Return type: Image Description: Load image sequence from memory buffer @@ -2776,60 +2786,60 @@ Function 293: LoadImageAnimFromMemory() (4 input parameters) Param[2]: fileData (type: const unsigned char *) Param[3]: dataSize (type: int) Param[4]: frames (type: int *) -Function 294: LoadImageFromMemory() (3 input parameters) +Function 296: LoadImageFromMemory() (3 input parameters) Name: LoadImageFromMemory Return type: Image Description: Load image from memory buffer, fileType refers to extension: i.e. '.png' Param[1]: fileType (type: const char *) Param[2]: fileData (type: const unsigned char *) Param[3]: dataSize (type: int) -Function 295: LoadImageFromTexture() (1 input parameters) +Function 297: LoadImageFromTexture() (1 input parameters) Name: LoadImageFromTexture Return type: Image Description: Load image from GPU texture data Param[1]: texture (type: Texture2D) -Function 296: LoadImageFromScreen() (0 input parameters) +Function 298: LoadImageFromScreen() (0 input parameters) Name: LoadImageFromScreen Return type: Image Description: Load image from screen buffer (screenshot) No input parameters -Function 297: IsImageValid() (1 input parameters) +Function 299: IsImageValid() (1 input parameters) Name: IsImageValid Return type: bool Description: Check if an image is valid (data and parameters) Param[1]: image (type: Image) -Function 298: UnloadImage() (1 input parameters) +Function 300: UnloadImage() (1 input parameters) Name: UnloadImage Return type: void Description: Unload image from CPU memory (RAM) Param[1]: image (type: Image) -Function 299: ExportImage() (2 input parameters) +Function 301: ExportImage() (2 input parameters) Name: ExportImage Return type: bool Description: Export image data to file, returns true on success Param[1]: image (type: Image) Param[2]: fileName (type: const char *) -Function 300: ExportImageToMemory() (3 input parameters) +Function 302: ExportImageToMemory() (3 input parameters) Name: ExportImageToMemory Return type: unsigned char * Description: Export image to memory buffer, memory must be MemFree() Param[1]: image (type: Image) Param[2]: fileType (type: const char *) Param[3]: fileSize (type: int *) -Function 301: ExportImageAsCode() (2 input parameters) +Function 303: ExportImageAsCode() (2 input parameters) Name: ExportImageAsCode Return type: bool Description: Export image as code file defining an array of bytes, returns true on success Param[1]: image (type: Image) Param[2]: fileName (type: const char *) -Function 302: GenImageColor() (3 input parameters) +Function 304: GenImageColor() (3 input parameters) Name: GenImageColor Return type: Image Description: Generate image: plain color Param[1]: width (type: int) Param[2]: height (type: int) Param[3]: color (type: Color) -Function 303: GenImageGradientLinear() (5 input parameters) +Function 305: GenImageGradientLinear() (5 input parameters) Name: GenImageGradientLinear Return type: Image Description: Generate image: linear gradient, direction in degrees [0..360], 0=Vertical gradient @@ -2838,7 +2848,7 @@ Function 303: GenImageGradientLinear() (5 input parameters) Param[3]: direction (type: int) Param[4]: start (type: Color) Param[5]: end (type: Color) -Function 304: GenImageGradientRadial() (5 input parameters) +Function 306: GenImageGradientRadial() (5 input parameters) Name: GenImageGradientRadial Return type: Image Description: Generate image: radial gradient @@ -2847,7 +2857,7 @@ Function 304: GenImageGradientRadial() (5 input parameters) Param[3]: density (type: float) Param[4]: inner (type: Color) Param[5]: outer (type: Color) -Function 305: GenImageGradientSquare() (5 input parameters) +Function 307: GenImageGradientSquare() (5 input parameters) Name: GenImageGradientSquare Return type: Image Description: Generate image: square gradient @@ -2856,7 +2866,7 @@ Function 305: GenImageGradientSquare() (5 input parameters) Param[3]: density (type: float) Param[4]: inner (type: Color) Param[5]: outer (type: Color) -Function 306: GenImageChecked() (6 input parameters) +Function 308: GenImageChecked() (6 input parameters) Name: GenImageChecked Return type: Image Description: Generate image: checked @@ -2866,14 +2876,14 @@ Function 306: GenImageChecked() (6 input parameters) Param[4]: checksY (type: int) Param[5]: col1 (type: Color) Param[6]: col2 (type: Color) -Function 307: GenImageWhiteNoise() (3 input parameters) +Function 309: GenImageWhiteNoise() (3 input parameters) Name: GenImageWhiteNoise Return type: Image Description: Generate image: white noise Param[1]: width (type: int) Param[2]: height (type: int) Param[3]: factor (type: float) -Function 308: GenImagePerlinNoise() (5 input parameters) +Function 310: GenImagePerlinNoise() (5 input parameters) Name: GenImagePerlinNoise Return type: Image Description: Generate image: perlin noise @@ -2882,45 +2892,45 @@ Function 308: GenImagePerlinNoise() (5 input parameters) Param[3]: offsetX (type: int) Param[4]: offsetY (type: int) Param[5]: scale (type: float) -Function 309: GenImageCellular() (3 input parameters) +Function 311: GenImageCellular() (3 input parameters) Name: GenImageCellular Return type: Image Description: Generate image: cellular algorithm, bigger tileSize means bigger cells Param[1]: width (type: int) Param[2]: height (type: int) Param[3]: tileSize (type: int) -Function 310: GenImageText() (3 input parameters) +Function 312: GenImageText() (3 input parameters) Name: GenImageText Return type: Image Description: Generate image: grayscale image from text data Param[1]: width (type: int) Param[2]: height (type: int) Param[3]: text (type: const char *) -Function 311: ImageCopy() (1 input parameters) +Function 313: ImageCopy() (1 input parameters) Name: ImageCopy Return type: Image Description: Create an image duplicate (useful for transformations) Param[1]: image (type: Image) -Function 312: ImageFromImage() (2 input parameters) +Function 314: ImageFromImage() (2 input parameters) Name: ImageFromImage Return type: Image Description: Create an image from another image piece Param[1]: image (type: Image) Param[2]: rec (type: Rectangle) -Function 313: ImageFromChannel() (2 input parameters) +Function 315: ImageFromChannel() (2 input parameters) Name: ImageFromChannel Return type: Image Description: Create an image from a selected channel of another image (GRAYSCALE) Param[1]: image (type: Image) Param[2]: selectedChannel (type: int) -Function 314: ImageText() (3 input parameters) +Function 316: ImageText() (3 input parameters) Name: ImageText Return type: Image Description: Create an image from text (default font) Param[1]: text (type: const char *) Param[2]: fontSize (type: int) Param[3]: color (type: Color) -Function 315: ImageTextEx() (5 input parameters) +Function 317: ImageTextEx() (5 input parameters) Name: ImageTextEx Return type: Image Description: Create an image from text (custom sprite font) @@ -2929,76 +2939,76 @@ Function 315: ImageTextEx() (5 input parameters) Param[3]: fontSize (type: float) Param[4]: spacing (type: float) Param[5]: tint (type: Color) -Function 316: ImageFormat() (2 input parameters) +Function 318: ImageFormat() (2 input parameters) Name: ImageFormat Return type: void Description: Convert image data to desired format Param[1]: image (type: Image *) Param[2]: newFormat (type: int) -Function 317: ImageToPOT() (2 input parameters) +Function 319: ImageToPOT() (2 input parameters) Name: ImageToPOT Return type: void Description: Convert image to POT (power-of-two) Param[1]: image (type: Image *) Param[2]: fill (type: Color) -Function 318: ImageCrop() (2 input parameters) +Function 320: ImageCrop() (2 input parameters) Name: ImageCrop Return type: void Description: Crop an image to a defined rectangle Param[1]: image (type: Image *) Param[2]: crop (type: Rectangle) -Function 319: ImageAlphaCrop() (2 input parameters) +Function 321: ImageAlphaCrop() (2 input parameters) Name: ImageAlphaCrop Return type: void Description: Crop image depending on alpha value Param[1]: image (type: Image *) Param[2]: threshold (type: float) -Function 320: ImageAlphaClear() (3 input parameters) +Function 322: ImageAlphaClear() (3 input parameters) Name: ImageAlphaClear Return type: void Description: Clear alpha channel to desired color Param[1]: image (type: Image *) Param[2]: color (type: Color) Param[3]: threshold (type: float) -Function 321: ImageAlphaMask() (2 input parameters) +Function 323: ImageAlphaMask() (2 input parameters) Name: ImageAlphaMask Return type: void Description: Apply alpha mask to image Param[1]: image (type: Image *) Param[2]: alphaMask (type: Image) -Function 322: ImageAlphaPremultiply() (1 input parameters) +Function 324: ImageAlphaPremultiply() (1 input parameters) Name: ImageAlphaPremultiply Return type: void Description: Premultiply alpha channel Param[1]: image (type: Image *) -Function 323: ImageBlurGaussian() (2 input parameters) +Function 325: ImageBlurGaussian() (2 input parameters) Name: ImageBlurGaussian Return type: void Description: Apply Gaussian blur using a box blur approximation Param[1]: image (type: Image *) Param[2]: blurSize (type: int) -Function 324: ImageKernelConvolution() (3 input parameters) +Function 326: ImageKernelConvolution() (3 input parameters) Name: ImageKernelConvolution Return type: void Description: Apply custom square convolution kernel to image Param[1]: image (type: Image *) Param[2]: kernel (type: const float *) Param[3]: kernelSize (type: int) -Function 325: ImageResize() (3 input parameters) +Function 327: ImageResize() (3 input parameters) Name: ImageResize Return type: void Description: Resize image (Bicubic scaling algorithm) Param[1]: image (type: Image *) Param[2]: newWidth (type: int) Param[3]: newHeight (type: int) -Function 326: ImageResizeNN() (3 input parameters) +Function 328: ImageResizeNN() (3 input parameters) Name: ImageResizeNN Return type: void Description: Resize image (Nearest-Neighbor scaling algorithm) Param[1]: image (type: Image *) Param[2]: newWidth (type: int) Param[3]: newHeight (type: int) -Function 327: ImageResizeCanvas() (6 input parameters) +Function 329: ImageResizeCanvas() (6 input parameters) Name: ImageResizeCanvas Return type: void Description: Resize canvas and fill with color @@ -3008,12 +3018,12 @@ Function 327: ImageResizeCanvas() (6 input parameters) Param[4]: offsetX (type: int) Param[5]: offsetY (type: int) Param[6]: fill (type: Color) -Function 328: ImageMipmaps() (1 input parameters) +Function 330: ImageMipmaps() (1 input parameters) Name: ImageMipmaps Return type: void Description: Compute all mipmap levels for a provided image Param[1]: image (type: Image *) -Function 329: ImageDither() (5 input parameters) +Function 331: ImageDither() (5 input parameters) Name: ImageDither Return type: void Description: Dither image data to 16bpp or lower (Floyd-Steinberg dithering) @@ -3022,109 +3032,109 @@ Function 329: ImageDither() (5 input parameters) Param[3]: gBpp (type: int) Param[4]: bBpp (type: int) Param[5]: aBpp (type: int) -Function 330: ImageFlipVertical() (1 input parameters) +Function 332: ImageFlipVertical() (1 input parameters) Name: ImageFlipVertical Return type: void Description: Flip image vertically Param[1]: image (type: Image *) -Function 331: ImageFlipHorizontal() (1 input parameters) +Function 333: ImageFlipHorizontal() (1 input parameters) Name: ImageFlipHorizontal Return type: void Description: Flip image horizontally Param[1]: image (type: Image *) -Function 332: ImageRotate() (2 input parameters) +Function 334: ImageRotate() (2 input parameters) Name: ImageRotate Return type: void Description: Rotate image by input angle in degrees (-359 to 359) Param[1]: image (type: Image *) Param[2]: degrees (type: int) -Function 333: ImageRotateCW() (1 input parameters) +Function 335: ImageRotateCW() (1 input parameters) Name: ImageRotateCW Return type: void Description: Rotate image clockwise 90deg Param[1]: image (type: Image *) -Function 334: ImageRotateCCW() (1 input parameters) +Function 336: ImageRotateCCW() (1 input parameters) Name: ImageRotateCCW Return type: void Description: Rotate image counter-clockwise 90deg Param[1]: image (type: Image *) -Function 335: ImageColorTint() (2 input parameters) +Function 337: ImageColorTint() (2 input parameters) Name: ImageColorTint Return type: void Description: Modify image color: tint Param[1]: image (type: Image *) Param[2]: color (type: Color) -Function 336: ImageColorInvert() (1 input parameters) +Function 338: ImageColorInvert() (1 input parameters) Name: ImageColorInvert Return type: void Description: Modify image color: invert Param[1]: image (type: Image *) -Function 337: ImageColorGrayscale() (1 input parameters) +Function 339: ImageColorGrayscale() (1 input parameters) Name: ImageColorGrayscale Return type: void Description: Modify image color: grayscale Param[1]: image (type: Image *) -Function 338: ImageColorContrast() (2 input parameters) +Function 340: ImageColorContrast() (2 input parameters) Name: ImageColorContrast Return type: void Description: Modify image color: contrast (-100 to 100) Param[1]: image (type: Image *) Param[2]: contrast (type: int) -Function 339: ImageColorBrightness() (2 input parameters) +Function 341: ImageColorBrightness() (2 input parameters) Name: ImageColorBrightness Return type: void Description: Modify image color: brightness (-255 to 255) Param[1]: image (type: Image *) Param[2]: brightness (type: int) -Function 340: ImageColorReplace() (3 input parameters) +Function 342: ImageColorReplace() (3 input parameters) Name: ImageColorReplace Return type: void Description: Modify image color: replace color Param[1]: image (type: Image *) Param[2]: color (type: Color) Param[3]: replace (type: Color) -Function 341: LoadImageColors() (1 input parameters) +Function 343: LoadImageColors() (1 input parameters) Name: LoadImageColors Return type: Color * Description: Load color data from image as a Color array (RGBA - 32bit) Param[1]: image (type: Image) -Function 342: LoadImagePalette() (3 input parameters) +Function 344: LoadImagePalette() (3 input parameters) Name: LoadImagePalette Return type: Color * Description: Load colors palette from image as a Color array (RGBA - 32bit) Param[1]: image (type: Image) Param[2]: maxPaletteSize (type: int) Param[3]: colorCount (type: int *) -Function 343: UnloadImageColors() (1 input parameters) +Function 345: UnloadImageColors() (1 input parameters) Name: UnloadImageColors Return type: void Description: Unload color data loaded with LoadImageColors() Param[1]: colors (type: Color *) -Function 344: UnloadImagePalette() (1 input parameters) +Function 346: UnloadImagePalette() (1 input parameters) Name: UnloadImagePalette Return type: void Description: Unload colors palette loaded with LoadImagePalette() Param[1]: colors (type: Color *) -Function 345: GetImageAlphaBorder() (2 input parameters) +Function 347: GetImageAlphaBorder() (2 input parameters) Name: GetImageAlphaBorder Return type: Rectangle Description: Get image alpha border rectangle Param[1]: image (type: Image) Param[2]: threshold (type: float) -Function 346: GetImageColor() (3 input parameters) +Function 348: GetImageColor() (3 input parameters) Name: GetImageColor Return type: Color Description: Get image pixel color at (x, y) position Param[1]: image (type: Image) Param[2]: x (type: int) Param[3]: y (type: int) -Function 347: ImageClearBackground() (2 input parameters) +Function 349: ImageClearBackground() (2 input parameters) Name: ImageClearBackground Return type: void - Description: Clear image background with given color + Description: Clear image background with provided color Param[1]: dst (type: Image *) Param[2]: color (type: Color) -Function 348: ImageDrawPixel() (4 input parameters) +Function 350: ImageDrawPixel() (4 input parameters) Name: ImageDrawPixel Return type: void Description: Draw pixel within an image @@ -3132,14 +3142,14 @@ Function 348: ImageDrawPixel() (4 input parameters) Param[2]: posX (type: int) Param[3]: posY (type: int) Param[4]: color (type: Color) -Function 349: ImageDrawPixelV() (3 input parameters) +Function 351: ImageDrawPixelV() (3 input parameters) Name: ImageDrawPixelV Return type: void Description: Draw pixel within an image (Vector version) Param[1]: dst (type: Image *) Param[2]: position (type: Vector2) Param[3]: color (type: Color) -Function 350: ImageDrawLine() (6 input parameters) +Function 352: ImageDrawLine() (6 input parameters) Name: ImageDrawLine Return type: void Description: Draw line within an image @@ -3149,7 +3159,7 @@ Function 350: ImageDrawLine() (6 input parameters) Param[4]: endPosX (type: int) Param[5]: endPosY (type: int) Param[6]: color (type: Color) -Function 351: ImageDrawLineV() (4 input parameters) +Function 353: ImageDrawLineV() (4 input parameters) Name: ImageDrawLineV Return type: void Description: Draw line within an image (Vector version) @@ -3157,7 +3167,7 @@ Function 351: ImageDrawLineV() (4 input parameters) Param[2]: start (type: Vector2) Param[3]: end (type: Vector2) Param[4]: color (type: Color) -Function 352: ImageDrawLineEx() (5 input parameters) +Function 354: ImageDrawLineEx() (5 input parameters) Name: ImageDrawLineEx Return type: void Description: Draw a line defining thickness within an image @@ -3166,7 +3176,7 @@ Function 352: ImageDrawLineEx() (5 input parameters) Param[3]: end (type: Vector2) Param[4]: thick (type: int) Param[5]: color (type: Color) -Function 353: ImageDrawLineStrip() (4 input parameters) +Function 355: ImageDrawLineStrip() (4 input parameters) Name: ImageDrawLineStrip Return type: void Description: Draw a lines sequence within an image @@ -3174,7 +3184,7 @@ Function 353: ImageDrawLineStrip() (4 input parameters) Param[2]: points (type: const Vector2 *) Param[3]: pointCount (type: int) Param[4]: color (type: Color) -Function 354: ImageDrawTriangle() (5 input parameters) +Function 356: ImageDrawTriangle() (5 input parameters) Name: ImageDrawTriangle Return type: void Description: Draw triangle within an image @@ -3183,7 +3193,7 @@ Function 354: ImageDrawTriangle() (5 input parameters) Param[3]: v2 (type: Vector2) Param[4]: v3 (type: Vector2) Param[5]: color (type: Color) -Function 355: ImageDrawTriangleGradient() (7 input parameters) +Function 357: ImageDrawTriangleGradient() (7 input parameters) Name: ImageDrawTriangleGradient Return type: void Description: Draw triangle with interpolated colors within an image @@ -3194,7 +3204,7 @@ Function 355: ImageDrawTriangleGradient() (7 input parameters) Param[5]: c1 (type: Color) Param[6]: c2 (type: Color) Param[7]: c3 (type: Color) -Function 356: ImageDrawTriangleLines() (5 input parameters) +Function 358: ImageDrawTriangleLines() (5 input parameters) Name: ImageDrawTriangleLines Return type: void Description: Draw triangle outline within an image @@ -3203,7 +3213,7 @@ Function 356: ImageDrawTriangleLines() (5 input parameters) Param[3]: v2 (type: Vector2) Param[4]: v3 (type: Vector2) Param[5]: color (type: Color) -Function 357: ImageDrawTriangleFan() (4 input parameters) +Function 359: ImageDrawTriangleFan() (4 input parameters) Name: ImageDrawTriangleFan Return type: void Description: Draw a triangle fan defined by points within an image (first vertex is the center) @@ -3211,7 +3221,7 @@ Function 357: ImageDrawTriangleFan() (4 input parameters) Param[2]: points (type: const Vector2 *) Param[3]: pointCount (type: int) Param[4]: color (type: Color) -Function 358: ImageDrawTriangleStrip() (4 input parameters) +Function 360: ImageDrawTriangleStrip() (4 input parameters) Name: ImageDrawTriangleStrip Return type: void Description: Draw a triangle strip defined by points within an image @@ -3219,7 +3229,7 @@ Function 358: ImageDrawTriangleStrip() (4 input parameters) Param[2]: points (type: const Vector2 *) Param[3]: pointCount (type: int) Param[4]: color (type: Color) -Function 359: ImageDrawRectangle() (6 input parameters) +Function 361: ImageDrawRectangle() (6 input parameters) Name: ImageDrawRectangle Return type: void Description: Draw rectangle within an image @@ -3229,7 +3239,7 @@ Function 359: ImageDrawRectangle() (6 input parameters) Param[4]: width (type: int) Param[5]: height (type: int) Param[6]: color (type: Color) -Function 360: ImageDrawRectangleV() (4 input parameters) +Function 362: ImageDrawRectangleV() (4 input parameters) Name: ImageDrawRectangleV Return type: void Description: Draw rectangle within an image (Vector version) @@ -3237,14 +3247,23 @@ Function 360: ImageDrawRectangleV() (4 input parameters) Param[2]: position (type: Vector2) Param[3]: size (type: Vector2) Param[4]: color (type: Color) -Function 361: ImageDrawRectangleRec() (3 input parameters) +Function 363: ImageDrawRectangleRec() (3 input parameters) Name: ImageDrawRectangleRec Return type: void Description: Draw rectangle within an image Param[1]: dst (type: Image *) Param[2]: rec (type: Rectangle) Param[3]: color (type: Color) -Function 362: ImageDrawRectangleLines() (6 input parameters) +Function 364: ImageDrawRectanglePro() (5 input parameters) + Name: ImageDrawRectanglePro + Return type: void + Description: Draw a color-filled rectangle with pro parameters within and image + Param[1]: dst (type: Image *) + Param[2]: rec (type: Rectangle) + Param[3]: origin (type: Vector2) + Param[4]: rotation (type: float) + Param[5]: color (type: Color) +Function 365: ImageDrawRectangleLines() (6 input parameters) Name: ImageDrawRectangleLines Return type: void Description: Draw rectangle lines within an image @@ -3254,7 +3273,7 @@ Function 362: ImageDrawRectangleLines() (6 input parameters) Param[4]: width (type: int) Param[5]: height (type: int) Param[6]: color (type: Color) -Function 363: ImageDrawRectangleLinesEx() (4 input parameters) +Function 366: ImageDrawRectangleLinesEx() (4 input parameters) Name: ImageDrawRectangleLinesEx Return type: void Description: Draw rectangle lines within an image with line thickness @@ -3262,7 +3281,17 @@ Function 363: ImageDrawRectangleLinesEx() (4 input parameters) Param[2]: rec (type: Rectangle) Param[3]: thick (type: int) Param[4]: color (type: Color) -Function 364: ImageDrawCircle() (5 input parameters) +Function 367: ImageDrawRectangleGradientEx() (6 input parameters) + Name: ImageDrawRectangleGradientEx + Return type: void + Description: Draw rectangle with gradient colors within an image, counter-clockwise color order + Param[1]: dst (type: Image *) + Param[2]: rec (type: Rectangle) + Param[3]: col1 (type: Color) + Param[4]: col2 (type: Color) + Param[5]: col3 (type: Color) + Param[6]: col4 (type: Color) +Function 368: ImageDrawCircle() (5 input parameters) Name: ImageDrawCircle Return type: void Description: Draw a filled circle within an image @@ -3271,7 +3300,7 @@ Function 364: ImageDrawCircle() (5 input parameters) Param[3]: centerY (type: int) Param[4]: radius (type: int) Param[5]: color (type: Color) -Function 365: ImageDrawCircleV() (4 input parameters) +Function 369: ImageDrawCircleV() (4 input parameters) Name: ImageDrawCircleV Return type: void Description: Draw a filled circle within an image (Vector version) @@ -3279,7 +3308,7 @@ Function 365: ImageDrawCircleV() (4 input parameters) Param[2]: center (type: Vector2) Param[3]: radius (type: int) Param[4]: color (type: Color) -Function 366: ImageDrawCircleLines() (5 input parameters) +Function 370: ImageDrawCircleLines() (5 input parameters) Name: ImageDrawCircleLines Return type: void Description: Draw circle outline within an image @@ -3288,7 +3317,7 @@ Function 366: ImageDrawCircleLines() (5 input parameters) Param[3]: centerY (type: int) Param[4]: radius (type: int) Param[5]: color (type: Color) -Function 367: ImageDrawCircleLinesV() (4 input parameters) +Function 371: ImageDrawCircleLinesV() (4 input parameters) Name: ImageDrawCircleLinesV Return type: void Description: Draw circle outline within an image (Vector version) @@ -3296,7 +3325,7 @@ Function 367: ImageDrawCircleLinesV() (4 input parameters) Param[2]: center (type: Vector2) Param[3]: radius (type: int) Param[4]: color (type: Color) -Function 368: ImageDrawCircleGradient() (5 input parameters) +Function 372: ImageDrawCircleGradient() (5 input parameters) Name: ImageDrawCircleGradient Return type: void Description: Draw a gradient-filled circle within an image @@ -3305,7 +3334,7 @@ Function 368: ImageDrawCircleGradient() (5 input parameters) Param[3]: radius (type: float) Param[4]: inner (type: Color) Param[5]: outer (type: Color) -Function 369: ImageDrawImage() (5 input parameters) +Function 373: ImageDrawImage() (5 input parameters) Name: ImageDrawImage Return type: void Description: Draw an image within an image @@ -3314,7 +3343,17 @@ Function 369: ImageDrawImage() (5 input parameters) Param[3]: posX (type: int) Param[4]: posY (type: int) Param[5]: tint (type: Color) -Function 370: ImageDrawImageRec() (5 input parameters) +Function 374: ImageDrawImageEx() (6 input parameters) + Name: ImageDrawImageEx + Return type: void + Description: Draw an image with scaling and rotation within an image + Param[1]: dst (type: Image *) + Param[2]: src (type: Image) + Param[3]: position (type: Vector2) + Param[4]: rotation (type: float) + Param[5]: scale (type: float) + Param[6]: tint (type: Color) +Function 375: ImageDrawImageRec() (5 input parameters) Name: ImageDrawImageRec Return type: void Description: Draw a part of an image defined by a rectangle within an image @@ -3323,7 +3362,7 @@ Function 370: ImageDrawImageRec() (5 input parameters) Param[3]: srcRec (type: Rectangle) Param[4]: position (type: Vector2) Param[5]: tint (type: Color) -Function 371: ImageDrawImagePro() (7 input parameters) +Function 376: ImageDrawImagePro() (7 input parameters) Name: ImageDrawImagePro Return type: void Description: Draw a part of an image defined by a rectangle into destination rectangle, with scaling and rotation, within an image @@ -3334,7 +3373,7 @@ Function 371: ImageDrawImagePro() (7 input parameters) Param[5]: origin (type: Vector2) Param[6]: rotation (type: float) Param[7]: tint (type: Color) -Function 372: ImageDrawText() (6 input parameters) +Function 377: ImageDrawText() (6 input parameters) Name: ImageDrawText Return type: void Description: Draw text (using default font) within an image (destination) @@ -3344,7 +3383,7 @@ Function 372: ImageDrawText() (6 input parameters) Param[4]: posY (type: int) Param[5]: fontSize (type: int) Param[6]: color (type: Color) -Function 373: ImageDrawTextEx() (7 input parameters) +Function 378: ImageDrawTextEx() (7 input parameters) Name: ImageDrawTextEx Return type: void Description: Draw text (custom sprite font) within an image (destination) @@ -3355,79 +3394,92 @@ Function 373: ImageDrawTextEx() (7 input parameters) Param[5]: fontSize (type: float) Param[6]: spacing (type: float) Param[7]: tint (type: Color) -Function 374: LoadTexture() (1 input parameters) +Function 379: ImageDrawTextPro() (9 input parameters) + Name: ImageDrawTextPro + Return type: void + Description: Draw text using Font and pro parameters (rotation) + Param[1]: dst (type: Image *) + Param[2]: font (type: Font) + Param[3]: text (type: const char *) + Param[4]: position (type: Vector2) + Param[5]: origin (type: Vector2) + Param[6]: rotation (type: float) + Param[7]: fontSize (type: float) + Param[8]: spacing (type: float) + Param[9]: tint (type: Color) +Function 380: LoadTexture() (1 input parameters) Name: LoadTexture Return type: Texture2D Description: Load texture from file into GPU memory (VRAM) Param[1]: fileName (type: const char *) -Function 375: LoadTextureFromImage() (1 input parameters) +Function 381: LoadTextureFromImage() (1 input parameters) Name: LoadTextureFromImage Return type: Texture2D Description: Load texture from image data Param[1]: image (type: Image) -Function 376: LoadTextureCubemap() (2 input parameters) +Function 382: LoadTextureCubemap() (2 input parameters) Name: LoadTextureCubemap Return type: TextureCubemap Description: Load cubemap from image, multiple image cubemap layouts supported Param[1]: image (type: Image) Param[2]: layout (type: int) -Function 377: LoadRenderTexture() (2 input parameters) +Function 383: LoadRenderTexture() (2 input parameters) Name: LoadRenderTexture Return type: RenderTexture2D Description: Load texture for rendering (framebuffer) Param[1]: width (type: int) Param[2]: height (type: int) -Function 378: IsTextureValid() (1 input parameters) +Function 384: IsTextureValid() (1 input parameters) Name: IsTextureValid Return type: bool Description: Check if texture is valid (loaded in GPU) Param[1]: texture (type: Texture2D) -Function 379: UnloadTexture() (1 input parameters) +Function 385: UnloadTexture() (1 input parameters) Name: UnloadTexture Return type: void Description: Unload texture from GPU memory (VRAM) Param[1]: texture (type: Texture2D) -Function 380: IsRenderTextureValid() (1 input parameters) +Function 386: IsRenderTextureValid() (1 input parameters) Name: IsRenderTextureValid Return type: bool Description: Check if render texture is valid (loaded in GPU) Param[1]: target (type: RenderTexture2D) -Function 381: UnloadRenderTexture() (1 input parameters) +Function 387: UnloadRenderTexture() (1 input parameters) Name: UnloadRenderTexture Return type: void Description: Unload render texture from GPU memory (VRAM) Param[1]: target (type: RenderTexture2D) -Function 382: UpdateTexture() (2 input parameters) +Function 388: UpdateTexture() (2 input parameters) Name: UpdateTexture Return type: void Description: Update GPU texture with new data (pixels should be able to fill texture) Param[1]: texture (type: Texture2D) Param[2]: pixels (type: const void *) -Function 383: UpdateTextureRec() (3 input parameters) +Function 389: UpdateTextureRec() (3 input parameters) Name: UpdateTextureRec Return type: void Description: Update GPU texture rectangle with new data (pixels and rec should fit in texture) Param[1]: texture (type: Texture2D) Param[2]: rec (type: Rectangle) Param[3]: pixels (type: const void *) -Function 384: GenTextureMipmaps() (1 input parameters) +Function 390: GenTextureMipmaps() (1 input parameters) Name: GenTextureMipmaps Return type: void Description: Generate GPU mipmaps for a texture Param[1]: texture (type: Texture2D *) -Function 385: SetTextureFilter() (2 input parameters) +Function 391: SetTextureFilter() (2 input parameters) Name: SetTextureFilter Return type: void Description: Set texture scaling filter mode Param[1]: texture (type: Texture2D) Param[2]: filter (type: int) -Function 386: SetTextureWrap() (2 input parameters) +Function 392: SetTextureWrap() (2 input parameters) Name: SetTextureWrap Return type: void Description: Set texture wrapping mode Param[1]: texture (type: Texture2D) Param[2]: wrap (type: int) -Function 387: DrawTexture() (4 input parameters) +Function 393: DrawTexture() (4 input parameters) Name: DrawTexture Return type: void Description: Draw a Texture2D @@ -3435,14 +3487,14 @@ Function 387: DrawTexture() (4 input parameters) Param[2]: posX (type: int) Param[3]: posY (type: int) Param[4]: tint (type: Color) -Function 388: DrawTextureV() (3 input parameters) +Function 394: DrawTextureV() (3 input parameters) Name: DrawTextureV Return type: void Description: Draw a Texture2D with position defined as Vector2 Param[1]: texture (type: Texture2D) Param[2]: position (type: Vector2) Param[3]: tint (type: Color) -Function 389: DrawTextureEx() (5 input parameters) +Function 395: DrawTextureEx() (5 input parameters) Name: DrawTextureEx Return type: void Description: Draw a Texture2D with rotation and scale @@ -3451,7 +3503,7 @@ Function 389: DrawTextureEx() (5 input parameters) Param[3]: rotation (type: float) Param[4]: scale (type: float) Param[5]: tint (type: Color) -Function 390: DrawTextureRec() (4 input parameters) +Function 396: DrawTextureRec() (4 input parameters) Name: DrawTextureRec Return type: void Description: Draw a part of a texture defined by a rectangle @@ -3459,7 +3511,7 @@ Function 390: DrawTextureRec() (4 input parameters) Param[2]: rec (type: Rectangle) Param[3]: position (type: Vector2) Param[4]: tint (type: Color) -Function 391: DrawTexturePro() (6 input parameters) +Function 397: DrawTexturePro() (6 input parameters) Name: DrawTexturePro Return type: void Description: Draw a part of a texture defined by a source rectangle to destination rectangle, with scaling and rotation @@ -3469,7 +3521,7 @@ Function 391: DrawTexturePro() (6 input parameters) Param[4]: origin (type: Vector2) Param[5]: rotation (type: float) Param[6]: tint (type: Color) -Function 392: DrawTextureNPatch() (6 input parameters) +Function 398: DrawTextureNPatch() (6 input parameters) Name: DrawTextureNPatch Return type: void Description: Draw a texture (or part of it) that stretches or shrinks nicely @@ -3479,119 +3531,119 @@ Function 392: DrawTextureNPatch() (6 input parameters) Param[4]: origin (type: Vector2) Param[5]: rotation (type: float) Param[6]: tint (type: Color) -Function 393: ColorIsEqual() (2 input parameters) +Function 399: ColorIsEqual() (2 input parameters) Name: ColorIsEqual Return type: bool Description: Check if two colors are equal Param[1]: col1 (type: Color) Param[2]: col2 (type: Color) -Function 394: Fade() (2 input parameters) +Function 400: Fade() (2 input parameters) Name: Fade Return type: Color Description: Get color with alpha applied, alpha goes from 0.0f to 1.0f Param[1]: color (type: Color) Param[2]: alpha (type: float) -Function 395: ColorToInt() (1 input parameters) +Function 401: ColorToInt() (1 input parameters) Name: ColorToInt Return type: int Description: Get hexadecimal value for a Color (0xRRGGBBAA) Param[1]: color (type: Color) -Function 396: ColorNormalize() (1 input parameters) +Function 402: ColorNormalize() (1 input parameters) Name: ColorNormalize Return type: Vector4 Description: Get Color normalized as float [0..1] Param[1]: color (type: Color) -Function 397: ColorFromNormalized() (1 input parameters) +Function 403: ColorFromNormalized() (1 input parameters) Name: ColorFromNormalized Return type: Color Description: Get Color from normalized values [0..1] Param[1]: normalized (type: Vector4) -Function 398: ColorToHSV() (1 input parameters) +Function 404: ColorToHSV() (1 input parameters) Name: ColorToHSV Return type: Vector3 Description: Get HSV values for a Color, hue [0..360], saturation/value [0..1] Param[1]: color (type: Color) -Function 399: ColorFromHSV() (3 input parameters) +Function 405: ColorFromHSV() (3 input parameters) Name: ColorFromHSV Return type: Color Description: Get a Color from HSV values, hue [0..360], saturation/value [0..1] Param[1]: hue (type: float) Param[2]: saturation (type: float) Param[3]: value (type: float) -Function 400: ColorTint() (2 input parameters) +Function 406: ColorTint() (2 input parameters) Name: ColorTint Return type: Color Description: Get color multiplied with another color Param[1]: color (type: Color) Param[2]: tint (type: Color) -Function 401: ColorBrightness() (2 input parameters) +Function 407: ColorBrightness() (2 input parameters) Name: ColorBrightness Return type: Color Description: Get color with brightness correction, brightness factor goes from -1.0f to 1.0f Param[1]: color (type: Color) Param[2]: factor (type: float) -Function 402: ColorContrast() (2 input parameters) +Function 408: ColorContrast() (2 input parameters) Name: ColorContrast Return type: Color Description: Get color with contrast correction, contrast values between -1.0f and 1.0f Param[1]: color (type: Color) Param[2]: contrast (type: float) -Function 403: ColorAlpha() (2 input parameters) +Function 409: ColorAlpha() (2 input parameters) Name: ColorAlpha Return type: Color Description: Get color with alpha applied, alpha goes from 0.0f to 1.0f Param[1]: color (type: Color) Param[2]: alpha (type: float) -Function 404: ColorAlphaBlend() (3 input parameters) +Function 410: ColorAlphaBlend() (3 input parameters) Name: ColorAlphaBlend Return type: Color Description: Get src alpha-blended into dst color with tint Param[1]: dst (type: Color) Param[2]: src (type: Color) Param[3]: tint (type: Color) -Function 405: ColorLerp() (3 input parameters) +Function 411: ColorLerp() (3 input parameters) Name: ColorLerp Return type: Color Description: Get color lerp interpolation between two colors, factor [0.0f..1.0f] Param[1]: color1 (type: Color) Param[2]: color2 (type: Color) Param[3]: factor (type: float) -Function 406: GetColor() (1 input parameters) +Function 412: GetColor() (1 input parameters) Name: GetColor Return type: Color Description: Get Color structure from hexadecimal value Param[1]: hexValue (type: unsigned int) -Function 407: GetPixelColor() (2 input parameters) +Function 413: GetPixelColor() (2 input parameters) Name: GetPixelColor Return type: Color Description: Get Color from a source pixel pointer of certain format Param[1]: srcPtr (type: const void *) Param[2]: format (type: int) -Function 408: SetPixelColor() (3 input parameters) +Function 414: SetPixelColor() (3 input parameters) Name: SetPixelColor Return type: void Description: Set color formatted into destination pixel pointer Param[1]: dstPtr (type: void *) Param[2]: color (type: Color) Param[3]: format (type: int) -Function 409: GetPixelDataSize() (3 input parameters) +Function 415: GetPixelDataSize() (3 input parameters) Name: GetPixelDataSize Return type: int Description: Get pixel data size in bytes for certain format Param[1]: width (type: int) Param[2]: height (type: int) Param[3]: format (type: int) -Function 410: GetFontDefault() (0 input parameters) +Function 416: GetFontDefault() (0 input parameters) Name: GetFontDefault Return type: Font Description: Get the default Font No input parameters -Function 411: LoadFont() (1 input parameters) +Function 417: LoadFont() (1 input parameters) Name: LoadFont Return type: Font Description: Load font from file into GPU memory (VRAM) Param[1]: fileName (type: const char *) -Function 412: LoadFontEx() (4 input parameters) +Function 418: LoadFontEx() (4 input parameters) Name: LoadFontEx Return type: Font Description: Load font from file with defined codepoints and generation size, use NULL for codepoints and 0 for codepointCount to load the default character set, font size is provided in pixels height @@ -3599,14 +3651,14 @@ Function 412: LoadFontEx() (4 input parameters) Param[2]: fontSize (type: int) Param[3]: codepoints (type: const int *) Param[4]: codepointCount (type: int) -Function 413: LoadFontFromImage() (3 input parameters) +Function 419: LoadFontFromImage() (3 input parameters) Name: LoadFontFromImage Return type: Font Description: Load font from Image (XNA style) Param[1]: image (type: Image) Param[2]: key (type: Color) Param[3]: firstChar (type: int) -Function 414: LoadFontFromMemory() (6 input parameters) +Function 420: LoadFontFromMemory() (6 input parameters) Name: LoadFontFromMemory Return type: Font Description: Load font from memory buffer, fileType refers to extension: i.e. '.ttf' @@ -3616,12 +3668,12 @@ Function 414: LoadFontFromMemory() (6 input parameters) Param[4]: fontSize (type: int) Param[5]: codepoints (type: const int *) Param[6]: codepointCount (type: int) -Function 415: IsFontValid() (1 input parameters) +Function 421: IsFontValid() (1 input parameters) Name: IsFontValid Return type: bool Description: Check if font is valid (font data loaded, WARNING: GPU texture not checked) Param[1]: font (type: Font) -Function 416: LoadFontData() (7 input parameters) +Function 422: LoadFontData() (7 input parameters) Name: LoadFontData Return type: GlyphInfo * Description: Load font data for further use @@ -3632,7 +3684,7 @@ Function 416: LoadFontData() (7 input parameters) Param[5]: codepointCount (type: int) Param[6]: type (type: int) Param[7]: glyphCount (type: int *) -Function 417: GenImageFontAtlas() (6 input parameters) +Function 423: GenImageFontAtlas() (6 input parameters) Name: GenImageFontAtlas Return type: Image Description: Generate image font atlas using chars info @@ -3642,30 +3694,30 @@ Function 417: GenImageFontAtlas() (6 input parameters) Param[4]: fontSize (type: int) Param[5]: padding (type: int) Param[6]: packMethod (type: int) -Function 418: UnloadFontData() (2 input parameters) +Function 424: UnloadFontData() (2 input parameters) Name: UnloadFontData Return type: void Description: Unload font chars info data (RAM) Param[1]: glyphs (type: GlyphInfo *) Param[2]: glyphCount (type: int) -Function 419: UnloadFont() (1 input parameters) +Function 425: UnloadFont() (1 input parameters) Name: UnloadFont Return type: void Description: Unload font from GPU memory (VRAM) Param[1]: font (type: Font) -Function 420: ExportFontAsCode() (2 input parameters) +Function 426: ExportFontAsCode() (2 input parameters) Name: ExportFontAsCode Return type: bool Description: Export font as code file, returns true on success Param[1]: font (type: Font) Param[2]: fileName (type: const char *) -Function 421: DrawFPS() (2 input parameters) +Function 427: DrawFPS() (2 input parameters) Name: DrawFPS Return type: void Description: Draw current FPS Param[1]: posX (type: int) Param[2]: posY (type: int) -Function 422: DrawText() (5 input parameters) +Function 428: DrawText() (5 input parameters) Name: DrawText Return type: void Description: Draw text (using default font) @@ -3674,7 +3726,7 @@ Function 422: DrawText() (5 input parameters) Param[3]: posY (type: int) Param[4]: fontSize (type: int) Param[5]: color (type: Color) -Function 423: DrawTextEx() (6 input parameters) +Function 429: DrawTextEx() (6 input parameters) Name: DrawTextEx Return type: void Description: Draw text using font and additional parameters @@ -3684,7 +3736,7 @@ Function 423: DrawTextEx() (6 input parameters) Param[4]: fontSize (type: float) Param[5]: spacing (type: float) Param[6]: tint (type: Color) -Function 424: DrawTextPro() (8 input parameters) +Function 430: DrawTextPro() (8 input parameters) Name: DrawTextPro Return type: void Description: Draw text using Font and pro parameters (rotation) @@ -3696,7 +3748,7 @@ Function 424: DrawTextPro() (8 input parameters) Param[6]: fontSize (type: float) Param[7]: spacing (type: float) Param[8]: tint (type: Color) -Function 425: DrawTextCodepoint() (5 input parameters) +Function 431: DrawTextCodepoint() (5 input parameters) Name: DrawTextCodepoint Return type: void Description: Draw one character (codepoint) @@ -3705,7 +3757,7 @@ Function 425: DrawTextCodepoint() (5 input parameters) Param[3]: position (type: Vector2) Param[4]: fontSize (type: float) Param[5]: tint (type: Color) -Function 426: DrawTextCodepoints() (7 input parameters) +Function 432: DrawTextCodepoints() (7 input parameters) Name: DrawTextCodepoints Return type: void Description: Draw multiple characters (codepoint) @@ -3716,18 +3768,18 @@ Function 426: DrawTextCodepoints() (7 input parameters) Param[5]: fontSize (type: float) Param[6]: spacing (type: float) Param[7]: tint (type: Color) -Function 427: SetTextLineSpacing() (1 input parameters) +Function 433: SetTextLineSpacing() (1 input parameters) Name: SetTextLineSpacing Return type: void Description: Set vertical line spacing when drawing with line-breaks Param[1]: spacing (type: int) -Function 428: MeasureText() (2 input parameters) +Function 434: MeasureText() (2 input parameters) Name: MeasureText Return type: int Description: Measure string width for default font Param[1]: text (type: const char *) Param[2]: fontSize (type: int) -Function 429: MeasureTextEx() (4 input parameters) +Function 435: MeasureTextEx() (4 input parameters) Name: MeasureTextEx Return type: Vector2 Description: Measure string size for Font @@ -3735,7 +3787,7 @@ Function 429: MeasureTextEx() (4 input parameters) Param[2]: text (type: const char *) Param[3]: fontSize (type: float) Param[4]: spacing (type: float) -Function 430: MeasureTextCodepoints() (5 input parameters) +Function 436: MeasureTextCodepoints() (5 input parameters) Name: MeasureTextCodepoints Return type: Vector2 Description: Measure string size for an existing array of codepoints for Font @@ -3744,144 +3796,144 @@ Function 430: MeasureTextCodepoints() (5 input parameters) Param[3]: length (type: int) Param[4]: fontSize (type: float) Param[5]: spacing (type: float) -Function 431: GetGlyphIndex() (2 input parameters) +Function 437: GetGlyphIndex() (2 input parameters) Name: GetGlyphIndex Return type: int Description: Get glyph index position in font for a codepoint (unicode character), fallback to '?' if not found Param[1]: font (type: Font) Param[2]: codepoint (type: int) -Function 432: GetGlyphInfo() (2 input parameters) +Function 438: GetGlyphInfo() (2 input parameters) Name: GetGlyphInfo Return type: GlyphInfo Description: Get glyph font info data for a codepoint (unicode character), fallback to '?' if not found Param[1]: font (type: Font) Param[2]: codepoint (type: int) -Function 433: GetGlyphAtlasRec() (2 input parameters) +Function 439: GetGlyphAtlasRec() (2 input parameters) Name: GetGlyphAtlasRec Return type: Rectangle Description: Get glyph rectangle in font atlas for a codepoint (unicode character), fallback to '?' if not found Param[1]: font (type: Font) Param[2]: codepoint (type: int) -Function 434: LoadUTF8() (2 input parameters) +Function 440: LoadUTF8() (2 input parameters) Name: LoadUTF8 Return type: char * Description: Load UTF-8 text encoded from codepoints array Param[1]: codepoints (type: const int *) Param[2]: length (type: int) -Function 435: UnloadUTF8() (1 input parameters) +Function 441: UnloadUTF8() (1 input parameters) Name: UnloadUTF8 Return type: void Description: Unload UTF-8 text encoded from codepoints array Param[1]: text (type: char *) -Function 436: LoadCodepoints() (2 input parameters) +Function 442: LoadCodepoints() (2 input parameters) Name: LoadCodepoints Return type: int * Description: Load all codepoints from a UTF-8 text string, codepoints count returned by parameter Param[1]: text (type: const char *) Param[2]: count (type: int *) -Function 437: UnloadCodepoints() (1 input parameters) +Function 443: UnloadCodepoints() (1 input parameters) Name: UnloadCodepoints Return type: void Description: Unload codepoints data from memory Param[1]: codepoints (type: int *) -Function 438: GetCodepointCount() (1 input parameters) +Function 444: GetCodepointCount() (1 input parameters) Name: GetCodepointCount Return type: int Description: Get total number of codepoints in a UTF-8 encoded string Param[1]: text (type: const char *) -Function 439: GetCodepoint() (2 input parameters) +Function 445: GetCodepoint() (2 input parameters) Name: GetCodepoint Return type: int Description: Get next codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure Param[1]: text (type: const char *) Param[2]: codepointSize (type: int *) -Function 440: GetCodepointNext() (2 input parameters) +Function 446: GetCodepointNext() (2 input parameters) Name: GetCodepointNext Return type: int Description: Get next codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure Param[1]: text (type: const char *) Param[2]: codepointSize (type: int *) -Function 441: GetCodepointPrevious() (2 input parameters) +Function 447: GetCodepointPrevious() (2 input parameters) Name: GetCodepointPrevious Return type: int Description: Get previous codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure Param[1]: text (type: const char *) Param[2]: codepointSize (type: int *) -Function 442: CodepointToUTF8() (2 input parameters) +Function 448: CodepointToUTF8() (2 input parameters) Name: CodepointToUTF8 Return type: const char * Description: Encode one codepoint into UTF-8 byte array (array length returned as parameter) Param[1]: codepoint (type: int) Param[2]: utf8Size (type: int *) -Function 443: LoadTextLines() (2 input parameters) +Function 449: LoadTextLines() (2 input parameters) Name: LoadTextLines Return type: char ** Description: Load text as separate lines ('\n') Param[1]: text (type: const char *) Param[2]: count (type: int *) -Function 444: UnloadTextLines() (2 input parameters) +Function 450: UnloadTextLines() (2 input parameters) Name: UnloadTextLines Return type: void Description: Unload text lines Param[1]: text (type: char **) Param[2]: lineCount (type: int) -Function 445: TextCopy() (2 input parameters) +Function 451: TextCopy() (2 input parameters) Name: TextCopy Return type: int Description: Copy one string to another, returns bytes copied Param[1]: dst (type: char *) Param[2]: src (type: const char *) -Function 446: TextIsEqual() (2 input parameters) +Function 452: TextIsEqual() (2 input parameters) Name: TextIsEqual Return type: bool Description: Check if two text strings are equal Param[1]: text1 (type: const char *) Param[2]: text2 (type: const char *) -Function 447: TextLength() (1 input parameters) +Function 453: TextLength() (1 input parameters) Name: TextLength Return type: unsigned int Description: Get text length, checks for '\0' ending Param[1]: text (type: const char *) -Function 448: TextFormat() (2 input parameters) +Function 454: TextFormat() (2 input parameters) Name: TextFormat Return type: const char * Description: Text formatting with variables (sprintf() style) Param[1]: text (type: const char *) Param[2]: args (type: ...) -Function 449: TextSubtext() (3 input parameters) +Function 455: TextSubtext() (3 input parameters) Name: TextSubtext Return type: const char * Description: Get a piece of a text string Param[1]: text (type: const char *) Param[2]: position (type: int) Param[3]: length (type: int) -Function 450: TextRemoveSpaces() (1 input parameters) +Function 456: TextRemoveSpaces() (1 input parameters) Name: TextRemoveSpaces Return type: const char * Description: Remove text spaces, concat words Param[1]: text (type: const char *) -Function 451: GetTextBetween() (3 input parameters) +Function 457: GetTextBetween() (3 input parameters) Name: GetTextBetween Return type: char * Description: Get text between two strings Param[1]: text (type: const char *) Param[2]: begin (type: const char *) Param[3]: end (type: const char *) -Function 452: TextReplace() (3 input parameters) +Function 458: TextReplace() (3 input parameters) Name: TextReplace Return type: char * Description: Replace text string with new string Param[1]: text (type: const char *) Param[2]: search (type: const char *) Param[3]: replacement (type: const char *) -Function 453: TextReplaceAlloc() (3 input parameters) +Function 459: TextReplaceAlloc() (3 input parameters) Name: TextReplaceAlloc Return type: char * Description: Replace text string with new string, memory must be MemFree() Param[1]: text (type: const char *) Param[2]: search (type: const char *) Param[3]: replacement (type: const char *) -Function 454: TextReplaceBetween() (4 input parameters) +Function 460: TextReplaceBetween() (4 input parameters) Name: TextReplaceBetween Return type: char * Description: Replace text between two specific strings @@ -3889,7 +3941,7 @@ Function 454: TextReplaceBetween() (4 input parameters) Param[2]: begin (type: const char *) Param[3]: end (type: const char *) Param[4]: replacement (type: const char *) -Function 455: TextReplaceBetweenAlloc() (4 input parameters) +Function 461: TextReplaceBetweenAlloc() (4 input parameters) Name: TextReplaceBetweenAlloc Return type: char * Description: Replace text between two specific strings, memory must be MemFree() @@ -3897,96 +3949,96 @@ Function 455: TextReplaceBetweenAlloc() (4 input parameters) Param[2]: begin (type: const char *) Param[3]: end (type: const char *) Param[4]: replacement (type: const char *) -Function 456: TextInsert() (3 input parameters) +Function 462: TextInsert() (3 input parameters) Name: TextInsert Return type: char * Description: Insert text in a defined byte position Param[1]: text (type: const char *) Param[2]: insert (type: const char *) Param[3]: position (type: int) -Function 457: TextInsertAlloc() (3 input parameters) +Function 463: TextInsertAlloc() (3 input parameters) Name: TextInsertAlloc Return type: char * Description: Insert text in a defined byte position, memory must be MemFree() Param[1]: text (type: const char *) Param[2]: insert (type: const char *) Param[3]: position (type: int) -Function 458: TextJoin() (3 input parameters) +Function 464: TextJoin() (3 input parameters) Name: TextJoin Return type: char * Description: Join text strings with delimiter Param[1]: textList (type: char **) Param[2]: count (type: int) Param[3]: delimiter (type: const char *) -Function 459: TextSplit() (3 input parameters) +Function 465: TextSplit() (3 input parameters) Name: TextSplit Return type: char ** Description: Split text into multiple strings, using MAX_TEXTSPLIT_COUNT static strings Param[1]: text (type: const char *) Param[2]: delimiter (type: char) Param[3]: count (type: int *) -Function 460: TextAppend() (3 input parameters) +Function 466: TextAppend() (3 input parameters) Name: TextAppend Return type: void Description: Append text at specific position and move cursor Param[1]: text (type: char *) Param[2]: append (type: const char *) Param[3]: position (type: int *) -Function 461: TextFindIndex() (2 input parameters) +Function 467: TextFindIndex() (2 input parameters) Name: TextFindIndex Return type: int Description: Find first text occurrence within a string, -1 if not found Param[1]: text (type: const char *) Param[2]: search (type: const char *) -Function 462: TextToUpper() (1 input parameters) +Function 468: TextToUpper() (1 input parameters) Name: TextToUpper Return type: char * Description: Get upper case version of provided string Param[1]: text (type: const char *) -Function 463: TextToLower() (1 input parameters) +Function 469: TextToLower() (1 input parameters) Name: TextToLower Return type: char * Description: Get lower case version of provided string Param[1]: text (type: const char *) -Function 464: TextToPascal() (1 input parameters) +Function 470: TextToPascal() (1 input parameters) Name: TextToPascal Return type: char * Description: Get Pascal case notation version of provided string Param[1]: text (type: const char *) -Function 465: TextToSnake() (1 input parameters) +Function 471: TextToSnake() (1 input parameters) Name: TextToSnake Return type: char * Description: Get Snake case notation version of provided string Param[1]: text (type: const char *) -Function 466: TextToCamel() (1 input parameters) +Function 472: TextToCamel() (1 input parameters) Name: TextToCamel Return type: char * Description: Get Camel case notation version of provided string Param[1]: text (type: const char *) -Function 467: TextToInteger() (1 input parameters) +Function 473: TextToInteger() (1 input parameters) Name: TextToInteger Return type: int Description: Get integer value from text Param[1]: text (type: const char *) -Function 468: TextToFloat() (1 input parameters) +Function 474: TextToFloat() (1 input parameters) Name: TextToFloat Return type: float Description: Get float value from text Param[1]: text (type: const char *) -Function 469: DrawLine3D() (3 input parameters) +Function 475: DrawLine3D() (3 input parameters) Name: DrawLine3D Return type: void Description: Draw a line in 3D world space Param[1]: startPos (type: Vector3) Param[2]: endPos (type: Vector3) Param[3]: color (type: Color) -Function 470: DrawPoint3D() (2 input parameters) +Function 476: DrawPoint3D() (2 input parameters) Name: DrawPoint3D Return type: void Description: Draw a point in 3D space, actually a small line Param[1]: position (type: Vector3) Param[2]: color (type: Color) -Function 471: DrawCircle3D() (5 input parameters) +Function 477: DrawCircle3D() (5 input parameters) Name: DrawCircle3D Return type: void Description: Draw a circle in 3D world space @@ -3995,7 +4047,7 @@ Function 471: DrawCircle3D() (5 input parameters) Param[3]: rotationAxis (type: Vector3) Param[4]: rotationAngle (type: float) Param[5]: color (type: Color) -Function 472: DrawTriangle3D() (4 input parameters) +Function 478: DrawTriangle3D() (4 input parameters) Name: DrawTriangle3D Return type: void Description: Draw a color-filled triangle, counter-clockwise vertex order @@ -4003,14 +4055,14 @@ Function 472: DrawTriangle3D() (4 input parameters) Param[2]: v2 (type: Vector3) Param[3]: v3 (type: Vector3) Param[4]: color (type: Color) -Function 473: DrawTriangleStrip3D() (3 input parameters) +Function 479: DrawTriangleStrip3D() (3 input parameters) Name: DrawTriangleStrip3D Return type: void Description: Draw a triangle strip defined by points Param[1]: points (type: const Vector3 *) Param[2]: pointCount (type: int) Param[3]: color (type: Color) -Function 474: DrawCube() (5 input parameters) +Function 480: DrawCube() (5 input parameters) Name: DrawCube Return type: void Description: Draw cube @@ -4019,14 +4071,14 @@ Function 474: DrawCube() (5 input parameters) Param[3]: height (type: float) Param[4]: length (type: float) Param[5]: color (type: Color) -Function 475: DrawCubeV() (3 input parameters) +Function 481: DrawCubeV() (3 input parameters) Name: DrawCubeV Return type: void Description: Draw cube (Vector version) Param[1]: position (type: Vector3) Param[2]: size (type: Vector3) Param[3]: color (type: Color) -Function 476: DrawCubeWires() (5 input parameters) +Function 482: DrawCubeWires() (5 input parameters) Name: DrawCubeWires Return type: void Description: Draw cube wires @@ -4035,21 +4087,21 @@ Function 476: DrawCubeWires() (5 input parameters) Param[3]: height (type: float) Param[4]: length (type: float) Param[5]: color (type: Color) -Function 477: DrawCubeWiresV() (3 input parameters) +Function 483: DrawCubeWiresV() (3 input parameters) Name: DrawCubeWiresV Return type: void Description: Draw cube wires (Vector version) Param[1]: position (type: Vector3) Param[2]: size (type: Vector3) Param[3]: color (type: Color) -Function 478: DrawSphere() (3 input parameters) +Function 484: DrawSphere() (3 input parameters) Name: DrawSphere Return type: void Description: Draw sphere Param[1]: centerPos (type: Vector3) Param[2]: radius (type: float) Param[3]: color (type: Color) -Function 479: DrawSphereEx() (5 input parameters) +Function 485: DrawSphereEx() (5 input parameters) Name: DrawSphereEx Return type: void Description: Draw sphere with defined rings and slices @@ -4058,7 +4110,7 @@ Function 479: DrawSphereEx() (5 input parameters) Param[3]: rings (type: int) Param[4]: slices (type: int) Param[5]: color (type: Color) -Function 480: DrawSphereWires() (5 input parameters) +Function 486: DrawSphereWires() (5 input parameters) Name: DrawSphereWires Return type: void Description: Draw sphere wires @@ -4067,7 +4119,7 @@ Function 480: DrawSphereWires() (5 input parameters) Param[3]: rings (type: int) Param[4]: slices (type: int) Param[5]: color (type: Color) -Function 481: DrawCylinder() (6 input parameters) +Function 487: DrawCylinder() (6 input parameters) Name: DrawCylinder Return type: void Description: Draw a cylinder/cone @@ -4077,7 +4129,7 @@ Function 481: DrawCylinder() (6 input parameters) Param[4]: height (type: float) Param[5]: sides (type: int) Param[6]: color (type: Color) -Function 482: DrawCylinderEx() (6 input parameters) +Function 488: DrawCylinderEx() (6 input parameters) Name: DrawCylinderEx Return type: void Description: Draw a cylinder with base at startPos and top at endPos @@ -4087,7 +4139,7 @@ Function 482: DrawCylinderEx() (6 input parameters) Param[4]: endRadius (type: float) Param[5]: sides (type: int) Param[6]: color (type: Color) -Function 483: DrawCylinderWires() (6 input parameters) +Function 489: DrawCylinderWires() (6 input parameters) Name: DrawCylinderWires Return type: void Description: Draw a cylinder/cone wires @@ -4097,7 +4149,7 @@ Function 483: DrawCylinderWires() (6 input parameters) Param[4]: height (type: float) Param[5]: sides (type: int) Param[6]: color (type: Color) -Function 484: DrawCylinderWiresEx() (6 input parameters) +Function 490: DrawCylinderWiresEx() (6 input parameters) Name: DrawCylinderWiresEx Return type: void Description: Draw a cylinder wires with base at startPos and top at endPos @@ -4107,7 +4159,7 @@ Function 484: DrawCylinderWiresEx() (6 input parameters) Param[4]: endRadius (type: float) Param[5]: sides (type: int) Param[6]: color (type: Color) -Function 485: DrawCapsule() (6 input parameters) +Function 491: DrawCapsule() (6 input parameters) Name: DrawCapsule Return type: void Description: Draw a capsule with the center of its sphere caps at startPos and endPos @@ -4117,7 +4169,7 @@ Function 485: DrawCapsule() (6 input parameters) Param[4]: rings (type: int) Param[5]: slices (type: int) Param[6]: color (type: Color) -Function 486: DrawCapsuleWires() (6 input parameters) +Function 492: DrawCapsuleWires() (6 input parameters) Name: DrawCapsuleWires Return type: void Description: Draw capsule wireframe with the center of its sphere caps at startPos and endPos @@ -4127,51 +4179,51 @@ Function 486: DrawCapsuleWires() (6 input parameters) Param[4]: rings (type: int) Param[5]: slices (type: int) Param[6]: color (type: Color) -Function 487: DrawPlane() (3 input parameters) +Function 493: DrawPlane() (3 input parameters) Name: DrawPlane Return type: void Description: Draw a plane XZ Param[1]: centerPos (type: Vector3) Param[2]: size (type: Vector2) Param[3]: color (type: Color) -Function 488: DrawRay() (2 input parameters) +Function 494: DrawRay() (2 input parameters) Name: DrawRay Return type: void Description: Draw a ray line Param[1]: ray (type: Ray) Param[2]: color (type: Color) -Function 489: DrawGrid() (2 input parameters) +Function 495: DrawGrid() (2 input parameters) Name: DrawGrid Return type: void Description: Draw a grid (centered at (0, 0, 0)) Param[1]: slices (type: int) Param[2]: spacing (type: float) -Function 490: LoadModel() (1 input parameters) +Function 496: LoadModel() (1 input parameters) Name: LoadModel Return type: Model Description: Load model from files (meshes and materials) Param[1]: fileName (type: const char *) -Function 491: LoadModelFromMesh() (1 input parameters) +Function 497: LoadModelFromMesh() (1 input parameters) Name: LoadModelFromMesh Return type: Model Description: Load model from generated mesh (default material) Param[1]: mesh (type: Mesh) -Function 492: IsModelValid() (1 input parameters) +Function 498: IsModelValid() (1 input parameters) Name: IsModelValid Return type: bool Description: Check if model is valid (loaded in GPU, VAO/VBOs) Param[1]: model (type: Model) -Function 493: UnloadModel() (1 input parameters) +Function 499: UnloadModel() (1 input parameters) Name: UnloadModel Return type: void Description: Unload model (including meshes) from memory (RAM and/or VRAM) Param[1]: model (type: Model) -Function 494: GetModelBoundingBox() (1 input parameters) +Function 500: GetModelBoundingBox() (1 input parameters) Name: GetModelBoundingBox Return type: BoundingBox Description: Compute model bounding box limits (considers all meshes) Param[1]: model (type: Model) -Function 495: DrawModel() (4 input parameters) +Function 501: DrawModel() (4 input parameters) Name: DrawModel Return type: void Description: Draw a model (with texture if set) @@ -4179,7 +4231,7 @@ Function 495: DrawModel() (4 input parameters) Param[2]: position (type: Vector3) Param[3]: scale (type: float) Param[4]: tint (type: Color) -Function 496: DrawModelEx() (6 input parameters) +Function 502: DrawModelEx() (6 input parameters) Name: DrawModelEx Return type: void Description: Draw a model with custom transform @@ -4189,7 +4241,7 @@ Function 496: DrawModelEx() (6 input parameters) Param[4]: rotationAngle (type: float) Param[5]: scale (type: Vector3) Param[6]: tint (type: Color) -Function 497: DrawModelWires() (4 input parameters) +Function 503: DrawModelWires() (4 input parameters) Name: DrawModelWires Return type: void Description: Draw a model wires (with texture if set) @@ -4197,7 +4249,7 @@ Function 497: DrawModelWires() (4 input parameters) Param[2]: position (type: Vector3) Param[3]: scale (type: float) Param[4]: tint (type: Color) -Function 498: DrawModelWiresEx() (6 input parameters) +Function 504: DrawModelWiresEx() (6 input parameters) Name: DrawModelWiresEx Return type: void Description: Draw a model wires with custom transform @@ -4207,13 +4259,13 @@ Function 498: DrawModelWiresEx() (6 input parameters) Param[4]: rotationAngle (type: float) Param[5]: scale (type: Vector3) Param[6]: tint (type: Color) -Function 499: DrawBoundingBox() (2 input parameters) +Function 505: DrawBoundingBox() (2 input parameters) Name: DrawBoundingBox Return type: void Description: Draw bounding box (wires) Param[1]: box (type: BoundingBox) Param[2]: color (type: Color) -Function 500: DrawBillboard() (5 input parameters) +Function 506: DrawBillboard() (5 input parameters) Name: DrawBillboard Return type: void Description: Draw a billboard texture @@ -4222,7 +4274,7 @@ Function 500: DrawBillboard() (5 input parameters) Param[3]: position (type: Vector3) Param[4]: scale (type: float) Param[5]: tint (type: Color) -Function 501: DrawBillboardRec() (6 input parameters) +Function 507: DrawBillboardRec() (6 input parameters) Name: DrawBillboardRec Return type: void Description: Draw a billboard texture defined by rectangle @@ -4232,7 +4284,7 @@ Function 501: DrawBillboardRec() (6 input parameters) Param[4]: position (type: Vector3) Param[5]: size (type: Vector2) Param[6]: tint (type: Color) -Function 502: DrawBillboardPro() (9 input parameters) +Function 508: DrawBillboardPro() (9 input parameters) Name: DrawBillboardPro Return type: void Description: Draw a billboard texture defined by source rectangle with scaling and rotation @@ -4245,13 +4297,13 @@ Function 502: DrawBillboardPro() (9 input parameters) Param[7]: origin (type: Vector2) Param[8]: rotation (type: float) Param[9]: tint (type: Color) -Function 503: UploadMesh() (2 input parameters) +Function 509: UploadMesh() (2 input parameters) Name: UploadMesh Return type: void Description: Upload mesh vertex data in GPU and provide VAO/VBO ids Param[1]: mesh (type: Mesh *) Param[2]: dynamic (type: bool) -Function 504: UpdateMeshBuffer() (5 input parameters) +Function 510: UpdateMeshBuffer() (5 input parameters) Name: UpdateMeshBuffer Return type: void Description: Update mesh vertex data in GPU for a specific buffer index @@ -4260,19 +4312,19 @@ Function 504: UpdateMeshBuffer() (5 input parameters) Param[3]: data (type: const void *) Param[4]: dataSize (type: int) Param[5]: offset (type: int) -Function 505: UnloadMesh() (1 input parameters) +Function 511: UnloadMesh() (1 input parameters) Name: UnloadMesh Return type: void Description: Unload mesh data from CPU and GPU Param[1]: mesh (type: Mesh) -Function 506: DrawMesh() (3 input parameters) +Function 512: DrawMesh() (3 input parameters) Name: DrawMesh Return type: void Description: Draw a 3d mesh with material and transform Param[1]: mesh (type: Mesh) Param[2]: material (type: Material) Param[3]: transform (type: Matrix) -Function 507: DrawMeshInstanced() (4 input parameters) +Function 513: DrawMeshInstanced() (4 input parameters) Name: DrawMeshInstanced Return type: void Description: Draw multiple mesh instances with material and different transforms @@ -4280,35 +4332,35 @@ Function 507: DrawMeshInstanced() (4 input parameters) Param[2]: material (type: Material) Param[3]: transforms (type: const Matrix *) Param[4]: instances (type: int) -Function 508: GetMeshBoundingBox() (1 input parameters) +Function 514: GetMeshBoundingBox() (1 input parameters) Name: GetMeshBoundingBox Return type: BoundingBox Description: Compute mesh bounding box limits Param[1]: mesh (type: Mesh) -Function 509: GenMeshTangents() (1 input parameters) +Function 515: GenMeshTangents() (1 input parameters) Name: GenMeshTangents Return type: void Description: Compute mesh tangents Param[1]: mesh (type: Mesh *) -Function 510: ExportMesh() (2 input parameters) +Function 516: ExportMesh() (2 input parameters) Name: ExportMesh Return type: bool Description: Export mesh data to file, returns true on success Param[1]: mesh (type: Mesh) Param[2]: fileName (type: const char *) -Function 511: ExportMeshAsCode() (2 input parameters) +Function 517: ExportMeshAsCode() (2 input parameters) Name: ExportMeshAsCode Return type: bool Description: Export mesh as code file (.h) defining multiple arrays of vertex attributes Param[1]: mesh (type: Mesh) Param[2]: fileName (type: const char *) -Function 512: GenMeshPoly() (2 input parameters) +Function 518: GenMeshPoly() (2 input parameters) Name: GenMeshPoly Return type: Mesh Description: Generate polygonal mesh Param[1]: sides (type: int) Param[2]: radius (type: float) -Function 513: GenMeshPlane() (4 input parameters) +Function 519: GenMeshPlane() (4 input parameters) Name: GenMeshPlane Return type: Mesh Description: Generate plane mesh (with subdivisions) @@ -4316,42 +4368,42 @@ Function 513: GenMeshPlane() (4 input parameters) Param[2]: length (type: float) Param[3]: resX (type: int) Param[4]: resZ (type: int) -Function 514: GenMeshCube() (3 input parameters) +Function 520: GenMeshCube() (3 input parameters) Name: GenMeshCube Return type: Mesh Description: Generate cuboid mesh Param[1]: width (type: float) Param[2]: height (type: float) Param[3]: length (type: float) -Function 515: GenMeshSphere() (3 input parameters) +Function 521: GenMeshSphere() (3 input parameters) Name: GenMeshSphere Return type: Mesh Description: Generate sphere mesh (standard sphere) Param[1]: radius (type: float) Param[2]: rings (type: int) Param[3]: slices (type: int) -Function 516: GenMeshHemiSphere() (3 input parameters) +Function 522: GenMeshHemiSphere() (3 input parameters) Name: GenMeshHemiSphere Return type: Mesh Description: Generate half-sphere mesh (no bottom cap) Param[1]: radius (type: float) Param[2]: rings (type: int) Param[3]: slices (type: int) -Function 517: GenMeshCylinder() (3 input parameters) +Function 523: GenMeshCylinder() (3 input parameters) Name: GenMeshCylinder Return type: Mesh Description: Generate cylinder mesh Param[1]: radius (type: float) Param[2]: height (type: float) Param[3]: slices (type: int) -Function 518: GenMeshCone() (3 input parameters) +Function 524: GenMeshCone() (3 input parameters) Name: GenMeshCone Return type: Mesh Description: Generate cone/pyramid mesh Param[1]: radius (type: float) Param[2]: height (type: float) Param[3]: slices (type: int) -Function 519: GenMeshTorus() (4 input parameters) +Function 525: GenMeshTorus() (4 input parameters) Name: GenMeshTorus Return type: Mesh Description: Generate torus mesh @@ -4359,7 +4411,7 @@ Function 519: GenMeshTorus() (4 input parameters) Param[2]: size (type: float) Param[3]: radSeg (type: int) Param[4]: sides (type: int) -Function 520: GenMeshKnot() (4 input parameters) +Function 526: GenMeshKnot() (4 input parameters) Name: GenMeshKnot Return type: Mesh Description: Generate trefoil knot mesh @@ -4367,67 +4419,67 @@ Function 520: GenMeshKnot() (4 input parameters) Param[2]: size (type: float) Param[3]: radSeg (type: int) Param[4]: sides (type: int) -Function 521: GenMeshHeightmap() (2 input parameters) +Function 527: GenMeshHeightmap() (2 input parameters) Name: GenMeshHeightmap Return type: Mesh Description: Generate heightmap mesh from image data Param[1]: heightmap (type: Image) Param[2]: size (type: Vector3) -Function 522: GenMeshCubicmap() (2 input parameters) +Function 528: GenMeshCubicmap() (2 input parameters) Name: GenMeshCubicmap Return type: Mesh Description: Generate cubes-based map mesh from image data Param[1]: cubicmap (type: Image) Param[2]: cubeSize (type: Vector3) -Function 523: LoadMaterials() (2 input parameters) +Function 529: LoadMaterials() (2 input parameters) Name: LoadMaterials Return type: Material * Description: Load materials from model file Param[1]: fileName (type: const char *) Param[2]: materialCount (type: int *) -Function 524: LoadMaterialDefault() (0 input parameters) +Function 530: LoadMaterialDefault() (0 input parameters) Name: LoadMaterialDefault Return type: Material Description: Load default material (Supports: DIFFUSE, SPECULAR, NORMAL maps) No input parameters -Function 525: IsMaterialValid() (1 input parameters) +Function 531: IsMaterialValid() (1 input parameters) Name: IsMaterialValid Return type: bool Description: Check if material is valid (shader assigned, map textures loaded in GPU) Param[1]: material (type: Material) -Function 526: UnloadMaterial() (1 input parameters) +Function 532: UnloadMaterial() (1 input parameters) Name: UnloadMaterial Return type: void Description: Unload material from GPU memory (VRAM) Param[1]: material (type: Material) -Function 527: SetMaterialTexture() (3 input parameters) +Function 533: SetMaterialTexture() (3 input parameters) Name: SetMaterialTexture Return type: void Description: Set texture for a material map type (MATERIAL_MAP_DIFFUSE, MATERIAL_MAP_SPECULAR...) Param[1]: material (type: Material *) Param[2]: mapType (type: int) Param[3]: texture (type: Texture2D) -Function 528: SetModelMeshMaterial() (3 input parameters) +Function 534: SetModelMeshMaterial() (3 input parameters) Name: SetModelMeshMaterial Return type: void Description: Set material for a mesh Param[1]: model (type: Model *) Param[2]: meshId (type: int) Param[3]: materialId (type: int) -Function 529: LoadModelAnimations() (2 input parameters) +Function 535: LoadModelAnimations() (2 input parameters) Name: LoadModelAnimations Return type: ModelAnimation * Description: Load model animations from file Param[1]: fileName (type: const char *) Param[2]: animCount (type: int *) -Function 530: UpdateModelAnimation() (3 input parameters) +Function 536: UpdateModelAnimation() (3 input parameters) Name: UpdateModelAnimation Return type: void Description: Update model animation pose (vertex buffers and bone matrices) Param[1]: model (type: Model) Param[2]: anim (type: ModelAnimation) Param[3]: frame (type: float) -Function 531: UpdateModelAnimationEx() (6 input parameters) +Function 537: UpdateModelAnimationEx() (6 input parameters) Name: UpdateModelAnimationEx Return type: void Description: Update model animation pose, blending two animations @@ -4437,19 +4489,19 @@ Function 531: UpdateModelAnimationEx() (6 input parameters) Param[4]: animB (type: ModelAnimation) Param[5]: frameB (type: float) Param[6]: blend (type: float) -Function 532: UnloadModelAnimations() (2 input parameters) +Function 538: UnloadModelAnimations() (2 input parameters) Name: UnloadModelAnimations Return type: void Description: Unload animation array data Param[1]: animations (type: ModelAnimation *) Param[2]: animCount (type: int) -Function 533: IsModelAnimationValid() (2 input parameters) +Function 539: IsModelAnimationValid() (2 input parameters) Name: IsModelAnimationValid Return type: bool Description: Check model animation skeleton match Param[1]: model (type: Model) Param[2]: anim (type: ModelAnimation) -Function 534: CheckCollisionSpheres() (4 input parameters) +Function 540: CheckCollisionSpheres() (4 input parameters) Name: CheckCollisionSpheres Return type: bool Description: Check collision between two spheres @@ -4457,40 +4509,40 @@ Function 534: CheckCollisionSpheres() (4 input parameters) Param[2]: radius1 (type: float) Param[3]: center2 (type: Vector3) Param[4]: radius2 (type: float) -Function 535: CheckCollisionBoxes() (2 input parameters) +Function 541: CheckCollisionBoxes() (2 input parameters) Name: CheckCollisionBoxes Return type: bool Description: Check collision between two bounding boxes Param[1]: box1 (type: BoundingBox) Param[2]: box2 (type: BoundingBox) -Function 536: CheckCollisionBoxSphere() (3 input parameters) +Function 542: CheckCollisionBoxSphere() (3 input parameters) Name: CheckCollisionBoxSphere Return type: bool Description: Check collision between box and sphere Param[1]: box (type: BoundingBox) Param[2]: center (type: Vector3) Param[3]: radius (type: float) -Function 537: GetRayCollisionSphere() (3 input parameters) +Function 543: GetRayCollisionSphere() (3 input parameters) Name: GetRayCollisionSphere Return type: RayCollision Description: Get collision info between ray and sphere Param[1]: ray (type: Ray) Param[2]: center (type: Vector3) Param[3]: radius (type: float) -Function 538: GetRayCollisionBox() (2 input parameters) +Function 544: GetRayCollisionBox() (2 input parameters) Name: GetRayCollisionBox Return type: RayCollision Description: Get collision info between ray and box Param[1]: ray (type: Ray) Param[2]: box (type: BoundingBox) -Function 539: GetRayCollisionMesh() (3 input parameters) +Function 545: GetRayCollisionMesh() (3 input parameters) Name: GetRayCollisionMesh Return type: RayCollision Description: Get collision info between ray and mesh Param[1]: ray (type: Ray) Param[2]: mesh (type: Mesh) Param[3]: transform (type: Matrix) -Function 540: GetRayCollisionTriangle() (4 input parameters) +Function 546: GetRayCollisionTriangle() (4 input parameters) Name: GetRayCollisionTriangle Return type: RayCollision Description: Get collision info between ray and triangle @@ -4498,7 +4550,7 @@ Function 540: GetRayCollisionTriangle() (4 input parameters) Param[2]: p1 (type: Vector3) Param[3]: p2 (type: Vector3) Param[4]: p3 (type: Vector3) -Function 541: GetRayCollisionQuad() (5 input parameters) +Function 547: GetRayCollisionQuad() (5 input parameters) Name: GetRayCollisionQuad Return type: RayCollision Description: Get collision info between ray and quad @@ -4507,158 +4559,158 @@ Function 541: GetRayCollisionQuad() (5 input parameters) Param[3]: p2 (type: Vector3) Param[4]: p3 (type: Vector3) Param[5]: p4 (type: Vector3) -Function 542: InitAudioDevice() (0 input parameters) +Function 548: InitAudioDevice() (0 input parameters) Name: InitAudioDevice Return type: void Description: Initialize audio device and context No input parameters -Function 543: CloseAudioDevice() (0 input parameters) +Function 549: CloseAudioDevice() (0 input parameters) Name: CloseAudioDevice Return type: void Description: Close the audio device and context No input parameters -Function 544: IsAudioDeviceReady() (0 input parameters) +Function 550: IsAudioDeviceReady() (0 input parameters) Name: IsAudioDeviceReady Return type: bool Description: Check if audio device has been initialized successfully No input parameters -Function 545: SetMasterVolume() (1 input parameters) +Function 551: SetMasterVolume() (1 input parameters) Name: SetMasterVolume Return type: void Description: Set master volume (listener) Param[1]: volume (type: float) -Function 546: GetMasterVolume() (0 input parameters) +Function 552: GetMasterVolume() (0 input parameters) Name: GetMasterVolume Return type: float Description: Get master volume (listener) No input parameters -Function 547: LoadWave() (1 input parameters) +Function 553: LoadWave() (1 input parameters) Name: LoadWave Return type: Wave Description: Load wave data from file Param[1]: fileName (type: const char *) -Function 548: LoadWaveFromMemory() (3 input parameters) +Function 554: LoadWaveFromMemory() (3 input parameters) Name: LoadWaveFromMemory Return type: Wave Description: Load wave from memory buffer, fileType refers to extension: i.e. '.wav' Param[1]: fileType (type: const char *) Param[2]: fileData (type: const unsigned char *) Param[3]: dataSize (type: int) -Function 549: IsWaveValid() (1 input parameters) +Function 555: IsWaveValid() (1 input parameters) Name: IsWaveValid Return type: bool Description: Check if wave data is valid (data loaded and parameters) Param[1]: wave (type: Wave) -Function 550: LoadSound() (1 input parameters) +Function 556: LoadSound() (1 input parameters) Name: LoadSound Return type: Sound Description: Load sound from file Param[1]: fileName (type: const char *) -Function 551: LoadSoundFromWave() (1 input parameters) +Function 557: LoadSoundFromWave() (1 input parameters) Name: LoadSoundFromWave Return type: Sound Description: Load sound from wave data Param[1]: wave (type: Wave) -Function 552: LoadSoundAlias() (1 input parameters) +Function 558: LoadSoundAlias() (1 input parameters) Name: LoadSoundAlias Return type: Sound Description: Load sound alias, new sound that shares the same sample data as the source sound, does not own the sound data Param[1]: source (type: Sound) -Function 553: IsSoundValid() (1 input parameters) +Function 559: IsSoundValid() (1 input parameters) Name: IsSoundValid Return type: bool Description: Check if sound is valid (data loaded and buffers initialized) Param[1]: sound (type: Sound) -Function 554: UpdateSound() (3 input parameters) +Function 560: UpdateSound() (3 input parameters) Name: UpdateSound Return type: void Description: Update sound buffer with new data (default data format: 32 bit float, stereo) Param[1]: sound (type: Sound) Param[2]: data (type: const void *) Param[3]: frameCount (type: int) -Function 555: UnloadWave() (1 input parameters) +Function 561: UnloadWave() (1 input parameters) Name: UnloadWave Return type: void Description: Unload wave data Param[1]: wave (type: Wave) -Function 556: UnloadSound() (1 input parameters) +Function 562: UnloadSound() (1 input parameters) Name: UnloadSound Return type: void Description: Unload sound Param[1]: sound (type: Sound) -Function 557: UnloadSoundAlias() (1 input parameters) +Function 563: UnloadSoundAlias() (1 input parameters) Name: UnloadSoundAlias Return type: void Description: Unload sound alias (does not deallocate sample data) Param[1]: alias (type: Sound) -Function 558: ExportWave() (2 input parameters) +Function 564: ExportWave() (2 input parameters) Name: ExportWave Return type: bool Description: Export wave data to file, returns true on success Param[1]: wave (type: Wave) Param[2]: fileName (type: const char *) -Function 559: ExportWaveAsCode() (2 input parameters) +Function 565: ExportWaveAsCode() (2 input parameters) Name: ExportWaveAsCode Return type: bool Description: Export wave sample data to code (.h), returns true on success Param[1]: wave (type: Wave) Param[2]: fileName (type: const char *) -Function 560: PlaySound() (1 input parameters) +Function 566: PlaySound() (1 input parameters) Name: PlaySound Return type: void Description: Play a sound Param[1]: sound (type: Sound) -Function 561: StopSound() (1 input parameters) +Function 567: StopSound() (1 input parameters) Name: StopSound Return type: void Description: Stop playing a sound Param[1]: sound (type: Sound) -Function 562: PauseSound() (1 input parameters) +Function 568: PauseSound() (1 input parameters) Name: PauseSound Return type: void Description: Pause a sound Param[1]: sound (type: Sound) -Function 563: ResumeSound() (1 input parameters) +Function 569: ResumeSound() (1 input parameters) Name: ResumeSound Return type: void Description: Resume a paused sound Param[1]: sound (type: Sound) -Function 564: IsSoundPlaying() (1 input parameters) +Function 570: IsSoundPlaying() (1 input parameters) Name: IsSoundPlaying Return type: bool Description: Check if sound is currently playing Param[1]: sound (type: Sound) -Function 565: SetSoundVolume() (2 input parameters) +Function 571: SetSoundVolume() (2 input parameters) Name: SetSoundVolume Return type: void Description: Set volume for a sound (1.0 is max level) Param[1]: sound (type: Sound) Param[2]: volume (type: float) -Function 566: SetSoundPitch() (2 input parameters) +Function 572: SetSoundPitch() (2 input parameters) Name: SetSoundPitch Return type: void Description: Set pitch for a sound (1.0 is base level) Param[1]: sound (type: Sound) Param[2]: pitch (type: float) -Function 567: SetSoundPan() (2 input parameters) +Function 573: SetSoundPan() (2 input parameters) Name: SetSoundPan Return type: void Description: Set pan for a sound (-1.0 left, 0.0 center, 1.0 right) Param[1]: sound (type: Sound) Param[2]: pan (type: float) -Function 568: WaveCopy() (1 input parameters) +Function 574: WaveCopy() (1 input parameters) Name: WaveCopy Return type: Wave Description: Copy a wave to a new wave Param[1]: wave (type: Wave) -Function 569: WaveCrop() (3 input parameters) +Function 575: WaveCrop() (3 input parameters) Name: WaveCrop Return type: void Description: Crop a wave to defined frames range Param[1]: wave (type: Wave *) Param[2]: initFrame (type: int) Param[3]: finalFrame (type: int) -Function 570: WaveFormat() (4 input parameters) +Function 576: WaveFormat() (4 input parameters) Name: WaveFormat Return type: void Description: Convert wave data to desired format @@ -4666,203 +4718,203 @@ Function 570: WaveFormat() (4 input parameters) Param[2]: sampleRate (type: int) Param[3]: sampleSize (type: int) Param[4]: channels (type: int) -Function 571: LoadWaveSamples() (1 input parameters) +Function 577: LoadWaveSamples() (1 input parameters) Name: LoadWaveSamples Return type: float * Description: Load samples data from wave as a 32bit float data array Param[1]: wave (type: Wave) -Function 572: UnloadWaveSamples() (1 input parameters) +Function 578: UnloadWaveSamples() (1 input parameters) Name: UnloadWaveSamples Return type: void Description: Unload samples data loaded with LoadWaveSamples() Param[1]: samples (type: float *) -Function 573: LoadMusicStream() (1 input parameters) +Function 579: LoadMusicStream() (1 input parameters) Name: LoadMusicStream Return type: Music Description: Load music stream from file Param[1]: fileName (type: const char *) -Function 574: LoadMusicStreamFromMemory() (3 input parameters) +Function 580: LoadMusicStreamFromMemory() (3 input parameters) Name: LoadMusicStreamFromMemory Return type: Music Description: Load music stream from data Param[1]: fileType (type: const char *) Param[2]: data (type: const unsigned char *) Param[3]: dataSize (type: int) -Function 575: IsMusicValid() (1 input parameters) +Function 581: IsMusicValid() (1 input parameters) Name: IsMusicValid Return type: bool Description: Check if music stream is valid (context and buffers initialized) Param[1]: music (type: Music) -Function 576: UnloadMusicStream() (1 input parameters) +Function 582: UnloadMusicStream() (1 input parameters) Name: UnloadMusicStream Return type: void Description: Unload music stream Param[1]: music (type: Music) -Function 577: PlayMusicStream() (1 input parameters) +Function 583: PlayMusicStream() (1 input parameters) Name: PlayMusicStream Return type: void Description: Start music playing Param[1]: music (type: Music) -Function 578: IsMusicStreamPlaying() (1 input parameters) +Function 584: IsMusicStreamPlaying() (1 input parameters) Name: IsMusicStreamPlaying Return type: bool Description: Check if music is playing Param[1]: music (type: Music) -Function 579: UpdateMusicStream() (1 input parameters) +Function 585: UpdateMusicStream() (1 input parameters) Name: UpdateMusicStream Return type: void Description: Update buffers for music streaming Param[1]: music (type: Music) -Function 580: StopMusicStream() (1 input parameters) +Function 586: StopMusicStream() (1 input parameters) Name: StopMusicStream Return type: void Description: Stop music playing Param[1]: music (type: Music) -Function 581: PauseMusicStream() (1 input parameters) +Function 587: PauseMusicStream() (1 input parameters) Name: PauseMusicStream Return type: void Description: Pause music playing Param[1]: music (type: Music) -Function 582: ResumeMusicStream() (1 input parameters) +Function 588: ResumeMusicStream() (1 input parameters) Name: ResumeMusicStream Return type: void Description: Resume playing paused music Param[1]: music (type: Music) -Function 583: SeekMusicStream() (2 input parameters) +Function 589: SeekMusicStream() (2 input parameters) Name: SeekMusicStream Return type: void Description: Seek music to a position (in seconds) Param[1]: music (type: Music) Param[2]: position (type: float) -Function 584: SetMusicVolume() (2 input parameters) +Function 590: SetMusicVolume() (2 input parameters) Name: SetMusicVolume Return type: void Description: Set volume for music (1.0 is max level) Param[1]: music (type: Music) Param[2]: volume (type: float) -Function 585: SetMusicPitch() (2 input parameters) +Function 591: SetMusicPitch() (2 input parameters) Name: SetMusicPitch Return type: void Description: Set pitch for music (1.0 is base level) Param[1]: music (type: Music) Param[2]: pitch (type: float) -Function 586: SetMusicPan() (2 input parameters) +Function 592: SetMusicPan() (2 input parameters) Name: SetMusicPan Return type: void Description: Set pan for music (-1.0 left, 0.0 center, 1.0 right) Param[1]: music (type: Music) Param[2]: pan (type: float) -Function 587: GetMusicTimeLength() (1 input parameters) +Function 593: GetMusicTimeLength() (1 input parameters) Name: GetMusicTimeLength Return type: float Description: Get music time length (in seconds) Param[1]: music (type: Music) -Function 588: GetMusicTimePlayed() (1 input parameters) +Function 594: GetMusicTimePlayed() (1 input parameters) Name: GetMusicTimePlayed Return type: float Description: Get current music time played (in seconds) Param[1]: music (type: Music) -Function 589: LoadAudioStream() (3 input parameters) +Function 595: LoadAudioStream() (3 input parameters) Name: LoadAudioStream Return type: AudioStream Description: Load audio stream (to stream raw audio pcm data) Param[1]: sampleRate (type: unsigned int) Param[2]: sampleSize (type: unsigned int) Param[3]: channels (type: unsigned int) -Function 590: IsAudioStreamValid() (1 input parameters) +Function 596: IsAudioStreamValid() (1 input parameters) Name: IsAudioStreamValid Return type: bool Description: Check if an audio stream is valid (buffers initialized) Param[1]: stream (type: AudioStream) -Function 591: UnloadAudioStream() (1 input parameters) +Function 597: UnloadAudioStream() (1 input parameters) Name: UnloadAudioStream Return type: void Description: Unload audio stream and free memory Param[1]: stream (type: AudioStream) -Function 592: UpdateAudioStream() (3 input parameters) +Function 598: UpdateAudioStream() (3 input parameters) Name: UpdateAudioStream Return type: void Description: Update audio stream buffers with data Param[1]: stream (type: AudioStream) Param[2]: data (type: const void *) Param[3]: frameCount (type: int) -Function 593: IsAudioStreamProcessed() (1 input parameters) +Function 599: IsAudioStreamProcessed() (1 input parameters) Name: IsAudioStreamProcessed Return type: bool Description: Check if any audio stream buffers requires refill Param[1]: stream (type: AudioStream) -Function 594: PlayAudioStream() (1 input parameters) +Function 600: PlayAudioStream() (1 input parameters) Name: PlayAudioStream Return type: void Description: Play audio stream Param[1]: stream (type: AudioStream) -Function 595: PauseAudioStream() (1 input parameters) +Function 601: PauseAudioStream() (1 input parameters) Name: PauseAudioStream Return type: void Description: Pause audio stream Param[1]: stream (type: AudioStream) -Function 596: ResumeAudioStream() (1 input parameters) +Function 602: ResumeAudioStream() (1 input parameters) Name: ResumeAudioStream Return type: void Description: Resume audio stream Param[1]: stream (type: AudioStream) -Function 597: IsAudioStreamPlaying() (1 input parameters) +Function 603: IsAudioStreamPlaying() (1 input parameters) Name: IsAudioStreamPlaying Return type: bool Description: Check if audio stream is playing Param[1]: stream (type: AudioStream) -Function 598: StopAudioStream() (1 input parameters) +Function 604: StopAudioStream() (1 input parameters) Name: StopAudioStream Return type: void Description: Stop audio stream Param[1]: stream (type: AudioStream) -Function 599: SetAudioStreamVolume() (2 input parameters) +Function 605: SetAudioStreamVolume() (2 input parameters) Name: SetAudioStreamVolume Return type: void Description: Set volume for audio stream (1.0 is max level) Param[1]: stream (type: AudioStream) Param[2]: volume (type: float) -Function 600: SetAudioStreamPitch() (2 input parameters) +Function 606: SetAudioStreamPitch() (2 input parameters) Name: SetAudioStreamPitch Return type: void Description: Set pitch for audio stream (1.0 is base level) Param[1]: stream (type: AudioStream) Param[2]: pitch (type: float) -Function 601: SetAudioStreamPan() (2 input parameters) +Function 607: SetAudioStreamPan() (2 input parameters) Name: SetAudioStreamPan Return type: void Description: Set pan for audio stream (-1.0 left, 0.0 center, 1.0 right) Param[1]: stream (type: AudioStream) Param[2]: pan (type: float) -Function 602: SetAudioStreamBufferSizeDefault() (1 input parameters) +Function 608: SetAudioStreamBufferSizeDefault() (1 input parameters) Name: SetAudioStreamBufferSizeDefault Return type: void Description: Default size for new audio streams Param[1]: size (type: int) -Function 603: SetAudioStreamCallback() (2 input parameters) +Function 609: SetAudioStreamCallback() (2 input parameters) Name: SetAudioStreamCallback Return type: void Description: Audio thread callback to request new data Param[1]: stream (type: AudioStream) Param[2]: callback (type: AudioCallback) -Function 604: AttachAudioStreamProcessor() (2 input parameters) +Function 610: AttachAudioStreamProcessor() (2 input parameters) Name: AttachAudioStreamProcessor Return type: void Description: Attach audio stream processor to stream, receives frames x 2 samples as 'float' (stereo) Param[1]: stream (type: AudioStream) Param[2]: processor (type: AudioCallback) -Function 605: DetachAudioStreamProcessor() (2 input parameters) +Function 611: DetachAudioStreamProcessor() (2 input parameters) Name: DetachAudioStreamProcessor Return type: void Description: Detach audio stream processor from stream Param[1]: stream (type: AudioStream) Param[2]: processor (type: AudioCallback) -Function 606: AttachAudioMixedProcessor() (1 input parameters) +Function 612: AttachAudioMixedProcessor() (1 input parameters) Name: AttachAudioMixedProcessor Return type: void Description: Attach audio stream processor to the entire audio pipeline, receives frames x 2 samples as 'float' (stereo) Param[1]: processor (type: AudioCallback) -Function 607: DetachAudioMixedProcessor() (1 input parameters) +Function 613: DetachAudioMixedProcessor() (1 input parameters) Name: DetachAudioMixedProcessor Return type: void Description: Detach audio stream processor from the entire audio pipeline diff --git a/tools/rlparser/output/raylib_api.xml b/tools/rlparser/output/raylib_api.xml index ec7711ee7..26066795b 100644 --- a/tools/rlparser/output/raylib_api.xml +++ b/tools/rlparser/output/raylib_api.xml @@ -201,7 +201,7 @@ - + @@ -218,7 +218,7 @@ - + @@ -681,7 +681,7 @@ - + @@ -1099,10 +1099,10 @@ - + - + @@ -1115,7 +1115,13 @@ - + + + + + + + @@ -1316,7 +1322,7 @@ - + @@ -2036,7 +2042,7 @@ - + @@ -2132,6 +2138,13 @@ + + + + + + + @@ -2146,6 +2159,14 @@ + + + + + + + + @@ -2186,6 +2207,14 @@ + + + + + + + + @@ -2219,6 +2248,17 @@ + + + + + + + + + + + diff --git a/tools/rlparser/rlparser.c b/tools/rlparser/rlparser.c index dc2afe114..a51b00b99 100644 --- a/tools/rlparser/rlparser.c +++ b/tools/rlparser/rlparser.c @@ -146,7 +146,7 @@ typedef struct FunctionInfo { } FunctionInfo; // Output format for parsed data -typedef enum { DEFAULT = 0, JSON, XML, LUA, CODE } OutputFormat; +typedef enum { DEFAULT = 0, JSON, XML, LUA, SEXPR, CODE } OutputFormat; //---------------------------------------------------------------------------------- // Global Variables Definition @@ -1062,6 +1062,7 @@ int main(int argc, char *argv[]) else if (outputFormat == JSON) printf("\nOutput format: JSON\n\n"); else if (outputFormat == XML) printf("\nOutput format: XML\n\n"); else if (outputFormat == LUA) printf("\nOutput format: LUA\n\n"); + else if (outputFormat == SEXPR) printf("\nOutput format: SEXPR\n\n"); else if (outputFormat == CODE) printf("\nOutput format: CODE\n\n"); ExportParsedData(outFileName, outputFormat); @@ -1098,10 +1099,10 @@ static void ShowCommandLineInfo(void) printf(" -i, --input : Define input header file to parse.\n"); printf(" NOTE: If not specified, defaults to: raylib.h\n\n"); printf(" -o, --output : Define output file and format.\n"); - printf(" Supported extensions: .txt, .json, .xml, .lua, .h\n"); + printf(" Supported extensions: .txt, .json, .xml, .lua, .sexpr, .h\n"); printf(" NOTE: If not specified, defaults to: raylib_api.txt\n\n"); printf(" -f, --format : Define output format for parser data.\n"); - printf(" Supported types: DEFAULT, JSON, XML, LUA, CODE\n\n"); + printf(" Supported types: DEFAULT, JSON, XML, LUA, SEXPR, CODE\n\n"); printf(" -d, --define : Define functions specifiers (i.e. RLAPI for raylib.h, RMAPI for raymath.h, etc.)\n"); printf(" NOTE: If no specifier defined, defaults to: RLAPI\n\n"); printf(" -t, --truncate : Define string to truncate input after (i.e. \"RLGL IMPLEMENTATION\" for rlgl.h)\n"); @@ -1154,6 +1155,7 @@ static void ProcessCommandLine(int argc, char *argv[]) else if (IsTextEqual(argv[i + 1], "JSON\0", 5)) outputFormat = JSON; else if (IsTextEqual(argv[i + 1], "XML\0", 4)) outputFormat = XML; else if (IsTextEqual(argv[i + 1], "LUA\0", 4)) outputFormat = LUA; + else if (IsTextEqual(argv[i + 1], "SEXPR\0", 4)) outputFormat = SEXPR; else if (IsTextEqual(argv[i + 1], "CODE\0", 5)) outputFormat = CODE; } else printf("WARNING: No format parameters provided\n"); @@ -2007,6 +2009,131 @@ static void ExportParsedData(const char *fileName, int format) fprintf(outFile, " }\n"); fprintf(outFile, "}\n"); } break; + case SEXPR: + { + fprintf(outFile, "("); + + // Print defines info + fprintf(outFile, "(defines\n"); + for (int i = 0; i < defineCount; i++) + { + if(i != 0) fprintf(outFile, "\n"); + fprintf(outFile, " ((name \"%s\")\n", defines[i].name); + fprintf(outFile, " (type \"%s\")\n", StrDefineType(defines[i].type)); + if ((defines[i].type == INT) || + (defines[i].type == LONG) || + (defines[i].type == FLOAT) || + (defines[i].type == DOUBLE) || + (defines[i].type == STRING)) + { + fprintf(outFile, " (value %s)\n", defines[i].value); + } + else + { + fprintf(outFile, " (value \"%s\")\n", defines[i].value); + } + fprintf(outFile, " (description \"%s\"))", defines[i].desc); + } + fprintf(outFile, ")\n\n"); + + // Print structs info + fprintf(outFile, " (structs\n"); + for (int i = 0; i < structCount; i++) + { + if(i != 0) fprintf(outFile, "\n\n"); + fprintf(outFile, " ((name \"%s\")\n", structs[i].name); + fprintf(outFile, " (description \"%s\")\n", EscapeBackslashes(structs[i].desc)); + fprintf(outFile, " (fields "); + for (int f = 0; f < structs[i].fieldCount; f++) + { + fprintf(outFile, "\n ((type \"%s\")\n", structs[i].fieldType[f]); + fprintf(outFile, " (name \"%s\")\n", structs[i].fieldName[f]); + fprintf(outFile, " (description \"%s\"))", EscapeBackslashes(structs[i].fieldDesc[f])); + } + fprintf(outFile, "))"); + } + fprintf(outFile, ")\n\n"); + + // Print aliases info + fprintf(outFile, " (aliases\n"); + for (int i = 0; i < aliasCount; i++) + { + if(i != 0) fprintf(outFile, "\n\n"); + fprintf(outFile, " ((type \"%s\")\n", aliases[i].type); + fprintf(outFile, " (name \"%s\")\n", aliases[i].name); + fprintf(outFile, " (description \"%s\"))", aliases[i].desc); + } + fprintf(outFile, ")\n\n"); + + // Print enums info + fprintf(outFile, " (enums\n"); + for (int i = 0; i < enumCount; i++) + { + if(i != 0) fprintf(outFile, "\n\n"); + fprintf(outFile, " ((name \"%s\")\n", enums[i].name); + fprintf(outFile, " (description \"%s\")\n", EscapeBackslashes(enums[i].desc)); + fprintf(outFile, " (values\n"); + for (int e = 0; e < enums[i].valueCount; e++) + { + if(e != 0) fprintf(outFile, "\n\n"); + fprintf(outFile, " ((name \"%s\")\n", enums[i].valueName[e]); + fprintf(outFile, " (value %i)\n", enums[i].valueInteger[e]); + fprintf(outFile, " (description \"%s\"))", EscapeBackslashes(enums[i].valueDesc[e])); + } + fprintf(outFile, "))"); + } + fprintf(outFile, ")\n\n"); + + // Print callbacks info + fprintf(outFile, " (callbacks\n"); + for (int i = 0; i < callbackCount; i++) + { + if(i != 0) fprintf(outFile, "\n\n"); + fprintf(outFile, " ((name \"%s\")\n", callbacks[i].name); + fprintf(outFile, " (description \"%s\")\n", EscapeBackslashes(callbacks[i].desc)); + fprintf(outFile, " (return-type \"%s\")", callbacks[i].retType); + + if (callbacks[i].paramCount == 0) fprintf(outFile, "\n"); + else + { + fprintf(outFile, "\n (params\n"); + for (int p = 0; p < callbacks[i].paramCount; p++) + { + if(p != 0) fprintf(outFile, "\n"); + fprintf(outFile, " ((type \"%s\") (name \"%s\"))", callbacks[i].paramType[p], callbacks[i].paramName[p]); + } + fprintf(outFile, ")"); + } + fprintf(outFile, ")"); + } + fprintf(outFile, ")\n\n"); + + // Print functions info + fprintf(outFile, " (functions\n"); + for (int i = 0; i < funcCount; i++) + { + if(i != 0) fprintf(outFile, "\n\n"); + fprintf(outFile, " ((name \"%s\")\n", funcs[i].name); + fprintf(outFile, " (description \"%s\")\n", EscapeBackslashes(funcs[i].desc)); + fprintf(outFile, " (return-type \"%s\")", funcs[i].retType); + + if (funcs[i].paramCount == 0) fprintf(outFile, ""); + else + { + fprintf(outFile, "\n (params\n"); + for (int p = 0; p < funcs[i].paramCount; p++) + { + if(p != 0) fprintf(outFile, "\n"); + fprintf(outFile, " ((type \"%s\") (name \"%s\"))", funcs[i].paramType[p], funcs[i].paramName[p]); + } + fprintf(outFile, ")"); + } + fprintf(outFile, ")"); + } + fprintf(outFile, ")"); + fprintf(outFile, ")\n"); + } break; + case CODE: default: break; }