mirror of
https://github.com/raysan5/raylib.git
synced 2026-07-17 02:51:55 -04:00
Compare commits
327 Commits
bb78e98a71
...
patch-1
| Author | SHA1 | Date | |
|---|---|---|---|
| 46b9579f0c | |||
| 8eb613e50a | |||
| 89b4fbd298 | |||
| 93e64f2210 | |||
| a9a0c046f1 | |||
| d224912bd5 | |||
| 39706cccbe | |||
| 4640c84920 | |||
| af98e3126e | |||
| e063385c47 | |||
| 7a247ff40f | |||
| 5de8c3521f | |||
| b631fb3d05 | |||
| fb4649a3fe | |||
| f00317bead | |||
| 8805ab3ee2 | |||
| ebec978443 | |||
| cfe56d97ea | |||
| 97d2b0146c | |||
| c31666fe2a | |||
| ab35e0f712 | |||
| c85cd07db0 | |||
| f458296a07 | |||
| 8df2f13962 | |||
| cba8f4286d | |||
| 86c7edfd74 | |||
| caadb48e25 | |||
| 3e9fb4757f | |||
| d159739a8b | |||
| f20f61d754 | |||
| 81b740403a | |||
| 3cb8a3d782 | |||
| f8e42cb509 | |||
| d631a5a466 | |||
| 5992929e56 | |||
| 3d640698d8 | |||
| 088177b269 | |||
| 2e03c9c266 | |||
| 65abee1cba | |||
| 1911a2827b | |||
| bb96b920d3 | |||
| 350124a45b | |||
| 5e374218ee | |||
| 9f60957b84 | |||
| 0c0375f8ae | |||
| 77ecd5befc | |||
| a7ac5c2823 | |||
| 44b16a548f | |||
| 9deaae0716 | |||
| 122e378e93 | |||
| 2c24ca1407 | |||
| 04a269f4f8 | |||
| 8999d2ba44 | |||
| 7ac798cef9 | |||
| 67359073ca | |||
| 3edfe19438 | |||
| 9215540015 | |||
| 83cb4cc210 | |||
| d1a14bee5d | |||
| ba3b8f8370 | |||
| 962bbfc6bf | |||
| b00e465deb | |||
| db0870f31f | |||
| 87a6e9693c | |||
| aaacda6e14 | |||
| f9c41a0866 | |||
| fa8aca8789 | |||
| efef4e31dd | |||
| 3973766b84 | |||
| 4d2b1d51e4 | |||
| 8713741782 | |||
| ac6526b731 | |||
| 94897c4eca | |||
| 444cc22633 | |||
| aeea213873 | |||
| 8d31d0c3cc | |||
| 9bd3d84f3d | |||
| 04b66f1965 | |||
| 7c1b9d0a32 | |||
| 02869da279 | |||
| aebfd788c7 | |||
| 26d82cf55d | |||
| d9335f6a95 | |||
| 0e7cc36567 | |||
| e57663c937 | |||
| 23433fe2dc | |||
| fefb9f4428 | |||
| 68c4b8a60f | |||
| 33b6f0f3a4 | |||
| ca0ba55050 | |||
| 236618f87b | |||
| f5ea52a2b8 | |||
| 6a6daad739 | |||
| 4724e5fec3 | |||
| d3d1b0cbcc | |||
| 20aa6cb764 | |||
| a41bb7c07a | |||
| 53ccae09cc | |||
| 869251e590 | |||
| 45f1af2bde | |||
| 15d25242be | |||
| 22509ab2d4 | |||
| 796e1ad22a | |||
| acfcf2f1d1 | |||
| ca46387b64 | |||
| fd79b81918 | |||
| 9ace148917 | |||
| a85c9f4898 | |||
| fadcd1fac5 | |||
| 1a4445f510 | |||
| fc824ff6d4 | |||
| 2c690425c9 | |||
| ee71f0f870 | |||
| e8650c1b8e | |||
| cef7718468 | |||
| 895154bcb2 | |||
| f421b74c0f | |||
| 90edc3b0a5 | |||
| f1d602029c | |||
| 10a889c482 | |||
| b7f50b2fb6 | |||
| 2ee6a76464 | |||
| f0d3e9a5c8 | |||
| 7c284cc5bc | |||
| 7b96144716 | |||
| 81c7cb6527 | |||
| 186d3ce9fb | |||
| e7edb181dc | |||
| ef8b3e6195 | |||
| 7f9ded7642 | |||
| 34b06ca587 | |||
| 4d845608b8 | |||
| eaf32c83bf | |||
| 808e6b9b20 | |||
| 7dd72e7328 | |||
| f8270483e1 | |||
| f17babfe8a | |||
| f65d5ad7a9 | |||
| 0d78f10161 | |||
| 7d5b61ce01 | |||
| b48933b096 | |||
| fd1dfd7d65 | |||
| be56f2c524 | |||
| d31c10a01e | |||
| c04e57399a | |||
| 6c090f6193 | |||
| 5ca45bce37 | |||
| 729327a078 | |||
| ea76845ecb | |||
| 5506aed190 | |||
| 43366d1c6a | |||
| f35f4b9fad | |||
| c4b4fcc17e | |||
| fbf132d1d1 | |||
| e274c195af | |||
| fd28dc5644 | |||
| 5aa3de194c | |||
| 9400199b80 | |||
| 200d344dee | |||
| 094edcd32e | |||
| a005a044da | |||
| ae315eecb9 | |||
| dcb0ca5d14 | |||
| 07b729d5d6 | |||
| cd4599b447 | |||
| b2ea5eae5e | |||
| 29ff1f02e9 | |||
| d840a100a7 | |||
| 95bfa196fd | |||
| aceb8ce3a8 | |||
| 33e889907e | |||
| 61537200c0 | |||
| 080f5c94bd | |||
| 7207c03c72 | |||
| cf9f27db54 | |||
| 0a2b81b128 | |||
| 05c15c8ba7 | |||
| d768dae402 | |||
| d580c47504 | |||
| 7b7ded566c | |||
| d9427b1e6f | |||
| da55d9067c | |||
| e5702a716f | |||
| 2dd8d7e8b1 | |||
| 168e2c43d0 | |||
| 638c1cb339 | |||
| 6a430eb834 | |||
| 3c82b48b1f | |||
| 72a341a37f | |||
| 79d5353cfd | |||
| 98efce4b0d | |||
| c9c26d8071 | |||
| 0e68f812b5 | |||
| 2752837839 | |||
| a627cd5b65 | |||
| 361dcb2a1f | |||
| 5082f5a813 | |||
| 3d2008c70b | |||
| a685b812d9 | |||
| 3b70f83c7d | |||
| a28b924f94 | |||
| 636269f6af | |||
| 826ca42d83 | |||
| 620b21bfce | |||
| 52dc7658da | |||
| 06621eb3b7 | |||
| 3b9ee2e9f3 | |||
| 6ae16c9895 | |||
| aa1100817a | |||
| 725c8b57ae | |||
| 00f3af78e3 | |||
| 3d3e6996b0 | |||
| 47bb749ce9 | |||
| ba72d25867 | |||
| 8e82249f65 | |||
| dff07d020c | |||
| 0f98d78a67 | |||
| c2ea6a38b5 | |||
| ccc0d7452a | |||
| 386eabb932 | |||
| 4ee2013169 | |||
| d892f3ba4a | |||
| 61dd488b76 | |||
| 4cae4ba9d5 | |||
| 07a056441a | |||
| 254953611e | |||
| 5608460901 | |||
| 3b23200b85 | |||
| 1c5cd35372 | |||
| e9caf5a981 | |||
| de8419cc8b | |||
| f220848896 | |||
| dbc56a87da | |||
| 932558ca7a | |||
| 7495a77a79 | |||
| a4680fc677 | |||
| d6445b55d6 | |||
| d87bf55607 | |||
| a32b53f4d6 | |||
| cc752037b9 | |||
| 90e9145978 | |||
| 9060ac7c95 | |||
| 4ced756474 | |||
| 88f8ca42f5 | |||
| 9a3283f698 | |||
| f0a043bb75 | |||
| dde8c8e07e | |||
| 1cbe438f93 | |||
| 7c96c24cf9 | |||
| d116c92f13 | |||
| 14fe0cbfd8 | |||
| 94f3c094e7 | |||
| be768e27f9 | |||
| 6ef36c0a17 | |||
| 49f88dc6ed | |||
| 86aa0950bd | |||
| 96e30549f5 | |||
| 1e43c1d372 | |||
| 21897f4bb9 | |||
| d8ebeb8939 | |||
| 82e980bd42 | |||
| 0decdcd497 | |||
| 4628915787 | |||
| dfbaafa337 | |||
| 019cc889fc | |||
| 034ffda887 | |||
| 970531d112 | |||
| 99eaf72362 | |||
| 1339ec637e | |||
| 44e5126d08 | |||
| 51d693607e | |||
| a5427bc38f | |||
| 605303f62b | |||
| b3592631b0 | |||
| ddfbe973d4 | |||
| fe5271c568 | |||
| de95b3aa70 | |||
| fbcc8cdb55 | |||
| ca6f188233 | |||
| 8e54b19d9f | |||
| e24b01bb28 | |||
| 68d519910a | |||
| 53915d77e6 | |||
| b202421e08 | |||
| 05a14456ae | |||
| c5fc771622 | |||
| d3c6f426b4 | |||
| c4bd4faab5 | |||
| 4a6ceb9c76 | |||
| 6ef0044381 | |||
| 1122add3ee | |||
| 92f82b4add | |||
| cdff3d7bea | |||
| 138ef838d9 | |||
| 6ff51d3a2a | |||
| ea6292e27a | |||
| bb7b8d70e9 | |||
| f36533cbd8 | |||
| 5c2dee0862 | |||
| 12140cd444 | |||
| 3f7f040c7e | |||
| 4799cab772 | |||
| eb4f1a6da0 | |||
| 449182bb51 | |||
| 4ca9170f5b | |||
| 78797757f0 | |||
| a6dc9f9e92 | |||
| c7df641aa2 | |||
| 63beefd0de | |||
| b3bf537fab | |||
| 8743e11285 | |||
| 04f81538b7 | |||
| 8d70f1007b | |||
| 6c0134bb5c | |||
| e9231bc4f1 | |||
| 4c79c6837b | |||
| e5f0c9f8b1 | |||
| d5326fe880 | |||
| adc4c9b875 | |||
| b09da8fce8 | |||
| 0b87a35e5a | |||
| a1bf8d9c75 | |||
| d3cc78d9d7 | |||
| e3dcb144bc | |||
| da93ec4a21 | |||
| fb0f83bc91 | |||
| 29ded51ea4 |
4
.github/workflows/analyze_codeql.yml
vendored
4
.github/workflows/analyze_codeql.yml
vendored
@ -44,7 +44,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@master
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
@ -128,7 +128,7 @@ jobs:
|
||||
|
||||
- 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 }}
|
||||
|
||||
24
.github/workflows/build_android.yml
vendored
24
.github/workflows/build_android.yml
vendored
@ -21,27 +21,27 @@ 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
|
||||
max-parallel: 1
|
||||
matrix:
|
||||
ARCH: ["arm64", "x86_64"]
|
||||
|
||||
|
||||
env:
|
||||
RELEASE_NAME: raylib-dev_android_api29_${{ matrix.ARCH }}
|
||||
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@master
|
||||
|
||||
|
||||
- name: Setup Release Version
|
||||
run: |
|
||||
echo "RELEASE_NAME=raylib-${{ github.event.release.tag_name }}_android_api29_${{ matrix.ARCH }}" >> $GITHUB_ENV
|
||||
shell: bash
|
||||
if: github.event_name == 'release' && github.event.action == 'published'
|
||||
|
||||
|
||||
- name: Setup Android NDK
|
||||
id: setup-ndk
|
||||
uses: nttld/setup-ndk@v1
|
||||
@ -52,7 +52,7 @@ jobs:
|
||||
ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
|
||||
|
||||
- name: Setup Environment
|
||||
run: |
|
||||
run: |
|
||||
mkdir build
|
||||
cd build
|
||||
mkdir ${{ env.RELEASE_NAME }}
|
||||
@ -60,7 +60,7 @@ jobs:
|
||||
mkdir include
|
||||
mkdir lib
|
||||
cd ../..
|
||||
|
||||
|
||||
# Generating static + shared library for 64bit arquitectures and API version 29
|
||||
- name: Build Library
|
||||
run: |
|
||||
@ -69,7 +69,7 @@ jobs:
|
||||
make PLATFORM=PLATFORM_ANDROID ANDROID_ARCH=${{ matrix.ARCH }} ANDROID_API_VERSION=29 ANDROID_NDK=${{ env.ANDROID_NDK_HOME }} RAYLIB_LIBTYPE=SHARED RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib" -B
|
||||
cd ..
|
||||
shell: cmd
|
||||
|
||||
|
||||
- name: Generate Artifacts
|
||||
run: |
|
||||
cp -v ./src/raylib.h ./build/${{ env.RELEASE_NAME }}/include
|
||||
@ -80,17 +80,17 @@ jobs:
|
||||
cp -v ./LICENSE ./build/${{ env.RELEASE_NAME }}/LICENSE
|
||||
cd build
|
||||
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: |
|
||||
./build/${{ env.RELEASE_NAME }}
|
||||
!./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:
|
||||
|
||||
4
.github/workflows/build_cmake.yml
vendored
4
.github/workflows/build_cmake.yml
vendored
@ -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
|
||||
|
||||
10
.github/workflows/build_examples_linux.yml
vendored
10
.github/workflows/build_examples_linux.yml
vendored
@ -22,19 +22,19 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
uses: actions/checkout@master
|
||||
|
||||
- name: Setup Environment
|
||||
run: |
|
||||
run: |
|
||||
sudo apt-get update -qq
|
||||
sudo apt-get install -y --no-install-recommends libglfw3 libglfw3-dev libx11-dev libxcursor-dev libxrandr-dev libxinerama-dev libxi-dev libxext-dev libxfixes-dev libwayland-dev libxkbcommon-dev
|
||||
|
||||
|
||||
- name: Build Library
|
||||
run: |
|
||||
cd src
|
||||
make PLATFORM=PLATFORM_DESKTOP CC=gcc RAYLIB_LIBTYPE=STATIC
|
||||
cd ..
|
||||
|
||||
|
||||
- name: Build Examples
|
||||
run: |
|
||||
cd examples
|
||||
|
||||
4
.github/workflows/build_examples_windows.yml
vendored
4
.github/workflows/build_examples_windows.yml
vendored
@ -13,7 +13,7 @@ on:
|
||||
- 'src/**'
|
||||
- 'examples/**'
|
||||
- '.github/workflows/windows_examples.yml'
|
||||
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
@ -22,7 +22,7 @@ jobs:
|
||||
runs-on: windows-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@master
|
||||
|
||||
- name: Add MSBuild to PATH
|
||||
uses: microsoft/setup-msbuild@v1
|
||||
|
||||
26
.github/workflows/build_linux.yml
vendored
26
.github/workflows/build_linux.yml
vendored
@ -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
|
||||
@ -42,23 +42,23 @@ jobs:
|
||||
ARCH_NAME: "arm64"
|
||||
COMPILER_PATH: "/usr/bin"
|
||||
runner: "ubuntu-24.04-arm"
|
||||
|
||||
|
||||
runs-on: ${{ matrix.runner }}
|
||||
env:
|
||||
RELEASE_NAME: raylib-dev_linux_${{ matrix.ARCH_NAME }}
|
||||
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@master
|
||||
|
||||
|
||||
- name: Setup Release Version
|
||||
run: |
|
||||
echo "RELEASE_NAME=raylib-${{ github.event.release.tag_name }}_linux_${{ matrix.ARCH_NAME }}" >> $GITHUB_ENV
|
||||
shell: bash
|
||||
if: github.event_name == 'release' && github.event.action == 'published'
|
||||
|
||||
|
||||
- name: Setup Environment
|
||||
run: |
|
||||
run: |
|
||||
sudo apt-get update -qq
|
||||
sudo apt-get install -y --no-install-recommends libglfw3 libglfw3-dev libx11-dev libxcursor-dev libxrandr-dev libxinerama-dev libxi-dev libxext-dev libxfixes-dev libwayland-dev libxkbcommon-dev
|
||||
mkdir build
|
||||
@ -74,7 +74,7 @@ jobs:
|
||||
run : |
|
||||
sudo apt-get install gcc-multilib
|
||||
if: matrix.bits == 32 && matrix.ARCH == 'i386'
|
||||
|
||||
|
||||
# TODO: Support 32bit (i386) static/shared library building
|
||||
- name: Build Library (32-bit)
|
||||
run: |
|
||||
@ -91,7 +91,7 @@ jobs:
|
||||
make PLATFORM=PLATFORM_DESKTOP CC=gcc RAYLIB_LIBTYPE=SHARED RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib" -B
|
||||
cd ..
|
||||
if: matrix.bits == 64 && matrix.ARCH == 'x86_64'
|
||||
|
||||
|
||||
- name: Build Library (64-bit ARM)
|
||||
run: |
|
||||
cd src
|
||||
@ -99,7 +99,7 @@ jobs:
|
||||
make PLATFORM=PLATFORM_DESKTOP CC=gcc RAYLIB_LIBTYPE=SHARED RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib" -B
|
||||
cd ..
|
||||
if: matrix.bits == 64 && matrix.ARCH == 'aarch64'
|
||||
|
||||
|
||||
- name: Generate Artifacts
|
||||
run: |
|
||||
cp -v ./src/raylib.h ./build/${{ env.RELEASE_NAME }}/include
|
||||
@ -110,17 +110,17 @@ jobs:
|
||||
cp -v ./LICENSE ./build/${{ env.RELEASE_NAME }}/LICENSE
|
||||
cd build
|
||||
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: |
|
||||
./build/${{ env.RELEASE_NAME }}
|
||||
!./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:
|
||||
|
||||
36
.github/workflows/build_macos.yml
vendored
36
.github/workflows/build_macos.yml
vendored
@ -21,16 +21,16 @@ 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:
|
||||
RELEASE_NAME: raylib-dev_macos
|
||||
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@master
|
||||
|
||||
|
||||
- name: Setup Release Version
|
||||
run: |
|
||||
echo "RELEASE_NAME=raylib-${{ github.event.release.tag_name }}_macos" >> $GITHUB_ENV
|
||||
@ -38,7 +38,7 @@ jobs:
|
||||
if: github.event_name == 'release' && github.event.action == 'published'
|
||||
|
||||
- name: Setup Environment
|
||||
run: |
|
||||
run: |
|
||||
mkdir build
|
||||
cd build
|
||||
mkdir ${{ env.RELEASE_NAME }}
|
||||
@ -46,47 +46,47 @@ jobs:
|
||||
mkdir include
|
||||
mkdir lib
|
||||
cd ../..
|
||||
|
||||
|
||||
# Generating static + shared library, note that i386 architecture is deprecated
|
||||
# Defining GL_SILENCE_DEPRECATION because OpenGL is deprecated on macOS
|
||||
- name: Build Library
|
||||
run: |
|
||||
cd src
|
||||
clang --version
|
||||
|
||||
|
||||
# Extract version numbers from Makefile
|
||||
brew install grep
|
||||
RAYLIB_API_VERSION=`ggrep -Po 'RAYLIB_API_VERSION\s*=\s\K(.*)' Makefile`
|
||||
RAYLIB_VERSION=`ggrep -Po 'RAYLIB_VERSION\s*=\s\K(.*)' Makefile`
|
||||
|
||||
|
||||
# Build raylib x86_64 static
|
||||
make PLATFORM=PLATFORM_DESKTOP RAYLIB_LIBTYPE=STATIC CUSTOM_CFLAGS="-target x86_64-apple-macos10.12 -DGL_SILENCE_DEPRECATION"
|
||||
mv libraylib.a /tmp/libraylib_x86_64.a
|
||||
make clean
|
||||
|
||||
|
||||
# Build raylib arm64 static
|
||||
make PLATFORM=PLATFORM_DESKTOP RAYLIB_LIBTYPE=STATIC CUSTOM_CFLAGS="-target arm64-apple-macos11 -DGL_SILENCE_DEPRECATION" -B
|
||||
mv libraylib.a /tmp/libraylib_arm64.a
|
||||
make clean
|
||||
|
||||
|
||||
# Join x86_64 and arm64 static
|
||||
lipo -create -output ../build/${{ env.RELEASE_NAME }}/lib/libraylib.a /tmp/libraylib_x86_64.a /tmp/libraylib_arm64.a
|
||||
|
||||
|
||||
# Build raylib x86_64 dynamic
|
||||
make PLATFORM=PLATFORM_DESKTOP RAYLIB_LIBTYPE=SHARED CUSTOM_CFLAGS="-target x86_64-apple-macos10.12 -DGL_SILENCE_DEPRECATION" CUSTOM_LDFLAGS="-target x86_64-apple-macos10.12" -B
|
||||
mv libraylib.${RAYLIB_VERSION}.dylib /tmp/libraylib_x86_64.${RAYLIB_VERSION}.dylib
|
||||
make clean
|
||||
|
||||
|
||||
# Build raylib arm64 dynamic
|
||||
make PLATFORM=PLATFORM_DESKTOP RAYLIB_LIBTYPE=SHARED CUSTOM_CFLAGS="-target arm64-apple-macos11 -DGL_SILENCE_DEPRECATION" CUSTOM_LDFLAGS="-target arm64-apple-macos11" -B
|
||||
mv libraylib.${RAYLIB_VERSION}.dylib /tmp/libraylib_arm64.${RAYLIB_VERSION}.dylib
|
||||
|
||||
|
||||
# Join x86_64 and arm64 dynamic
|
||||
lipo -create -output ../build/${{ env.RELEASE_NAME }}/lib/libraylib.${RAYLIB_VERSION}.dylib /tmp/libraylib_x86_64.${RAYLIB_VERSION}.dylib /tmp/libraylib_arm64.${RAYLIB_VERSION}.dylib
|
||||
ln -sv libraylib.${RAYLIB_VERSION}.dylib ../build/${{ env.RELEASE_NAME }}/lib/libraylib.dylib
|
||||
ln -sv libraylib.${RAYLIB_VERSION}.dylib ../build/${{ env.RELEASE_NAME }}/lib/libraylib.${RAYLIB_API_VERSION}.dylib
|
||||
cd ..
|
||||
|
||||
|
||||
- name: Generate Artifacts
|
||||
run: |
|
||||
cp -v ./src/raylib.h ./build/${{ env.RELEASE_NAME }}/include
|
||||
@ -97,17 +97,17 @@ jobs:
|
||||
cp -v ./LICENSE ./build/${{ env.RELEASE_NAME }}/LICENSE
|
||||
cd build
|
||||
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: |
|
||||
./build/${{ env.RELEASE_NAME }}
|
||||
!./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:
|
||||
|
||||
6
.github/workflows/build_webassembly.yml
vendored
6
.github/workflows/build_webassembly.yml
vendored
@ -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:
|
||||
|
||||
8
.github/workflows/build_windows.yml
vendored
8
.github/workflows/build_windows.yml
vendored
@ -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:
|
||||
|
||||
2
.github/workflows/parse_api.yml
vendored
2
.github/workflows/parse_api.yml
vendored
@ -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
|
||||
|
||||
8
.github/workflows/update_examples.yml
vendored
8
.github/workflows/update_examples.yml
vendored
@ -12,13 +12,13 @@ on:
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
|
||||
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'
|
||||
|
||||
6
.gitignore
vendored
6
.gitignore
vendored
@ -65,7 +65,7 @@ src/external/SDL3
|
||||
# Emscripten
|
||||
emsdk
|
||||
|
||||
# Ignore wasm data in examples/
|
||||
# Ignore binaries generated in examples/
|
||||
examples/**/*
|
||||
!examples/**/*.*
|
||||
!examples/**/*/
|
||||
@ -125,8 +125,8 @@ build-*/
|
||||
docgen_tmp/
|
||||
|
||||
# Tools stuff
|
||||
tools/parser/rlparser.exe
|
||||
tools/parser/rlparser
|
||||
tools/rlparser/rlparser.exe
|
||||
tools/rlparser/rlparser
|
||||
tools/rexm/rexm.exe
|
||||
tools/rexm/rexm
|
||||
|
||||
|
||||
34
BINDINGS.md
34
BINDINGS.md
@ -6,12 +6,12 @@ Some people ported raylib to other languages in the form of bindings or wrappers
|
||||
|
||||
| Name | raylib Version | Language | License |
|
||||
| :--------------------------------------------------------------------------------------- | :--------------: | :------------------------------------------------------------------: | :------------------: |
|
||||
| [raylib](https://github.com/raysan5/raylib) | **5.5** | [C/C++](https://en.wikipedia.org/wiki/C_(programming_language)) | Zlib |
|
||||
| [raylib](https://github.com/raysan5/raylib) | **6.0** | [C/C++](https://en.wikipedia.org/wiki/C_(programming_language)) | Zlib |
|
||||
| [raylib-ada](https://github.com/Fabien-Chouteau/raylib-ada) | **5.5** | [Ada](https://en.wikipedia.org/wiki/Ada_(programming_language)) | MIT |
|
||||
| [raylib-beef](https://github.com/Starpelly/raylib-beef) | **5.5** | [Beef](https://www.beeflang.org) | MIT |
|
||||
| [raybit](https://github.com/Alex-Velez/raybit) | **5.0** | [Brainfuck](https://en.wikipedia.org/wiki/Brainfuck) | MIT |
|
||||
| [raylib-c3](https://github.com/c3lang/vendor/tree/main/libraries/raylib55.c3l) | **5.5** | [C3](https://c3-lang.org) | MIT |
|
||||
| [raylib-cs](https://github.com/raylib-cs/raylib-cs) | **5.5** | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | Zlib |
|
||||
| [raylib-c3](https://github.com/c3lang/vendor/tree/main/libraries/raylib6.c3l) | **6** | [C3](https://c3-lang.org) | MIT |
|
||||
| [raylib-cs](https://github.com/raylib-cs/raylib-cs) | **6.0** | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | Zlib |
|
||||
| [Raylib-CsLo](https://github.com/NotNotTech/Raylib-CsLo) | 4.2 | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | MPL-2.0 |
|
||||
| [Raylib-CSharp-Vinculum](https://github.com/ZeroElectric/Raylib-CSharp-Vinculum) | **5.0** | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | MPL-2.0 |
|
||||
| [Raylib-CSharp](https://github.com/MrScautHD/Raylib-CSharp) | **5.5** | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | MIT |
|
||||
@ -26,17 +26,19 @@ Some people ported raylib to other languages in the form of bindings or wrappers
|
||||
| [raylib-cr](https://github.com/sol-vin/raylib-cr) | 4.6-dev (5e1a81) | [Crystal](https://crystal-lang.org) | Apache-2.0 |
|
||||
| [ray-cyber](https://github.com/fubark/ray-cyber) | **5.0** | [Cyber](https://cyberscript.dev) | MIT |
|
||||
| [dart-raylib](https://gitlab.com/wolfenrain/dart-raylib) | 4.0 | [Dart](https://dart.dev) | MIT |
|
||||
| [raylib_dart](https://pub.dev/packages/raylib_dart) | 6.0 | [Dart](https://dart.dev) | MIT |
|
||||
| [bindbc-raylib3](https://github.com/o3o/bindbc-raylib3) | **5.0** | [D](https://dlang.org) | BSL-1.0 |
|
||||
| [dray](https://github.com/redthing1/dray) | **5.0** | [D](https://dlang.org) | Apache-2.0 |
|
||||
| [raylib-d](https://github.com/schveiguy/raylib-d) | **5.5** | [D](https://dlang.org) | Zlib |
|
||||
| [DenoRaylib550](https://github.com/JJLDonley/DenoRaylib550) | **5.5** | [Deno](https://deno.land) | MIT |
|
||||
| [raylib-d](https://github.com/schveiguy/raylib-d) | **6.0** | [D](https://dlang.org) | Zlib |
|
||||
| [Deno-Raylib](https://github.com/JJLDonley/Deno-Raylib) | **6.0** | [Deno / TS](https://deno.land) | MIT |
|
||||
| [rayex](https://github.com/shiryel/rayex) | 3.7 | [elixir](https://elixir-lang.org) | Apache-2.0 |
|
||||
| [raylib-elle](https://github.com/acquitelol/elle/blob/rewrite/std/raylib.le) | **5.5** | [Elle](https://github.com/acquitelol/elle) | GPL-3.0 |
|
||||
| [raylib-factor](https://github.com/factor/factor/blob/master/extra/raylib/raylib.factor) | 5.5 | [Factor](https://factorcode.org) | BSD |
|
||||
| [raylib4fb](https://github.com/mudhairless/raylib4fb) | **6.0** | [FreeBASIC](https://www.freebasic.net) | Zlib |
|
||||
| [raylib-freebasic](https://github.com/WIITD/raylib-freebasic) | **5.0** | [FreeBASIC](https://www.freebasic.net) | MIT |
|
||||
| [raylib.f](https://github.com/cthulhuology/raylib.f) | **5.5** | [Forth](https://forth.com) | Zlib |
|
||||
| [fortran-raylib](https://github.com/interkosmos/fortran-raylib) | **5.5** | [Fortran](https://fortran-lang.org) | ISC |
|
||||
| [raylib-go](https://github.com/gen2brain/raylib-go) | **5.5** | [Go](https://golang.org) | Zlib |
|
||||
| [raylib-go](https://github.com/gen2brain/raylib-go) | **6.0** | [Go](https://golang.org) | Zlib |
|
||||
| [raylib-guile](https://github.com/petelliott/raylib-guile) | **auto** | [Guile](https://www.gnu.org/software/guile) | Zlib |
|
||||
| [gforth-raylib](https://github.com/ArnautDaniel/gforth-raylib) | 3.5 | [Gforth](https://gforth.org) | **???** |
|
||||
| [h-raylib](https://github.com/Anut-py/h-raylib) | **5.5-dev** | [Haskell](https://haskell.org) | Apache-2.0 |
|
||||
@ -48,9 +50,9 @@ Some people ported raylib to other languages in the form of bindings or wrappers
|
||||
| [Raylib.jl](https://github.com/chengchingwen/Raylib.jl) | 4.2 | [Julia](https://julialang.org) | Zlib |
|
||||
| [kaylib](https://github.com/electronstudio/kaylib) | 3.7 | [Kotlin/native](https://kotlinlang.org) | **???** |
|
||||
| [KaylibKit](https://codeberg.org/Kenta/KaylibKit) | 4.5 | [Kotlin/native](https://kotlinlang.org) | Zlib |
|
||||
| [raylib-lua](https://github.com/TSnake41/raylib-lua) | 5.0 | [Lua](http://www.lua.org) | ISC |
|
||||
| [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 |
|
||||
@ -61,9 +63,9 @@ Some people ported raylib to other languages in the form of bindings or wrappers
|
||||
| [node-raylib](https://github.com/RobLoach/node-raylib) | 4.5 | [Node.js](https://nodejs.org/en) | Zlib |
|
||||
| [raylib-odin](https://github.com/odin-lang/Odin/tree/master/vendor/raylib) | **5.5** | [Odin](https://odin-lang.org) | Zlib |
|
||||
| [raylib_odin_bindings](https://github.com/Deathbat2190/raylib_odin_bindings) | 4.0-dev | [Odin](https://odin-lang.org) | MIT |
|
||||
| [raylib-ocaml](https://github.com/tjammer/raylib-ocaml) | **5.0** | [OCaml](https://ocaml.org) | MIT |
|
||||
| [raylib-ocaml](https://github.com/tjammer/raylib-ocaml) | **6.0** | [OCaml](https://ocaml.org) | MIT |
|
||||
| [TurboRaylib](https://github.com/turborium/TurboRaylib) | 4.5 | [Object Pascal](https://en.wikipedia.org/wiki/Object_Pascal) | MIT |
|
||||
| [Ray4Laz](https://github.com/GuvaCode/Ray4Laz) | **5.5** | [Free Pascal](https://en.wikipedia.org/wiki/Free_Pascal)/[Delphi](https://en.wikipedia.org/wiki/Delphi_(software)) | Zlib |
|
||||
| [Ray4Laz](https://github.com/GuvaCode/Ray4Laz) | **6.0** | [Free Pascal](https://en.wikipedia.org/wiki/Free_Pascal)/[Delphi](https://en.wikipedia.org/wiki/Delphi_(software)) | Zlib |
|
||||
| [Raylib.4.0.Pascal](https://github.com/sysrpl/Raylib.4.0.Pascal) | 4.0 | [Free Pascal](https://en.wikipedia.org/wiki/Free_Pascal) | Zlib |
|
||||
| [pyraylib](https://github.com/Ho011/pyraylib) | 3.7 | [Python](https://www.python.org) | Zlib |
|
||||
| [raylib-python-cffi](https://github.com/electronstudio/raylib-python-cffi) | **5.5** | [Python](https://www.python.org) | EPL-2.0 |
|
||||
@ -76,6 +78,7 @@ Some people ported raylib to other languages in the form of bindings or wrappers
|
||||
| [raylibr](https://github.com/jeroenjanssens/raylibr) | 4.0 | [R](https://www.r-project.org) | MIT |
|
||||
| [raylib-ffi](https://github.com/ewpratten/raylib-ffi) | 5.5 | [Rust](https://www.rust-lang.org) | GPLv3 |
|
||||
| [raylib-rs](https://github.com/raylib-rs/raylib-rs) | **5.5** | [Rust](https://www.rust-lang.org) | Zlib |
|
||||
| [sola-raylib](https://github.com/brettchalupa/sola-raylib) | **6.0** | [Rust](https://www.rust-lang.org) | Zlib |
|
||||
| [raylib-ruby](https://github.com/wilsonsilva/raylib-ruby) | 4.5 | [Ruby](https://www.ruby-lang.org) | Zlib |
|
||||
| [Relib](https://github.com/RedCubeDev-ByteSpace/Relib) | 3.5 | [ReCT](https://github.com/RedCubeDev-ByteSpace/ReCT) | **???** |
|
||||
| [racket-raylib](https://github.com/eutro/racket-raylib) | **5.5** | [Racket](https://racket-lang.org) | MIT/Apache-2.0 |
|
||||
@ -85,10 +88,10 @@ Some people ported raylib to other languages in the form of bindings or wrappers
|
||||
| [raylib-umka](https://github.com/robloach/raylib-umka) | 4.5 | [Umka](https://github.com/vtereshkov/umka-lang) | Zlib |
|
||||
| [raylib-v](https://github.com/vlang/raylib) | 5.5 | [V](https://vlang.io) | MIT/Unlicense |
|
||||
| [raylib.v](https://github.com/irishgreencitrus/raylib.v) | 4.2 | [V](https://vlang.io) | Zlib |
|
||||
| [raylib-vapi](https://github.com/lxmcf/raylib-vapi) | **5.0** | [Vala](https://vala.dev) | Zlib |
|
||||
| [raylib-vapi](https://github.com/lxmcf/raylib-vapi) | **6.0** | [Vala](https://vala.dev) | Zlib |
|
||||
| [raylib-wave](https://github.com/wavefnd/raylib-wave) | **auto** |[Wave](http://wave-lang.dev) | Zlib |
|
||||
| [raylib-wren](https://github.com/TSnake41/raylib-wren) | 4.5 | [Wren](http://wren.io) | ISC |
|
||||
| [raylib-zig](https://github.com/raylib-zig/raylib-zig) | **5.6-dev** | [Zig](https://ziglang.org) | MIT |
|
||||
| [raylib-zig](https://github.com/raylib-zig/raylib-zig) | **6.0** | [Zig](https://ziglang.org) | MIT |
|
||||
| [raylib.zig](https://github.com/ryupold/raylib.zig) | **5.1-dev** | [Zig](https://ziglang.org) | MIT |
|
||||
| [raylib-zig-bindings](https://github.com/L-Briand/raylib-zig-bindings) | **5.0** | [Zig](https://ziglang.org) | Zlib |
|
||||
| [hare-raylib](https://git.sr.ht/~evantj/hare-raylib) | **auto** | [Hare](https://harelang.org) | Zlib |
|
||||
@ -100,10 +103,11 @@ Some people ported raylib to other languages in the form of bindings or wrappers
|
||||
| [Raylib.lean](https://github.com/KislyjKisel/Raylib.lean) | **5.5-dev** | [Lean4](https://lean-lang.org) | BSD-3-Clause |
|
||||
| [raylib-cobol](https://codeberg.org/glowiak/raylib-cobol) | **auto** | [COBOL](https://gnucobol.sourceforge.io) | Public domain |
|
||||
| [raylib-apl](https://github.com/Brian-ED/raylib-apl) | **5.0** | [Dyalog APL](https://www.dyalog.com/) | MIT |
|
||||
| [raylib-jai](https://github.com/ahmedqarmout2/raylib-jai) | **5.5** | [Jai](https://github.com/BSVino/JaiPrimer/blob/master/JaiPrimer.md) | MIT |
|
||||
| [raylib-jai](https://github.com/ahmedqarmout2/raylib-jai) | **6.0** | [Jai](https://github.com/BSVino/JaiPrimer/blob/master/JaiPrimer.md) | MIT |
|
||||
| [fnl-raylib](https://github.com/0riginaln0/fnl-raylib) | **5.5** | [Fennel](https://fennel-lang.org/) | MIT |
|
||||
| [Rayua](https://github.com/uiua-lang/rayua) | **5.5** | [Uiua](https://www.uiua.org/) | **???** |
|
||||
| [Target](https://github.com/FinnDemonCat/Target/tree/main/libs/raylib) | **5.5** | [Dart](https://dart.dev/) | Apache-2.0 license |
|
||||
| [Target](https://github.com/FinnDemonCat/Target/tree/main/libs/raylib) | **5.5** | [Dart](https://dart.dev/) | Apache-2.0 license |
|
||||
| [gclang-raylib](https://github.com/gnuchanos/gcLang_Compiler/tree/main/windows_version/raylib_version)| **6.0** | [gclang](https://github.com/gnuchanos/gcLang_Compiler) | AGPL-3.0 |
|
||||
|
||||
|
||||
### Utility Wrapers
|
||||
@ -111,7 +115,7 @@ Some people ported raylib to other languages in the form of bindings or wrappers
|
||||
These are utility wrappers for specific languages, they are not required to use raylib in the language but may adapt the raylib API to be more inline with the language's paradigm.
|
||||
| Name | raylib Version | Language | License |
|
||||
| ---------------------------------------------------- | :------------: | :------------------------------------------: | :-----: |
|
||||
| [raylib-cpp](https://github.com/robloach/raylib-cpp) | **5.5** | [C++](https://en.wikipedia.org/wiki/C%2B%2B) | Zlib |
|
||||
| [raylib-cpp](https://github.com/robloach/raylib-cpp) | **6.0** | [C++](https://en.wikipedia.org/wiki/C%2B%2B) | Zlib |
|
||||
| [claylib](https://github.com/defun-games/claylib) | 4.5 | [Common Lisp](https://common-lisp.net) | Zlib |
|
||||
| [rayed-bqn](https://github.com/Brian-ED/rayed-bqn) | **5.0** | [BQN](https://mlochbaum.github.io/BQN) | MIT |
|
||||
| [DOOR](https://github.com/RealDoigt/DOOR) | 4.0 | [D](https://dlang.org) | MIT |
|
||||
|
||||
42
CHANGELOG
42
CHANGELOG
@ -1,10 +1,10 @@
|
||||
changelog
|
||||
---------
|
||||
|
||||
Current Release: raylib 5.5 (18 November 2024)
|
||||
Current Release: raylib 6.0 (23 April 2026)
|
||||
|
||||
-------------------------------------------------------------------------
|
||||
Release: raylib 6.0 (?? March 2026)
|
||||
Release: raylib 6.0 (23 April 2026)
|
||||
-------------------------------------------------------------------------
|
||||
KEY CHANGES:
|
||||
- New Software Renderer backend [rlsw]
|
||||
@ -17,7 +17,7 @@ KEY CHANGES:
|
||||
- New File System API
|
||||
- New Text Management API
|
||||
- New tool: [rexm] raylib examples manager
|
||||
- Added +50 new examples to learn from
|
||||
- Added +70 new examples to learn from
|
||||
|
||||
Detailed changes:
|
||||
|
||||
@ -115,6 +115,7 @@ Detailed changes:
|
||||
[rcore][GLFW] REVIEWED: `GetGamepadButtonPressed()`, return GAMEPAD_BUTTON_*_TRIGGER_2 if pressed (#4742) by @whaleymar
|
||||
[rcore][GLFW] REVIEWED: Update `mappings.h` using `GenerateMappings.cmake` by @sleeptightAnsiC
|
||||
[rcore][RGFW] ADDED: New backend option: `PLATFORM_WEB_RGFW` and update RGFW (#4480) by @colleagueRiley
|
||||
[rcore][RGFW] ADDED: Support for software rendering (#5773) by @CrackedPixel
|
||||
[rcore][RGFW] REVIEWED: Added missing Right Control key by @M374LX
|
||||
[rcore][RGFW] REVIEWED: Changed `RGFW_window_eventWait` timeout to -1 by @doggymangc
|
||||
[rcore][RGFW] REVIEWED: Duplicate entries removed from `keyMappingRGFW` (#5242) by @iamahuman1395
|
||||
@ -221,6 +222,7 @@ Detailed changes:
|
||||
[rlsw] REVIEWED: C++ support (#5291) by @alexgb0
|
||||
[rshapes] ADDED: `DrawLineDashed()` (#5222) by @luis605
|
||||
[rshapes] ADDED: `DrawEllipseV()` and `DrawEllipseLinesV()` (#4963) by @meowstr
|
||||
[rshapes] REDESIGNED: `DrawCircleGradient()` to use Vector2 as center parameter by @raysan5 -WARNING-
|
||||
[rshapes] REVIEWED: `DrawLine()`, fix pixel offset issue on drawing (#4666) by @Bigfoot71
|
||||
[rshapes] REVIEWED: `DrawRectangleGradientEx()`, incorrect parameter names (#4980) by @vincent
|
||||
[rshapes] REVIEWED: `DrawRectangleLines`, fix pixel offset issue (#4669) by @Bigfoot71
|
||||
@ -285,6 +287,7 @@ Detailed changes:
|
||||
[rtext] REVIEWED: `TextToFloat()`, remove removed inaccurate comment (#4596) by @hexmaster111
|
||||
[rtext] REDESIGNED: `LoadFontData()`, added input parameter by @raysan5 -WARNING-
|
||||
[rmodels] ADDED: Support CPU animation in OpenGL 1.1 (#4925) by @JeffM2501
|
||||
[rmodels] REMOVED: `DrawModelPoints()` and `DrawModelPointsEx()`, moved to an example (#5697) by @maiconpintoabreu -WARNING-
|
||||
[rmodels] RENAMED: Skinning shader variables (new default naming) by @raysan5
|
||||
[rmodels] REVIEWED: glTF animation framerate calculation (#4472, #5445) by @TheLazyIndianTechie
|
||||
[rmodels] REVIEWED: Assign meshes without bone weights to the bone they are attached to so they animate by @Jeffm2501
|
||||
@ -311,6 +314,7 @@ Detailed changes:
|
||||
[rmodels] REVIEWED: `LoadModelAnimationsGLTF()`, properly load 1 frame animations (#5561) by @arlez80
|
||||
[rmodels] REVIEWED: `LoadModelAnimationsGLTF()`, anim correctly inherits world transform (#5206) by @ArmanOmmid
|
||||
[rmodels] REVIEWED: `UploadMesh()`, improve default normal and tangent values (#4763) by @Bigfoot71
|
||||
[rmodels] REVIEWED: `UplaodMesh()`, fix for devices without VAO support (#5692) by @psxdev
|
||||
[rmodels] REVIEWED: `GenMeshTangents()`, improvements (#4937) by @Bigfoot71
|
||||
[rmodels] REVIEWED: `UpdateModelAnimation()` optimization (#5244) by @Arrangemonk
|
||||
[rmodels] REVIEWED: `UpdateModelAnimationBones()`, break on first mesh found and formating by @raysan5
|
||||
@ -322,6 +326,8 @@ Detailed changes:
|
||||
[rmodels] REVIEWED: `DrawMeshInstanced()`, breaking if instanceTransform was unused (#5469) by @al13n321
|
||||
[rmodels] REVIEWED: `DrawSphereEx()`, normals support (#4926) by @karl-zylinski
|
||||
[rmodels] REVIEWED: `ExportMesh()`, improve OBJ vertex data precision and lower memory usage (#4496) by @mikeemm
|
||||
[rmodels] REVIEWED: `CheckCollisionSpheres()`, simplified using `Vector3DistanceSqr()` (#5695) by @Bigfoot71
|
||||
[rmodels] REVIEWED: `CheckCollisionBoxSphere()`, improved performance and consistency (#5776) by @maiconpintoabreu
|
||||
[raudio] REVIEWED: Fix a glitch at the end of a sound (#5578) by @mackron
|
||||
[raudio] REVIEWED: Improvements to device configuration (#5577) by @mackron
|
||||
[raudio] REVIEWED: Initialize sound alias properties as if it was a new sound (#5123) by @JeffM2501
|
||||
@ -406,11 +412,12 @@ Detailed changes:
|
||||
[build][CMake] REVIEWED: Set `libm` as public so it can be linked by consumer (#5193) by @brccabral
|
||||
[build][Cmake] REVIEWED: Expose PLATFORM_WEB_RGFW (#5579) by @crisserpl2
|
||||
[build][Zig] ADDED: Android target to build by @lumenkeyes
|
||||
[build][Zig] REDESIGNED: Complete refactor of build.zig to support Zig 0.16.0 (#5764) by @HaxSam
|
||||
[build][Zig] REVIEWED: Link EGL for Android by @lumenkeyes
|
||||
[build][Zig] REVIEWED: Approach to build for web with zig-build (#5157) by @haxsam
|
||||
[build][Zig] REVIEWED: Fix build accessing env vars (#5490) by @iisakki
|
||||
[build][Zig] REVIEWED: Fix emscripten building by @johnnymarler
|
||||
[build][Zig] REVIWED: Move examples/build.zig into main build.zig by @johnnymarler
|
||||
[build][Zig] REVIEWED: Move examples/build.zig into main build.zig by @johnnymarler
|
||||
[build][Zig] REVIEWED: Fix raygui inclusion in windows crosscompilation (#4489) by @kimierik
|
||||
[build][Zig] REVIEWED: Issue on emscripten run if the user has not installed emsdk by @emilhakimov415
|
||||
[build][Zig] REVIEWED: Make X11 the default display backend instead of choosing at runtime (#5168) by @Not-Nik
|
||||
@ -458,6 +465,7 @@ Detailed changes:
|
||||
[examples] ADDED: `shapes_rlgl_triangle` example (#5353) by @robinsaviary
|
||||
[examples] ADDED: `shapes_starfield` (#5255) by @themushroompirates
|
||||
[examples] ADDED: `shapes_triangle_strip` (#5240) by @Jopestpe
|
||||
[examples] ADDED: `shapes_collision_ellipses` (#5722) by @Monjaris
|
||||
[examples] ADDED: `text_inline_styling` by @raysan5
|
||||
[examples] ADDED: `text_strings_management` (#5379) by @davidbuzatto
|
||||
[examples] ADDED: `text_words_alignment` (#5254) by @themushroompirates
|
||||
@ -759,6 +767,7 @@ Detailed changes:
|
||||
[rexm] REVIEWED: `Makefile.Web` before trying to rebuild new example for web by @raysan5
|
||||
[rexm] REVIEWED: Using `Makefile.Web` for specific web versions generation by @raysan5
|
||||
|
||||
[external] ADDED: `cgltf_write` 1.15, to support glTF models export in the future, by @raysan5
|
||||
[external] RENAMED: `rl_gputex.h` to `rltexgpu.h`, compressed textures loading
|
||||
[external] REVIEWED: `rltexgpu.h`, make it usable standalone by @raysan5
|
||||
[external] REVIEWED: `rltexgpu.h, fix the swizzling in `rl_load_dds_from_memory()` (#5422) by @msmith-codes
|
||||
@ -767,16 +776,23 @@ Detailed changes:
|
||||
[external] REVIEWED: `sdefl` and `sinfl` issues (#5367) by @raysan5
|
||||
[external] REVIEWED: `sinfl_bsr()`, improvements by @RicoP
|
||||
[external] REVIEWED: `stb_truetype`, fix composite glyph scaling logic (#4811) by @ashishbhattarai
|
||||
[external] UPDATED: `raygui` to 5.0-dev for examples by @raysan5
|
||||
[external] UPDATED: dr_libs (#5020) by @Emil2010
|
||||
[external] UPDATED: miniaudio to v0.11.22 (#4983) by @M374LX
|
||||
[external] UPDATED: miniaudio to v0.11.23 (#5234) by @pyrokn8
|
||||
[external] UPDATED: miniaudio to v0.11.24 (#5506) by @vdemcak
|
||||
[external] UPDATED: raygui to 5.0-dev for examples by @raysan5
|
||||
[external] UPDATED: RGFW to 1.5 (#4688) by @ColleagueRiley
|
||||
[external] UPDATED: RGFW to 1.6 (#4795) by @colleagueRiley
|
||||
[external] UPDATED: RGFW to 1.7 (#4965) by @M374LX
|
||||
[external] UPDATED: RGFW to 1.7.5-dev (#4976) by @M374LX
|
||||
[external] UPDATED: RGFW to 2.0.0 (#5582) by @CrackedPixel
|
||||
[external] UPDATED: `miniaudio` to v0.11.22 (#4983) by @M374LX
|
||||
[external] UPDATED: `miniaudio` to v0.11.23 (#5234) by @pyrokn8
|
||||
[external] UPDATED: `miniaudio` to v0.11.24 (#5506) by @vdemcak
|
||||
[external] UPDATED: `RGFW` to 1.5 (#4688) by @ColleagueRiley
|
||||
[external] UPDATED: `RGFW` to 1.6 (#4795) by @colleagueRiley
|
||||
[external] UPDATED: `RGFW` to 1.7 (#4965) by @M374LX
|
||||
[external] UPDATED: `RGFW` to 1.7.5-dev (#4976) by @M374LX
|
||||
[external] UPDATED: `RGFW` to 2.0.0 (#5582) by @CrackedPixel
|
||||
[external] UPDATED: `cgltf` 1.14 to 1.15 by @raysan5
|
||||
[external] UPDATED: `dr_flac` v0.13.0 to v0.13.3 by @raysan5
|
||||
[external] UPDATED: `dr_mp3` v0.7.0 to v0.7.4 by @raysan5
|
||||
[external] UPDATED: `m3d` to latest master by @raysan5
|
||||
[external] UPDATED: `qoi` to latest master by @raysan5
|
||||
[external] UPDATED: `qoa` to latest master by @raysan5
|
||||
[external] UPDATED: `stb_image_resize2` v2.12 to v2.18 by @raysan5
|
||||
|
||||
[misc] ADDED: SECURITY.md for security reporting policies by @raysan5
|
||||
[misc] ADDED: `examples/examples_list`, to be used by `rexm` or other tools by @raysan5
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
cmake_minimum_required(VERSION 3.25)
|
||||
#this change avoid the warning that appear when we include raylib using Cmake fatch content
|
||||
cmake_minimum_required(VERSION 3.22)
|
||||
project(raylib)
|
||||
|
||||
# Avoid excessive expansion of variables in conditionals. In particular, if
|
||||
@ -29,7 +28,7 @@ include(CompilerFlags)
|
||||
# Registers build options that are exposed to cmake
|
||||
include(CMakeOptions.txt)
|
||||
|
||||
if (UNIX AND NOT APPLE AND NOT "${PLATFORM}" MATCHES "DRM" AND NOT "${PLATFORM}" MATCHES "Web")
|
||||
if (UNIX AND NOT APPLE AND NOT "${PLATFORM}" MATCHES "DRM" AND NOT "${PLATFORM}" MATCHES "Web" AND NOT "${PLATFORM}" MATCHES "SDL")
|
||||
if (NOT GLFW_BUILD_WAYLAND AND NOT GLFW_BUILD_X11)
|
||||
message(FATAL_ERROR "Cannot disable both Wayland and X11")
|
||||
endif()
|
||||
|
||||
@ -6,7 +6,7 @@ if(EMSCRIPTEN)
|
||||
# When configuring web builds with "emcmake cmake -B build -S .", set PLATFORM to Web by default
|
||||
SET(PLATFORM Web CACHE STRING "Platform to build for.")
|
||||
endif()
|
||||
enum_option(PLATFORM "Desktop;Web;WebRGFW;Android;Raspberry Pi;DRM;SDL;RGFW" "Platform to build for.")
|
||||
enum_option(PLATFORM "Desktop;Win32;Web;WebRGFW;Android;Raspberry Pi;DRM;SDL;RGFW;Memory" "Platform to build for.")
|
||||
|
||||
enum_option(OPENGL_VERSION "OFF;4.3;3.3;2.1;1.1;ES 2.0;ES 3.0;Software" "Force a specific OpenGL Version?")
|
||||
|
||||
@ -29,11 +29,15 @@ option(GLFW_BUILD_WAYLAND "Build the bundled GLFW with Wayland support" OFF)
|
||||
option(GLFW_BUILD_X11 "Build the bundled GLFW with X11 support" ON)
|
||||
|
||||
option(INCLUDE_EVERYTHING "Include everything disabled by default (for CI usage)" OFF)
|
||||
set(OFF ${INCLUDE_EVERYTHING} CACHE INTERNAL "Replace any OFF by default with \${OFF} to have it covered by this option")
|
||||
|
||||
include(ParseConfigHeader)
|
||||
|
||||
foreach(FLAG IN LISTS CONFIG_HEADER_FLAGS)
|
||||
string(REGEX MATCH "([^=]+)=(.+)" _ ${FLAG})
|
||||
cmake_dependent_option(${CMAKE_MATCH_1} "" ${CMAKE_MATCH_2} CUSTOMIZE_BUILD ${CMAKE_MATCH_2})
|
||||
set(CONFIG_HEADER_FLAG_DEFAULT ${CMAKE_MATCH_2})
|
||||
if (INCLUDE_EVERYTHING AND "${CONFIG_HEADER_FLAG_DEFAULT}" STREQUAL "OFF")
|
||||
set(CONFIG_HEADER_FLAG_DEFAULT ON)
|
||||
endif()
|
||||
|
||||
cmake_dependent_option(${CMAKE_MATCH_1} "" ${CONFIG_HEADER_FLAG_DEFAULT} CUSTOMIZE_BUILD ${CONFIG_HEADER_FLAG_DEFAULT})
|
||||
endforeach()
|
||||
|
||||
85
HISTORY.md
85
HISTORY.md
@ -526,26 +526,79 @@ Last but not least, I want to thank **raylib sponsors and all the raylib communi
|
||||
notes on raylib 6.0
|
||||
-------------------
|
||||
|
||||
A new raylib release is finally ready, after almost 1.5 years since last release. This is the biggest release ever with many improvements to the library, thanks to the support of many amazing contributors and also thanks to the financial support of NLnet/NGI0 funds.
|
||||
A new `raylib` release is finally ready and, again, this is the **biggest `raylib` release ever**! Thanks to the support of many amazing contributors this release comes packed with many new features and improvements, also thanks to the financial support of [NLnet](https://nlnet.nl/) and the [NGI Zero Commond Fund](https://nlnet.nl/NGI0/) that allow me to work on this project mostly fulltime for the past few months.
|
||||
|
||||
Some astonishing numbers for this release:
|
||||
|
||||
- **+320** closed issues (for a TOTAL of **+2130**!)
|
||||
- **+1800** commits since previous RELEASE (for a TOTAL of **+9600**!)
|
||||
- **18** functions ADDED to raylib API (for a TOTAL of **599**!)
|
||||
- **+50** new examples to learn from (for a TOTAL of **212**!)
|
||||
- **+200** new contributors (for a TOTAL of **+840**!)
|
||||
- **+330** closed issues (for a TOTAL of **+2150**!)
|
||||
- **+2000** commits since previous RELEASE (for a TOTAL of **+9760**!)
|
||||
- **+20** new functions ADDED to raylib API (for a TOTAL of **600**!)
|
||||
- **+70** new examples to learn from (for a TOTAL of **+215**!)
|
||||
- **+210** new contributors (for a TOTAL of **+850**!)
|
||||
|
||||
Highlights for `raylib 6.0`:
|
||||
|
||||
- New Software Renderer backend [rlsw]
|
||||
- New rcore platform backend: Memory (memory buffer)
|
||||
- New rcore platform backend: Win32 (experimental)
|
||||
- New rcore platform backend: Emscripten (experimental)
|
||||
- Redesigned Skeletal Animation System
|
||||
- Redesigned fullscreen modes and high-dpi content scaling
|
||||
- Redesigned Build Config System [config.h]
|
||||
- New File System API
|
||||
- New Text Management API
|
||||
- New tool: [rexm] raylib examples manager
|
||||
- **`NEW` Software Renderer - [`rlsw`](https://github.com/raysan5/raylib/blob/master/src/external/rlsw.h)**: The biggest addition of this new release. A new software renderer backend, that allows raylib to run purely on CPU, with no neeed for a GPU. It finally closes the circle of my search for a portable self-contained, with **no-external-dependencies**, graphics library, able to run on any device providing some CPU-power and some RAM memory. It has been possible thanks to the amazing work of **Le Juez Victor** ([@Bigfoot71](https://github.com/Bigfoot71)), who created [`rlsw`](https://github.com/raysan5/raylib/blob/master/src/external/rlsw.h), a single-file header-only library implementing OpenGL 1.1+ specification, tailored to fit into raylib [`rlgl`](https://github.com/raysan5/raylib/blob/master/src/rlgl.h) OpenGL wrapper, and allowing to run raylib seamlessly over CPU with **no code changes required on user side**. As expected, software rendering is slower than hardware-accelerated rendering but it is still fast enough to run basic application at 30-60 fps. Actually, it already proved it usefulness on a new [raylib port for ESP32](https://components.espressif.com/components/georgik/raylib/versions/6.0.0/readme) microcontroller by Espressif, useful for industrial applications, and opens the door to the upcoming RISC-V powered devices that start arriving to the marked, and many times come with no GPU. Along the new software renderer, some of the existing platform backends have been adapted to support it (SDL, RGFW, DRM) and also **new platforms backends have been created** to accomodate it (Win32, Emscripten), incluing a new `PLATFORM_MEMORY`, that allows direct rendering to a memory framebuffer.
|
||||
|
||||
- **`NEW` Platform backend: Memory - [`rcore_memory`](https://github.com/raysan5/raylib/blob/master/src/platforms/rcore_memory.c)**: This new platform has been added along the **software renderer** backend, allowing 2d and 3d rendering over a **platform-agnostic memory framebuffer**, it can run headless and output frames can be directly exported to images. This new backend could also be useful for graphics rendering on servers or process images directly using the memory buffer.
|
||||
|
||||
- **`NEW` Platform backend: Win32 - [`rcore_desktop_win32`](https://github.com/raysan5/raylib/blob/master/src/platforms/rcore_desktop_win32.c)**: A new **Windows platform backend** and the first step towards a potential replacement/alternative to the platform libraries currently used by raylib (GLFW/SDL/RGFW). This backend follows same API template structure than the other raylib backends, but directly implementing Win32 API calls. It allows initializing OpenGL GPU-accelerated windows and also GDI based windows, useful for the software renderer backend. This new backend approach, following a common template-structure and separating the platform logic by specific OS/Windowing system, will simplify code, improve maintenance, readability and portability for raylib, setting some bases for the future. *NOTE: This backend is new and it could require further testing, use it as an experimental backend for now.*
|
||||
|
||||
- **`NEW` Platform backend: Emscripten - [`rcore_web_emscripten`](https://github.com/raysan5/raylib/blob/master/src/platforms/rcore_web_emscripten.c)**: In the same line as Win32 backend, this new web backend moves away from `libglfw.js` and **directly implements Emscripten/JS functionality**, with **no other dependencies**, adding support for the new software renderer to draw directly on a **non-accelerated 2d canvas** but also supporting a WebGL-hardware-accelerated canvas when required. *NOTE: This backend is new and it could require further testing, use it as an experimental backend for now.*
|
||||
|
||||
- **`REDESIGNED` Fullscreen modes and High-DPI content scaling**: After many years and many related issues, the full-screen and high-dpi content scaling support has been **completely redesigned** from scratch. New design prioritizes **borderless fullscreen modes** and automatically detects current monitor content scaling configuration to scale window and framebuffer accordingly when required. Still, High-DPI support must be requested by user if desired enabling `FLAG_WINDOW_HIGHDPI` on window creation. This new system has been carefully tested on Windows, Linux (X11, Wayland), macOS with multiple monitors and multiple resolutions, including 4K monitors.
|
||||
|
||||
- **`REDESIGNED` Skeletal Animation System**: A new animation system for 3d models has been created to support animation blending, between single frames but also between differents frames on different animations, to allow easy **timed transitions** between animations. This redesign implied reviewing several raylib structures to better accomodate animation data: `Model`, `ModelSkeleton`, `ModelAnimation`, but the API was simplified and support for GPU-skinning was improved with multiple optimizations.
|
||||
|
||||
- **`REDESIGNED` Build Config System - [`config.h`](https://github.com/raysan5/raylib/blob/master/src/config.h)**: raylib allows lot of customization for specific needs (i.e. disabling modules not needed for specific applications like rmodels or raudio) but previous implementation did not allow easely disabling some features from **custom build systems**. New design not only allows disabling features with simple `-DSUPPORT_FILEFORMAT_OBJ=0` on building command-line but also the full system has been reviewed, removing useless flags and exposing new ones.
|
||||
|
||||
- **`NEW` File System API**: Along the years, multiple filesystem functions have been added to raylib API as required but it felt somewhat inconsistent with some pieces missing. In this new release, the full filesystem API has beeen reviewed and reorganized, compiling all the functionality single module: [rcore](https://github.com/raysan5/raylib/blob/master/src/raylib.h#L1126), consequently `utils` module has been removed and build system has been simplified even more; **only 6-7 modules (.c) need to be compiled containing the full raylib library**. This new filesystem API will allow raylib to be used on the creation of custom build systems, as already demostrated with the new `rexm` tool for examples management. At the moment raylib includes **+40 file system management functions**, here a list with the new functions added:
|
||||
```c
|
||||
int FileRename(const char *fileName, const char *fileRename); // Rename file (if exists)
|
||||
int FileRemove(const char *fileName); // Remove file (if exists)
|
||||
int FileCopy(const char *srcPath, const char *dstPath); // Copy file from one path to another, dstPath created if it doesn't exist
|
||||
int FileMove(const char *srcPath, const char *dstPath); // Move file from one directory to another, dstPath created if it doesn't exist
|
||||
int FileTextReplace(const char *fileName, const char *search, const char *replacement); // Replace text in an existing file
|
||||
int FileTextFindIndex(const char *fileName, const char *search); // Find text in existing file
|
||||
```
|
||||
|
||||
- **`NEW` Text Management API**: Along with the new file system functionality, a new set of text management functions has been added, also very useful for text procesing and also used in custom build systems creation using raylib. At the moment raylib includes **+30 text management functions**, here a list with the new functions added:
|
||||
```c
|
||||
char **LoadTextLines(const char *text, int *count); // Load text as separate lines ('\n')
|
||||
void UnloadTextLines(char **text, int lineCount); // Unload text lines
|
||||
const char *TextRemoveSpaces(const char *text); // Remove text spaces, concat words
|
||||
char *GetTextBetween(const char *text, const char *begin, const char *end); // Get text between two strings
|
||||
char *TextReplace(const char *text, const char *search, const char *replacement); // Replace text string with new string
|
||||
char *TextReplaceAlloc(const char *text, const char *search, const char *replacement); // Replace text string with new string, memory must be MemFree()
|
||||
char *TextReplaceBetween(const char *text, const char *begin, const char *end, const char *replacement); // Replace text between two specific strings
|
||||
char *TextReplaceBetweenAlloc(const char *text, const char *begin, const char *end, const char *replacement); // Replace text between two specific strings, memory must be MemFree()
|
||||
char *TextInsertAlloc(const char *text, const char *insert, int position); // Insert text in a defined byte position, memory must be MemFree()
|
||||
```
|
||||
|
||||
- **`NEW` tool: raylib examples manager - [rexm](https://github.com/raysan5/raylib/tree/master/tools/rexm)**: raylib examples collection is huge, with **more than 200 examples** it was quite difficult to manage: adding, removing, renaming examples was a very costly process involving many files to be modified (including build systems), also the examples did not follow a common header convention neither a structure conventions. For that reason, a new support tool has been created: **rexm**, a raylib examples manager that allows to easely add/remove/rename examples, automatically fix inconsistencies and even **building and automated testing** on multiple platforms.
|
||||
```
|
||||
USAGE:
|
||||
> rexm <command> <example_name> [<example_rename>]
|
||||
|
||||
COMMANDS:
|
||||
create <new_example_name> : Creates an empty example, from internal template
|
||||
add <example_name> : Add existing example to collection
|
||||
rename <old_examples_name> <new_example_name> : Rename an existing example
|
||||
remove <example_name> : Remove an existing example from collection
|
||||
build <example_name> : Build example for Desktop and Web platforms
|
||||
test <example_name> : Build and Test example for Desktop and Web platforms
|
||||
validate : Validate examples collection, generates report
|
||||
update : Validate and update examples collection, generates report
|
||||
```
|
||||
|
||||
- **`NEW` +70 new examples**: Thanks to `rexm` and the simplification on examples management, this new raylib release includes +70 new examples to learn from, most of them contributed by community. Multiple examples have also been renamed for consistency and all examples header and structure have been reviewed and unified.
|
||||
|
||||
Make sure to check raylib [CHANGELOG](https://github.com/raysan5/raylib/blob/master/CHANGELOG) for a detailed list of changes!
|
||||
|
||||
I want to **thank all the contributors (+850!**) that along the years have **greatly improved raylib** and pushed it further and better day after day. And **many thanks to raylib community and all raylib users** for supporting the library along those many years.
|
||||
|
||||
Finally, I want to thank [puffer.ai](https://puffer.ai/) and [comma.ai](https://comma.ai/) for **using raylib and supporting the project** as platinum sponsors, along many others individuals that have been sponsoring raylib along the years. Thanks to all of you for allowing me to keep working on this library!
|
||||
|
||||
**After +12 years of development, `raylib 6.0` is today one of the bests libraries to enjoy games/tools/graphics programming!**
|
||||
|
||||
**Enjoy graphics programming with raylib!** :)
|
||||
|
||||
@ -14,7 +14,7 @@ Ready to learn? Jump to [code examples!](https://www.raylib.com/examples.html)
|
||||
|
||||
[](https://github.com/raysan5/raylib/releases)
|
||||
[](https://github.com/raysan5/raylib/stargazers)
|
||||
[](https://github.com/raysan5/raylib/commits/master)
|
||||
[](https://github.com/raysan5/raylib/commits/master)
|
||||
[](https://github.com/sponsors/raysan5)
|
||||
[](https://repology.org/project/raylib/versions)
|
||||
[](LICENSE)
|
||||
@ -40,6 +40,7 @@ features
|
||||
- Written in plain C code (C99) using PascalCase/camelCase notation
|
||||
- Hardware accelerated with OpenGL: **1.1, 2.1, 3.3, 4.3, ES 2.0, ES 3.0**
|
||||
- **Unique OpenGL abstraction layer** (usable as standalone module): [rlgl](https://github.com/raysan5/raylib/blob/master/src/rlgl.h)
|
||||
- **Software Renderer** backend (no OpenGL required!): [rlsw](https://github.com/raysan5/raylib/blob/master/src/external/rlsw.h)
|
||||
- Multiple **Fonts** formats supported (TTF, OTF, FNT, BDF, sprite fonts)
|
||||
- Multiple texture formats supported, including **compressed formats** (DXT, ETC, ASTC)
|
||||
- **Full 3D support**, including 3D Shapes, Models, Billboards, Heightmaps and more!
|
||||
@ -61,7 +62,7 @@ This is a basic raylib example, it creates a window and draws the text `"Congrat
|
||||
|
||||
int main(void)
|
||||
{
|
||||
InitWindow(800, 450, "raylib [core] example - basic window");
|
||||
InitWindow(800, 450, "raylib example - basic window");
|
||||
|
||||
while (!WindowShouldClose())
|
||||
{
|
||||
|
||||
@ -6,6 +6,7 @@ Here is a wishlist with features and ideas to improve the library. Note that fea
|
||||
- [GitHub PRs](https://github.com/raysan5/raylib/pulls) open with improvements to be reviewed.
|
||||
- [raylib source code](https://github.com/raysan5/raylib/tree/master/src) has multiple *TODO* comments around code with pending things to review or improve.
|
||||
- raylib wishlists discussions are open to everyone to ask for improvements, feel free to check and comment:
|
||||
- [raylib 7.0 wishlist](https://github.com/raysan5/raylib/discussions/5710)
|
||||
- [raylib 6.0 wishlist](https://github.com/raysan5/raylib/discussions/4660)
|
||||
- [raylib 5.0 wishlist](https://github.com/raysan5/raylib/discussions/2952)
|
||||
- [raylib wishlist 2022](https://github.com/raysan5/raylib/discussions/2272)
|
||||
@ -21,7 +22,7 @@ _Current version of raylib is complete and functional but there is always room f
|
||||
- [ ] `rcore_desktop_wayland`: Create additional platform backend: Linux/Wayland
|
||||
- [ ] `rcore`: Investigate alternative embedded platforms and realtime OSs
|
||||
- [ ] `rlsw`: Software renderer optimizations: mipmaps, platform-specific SIMD
|
||||
- [ ] `rtextures`: Consider moving N-patch system to separate example
|
||||
- [ ] `rtextures`: Consider removing N-patch system, provide as separate example
|
||||
- [ ] `rtextures`: Review blending modes system, provide more options or better samples
|
||||
- [ ] `rtext`: Investigate the recently opened [`Slug`](https://sluglibrary.com/) font rendering algorithm
|
||||
- [ ] `raudio`: Support microphone input, basic API to read microphone
|
||||
|
||||
@ -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.
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
.{
|
||||
.name = .raylib,
|
||||
.version = "5.6.0-dev",
|
||||
.minimum_zig_version = "0.15.1",
|
||||
.version = "6.0.0",
|
||||
.minimum_zig_version = "0.16.0",
|
||||
|
||||
.fingerprint = 0x13035e5cb8bc1ac2, // Changing this has security and trust implications.
|
||||
|
||||
@ -11,6 +11,11 @@
|
||||
.hash = "N-V-__8AALShqgXkvqYU6f__FrA22SMWmi2TXCJjNTO1m8XJ",
|
||||
.lazy = true,
|
||||
},
|
||||
.raygui = .{
|
||||
.url = "git+https://github.com/raysan5/raygui#3b2855842ab578a034f827c38cf8f62c042fc983",
|
||||
.hash = "N-V-__8AAHvybwBw1kyBGn0BW_s1RqIpycNjLf_XbE-fpLUF",
|
||||
.lazy = true,
|
||||
},
|
||||
.emsdk = .{
|
||||
.url = "git+https://github.com/emscripten-core/emsdk#4.0.9",
|
||||
.hash = "N-V-__8AAJl1DwBezhYo_VE6f53mPVm00R-Fk28NPW7P14EQ",
|
||||
|
||||
@ -7,6 +7,30 @@ if(POLICY CMP0072)
|
||||
cmake_policy(SET CMP0072 NEW)
|
||||
endif()
|
||||
|
||||
include(CheckCSourceCompiles)
|
||||
include(CMakePushCheckState)
|
||||
|
||||
function(raylib_check_libatomic_required result)
|
||||
set(_atomic_test_source "
|
||||
int main(void)
|
||||
{
|
||||
volatile long long value = 0;
|
||||
return (int)__atomic_fetch_add(&value, 1, __ATOMIC_SEQ_CST);
|
||||
}")
|
||||
|
||||
check_c_source_compiles("${_atomic_test_source}" RAYLIB_ATOMICS_WITHOUT_LIBATOMIC)
|
||||
|
||||
if (RAYLIB_ATOMICS_WITHOUT_LIBATOMIC)
|
||||
set(${result} FALSE PARENT_SCOPE)
|
||||
else ()
|
||||
cmake_push_check_state()
|
||||
list(APPEND CMAKE_REQUIRED_LIBRARIES atomic)
|
||||
check_c_source_compiles("${_atomic_test_source}" RAYLIB_ATOMICS_WITH_LIBATOMIC)
|
||||
cmake_pop_check_state()
|
||||
set(${result} ${RAYLIB_ATOMICS_WITH_LIBATOMIC} PARENT_SCOPE)
|
||||
endif ()
|
||||
endfunction()
|
||||
|
||||
set(RAYLIB_DEPENDENCIES "include(CMakeFindDependencyMacro)")
|
||||
|
||||
if (${PLATFORM} STREQUAL "Desktop")
|
||||
@ -67,6 +91,21 @@ if (${PLATFORM} STREQUAL "Desktop")
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
elseif (${PLATFORM} STREQUAL "Win32")
|
||||
if ((NOT WIN32) AND (NOT CMAKE_C_COMPILER MATCHES "mingw|mingw32|mingw64"))
|
||||
message(FATAL_ERROR "Win32 platform requires Windows or a cross compiler.")
|
||||
endif ()
|
||||
|
||||
set(PLATFORM_CPP "PLATFORM_DESKTOP_WIN32")
|
||||
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
|
||||
|
||||
if (${OPENGL_VERSION} MATCHES "Software")
|
||||
set(GRAPHICS "GRAPHICS_API_OPENGL_SOFTWARE")
|
||||
endif ()
|
||||
|
||||
find_package(OpenGL QUIET)
|
||||
set(LIBS_PRIVATE ${OPENGL_LIBRARIES} winmm)
|
||||
|
||||
elseif (${PLATFORM} STREQUAL "Web")
|
||||
set(PLATFORM_CPP "PLATFORM_WEB")
|
||||
if(NOT GRAPHICS)
|
||||
@ -96,21 +135,30 @@ elseif (${PLATFORM} STREQUAL "Android")
|
||||
|
||||
elseif ("${PLATFORM}" STREQUAL "DRM")
|
||||
set(PLATFORM_CPP "PLATFORM_DRM")
|
||||
set(GRAPHICS "GRAPHICS_API_OPENGL_ES2")
|
||||
|
||||
add_definitions(-D_DEFAULT_SOURCE)
|
||||
add_definitions(-DEGL_NO_X11)
|
||||
add_definitions(-DPLATFORM_DRM)
|
||||
|
||||
find_library(GLESV2 GLESv2)
|
||||
find_library(EGL EGL)
|
||||
find_library(DRM drm)
|
||||
find_library(GBM gbm)
|
||||
|
||||
if (NOT CMAKE_CROSSCOMPILING OR NOT CMAKE_SYSROOT)
|
||||
include_directories(/usr/include/libdrm)
|
||||
endif ()
|
||||
set(LIBS_PRIVATE ${GLESV2} ${EGL} ${DRM} ${GBM} atomic pthread dl)
|
||||
|
||||
if ("${OPENGL_VERSION}" STREQUAL "Software")
|
||||
# software rendering does not require EGL/GBM.
|
||||
set(GRAPHICS "GRAPHICS_API_OPENGL_SOFTWARE")
|
||||
set(LIBS_PRIVATE ${DRM} atomic pthread dl)
|
||||
else ()
|
||||
set(GRAPHICS "GRAPHICS_API_OPENGL_ES2")
|
||||
add_definitions(-DEGL_NO_X11)
|
||||
|
||||
find_library(GLESV2 GLESv2)
|
||||
find_library(EGL EGL)
|
||||
find_library(GBM gbm)
|
||||
|
||||
set(LIBS_PRIVATE ${GLESV2} ${EGL} ${DRM} ${GBM} atomic pthread dl)
|
||||
endif ()
|
||||
set(LIBS_PUBLIC m)
|
||||
|
||||
elseif ("${PLATFORM}" STREQUAL "SDL")
|
||||
@ -147,6 +195,7 @@ elseif ("${PLATFORM}" STREQUAL "SDL")
|
||||
add_compile_definitions(USING_SDL2_PACKAGE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
elseif ("${PLATFORM}" STREQUAL "RGFW")
|
||||
set(PLATFORM_CPP "PLATFORM_DESKTOP_RGFW")
|
||||
|
||||
@ -172,6 +221,15 @@ elseif ("${PLATFORM}" STREQUAL "WebRGFW")
|
||||
set(PLATFORM_CPP "PLATFORM_WEB_RGFW")
|
||||
set(GRAPHICS "GRAPHICS_API_OPENGL_ES2")
|
||||
set(CMAKE_STATIC_LIBRARY_SUFFIX ".a")
|
||||
|
||||
elseif ("${PLATFORM}" STREQUAL "Memory")
|
||||
set(PLATFORM_CPP "PLATFORM_MEMORY")
|
||||
set(GRAPHICS "GRAPHICS_API_OPENGL_SOFTWARE")
|
||||
set(OPENGL_VERSION "Software")
|
||||
|
||||
if(WIN32 OR CMAKE_C_COMPILER MATCHES "mingw|mingw32|mingw64")
|
||||
set(LIBS_PRIVATE winmm)
|
||||
endif()
|
||||
endif ()
|
||||
|
||||
if (NOT ${OPENGL_VERSION} MATCHES "OFF")
|
||||
@ -203,6 +261,14 @@ endif ()
|
||||
|
||||
set(LIBS_PRIVATE ${LIBS_PRIVATE} ${OPENAL_LIBRARY})
|
||||
|
||||
if (SUPPORT_MODULE_RAUDIO AND UNIX AND NOT APPLE)
|
||||
raylib_check_libatomic_required(RAYLIB_LIBATOMIC_REQUIRED)
|
||||
if (RAYLIB_LIBATOMIC_REQUIRED)
|
||||
message(STATUS "64-bit atomics require libatomic")
|
||||
list(APPEND LIBS_PRIVATE atomic)
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
if (${PLATFORM} MATCHES "Desktop")
|
||||
set(LIBS_PRIVATE ${LIBS_PRIVATE} glfw)
|
||||
endif ()
|
||||
|
||||
@ -10,7 +10,9 @@ string(REGEX MATCHALL ${MACRO_REGEX} MACRO_LIST ${CONFIG_HEADER_CONTENT})
|
||||
set(CONFIG_HEADER_FLAGS ${MACRO_LIST})
|
||||
list(FILTER CONFIG_HEADER_FLAGS INCLUDE REGEX "^.+SUPPORT_")
|
||||
list(TRANSFORM CONFIG_HEADER_FLAGS REPLACE ${MACRO_REGEX} [[\2=OFF]] REGEX "^//")
|
||||
list(TRANSFORM CONFIG_HEADER_FLAGS REPLACE ${MACRO_REGEX} [[\2=ON]])
|
||||
list(TRANSFORM CONFIG_HEADER_FLAGS REPLACE ${MACRO_REGEX} [[\2=\3]] REGEX "^[^/]")
|
||||
list(TRANSFORM CONFIG_HEADER_FLAGS REPLACE [[=0$]] [[=OFF]])
|
||||
list(TRANSFORM CONFIG_HEADER_FLAGS REPLACE [[=1$]] [[=ON]])
|
||||
|
||||
set(CONFIG_HEADER_VALUES ${MACRO_LIST})
|
||||
list(FILTER CONFIG_HEADER_VALUES EXCLUDE REGEX "(^.+SUPPORT_)|(^//)")
|
||||
|
||||
@ -98,13 +98,15 @@ if (${PLATFORM} MATCHES "Android")
|
||||
|
||||
elseif (${PLATFORM} MATCHES "Web")
|
||||
set(example_sources) # clear example_sources
|
||||
list(APPEND example_sources others/web_basic_window.c)
|
||||
list(APPEND example_sources core/core_input_gestures_testbed.c)
|
||||
|
||||
elseif ("${PLATFORM}" STREQUAL "DRM")
|
||||
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/others/rlgl_standalone.c)
|
||||
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/others/raylib_opengl_interop.c)
|
||||
|
||||
elseif ("${PLATFORM}" MATCHES "Memory")
|
||||
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/others/raylib_opengl_interop.c)
|
||||
|
||||
elseif ("${OPENGL_VERSION}" STREQUAL "Software")
|
||||
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/others/rlgl_standalone.c)
|
||||
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/others/raylib_opengl_interop.c)
|
||||
|
||||
@ -20,6 +20,8 @@
|
||||
# - Linux (X11 desktop mode)
|
||||
# - macOS/OSX (x64, arm64 (not tested))
|
||||
# - Others (not tested)
|
||||
# > PLATFORM_DESKTOP_WIN32 (native Win32):
|
||||
# - Windows (Win32, Win64)
|
||||
# > PLATFORM_WEB_RGFW:
|
||||
# - HTML5 (WebAssembly)
|
||||
# > PLATFORM_WEB:
|
||||
@ -510,7 +512,7 @@ ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_WIN32)
|
||||
# Libraries for Windows desktop compilation
|
||||
LDFLAGS += -L..\src
|
||||
LDLIBS = -lraylib -lgdi32 -lwinmm -lshcore
|
||||
ifneq ($(GRAPHICS),GRAPHICS_API_OPENGL_11_SOFTWARE)
|
||||
ifneq ($(GRAPHICS),GRAPHICS_API_OPENGL_SOFTWARE)
|
||||
LDLIBS += -lopengl32
|
||||
endif
|
||||
endif
|
||||
@ -794,6 +796,23 @@ ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_GLFW)
|
||||
rm -f *.o
|
||||
endif
|
||||
endif
|
||||
ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_WIN32)
|
||||
ifeq ($(PLATFORM_OS),WINDOWS)
|
||||
del *.o *.exe /s
|
||||
endif
|
||||
ifeq ($(PLATFORM_OS),BSD)
|
||||
find . -type f -perm -ugo+x -delete
|
||||
rm -fv *.o
|
||||
endif
|
||||
ifeq ($(PLATFORM_OS),LINUX)
|
||||
find . -type f -executable -delete
|
||||
rm -fv *.o
|
||||
endif
|
||||
ifeq ($(PLATFORM_OS),OSX)
|
||||
find . -type f -perm +ugo+x -delete
|
||||
rm -f *.o
|
||||
endif
|
||||
endif
|
||||
ifeq ($(TARGET_PLATFORM),PLATFORM_DRM)
|
||||
find . -type f -executable -delete
|
||||
rm -fv *.o
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
#
|
||||
# raylib makefile for Android project (APK building)
|
||||
#
|
||||
# Copyright (c) 2017-2025 Ramon Santamaria (@raysan5)
|
||||
# Copyright (c) 2017-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.
|
||||
|
||||
@ -1153,7 +1153,10 @@ text/text_font_filters: text/text_font_filters.c
|
||||
--preload-file text/resources/KAISG.ttf@resources/KAISG.ttf
|
||||
|
||||
text/text_font_loading: text/text_font_loading.c
|
||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
|
||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
|
||||
--preload-file text/resources/pixantiqua.fnt@resources/pixantiqua.fnt \
|
||||
--preload-file text/resources/pixantiqua.png@resources/pixantiqua.png \
|
||||
--preload-file text/resources/pixantiqua.ttf@resources/pixantiqua.ttf
|
||||
|
||||
text/text_font_sdf: text/text_font_sdf.c
|
||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
|
||||
|
||||
238
examples/audio/audio_amp_envelope.c
Normal file
238
examples/audio/audio_amp_envelope.c
Normal file
@ -0,0 +1,238 @@
|
||||
/*******************************************************************************************
|
||||
*
|
||||
* raylib [audio] example - amp envelope
|
||||
*
|
||||
* Example complexity rating: [★☆☆☆] 1/4
|
||||
*
|
||||
* Example originally created with raylib 6.0, last time updated with raylib 6.0
|
||||
*
|
||||
* Example contributed by Arbinda Rizki Muhammad (@arbipink) and reviewed by Ramon Santamaria (@raysan5)
|
||||
*
|
||||
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||
* BSD-like license that allows static linking with closed source software
|
||||
*
|
||||
* Copyright (c) 2026 Arbinda Rizki Muhammad (@arbipink)
|
||||
*
|
||||
********************************************************************************************/
|
||||
|
||||
#include "raylib.h"
|
||||
|
||||
#define RAYGUI_IMPLEMENTATION
|
||||
#include "raygui.h"
|
||||
|
||||
#include <math.h> // Required for: sinf()
|
||||
|
||||
#define BUFFER_SIZE 4096
|
||||
#define SAMPLE_RATE 44100
|
||||
|
||||
// Wave state
|
||||
typedef enum {
|
||||
IDLE,
|
||||
ATTACK,
|
||||
DECAY,
|
||||
SUSTAIN,
|
||||
RELEASE
|
||||
} ADSRState;
|
||||
|
||||
// Grouping all ADSR parameters and state into a struct
|
||||
typedef struct {
|
||||
float attackTime;
|
||||
float decayTime;
|
||||
float sustainLevel;
|
||||
float releaseTime;
|
||||
float currentValue;
|
||||
ADSRState state;
|
||||
} Envelope;
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
// Module Functions Declaration
|
||||
//------------------------------------------------------------------------------------
|
||||
static void FillAudioBuffer(int i, float *buffer, float envelopeValue, float *audioTime);
|
||||
static void UpdateEnvelope(Envelope *env);
|
||||
static void DrawADSRGraph(Envelope *env, Rectangle bounds);
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
// Program main entry point
|
||||
//------------------------------------------------------------------------------------
|
||||
int main(void)
|
||||
{
|
||||
// Initialization
|
||||
//--------------------------------------------------------------------------------------
|
||||
const int screenWidth = 800;
|
||||
const int screenHeight = 450;
|
||||
|
||||
InitWindow(screenWidth, screenHeight, "raylib [audio] example - amp envelope");
|
||||
|
||||
InitAudioDevice();
|
||||
|
||||
// Set the number of samples the stream will keep in memory at a time to BUFFER_SIZE
|
||||
SetAudioStreamBufferSizeDefault(BUFFER_SIZE);
|
||||
float buffer[BUFFER_SIZE] = { 0 };
|
||||
|
||||
// Init raw audio stream (sample rate: 44100, sample size: 32bit-float, channels: 1-mono)
|
||||
AudioStream stream = LoadAudioStream(SAMPLE_RATE, 32, 1);
|
||||
|
||||
// Init Phase
|
||||
float audioTime = 0.0f;
|
||||
|
||||
// Initialize the struct
|
||||
Envelope env = {
|
||||
.attackTime = 1.0f,
|
||||
.decayTime = 1.0f,
|
||||
.sustainLevel = 0.5f,
|
||||
.releaseTime = 1.0f,
|
||||
.currentValue = 0.0f,
|
||||
.state = IDLE
|
||||
};
|
||||
|
||||
SetTargetFPS(60);
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
// Main game loop
|
||||
while (!WindowShouldClose())
|
||||
{
|
||||
// Update
|
||||
//----------------------------------------------------------------------------------
|
||||
if (IsKeyPressed(KEY_SPACE)) env.state = ATTACK;
|
||||
|
||||
if (IsKeyReleased(KEY_SPACE) && (env.state != IDLE)) env.state = RELEASE;
|
||||
|
||||
if (IsAudioStreamProcessed(stream))
|
||||
{
|
||||
if ((env.state != IDLE) || (env.currentValue > 0.0f))
|
||||
{
|
||||
for (int i = 0; i < BUFFER_SIZE; i++)
|
||||
{
|
||||
UpdateEnvelope(&env);
|
||||
FillAudioBuffer(i, buffer, env.currentValue, &audioTime);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Clear buffer if silent to avoid looping noise
|
||||
for (int i = 0; i < BUFFER_SIZE; i++) buffer[i] = 0;
|
||||
audioTime = 0.0f;
|
||||
}
|
||||
|
||||
UpdateAudioStream(stream, buffer, BUFFER_SIZE);
|
||||
}
|
||||
|
||||
if (!IsAudioStreamPlaying(stream)) PlayAudioStream(stream);
|
||||
//----------------------------------------------------------------------------------
|
||||
|
||||
// Draw
|
||||
//----------------------------------------------------------------------------------
|
||||
BeginDrawing();
|
||||
|
||||
ClearBackground(RAYWHITE);
|
||||
|
||||
GuiSliderBar((Rectangle){ 100, 60, 400, 30 }, "Attack (s)", TextFormat("%2.2fs", env.attackTime), &env.attackTime, 0.1f, 3.0f);
|
||||
GuiSliderBar((Rectangle){ 100, 100, 400, 30 }, "Decay (s)", TextFormat("%2.2fs", env.decayTime), &env.decayTime, 0.1f, 3.0f);
|
||||
GuiSliderBar((Rectangle){ 100, 140, 400, 30 }, "Sustain", TextFormat("%2.2f", env.sustainLevel), &env.sustainLevel, 0.0f, 1.0f);
|
||||
GuiSliderBar((Rectangle){ 100, 180, 400, 30 }, "Release (s)", TextFormat("%2.2fs", env.releaseTime), &env.releaseTime, 0.1f, 3.0f);
|
||||
|
||||
DrawADSRGraph(&env, (Rectangle){ 100, 250, 400, 100 });
|
||||
|
||||
DrawCircleV((Vector2){ 520, 350 - (env.currentValue * 100) }, 5, MAROON);
|
||||
DrawText(TextFormat("Current Gain: %2.2f", env.currentValue), 535, 345 - (env.currentValue * 100), 10, MAROON);
|
||||
|
||||
DrawText("Press SPACE to PLAY the sound!", 200, 400, 20, LIGHTGRAY);
|
||||
|
||||
EndDrawing();
|
||||
//----------------------------------------------------------------------------------
|
||||
}
|
||||
|
||||
// De-Initialization
|
||||
//--------------------------------------------------------------------------------------
|
||||
UnloadAudioStream(stream);
|
||||
CloseAudioDevice();
|
||||
|
||||
CloseWindow();
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
// Module Functions Definition
|
||||
//------------------------------------------------------------------------------------
|
||||
static void FillAudioBuffer(int i, float *buffer, float envelopeValue, float *audioTime)
|
||||
{
|
||||
int frequency = 440;
|
||||
buffer[i] = envelopeValue*sinf(2.0f*PI*frequency*(*audioTime));
|
||||
*audioTime += (1.0f/SAMPLE_RATE);
|
||||
}
|
||||
|
||||
static void UpdateEnvelope(Envelope *env)
|
||||
{
|
||||
// Calculate the time delta for ONE sample (1/44100)
|
||||
float sampleTime = 1.0f/SAMPLE_RATE;
|
||||
|
||||
switch(env->state)
|
||||
{
|
||||
case ATTACK:
|
||||
{
|
||||
env->currentValue += (1.0f/env->attackTime)*sampleTime;
|
||||
if (env->currentValue >= 1.0f)
|
||||
{
|
||||
env->currentValue = 1.0f;
|
||||
env->state = DECAY;
|
||||
}
|
||||
|
||||
} break;
|
||||
case DECAY:
|
||||
{
|
||||
env->currentValue -= ((1.0f - env->sustainLevel)/env->decayTime)*sampleTime;
|
||||
if (env->currentValue <= env->sustainLevel)
|
||||
{
|
||||
env->currentValue = env->sustainLevel;
|
||||
env->state = SUSTAIN;
|
||||
}
|
||||
|
||||
} break;
|
||||
case SUSTAIN:
|
||||
{
|
||||
env->currentValue = env->sustainLevel;
|
||||
|
||||
} break;
|
||||
case RELEASE:
|
||||
{
|
||||
env->currentValue -= (env->sustainLevel/env->releaseTime)*sampleTime;
|
||||
if (env->currentValue <= 0.001f) // Use a small threshold to avoid infinite tail
|
||||
{
|
||||
env->currentValue = 0.0f;
|
||||
env->state = IDLE;
|
||||
}
|
||||
|
||||
} break;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
|
||||
static void DrawADSRGraph(Envelope *env, Rectangle bounds)
|
||||
{
|
||||
DrawRectangleRec(bounds, Fade(LIGHTGRAY, 0.3f));
|
||||
DrawRectangleLinesEx(bounds, 1, GRAY);
|
||||
|
||||
// Fixed visual width for sustain stage since it's an amplitude not a time value
|
||||
float sustainWidth = 1.0f;
|
||||
|
||||
// Total time to visualize (sum of A, D, R + a padding for Sustain)
|
||||
float totalTime = env->attackTime + env->decayTime + sustainWidth + env->releaseTime;
|
||||
|
||||
float scaleX = bounds.width/totalTime;
|
||||
float scaleY = bounds.height;
|
||||
|
||||
Vector2 start = { bounds.x, bounds.y + bounds.height };
|
||||
Vector2 peak = { start.x + (env->attackTime*scaleX), bounds.y };
|
||||
Vector2 sustain = { peak.x + (env->decayTime*scaleX), bounds.y + (1.0f - env->sustainLevel)*scaleY };
|
||||
Vector2 rel = { sustain.x + (sustainWidth*scaleX), sustain.y };
|
||||
Vector2 end = { rel.x + (env->releaseTime*scaleX), bounds.y + bounds.height };
|
||||
|
||||
DrawLineV(start, peak, SKYBLUE);
|
||||
DrawLineV(peak, sustain, BLUE);
|
||||
DrawLineV(sustain, rel, DARKBLUE);
|
||||
DrawLineV(rel, end, ORANGE);
|
||||
|
||||
DrawText("ADSR Visualizer", bounds.x, bounds.y - 20, 10, DARKGRAY);
|
||||
}
|
||||
BIN
examples/audio/audio_amp_envelope.png
Normal file
BIN
examples/audio/audio_amp_envelope.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
6051
examples/audio/raygui.h
Normal file
6051
examples/audio/raygui.h
Normal file
File diff suppressed because it is too large
Load Diff
@ -23,15 +23,15 @@ void main()
|
||||
float localX = mod(fragCoord.x, cellWidth);
|
||||
float barWidth = cellWidth - 1.0;
|
||||
vec4 color = WHITE;
|
||||
|
||||
|
||||
if (localX <= barWidth)
|
||||
{
|
||||
float sampleX = (binIndex + 0.5)/NUM_OF_BINS;
|
||||
vec2 sampleCoord = vec2(sampleX, FFT_ROW);
|
||||
float amplitude = texture2D(iChannel0, sampleCoord).r; // Only filled the red channel, all channels left open for alternative use
|
||||
|
||||
|
||||
if (fragTexCoord.y < amplitude) color = BLACK;
|
||||
}
|
||||
|
||||
|
||||
gl_FragColor = color;
|
||||
}
|
||||
|
||||
@ -21,15 +21,15 @@ void main()
|
||||
float localX = mod(fragCoord.x, cellWidth);
|
||||
float barWidth = cellWidth - 1.0;
|
||||
vec4 color = WHITE;
|
||||
|
||||
|
||||
if (localX <= barWidth)
|
||||
{
|
||||
float sampleX = (binIndex + 0.5)/NUM_OF_BINS;
|
||||
vec2 sampleCoord = vec2(sampleX, FFT_ROW);
|
||||
float amplitude = texture2D(iChannel0, sampleCoord).r; // Only filled the red channel, all channels left open for alternative use
|
||||
|
||||
|
||||
if (fragTexCoord.y < amplitude) color = BLACK;
|
||||
}
|
||||
|
||||
|
||||
gl_FragColor = color;
|
||||
}
|
||||
|
||||
@ -21,15 +21,15 @@ void main()
|
||||
float localX = mod(fragCoord.x, cellWidth);
|
||||
float barWidth = cellWidth - 1.0;
|
||||
vec4 color = WHITE;
|
||||
|
||||
|
||||
if (localX <= barWidth)
|
||||
{
|
||||
float sampleX = (binIndex + 0.5)/NUM_OF_BINS;
|
||||
vec2 sampleCoord = vec2(sampleX, FFT_ROW);
|
||||
float amplitude = texture(iChannel0, sampleCoord).r; // Only filled the red channel, all channels left open for alternative use
|
||||
|
||||
|
||||
if (fragTexCoord.y < amplitude) color = BLACK;
|
||||
}
|
||||
|
||||
|
||||
finalColor = color;
|
||||
}
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||
* BSD-like license that allows static linking with closed source software
|
||||
*
|
||||
* Copyright (c) 2013-2025 Ramon Santamaria (@raysan5)
|
||||
* Copyright (c) 2013-2026 Ramon Santamaria (@raysan5)
|
||||
*
|
||||
********************************************************************************************/
|
||||
|
||||
|
||||
@ -21,6 +21,7 @@
|
||||
#include "raygui.h" // Required for GUI controls
|
||||
|
||||
#define MAX_FILEPATH_SIZE 1024
|
||||
#define FILE_FILTER "DIRS*;.png;.c"
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
// Program main entry point
|
||||
@ -41,7 +42,7 @@ int main(void)
|
||||
// NOTE: LoadDirectoryFiles() loads files and directories by default,
|
||||
// use LoadDirectoryFilesEx() for custom filters and recursive directories loading
|
||||
//FilePathList files = LoadDirectoryFiles(directory);
|
||||
FilePathList files = LoadDirectoryFilesEx(directory, ".png;.c", false);
|
||||
FilePathList files = LoadDirectoryFilesEx(directory, FILE_FILTER, false);
|
||||
|
||||
int btnBackPressed = false;
|
||||
|
||||
@ -61,7 +62,22 @@ int main(void)
|
||||
{
|
||||
TextCopy(directory, GetPrevDirectoryPath(directory));
|
||||
UnloadDirectoryFiles(files);
|
||||
files = LoadDirectoryFiles(directory);
|
||||
files = LoadDirectoryFilesEx(directory, FILE_FILTER, false);
|
||||
|
||||
listScrollIndex = 0;
|
||||
listItemActive = -1;
|
||||
listItemFocused = -1;
|
||||
}
|
||||
|
||||
if ((listItemActive >= 0) && (listItemActive < (int)files.count) && DirectoryExists(files.paths[listItemActive]))
|
||||
{
|
||||
TextCopy(directory, files.paths[listItemActive]);
|
||||
UnloadDirectoryFiles(files);
|
||||
files = LoadDirectoryFilesEx(directory, FILE_FILTER, false);
|
||||
|
||||
listScrollIndex = 0;
|
||||
listItemActive = -1;
|
||||
listItemFocused = -1;
|
||||
}
|
||||
//----------------------------------------------------------------------------------
|
||||
|
||||
|
||||
@ -52,7 +52,7 @@ int main(void)
|
||||
|
||||
// The target's height is flipped (in the source Rectangle), due to OpenGL reasons
|
||||
Rectangle sourceRec = { 0.0f, 0.0f, (float)target.texture.width, -(float)target.texture.height };
|
||||
Rectangle destRec = { -virtualRatio, -virtualRatio, screenWidth + (virtualRatio*2), screenHeight + (virtualRatio*2) };
|
||||
Rectangle destRec = { (screenWidth - screenWidth/1.25f)/2.0f, (screenHeight - screenHeight/1.25f)/2.0f, screenWidth/1.25f, screenHeight/1.25f };
|
||||
|
||||
Vector2 origin = { 0.0f, 0.0f };
|
||||
|
||||
@ -61,6 +61,9 @@ int main(void)
|
||||
float cameraX = 0.0f;
|
||||
float cameraY = 0.0f;
|
||||
|
||||
bool smoothOn = true;
|
||||
bool overscan = false;
|
||||
|
||||
SetTargetFPS(60);
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
@ -86,6 +89,18 @@ int main(void)
|
||||
worldSpaceCamera.target.y = truncf(screenSpaceCamera.target.y);
|
||||
screenSpaceCamera.target.y -= worldSpaceCamera.target.y;
|
||||
screenSpaceCamera.target.y *= virtualRatio;
|
||||
|
||||
if (IsKeyPressed(KEY_S)) smoothOn = !smoothOn;
|
||||
if (IsKeyPressed(KEY_O)) overscan = !overscan;
|
||||
|
||||
if (overscan)
|
||||
{
|
||||
destRec = (Rectangle) { -virtualRatio, -virtualRatio, screenWidth + (virtualRatio*2), screenHeight + (virtualRatio*2) };
|
||||
}
|
||||
else
|
||||
{
|
||||
destRec = (Rectangle) { (screenWidth - screenWidth/1.25f)/2.0f, (screenHeight - screenHeight/1.25f)/2.0f, screenWidth/1.25f, screenHeight/1.25f };
|
||||
}
|
||||
//----------------------------------------------------------------------------------
|
||||
|
||||
// Draw
|
||||
@ -101,14 +116,23 @@ int main(void)
|
||||
EndTextureMode();
|
||||
|
||||
BeginDrawing();
|
||||
ClearBackground(RED);
|
||||
ClearBackground(LIGHTGRAY);
|
||||
|
||||
BeginMode2D(screenSpaceCamera);
|
||||
if (smoothOn)
|
||||
{
|
||||
BeginMode2D(screenSpaceCamera);
|
||||
DrawTexturePro(target.texture, sourceRec, destRec, origin, 0.0f, WHITE);
|
||||
EndMode2D();
|
||||
}
|
||||
else
|
||||
{
|
||||
DrawTexturePro(target.texture, sourceRec, destRec, origin, 0.0f, WHITE);
|
||||
EndMode2D();
|
||||
}
|
||||
|
||||
DrawText(TextFormat("Screen resolution: %ix%i", screenWidth, screenHeight), 10, 10, 20, DARKBLUE);
|
||||
DrawText(TextFormat("World resolution: %ix%i", virtualScreenWidth, virtualScreenHeight), 10, 40, 20, DARKGREEN);
|
||||
DrawText(TextFormat("Smooth: %s", (smoothOn ? "ON" : "OFF")), 10, screenHeight - 60, 20, RED);
|
||||
DrawText(TextFormat("Overscan: %s", (overscan ? "ON" : "OFF")), 10, screenHeight - 30, 20, RED);
|
||||
DrawFPS(GetScreenWidth() - 95, 10);
|
||||
EndDrawing();
|
||||
//----------------------------------------------------------------------------------
|
||||
@ -122,4 +146,4 @@ int main(void)
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 3.4 KiB |
1422
examples/example_resources.zon
Normal file
1422
examples/example_resources.zon
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,8 +1,8 @@
|
||||
GLFW_ICON ICON "raylib.ico"
|
||||
|
||||
1 VERSIONINFO
|
||||
FILEVERSION 5,5,0,0
|
||||
PRODUCTVERSION 5,5,0,0
|
||||
FILEVERSION 6,0,0,0
|
||||
PRODUCTVERSION 6,0,0,0
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
@ -11,12 +11,12 @@ BEGIN
|
||||
BEGIN
|
||||
VALUE "CompanyName", "raylib technologies"
|
||||
VALUE "FileDescription", "raylib application (www.raylib.com)"
|
||||
VALUE "FileVersion", "5.5.0"
|
||||
VALUE "FileVersion", "6.0.0"
|
||||
VALUE "InternalName", "raylib-example"
|
||||
VALUE "LegalCopyright", "(c) 2025 Ramon Santamaria (@raysan5)"
|
||||
VALUE "LegalCopyright", "(c) 2026 Ramon Santamaria (@raysan5)"
|
||||
VALUE "OriginalFilename", "raylib-example"
|
||||
VALUE "ProductName", "raylib-example"
|
||||
VALUE "ProductVersion", "5.5.0"
|
||||
VALUE "ProductVersion", "6.0.0"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
|
||||
@ -53,13 +53,19 @@ int main(void)
|
||||
Model model = LoadModel("resources/models/gltf/robot.glb"); // Load character model
|
||||
Vector3 position = { 0.0f, 0.0f, 0.0f }; // Set model world position
|
||||
|
||||
#if SUPPORT_GPU_SKINNING
|
||||
// WARNING: SUPPORT_GPU_SKINNING is required to be enabled at raylib compile time (disabled by default)
|
||||
// It will skip loading CPU required buffers to store animation updated data, so, both modes are exclusive
|
||||
|
||||
// Load skinning shader
|
||||
// WARNING: It requires SUPPORT_GPU_SKINNING enabled on raylib (disabled by default)
|
||||
// NOTE: It must be a valid shader, following raylib attribs/uniform conventions for GPU skinning
|
||||
Shader skinningShader = LoadShader(TextFormat("resources/shaders/glsl%i/skinning.vs", GLSL_VERSION),
|
||||
TextFormat("resources/shaders/glsl%i/skinning.fs", GLSL_VERSION));
|
||||
|
||||
// Assign skinning shader to all materials shaders
|
||||
//for (int i = 0; i < model.materialCount; i++) model.materials[i].shader = skinningShader;
|
||||
// Skinning shader could be required to be assigned to all materials shaders, just to make
|
||||
// sure required uniforms are being updated for the mesh using that material (and shader)
|
||||
for (int i = 0; i < model.materialCount; i++) model.materials[i].shader = skinningShader;
|
||||
#endif
|
||||
|
||||
// Load model animations
|
||||
int animCount = 0;
|
||||
@ -244,6 +250,12 @@ int main(void)
|
||||
if (GuiDropdownBox((Rectangle){ GetScreenWidth() - 170.0f, 10, 160, 24 }, TextJoin(animNames, animCount, ";"),
|
||||
&animIndex1, dropdownEditMode1)) dropdownEditMode1 = !dropdownEditMode1;
|
||||
|
||||
GuiSetStyle(LABEL, TEXT_ALIGNMENT, TEXT_ALIGN_CENTER);
|
||||
GuiSetStyle(DEFAULT, TEXT_SIZE, GuiGetFont().baseSize*2);
|
||||
GuiLabel((Rectangle){ 0, GetScreenHeight() - 100.0f, GetScreenWidth(), 40 }, "PRESS SPACE to START BLENDING");
|
||||
GuiSetStyle(DEFAULT, TEXT_SIZE, GuiGetFont().baseSize);
|
||||
GuiSetStyle(LABEL, TEXT_ALIGNMENT, TEXT_ALIGN_LEFT);
|
||||
|
||||
// Draw playing timeline with keyframes for anim0[]
|
||||
GuiProgressBar((Rectangle){ 60, GetScreenHeight() - 60.0f, GetScreenWidth() - 180.0f, 20 }, "ANIM 0",
|
||||
TextFormat("FRAME: %.2f / %i", animFrameProgress0, anims[animIndex0].keyframeCount),
|
||||
@ -269,7 +281,9 @@ int main(void)
|
||||
//--------------------------------------------------------------------------------------
|
||||
UnloadModelAnimations(anims, animCount); // Unload model animation
|
||||
UnloadModel(model); // Unload model and meshes/material
|
||||
#if SUPPORT_GPU_SKINNING
|
||||
UnloadShader(skinningShader); // Unload GPU skinning shader
|
||||
#endif
|
||||
|
||||
CloseWindow(); // Close window and OpenGL context
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
@ -52,12 +52,19 @@ int main(void)
|
||||
Model model = LoadModel("resources/models/gltf/greenman.glb"); // Load character model
|
||||
Vector3 position = { 0.0f, 0.0f, 0.0f }; // Set model position
|
||||
|
||||
#if SUPPORT_GPU_SKINNING
|
||||
// WARNING: SUPPORT_GPU_SKINNING is required to be enabled at raylib compile time (disabled by default)
|
||||
// It will skip loading CPU required buffers to store animation updated data, so, both modes are exclusive
|
||||
|
||||
// Load skinning shader
|
||||
// WARNING: GPU skinning must be enabled in raylib with a compilation flag,
|
||||
// if not enabled, CPU skinning will be used instead
|
||||
// NOTE: It must be a valid shader, following raylib attribs/uniform conventions for GPU skinning
|
||||
Shader skinningShader = LoadShader(TextFormat("resources/shaders/glsl%i/skinning.vs", GLSL_VERSION),
|
||||
TextFormat("resources/shaders/glsl%i/skinning.fs", GLSL_VERSION));
|
||||
model.materials[1].shader = skinningShader;
|
||||
TextFormat("resources/shaders/glsl%i/skinning.fs", GLSL_VERSION));
|
||||
|
||||
// Skinning shader could be required to be assigned to all materials shaders, just to make
|
||||
// sure required uniforms are being updated for the mesh using that material (and shader)
|
||||
model.materials[1].shader = skinningShader; // Just assigning to materials[1] for this model
|
||||
#endif
|
||||
|
||||
// Load gltf model animations
|
||||
int animCount = 0;
|
||||
@ -111,7 +118,9 @@ int main(void)
|
||||
//--------------------------------------------------------------------------------------
|
||||
UnloadModelAnimations(anims, animCount); // Unload model animation
|
||||
UnloadModel(model); // Unload model and meshes/material
|
||||
#if SUPPORT_GPU_SKINNING
|
||||
UnloadShader(skinningShader); // Unload GPU skinning shader
|
||||
#endif
|
||||
|
||||
CloseWindow(); // Close window and OpenGL context
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
@ -77,7 +77,7 @@ int main(void)
|
||||
{
|
||||
// Cast a ray from the screen center (where crosshair would be)
|
||||
Vector2 screenCenter = { GetScreenWidth()/2.0f, GetScreenHeight()/2.0f };
|
||||
Ray ray = GetMouseRay(screenCenter, camera);
|
||||
Ray ray = GetScreenToWorldRay(screenCenter, camera);
|
||||
|
||||
// Check ray collision with all voxels
|
||||
float closestDistance = 99999.0f;
|
||||
|
||||
@ -108,7 +108,7 @@ int main(void)
|
||||
decalMaterial.maps[MATERIAL_MAP_DIFFUSE].color = RAYWHITE;
|
||||
|
||||
bool showModel = true;
|
||||
Model decalModels[MAX_DECALS] = { 0 };
|
||||
static Model decalModels[MAX_DECALS] = { 0 };
|
||||
int decalCount = 0;
|
||||
|
||||
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
||||
|
||||
@ -13,9 +13,9 @@
|
||||
| models/vox/chr_knight.vox | ❔ | ❔ | - |
|
||||
| models/vox/chr_sword.vox | ❔ | ❔ | - |
|
||||
| models/vox/monu9.vox | ❔ | ❔ | - |
|
||||
| billboard.png | [@emegeme](https://github.com/emegeme) | [CC0](https://creativecommons.org/publicdomain/zero/1.0/) | - |
|
||||
| billboard.png | [@raysan5](https://github.com/raysan5) | [CC0](https://creativecommons.org/publicdomain/zero/1.0/) | - |
|
||||
| cubicmap.png | [@raysan5](https://github.com/raysan5) | [CC0](https://creativecommons.org/publicdomain/zero/1.0/) | - |
|
||||
| cubicmap_atlas.png | [@emegeme](https://github.com/emegeme) | [CC0](https://creativecommons.org/publicdomain/zero/1.0/) | - |
|
||||
| cubicmap_atlas.png | [@raysan5](https://github.com/raysan5) | [CC0](https://creativecommons.org/publicdomain/zero/1.0/) | - |
|
||||
| heightmap.png | [@raysan5](https://github.com/raysan5) | [CC0](https://creativecommons.org/publicdomain/zero/1.0/) | - |
|
||||
| dresden_square_1k.hdr | [HDRIHaven](https://hdrihaven.com/hdri/?h=dresden_square) | [CC0](https://hdrihaven.com/p/license.php) | - |
|
||||
| dresden_square_2k.hdr | [HDRIHaven](https://hdrihaven.com/hdri/?h=dresden_square) | [CC0](https://hdrihaven.com/p/license.php) | - |
|
||||
|
||||
@ -14,7 +14,7 @@ void main()
|
||||
{
|
||||
// Fetch color from texture sampler
|
||||
vec4 texelColor = texture2D(texture0, fragTexCoord);
|
||||
|
||||
|
||||
// Calculate final fragment color
|
||||
gl_FragColor = texelColor*colDiffuse*fragColor;
|
||||
}
|
||||
|
||||
@ -23,7 +23,7 @@ void main()
|
||||
int boneIndex1 = int(vertexBoneIndices.y);
|
||||
int boneIndex2 = int(vertexBoneIndices.z);
|
||||
int boneIndex3 = int(vertexBoneIndices.w);
|
||||
|
||||
|
||||
// WARNING: OpenGL ES 2.0 does not support automatic matrix transposing, neither transpose() function
|
||||
mat4 boneMatrixTransposed0 = mat4(
|
||||
vec4(boneMatrices[boneIndex0][0].x, boneMatrices[boneIndex0][1].x, boneMatrices[boneIndex0][2].x, boneMatrices[boneIndex0][3].x),
|
||||
@ -45,13 +45,13 @@ void main()
|
||||
vec4(boneMatrices[boneIndex3][0].y, boneMatrices[boneIndex3][1].y, boneMatrices[boneIndex3][2].y, boneMatrices[boneIndex3][3].y),
|
||||
vec4(boneMatrices[boneIndex3][0].z, boneMatrices[boneIndex3][1].z, boneMatrices[boneIndex3][2].z, boneMatrices[boneIndex3][3].z),
|
||||
vec4(boneMatrices[boneIndex3][0].w, boneMatrices[boneIndex3][1].w, boneMatrices[boneIndex3][2].w, boneMatrices[boneIndex3][3].w));
|
||||
|
||||
|
||||
vec4 skinnedPosition =
|
||||
vertexBoneWeights.x*(boneMatrixTransposed0*vec4(vertexPosition, 1.0)) +
|
||||
vertexBoneWeights.y*(boneMatrixTransposed1*vec4(vertexPosition, 1.0)) +
|
||||
vertexBoneWeights.z*(boneMatrixTransposed2*vec4(vertexPosition, 1.0)) +
|
||||
vertexBoneWeights.y*(boneMatrixTransposed1*vec4(vertexPosition, 1.0)) +
|
||||
vertexBoneWeights.z*(boneMatrixTransposed2*vec4(vertexPosition, 1.0)) +
|
||||
vertexBoneWeights.w*(boneMatrixTransposed3*vec4(vertexPosition, 1.0));
|
||||
|
||||
|
||||
fragTexCoord = vertexTexCoord;
|
||||
fragColor = vertexColor;
|
||||
|
||||
|
||||
@ -12,7 +12,7 @@ void main()
|
||||
{
|
||||
// Fetch color from texture sampler
|
||||
vec4 texelColor = texture2D(texture0, fragTexCoord);
|
||||
|
||||
|
||||
// Calculate final fragment color
|
||||
gl_FragColor = texelColor*colDiffuse*fragColor;
|
||||
}
|
||||
|
||||
@ -23,7 +23,7 @@ void main()
|
||||
int boneIndex1 = int(vertexBoneIndices.y);
|
||||
int boneIndex2 = int(vertexBoneIndices.z);
|
||||
int boneIndex3 = int(vertexBoneIndices.w);
|
||||
|
||||
|
||||
// WARNING: OpenGL ES 2.0 does not support automatic matrix transposing, neither transpose() function
|
||||
mat4 boneMatrixTransposed0 = mat4(
|
||||
vec4(boneMatrices[boneIndex0][0].x, boneMatrices[boneIndex0][1].x, boneMatrices[boneIndex0][2].x, boneMatrices[boneIndex0][3].x),
|
||||
@ -45,13 +45,13 @@ void main()
|
||||
vec4(boneMatrices[boneIndex3][0].y, boneMatrices[boneIndex3][1].y, boneMatrices[boneIndex3][2].y, boneMatrices[boneIndex3][3].y),
|
||||
vec4(boneMatrices[boneIndex3][0].z, boneMatrices[boneIndex3][1].z, boneMatrices[boneIndex3][2].z, boneMatrices[boneIndex3][3].z),
|
||||
vec4(boneMatrices[boneIndex3][0].w, boneMatrices[boneIndex3][1].w, boneMatrices[boneIndex3][2].w, boneMatrices[boneIndex3][3].w));
|
||||
|
||||
|
||||
vec4 skinnedPosition =
|
||||
vertexBoneWeights.x*(boneMatrixTransposed0*vec4(vertexPosition, 1.0)) +
|
||||
vertexBoneWeights.y*(boneMatrixTransposed1*vec4(vertexPosition, 1.0)) +
|
||||
vertexBoneWeights.z*(boneMatrixTransposed2*vec4(vertexPosition, 1.0)) +
|
||||
vertexBoneWeights.y*(boneMatrixTransposed1*vec4(vertexPosition, 1.0)) +
|
||||
vertexBoneWeights.z*(boneMatrixTransposed2*vec4(vertexPosition, 1.0)) +
|
||||
vertexBoneWeights.w*(boneMatrixTransposed3*vec4(vertexPosition, 1.0));
|
||||
|
||||
|
||||
fragTexCoord = vertexTexCoord;
|
||||
fragColor = vertexColor;
|
||||
|
||||
|
||||
@ -26,17 +26,17 @@ void main()
|
||||
int boneIndex1 = int(vertexBoneIndices.y);
|
||||
int boneIndex2 = int(vertexBoneIndices.z);
|
||||
int boneIndex3 = int(vertexBoneIndices.w);
|
||||
|
||||
|
||||
vec4 skinnedPosition =
|
||||
vertexBoneWeights.x*(boneMatrices[boneIndex0]*vec4(vertexPosition, 1.0)) +
|
||||
vertexBoneWeights.y*(boneMatrices[boneIndex1]*vec4(vertexPosition, 1.0)) +
|
||||
vertexBoneWeights.z*(boneMatrices[boneIndex2]*vec4(vertexPosition, 1.0)) +
|
||||
vertexBoneWeights.y*(boneMatrices[boneIndex1]*vec4(vertexPosition, 1.0)) +
|
||||
vertexBoneWeights.z*(boneMatrices[boneIndex2]*vec4(vertexPosition, 1.0)) +
|
||||
vertexBoneWeights.w*(boneMatrices[boneIndex3]*vec4(vertexPosition, 1.0));
|
||||
|
||||
vec4 skinnedNormal =
|
||||
vertexBoneWeights.x*(boneMatrices[boneIndex0]*vec4(vertexNormal, 0.0)) +
|
||||
vertexBoneWeights.y*(boneMatrices[boneIndex1]*vec4(vertexNormal, 0.0)) +
|
||||
vertexBoneWeights.z*(boneMatrices[boneIndex2]*vec4(vertexNormal, 0.0)) +
|
||||
vertexBoneWeights.y*(boneMatrices[boneIndex1]*vec4(vertexNormal, 0.0)) +
|
||||
vertexBoneWeights.z*(boneMatrices[boneIndex2]*vec4(vertexNormal, 0.0)) +
|
||||
vertexBoneWeights.w*(boneMatrices[boneIndex3]*vec4(vertexNormal, 0.0));
|
||||
skinnedNormal.w = 0.0;
|
||||
|
||||
|
||||
@ -28,7 +28,7 @@
|
||||
|
||||
#include "raylib.h"
|
||||
|
||||
#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_DESKTOP_SDL)
|
||||
#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_DESKTOP_SDL) || defined(PLATFORM_DESKTOP_RGFW)
|
||||
#if defined(GRAPHICS_API_OPENGL_ES2)
|
||||
#include "glad_gles2.h" // Required for: OpenGL functionality
|
||||
#define glGenVertexArrays glGenVertexArraysOES
|
||||
|
||||
@ -58,12 +58,12 @@ void main()
|
||||
float gray = GreyScale(cellColor);
|
||||
|
||||
float n = 4096.0;
|
||||
|
||||
|
||||
// Character set from https://www.shadertoy.com/view/lssGDj
|
||||
// Create new bitmaps https://thrill-project.com/archiv/coding/bitmap/
|
||||
if (gray > 0.2) n = 65600.0; // :
|
||||
if (gray > 0.3) n = 18725316.0; // v
|
||||
if (gray > 0.4) n = 15255086.0; // o
|
||||
if (gray > 0.4) n = 15255086.0; // o
|
||||
if (gray > 0.5) n = 13121101.0; // &
|
||||
if (gray > 0.6) n = 15252014.0; // 8
|
||||
if (gray > 0.7) n = 13195790.0; // @
|
||||
|
||||
@ -12,5 +12,5 @@ void main()
|
||||
fragTexCoord = vertexTexCoord;
|
||||
|
||||
// Calculate final vertex position
|
||||
gl_Position = vec4(vertexPosition, 1.0);
|
||||
gl_Position = vec4(vertexPosition, 1.0);
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#version 100
|
||||
#extension GL_EXT_frag_depth : enable
|
||||
#extension GL_EXT_frag_depth : enable
|
||||
|
||||
precision mediump float;
|
||||
|
||||
@ -14,7 +14,7 @@ uniform vec4 colDiffuse;
|
||||
void main()
|
||||
{
|
||||
vec4 texelColor = texture2D(texture0, fragTexCoord);
|
||||
|
||||
|
||||
gl_FragColor = texelColor*colDiffuse*fragColor;
|
||||
gl_FragDepthEXT = 1.0 - gl_FragCoord.z;
|
||||
}
|
||||
|
||||
@ -24,13 +24,13 @@ void main()
|
||||
{
|
||||
// Store the fragment position vector in the first gbuffer texture
|
||||
//gPosition = fragPosition;
|
||||
|
||||
|
||||
// Store the per-fragment normals into the gbuffer
|
||||
//gNormal = normalize(fragNormal);
|
||||
|
||||
|
||||
// Store the diffuse per-fragment color
|
||||
gl_FragColor.rgb = texture2D(texture0, fragTexCoord).rgb;
|
||||
|
||||
|
||||
// Store specular intensity in gAlbedoSpec's alpha component
|
||||
gl_FragColor.a = texture2D(specularTexture, fragTexCoord).r;
|
||||
}
|
||||
|
||||
@ -48,7 +48,7 @@ void main()
|
||||
{
|
||||
// Calculate vertex attributes for fragment shader
|
||||
vec4 worldPos = matModel*vec4(vertexPosition, 1.0);
|
||||
fragPosition = worldPos.xyz;
|
||||
fragPosition = worldPos.xyz;
|
||||
fragTexCoord = vertexTexCoord;
|
||||
fragColor = vertexColor;
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
#version 100
|
||||
|
||||
#extension GL_EXT_frag_depth : enable // Extension required for writing depth
|
||||
|
||||
|
||||
precision mediump float; // Precision required for OpenGL ES2 (WebGL)
|
||||
|
||||
varying vec2 fragTexCoord;
|
||||
|
||||
@ -32,12 +32,12 @@ float sdHorseshoe(in vec3 p, in vec2 c, in float r, in float le, vec2 w)
|
||||
{
|
||||
p.x = abs(p.x);
|
||||
float l = length(p.xy);
|
||||
p.xy = mat2(-c.x, c.y,
|
||||
p.xy = mat2(-c.x, c.y,
|
||||
c.y, c.x)*p.xy;
|
||||
p.xy = vec2((p.y>0.0 || p.x>0.0)?p.x:l*sign(-c.x),
|
||||
(p.x>0.0)?p.y:l);
|
||||
p.xy = vec2(p.x,abs(p.y-r))-vec2(le,0.0);
|
||||
|
||||
|
||||
vec2 q = vec2(length(max(p.xy,0.0)) + min(0.0,max(p.x,p.y)),p.z);
|
||||
vec2 d = abs(q) - w;
|
||||
return min(max(d.x,d.y),0.0) + length(max(d,0.0));
|
||||
@ -56,9 +56,9 @@ float sdSixWayCutHollowSphere(vec3 p, float r, float h, float t)
|
||||
}
|
||||
|
||||
vec2 q = vec2(length(ap.yz), ap.x);
|
||||
|
||||
|
||||
float w = sqrt(r*r-h*h);
|
||||
|
||||
|
||||
return ((h*q.x<w*q.y) ? length(q-vec2(w,h)) : abs(length(q)-r)) - t;
|
||||
}
|
||||
|
||||
@ -110,8 +110,8 @@ vec2 raycast(in vec3 ro, in vec3 rd)
|
||||
if (t>tmax) break;
|
||||
vec2 h = map(ro+rd*t);
|
||||
if (abs(h.x) < (0.0001*t))
|
||||
{
|
||||
res = vec2(t,h.y);
|
||||
{
|
||||
res = vec2(t,h.y);
|
||||
break;
|
||||
}
|
||||
t += h.x;
|
||||
@ -146,9 +146,9 @@ float calcSoftshadow(in vec3 ro, in vec3 rd, in float mint, in float tmax)
|
||||
vec3 calcNormal(in vec3 pos)
|
||||
{
|
||||
vec2 e = vec2(1.0,-1.0)*0.5773*0.0005;
|
||||
return normalize(e.xyy*map(pos + e.xyy).x +
|
||||
e.yyx*map(pos + e.yyx).x +
|
||||
e.yxy*map(pos + e.yxy).x +
|
||||
return normalize(e.xyy*map(pos + e.xyy).x +
|
||||
e.yyx*map(pos + e.yyx).x +
|
||||
e.yxy*map(pos + e.yxy).x +
|
||||
e.xxx*map(pos + e.xxx).x);
|
||||
}
|
||||
|
||||
@ -176,15 +176,15 @@ float checkersGradBox(in vec2 p)
|
||||
// analytical integral (box filter)
|
||||
vec2 i = 2.0*(abs(fract((p-0.5*w)*0.5)-0.5)-abs(fract((p+0.5*w)*0.5)-0.5))/w;
|
||||
// xor pattern
|
||||
return 0.5 - 0.5*i.x*i.y;
|
||||
return 0.5 - 0.5*i.x*i.y;
|
||||
}
|
||||
|
||||
// https://www.shadertoy.com/view/tdS3DG
|
||||
vec4 render(in vec3 ro, in vec3 rd)
|
||||
{
|
||||
{
|
||||
// background
|
||||
vec3 col = vec3(0.7, 0.7, 0.9) - max(rd.y,0.0)*0.3;
|
||||
|
||||
|
||||
// raycast scene
|
||||
vec2 res = raycast(ro,rd);
|
||||
float t = res.x;
|
||||
@ -194,11 +194,11 @@ vec4 render(in vec3 ro, in vec3 rd)
|
||||
vec3 pos = ro + t*rd;
|
||||
vec3 nor = (m<1.5) ? vec3(0.0,1.0,0.0) : calcNormal(pos);
|
||||
vec3 ref = reflect(rd, nor);
|
||||
|
||||
// material
|
||||
|
||||
// material
|
||||
col = 0.2 + 0.2*sin(m*2.0 + vec3(0.0,1.0,2.0));
|
||||
float ks = 1.0;
|
||||
|
||||
|
||||
if (m<1.5)
|
||||
{
|
||||
float f = checkersGradBox(3.0*pos.xz);
|
||||
@ -208,7 +208,7 @@ vec4 render(in vec3 ro, in vec3 rd)
|
||||
|
||||
// lighting
|
||||
float occ = calcAO(pos, nor);
|
||||
|
||||
|
||||
vec3 lin = vec3(0.0);
|
||||
|
||||
// sun
|
||||
@ -249,7 +249,7 @@ vec4 render(in vec3 ro, in vec3 rd)
|
||||
dif *= occ;
|
||||
lin += col*0.25*dif*vec3(1.00,1.00,1.00);
|
||||
}
|
||||
|
||||
|
||||
col = lin;
|
||||
|
||||
col = mix(col, vec3(0.7,0.7,0.9), 1.0-exp(-0.0001*t*t*t));
|
||||
@ -289,7 +289,7 @@ void main()
|
||||
color = res.xyz;
|
||||
depth = CalcDepth(rd,res.w);
|
||||
}
|
||||
|
||||
|
||||
gl_FragColor = vec4(color , 1.0);
|
||||
gl_FragDepthEXT = depth;
|
||||
}
|
||||
@ -48,7 +48,7 @@ void main()
|
||||
float normR = float(iter - (iter/55)*55)/55.0;
|
||||
float normG = float(iter - (iter/69)*69)/69.0;
|
||||
float normB = float(iter - (iter/40)*40)/40.0;
|
||||
|
||||
|
||||
gl_FragColor = vec4(sin(normR*PI), sin(normG*PI), sin(normB*PI), 1.0);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -21,7 +21,7 @@ void main()
|
||||
// Convert the (normalized) texel color RED component (GB would work, too)
|
||||
// to the palette index by scaling up from [0..1] to [0..255]
|
||||
int index = int(texelColor.r*255.0);
|
||||
|
||||
|
||||
ivec3 color = ivec3(0);
|
||||
|
||||
// NOTE: On GLSL 100 we are not allowed to index a uniform array by a variable value,
|
||||
@ -34,7 +34,7 @@ void main()
|
||||
else if (index == 5) color = palette[5];
|
||||
else if (index == 6) color = palette[6];
|
||||
else if (index == 7) color = palette[7];
|
||||
|
||||
|
||||
//gl_FragColor = texture2D(palette, texelColor.xy); // Alternative to ivec3
|
||||
|
||||
// Calculate final fragment color. Note that the palette color components
|
||||
|
||||
@ -83,11 +83,11 @@ vec3 ComputePBR()
|
||||
{
|
||||
vec3 albedo = texture2D(albedoMap, vec2(fragTexCoord.x*tiling.x + offset.x, fragTexCoord.y*tiling.y + offset.y)).rgb;
|
||||
albedo = vec3(albedoColor.x*albedo.x, albedoColor.y*albedo.y, albedoColor.z*albedo.z);
|
||||
|
||||
|
||||
float metallic = clamp(metallicValue, 0.0, 1.0);
|
||||
float roughness = clamp(roughnessValue, 0.0, 1.0);
|
||||
float ao = clamp(aoValue, 0.0, 1.0);
|
||||
|
||||
|
||||
if (useTexMRA == 1)
|
||||
{
|
||||
vec4 mra = texture2D(mraMap, vec2(fragTexCoord.x*tiling.x + offset.x, fragTexCoord.y*tiling.y + offset.y));
|
||||
@ -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);
|
||||
}
|
||||
@ -132,18 +132,18 @@ vec3 ComputePBR()
|
||||
vec3 F = SchlickFresnel(hDotV, baseRefl); // Fresnel proportion of specular reflectance
|
||||
|
||||
vec3 spec = (D*G*F)/(4.0*nDotV*nDotL);
|
||||
|
||||
|
||||
// Difuse and spec light can't be above 1.0
|
||||
// kD = 1.0 - kS diffuse component is equal 1.0 - spec comonent
|
||||
vec3 kD = vec3(1.0) - F;
|
||||
|
||||
|
||||
// Mult kD by the inverse of metallnes, only non-metals should have diffuse light
|
||||
kD *= 1.0 - metallic;
|
||||
lightAccum += ((kD*albedo.rgb/PI + spec)*radiance*nDotL)*float(lights[i].enabled); // Angle of light has impact on result
|
||||
}
|
||||
|
||||
|
||||
vec3 ambientFinal = (ambientColor + albedo)*ambient*0.5;
|
||||
|
||||
|
||||
return (ambientFinal + lightAccum*ao + emissive);
|
||||
}
|
||||
|
||||
@ -153,7 +153,7 @@ void main()
|
||||
|
||||
// HDR tonemapping
|
||||
color = pow(color, color + vec3(1.0));
|
||||
|
||||
|
||||
// Gamma correction
|
||||
color = pow(color, vec3(1.0/2.2));
|
||||
|
||||
|
||||
@ -60,7 +60,7 @@ void main()
|
||||
float bias = max(0.0008*(1.0 - dot(normal, l)), 0.00008);
|
||||
int shadowCounter = 0;
|
||||
const int numSamples = 9;
|
||||
|
||||
|
||||
// PCF (percentage-closer filtering) algorithm:
|
||||
// Instead of testing if just one point is closer to the current point,
|
||||
// we test the surrounding points as well
|
||||
@ -74,7 +74,7 @@ void main()
|
||||
if (curDepth - bias > sampleDepth) shadowCounter++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
finalColor = mix(finalColor, vec4(0, 0, 0, 1), float(shadowCounter)/float(numSamples));
|
||||
|
||||
// Add ambient lighting whether in shadow or not
|
||||
|
||||
@ -56,12 +56,12 @@ void main()
|
||||
float gray = GreyScale(cellColor);
|
||||
|
||||
float n = 4096.0;
|
||||
|
||||
|
||||
// Character set from https://www.shadertoy.com/view/lssGDj
|
||||
// Create new bitmaps https://thrill-project.com/archiv/coding/bitmap/
|
||||
if (gray > 0.2) n = 65600.0; // :
|
||||
if (gray > 0.3) n = 18725316.0; // v
|
||||
if (gray > 0.4) n = 15255086.0; // o
|
||||
if (gray > 0.4) n = 15255086.0; // o
|
||||
if (gray > 0.5) n = 13121101.0; // &
|
||||
if (gray > 0.6) n = 15252014.0; // 8
|
||||
if (gray > 0.7) n = 13195790.0; // @
|
||||
|
||||
@ -12,5 +12,5 @@ void main()
|
||||
fragTexCoord = vertexTexCoord;
|
||||
|
||||
// Calculate final vertex position
|
||||
gl_Position = vec4(vertexPosition, 1.0);
|
||||
gl_Position = vec4(vertexPosition, 1.0);
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#version 120
|
||||
|
||||
#extension GL_EXT_frag_depth : enable
|
||||
#extension GL_EXT_frag_depth : enable
|
||||
|
||||
varying vec2 fragTexCoord;
|
||||
varying vec4 fragColor;
|
||||
@ -11,7 +11,7 @@ uniform vec4 colDiffuse;
|
||||
void main()
|
||||
{
|
||||
vec4 texelColor = texture2D(texture0, fragTexCoord);
|
||||
|
||||
|
||||
gl_FragColor = texelColor*colDiffuse*fragColor;
|
||||
gl_FragDepthEXT = 1.0 - gl_FragCoord.z;
|
||||
}
|
||||
@ -22,13 +22,13 @@ void main()
|
||||
{
|
||||
// Store the fragment position vector in the first gbuffer texture
|
||||
//gPosition = fragPosition;
|
||||
|
||||
|
||||
// Store the per-fragment normals into the gbuffer
|
||||
//gNormal = normalize(fragNormal);
|
||||
|
||||
|
||||
// Store the diffuse per-fragment color
|
||||
gl_FragColor.rgb = texture2D(texture0, fragTexCoord).rgb;
|
||||
|
||||
|
||||
// Store specular intensity in gAlbedoSpec's alpha component
|
||||
gl_FragColor.a = texture2D(specularTexture, fragTexCoord).r;
|
||||
}
|
||||
|
||||
@ -48,7 +48,7 @@ void main()
|
||||
{
|
||||
// Calculate vertex attributes for fragment shader
|
||||
vec4 worldPos = matModel*vec4(vertexPosition, 1.0);
|
||||
fragPosition = worldPos.xyz;
|
||||
fragPosition = worldPos.xyz;
|
||||
fragTexCoord = vertexTexCoord;
|
||||
fragColor = vertexColor;
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#version 120
|
||||
|
||||
#extension GL_EXT_frag_depth : enable // Extension required for writing depth
|
||||
#extension GL_EXT_frag_depth : enable // Extension required for writing depth
|
||||
|
||||
varying vec2 fragTexCoord;
|
||||
varying vec4 fragColor;
|
||||
|
||||
@ -30,12 +30,12 @@ float sdHorseshoe(in vec3 p, in vec2 c, in float r, in float le, vec2 w)
|
||||
{
|
||||
p.x = abs(p.x);
|
||||
float l = length(p.xy);
|
||||
p.xy = mat2(-c.x, c.y,
|
||||
p.xy = mat2(-c.x, c.y,
|
||||
c.y, c.x)*p.xy;
|
||||
p.xy = vec2((p.y>0.0 || p.x>0.0)?p.x:l*sign(-c.x),
|
||||
(p.x>0.0)?p.y:l);
|
||||
p.xy = vec2(p.x,abs(p.y-r))-vec2(le,0.0);
|
||||
|
||||
|
||||
vec2 q = vec2(length(max(p.xy,0.0)) + min(0.0,max(p.x,p.y)),p.z);
|
||||
vec2 d = abs(q) - w;
|
||||
return min(max(d.x,d.y),0.0) + length(max(d,0.0));
|
||||
@ -54,9 +54,9 @@ float sdSixWayCutHollowSphere(vec3 p, float r, float h, float t)
|
||||
}
|
||||
|
||||
vec2 q = vec2(length(ap.yz), ap.x);
|
||||
|
||||
|
||||
float w = sqrt(r*r-h*h);
|
||||
|
||||
|
||||
return ((h*q.x<w*q.y) ? length(q-vec2(w,h)) : abs(length(q)-r)) - t;
|
||||
}
|
||||
|
||||
@ -108,8 +108,8 @@ vec2 raycast(in vec3 ro, in vec3 rd)
|
||||
if (t>tmax) break;
|
||||
vec2 h = map(ro+rd*t);
|
||||
if (abs(h.x) < (0.0001*t))
|
||||
{
|
||||
res = vec2(t,h.y);
|
||||
{
|
||||
res = vec2(t,h.y);
|
||||
break;
|
||||
}
|
||||
t += h.x;
|
||||
@ -144,9 +144,9 @@ float calcSoftshadow(in vec3 ro, in vec3 rd, in float mint, in float tmax)
|
||||
vec3 calcNormal(in vec3 pos)
|
||||
{
|
||||
vec2 e = vec2(1.0, -1.0)*0.5773*0.0005;
|
||||
return normalize(e.xyy*map(pos + e.xyy).x +
|
||||
e.yyx*map(pos + e.yyx).x +
|
||||
e.yxy*map(pos + e.yxy).x +
|
||||
return normalize(e.xyy*map(pos + e.xyy).x +
|
||||
e.yyx*map(pos + e.yyx).x +
|
||||
e.yxy*map(pos + e.yxy).x +
|
||||
e.xxx*map(pos + e.xxx).x);
|
||||
}
|
||||
|
||||
@ -174,15 +174,15 @@ float checkersGradBox(in vec2 p)
|
||||
// analytical integral (box filter)
|
||||
vec2 i = 2.0*(abs(fract((p-0.5*w)*0.5)-0.5)-abs(fract((p+0.5*w)*0.5)-0.5))/w;
|
||||
// xor pattern
|
||||
return 0.5 - 0.5*i.x*i.y;
|
||||
return 0.5 - 0.5*i.x*i.y;
|
||||
}
|
||||
|
||||
// https://www.shadertoy.com/view/tdS3DG
|
||||
vec4 render(in vec3 ro, in vec3 rd)
|
||||
{
|
||||
{
|
||||
// background
|
||||
vec3 col = vec3(0.7, 0.7, 0.9) - max(rd.y,0.0)*0.3;
|
||||
|
||||
|
||||
// raycast scene
|
||||
vec2 res = raycast(ro,rd);
|
||||
float t = res.x;
|
||||
@ -192,11 +192,11 @@ vec4 render(in vec3 ro, in vec3 rd)
|
||||
vec3 pos = ro + t*rd;
|
||||
vec3 nor = (m<1.5) ? vec3(0.0,1.0,0.0) : calcNormal(pos);
|
||||
vec3 ref = reflect(rd, nor);
|
||||
|
||||
// material
|
||||
|
||||
// material
|
||||
col = 0.2 + 0.2*sin(m*2.0 + vec3(0.0,1.0,2.0));
|
||||
float ks = 1.0;
|
||||
|
||||
|
||||
if (m<1.5)
|
||||
{
|
||||
float f = checkersGradBox(3.0*pos.xz);
|
||||
@ -206,7 +206,7 @@ vec4 render(in vec3 ro, in vec3 rd)
|
||||
|
||||
// lighting
|
||||
float occ = calcAO(pos, nor);
|
||||
|
||||
|
||||
vec3 lin = vec3(0.0);
|
||||
|
||||
// sun
|
||||
@ -247,7 +247,7 @@ vec4 render(in vec3 ro, in vec3 rd)
|
||||
dif *= occ;
|
||||
lin += col*0.25*dif*vec3(1.00,1.00,1.00);
|
||||
}
|
||||
|
||||
|
||||
col = lin;
|
||||
|
||||
col = mix(col, vec3(0.7,0.7,0.9), 1.0-exp(-0.0001*t*t*t));
|
||||
|
||||
@ -81,11 +81,11 @@ vec3 ComputePBR()
|
||||
{
|
||||
vec3 albedo = texture2D(albedoMap, vec2(fragTexCoord.x*tiling.x + offset.x, fragTexCoord.y*tiling.y + offset.y)).rgb;
|
||||
albedo = vec3(albedoColor.x*albedo.x, albedoColor.y*albedo.y, albedoColor.z*albedo.z);
|
||||
|
||||
|
||||
float metallic = clamp(metallicValue, 0.0, 1.0);
|
||||
float roughness = clamp(roughnessValue, 0.0, 1.0);
|
||||
float ao = clamp(aoValue, 0.0, 1.0);
|
||||
|
||||
|
||||
if (useTexMRA == 1)
|
||||
{
|
||||
vec4 mra = texture2D(mraMap, vec2(fragTexCoord.x*tiling.x + offset.x, fragTexCoord.y*tiling.y + offset.y));
|
||||
@ -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);
|
||||
}
|
||||
@ -130,18 +130,18 @@ vec3 ComputePBR()
|
||||
vec3 F = SchlickFresnel(hDotV, baseRefl); // Fresnel proportion of specular reflectance
|
||||
|
||||
vec3 spec = (D*G*F)/(4.0*nDotV*nDotL);
|
||||
|
||||
|
||||
// Difuse and spec light can't be above 1.0
|
||||
// kD = 1.0 - kS diffuse component is equal 1.0 - spec comonent
|
||||
vec3 kD = vec3(1.0) - F;
|
||||
|
||||
|
||||
// Mult kD by the inverse of metallnes, only non-metals should have diffuse light
|
||||
kD *= 1.0 - metallic;
|
||||
lightAccum += ((kD*albedo.rgb/PI + spec)*radiance*nDotL)*float(lights[i].enabled); // Angle of light has impact on result
|
||||
}
|
||||
|
||||
|
||||
vec3 ambientFinal = (ambientColor + albedo)*ambient*0.5;
|
||||
|
||||
|
||||
return (ambientFinal + lightAccum*ao + emissive);
|
||||
}
|
||||
|
||||
@ -151,7 +151,7 @@ void main()
|
||||
|
||||
// HDR tonemapping
|
||||
color = pow(color, color + vec3(1.0));
|
||||
|
||||
|
||||
// Gamma correction
|
||||
color = pow(color, vec3(1.0/2.2));
|
||||
|
||||
|
||||
@ -58,7 +58,7 @@ void main()
|
||||
float bias = max(0.0008*(1.0 - dot(normal, l)), 0.00008);
|
||||
int shadowCounter = 0;
|
||||
const int numSamples = 9;
|
||||
|
||||
|
||||
// PCF (percentage-closer filtering) algorithm:
|
||||
// Instead of testing if just one point is closer to the current point,
|
||||
// we test the surrounding points as well
|
||||
@ -72,7 +72,7 @@ void main()
|
||||
if (curDepth - bias > sampleDepth) shadowCounter++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
finalColor = mix(finalColor, vec4(0, 0, 0, 1), float(shadowCounter)/float(numSamples));
|
||||
|
||||
// Add ambient lighting whether in shadow or not
|
||||
|
||||
@ -52,12 +52,12 @@ void main()
|
||||
float gray = GreyScale(cellColor);
|
||||
|
||||
int n = 4096;
|
||||
|
||||
|
||||
// Character set from https://www.shadertoy.com/view/lssGDj
|
||||
// Create new bitmaps https://thrill-project.com/archiv/coding/bitmap/
|
||||
if (gray > 0.2) n = 65600; // :
|
||||
if (gray > 0.3) n = 18725316; // v
|
||||
if (gray > 0.4) n = 15255086; // o
|
||||
if (gray > 0.4) n = 15255086; // o
|
||||
if (gray > 0.5) n = 13121101; // &
|
||||
if (gray > 0.6) n = 15252014; // 8
|
||||
if (gray > 0.7) n = 13195790; // @
|
||||
|
||||
@ -20,7 +20,7 @@ void main()
|
||||
|
||||
// NOTE: Implement here your fragment shader code
|
||||
|
||||
// final color is the color from the texture
|
||||
// final color is the color from the texture
|
||||
// times the tint color (colDiffuse)
|
||||
// times the fragment color (interpolated vertex color)
|
||||
finalColor = texelColor*colDiffuse*fragColor;
|
||||
|
||||
@ -14,7 +14,7 @@ out vec4 finalColor;
|
||||
void main()
|
||||
{
|
||||
vec4 texelColor = texture(texture0, fragTexCoord);
|
||||
|
||||
|
||||
finalColor = texelColor*colDiffuse*fragColor;
|
||||
gl_FragDepth = 1.0 - finalColor.z;
|
||||
}
|
||||
|
||||
@ -14,7 +14,7 @@ uniform mat4 matProjection;
|
||||
void main()
|
||||
{
|
||||
vec4 worldPos = matModel*vec4(vertexPosition, 1.0);
|
||||
fragPosition = worldPos.xyz;
|
||||
fragPosition = worldPos.xyz;
|
||||
fragTexCoord = vertexTexCoord;
|
||||
|
||||
mat3 normalMatrix = transpose(inverse(mat3(matModel)));
|
||||
|
||||
@ -16,7 +16,7 @@ out vec4 finalColor;
|
||||
void main()
|
||||
{
|
||||
vec4 texelColor = texture(texture0, fragTexCoord);
|
||||
|
||||
|
||||
finalColor = texelColor*colDiffuse*fragColor;
|
||||
gl_FragDepth = finalColor.z;
|
||||
}
|
||||
@ -33,7 +33,7 @@ float sdHorseshoe(in vec3 p, in vec2 c, in float r, in float le, vec2 w)
|
||||
p.xy = mat2(-c.x, c.y, c.y, c.x)*p.xy;
|
||||
p.xy = vec2(((p.y > 0.0) || (p.x > 0.0))? p.x : l*sign(-c.x), (p.x>0.0)? p.y : l);
|
||||
p.xy = vec2(p.x, abs(p.y - r)) - vec2(le, 0.0);
|
||||
|
||||
|
||||
vec2 q = vec2(length(max(p.xy, 0.0)) + min(0.0, max(p.x, p.y)), p.z);
|
||||
vec2 d = abs(q) - w;
|
||||
return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));
|
||||
@ -54,7 +54,7 @@ float sdSixWayCutHollowSphere(vec3 p, float r, float h, float t)
|
||||
|
||||
vec2 q = vec2(length(ap.yz), ap.x);
|
||||
float w = sqrt(r*r-h*h);
|
||||
|
||||
|
||||
return ((h*q.x < w*q.y)? length(q - vec2(w, h)) : abs(length(q) - r)) - t;
|
||||
}
|
||||
|
||||
@ -79,7 +79,7 @@ vec2 map(in vec3 pos)
|
||||
{
|
||||
vec2 res = vec2(sdHorseshoe(pos - vec3(-1.0, 0.08, 1.0), vec2(cos(1.3), sin(1.3)), 0.2, 0.3, vec2(0.03,0.5)), 11.5);
|
||||
res = opU(res, vec2(sdSixWayCutHollowSphere(pos-vec3(0.0, 1.0, 0.0), 4.0, 3.5, 0.5), 4.5));
|
||||
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
@ -105,8 +105,8 @@ vec2 raycast(in vec3 ro, in vec3 rd)
|
||||
if (t > tmax) break;
|
||||
vec2 h = map(ro + rd*t);
|
||||
if (abs(h.x )< (0.0001*t))
|
||||
{
|
||||
res = vec2(t, h.y);
|
||||
{
|
||||
res = vec2(t, h.y);
|
||||
break;
|
||||
}
|
||||
t += h.x;
|
||||
@ -131,9 +131,9 @@ float calcSoftshadow(in vec3 ro, in vec3 rd, in float mint, in float tmax)
|
||||
t += clamp(h, 0.01, 0.2);
|
||||
if ((res < 0.004) || (t > tmax)) break;
|
||||
}
|
||||
|
||||
|
||||
res = clamp(res, 0.0, 1.0);
|
||||
|
||||
|
||||
return res*res*(3.0-2.0*res);
|
||||
}
|
||||
|
||||
@ -141,9 +141,9 @@ float calcSoftshadow(in vec3 ro, in vec3 rd, in float mint, in float tmax)
|
||||
vec3 calcNormal(in vec3 pos)
|
||||
{
|
||||
vec2 e = vec2(1.0, -1.0)*0.5773*0.0005;
|
||||
return normalize(e.xyy*map(pos + e.xyy).x +
|
||||
e.yyx*map(pos + e.yyx).x +
|
||||
e.yxy*map(pos + e.yxy).x +
|
||||
return normalize(e.xyy*map(pos + e.xyy).x +
|
||||
e.yyx*map(pos + e.yyx).x +
|
||||
e.yxy*map(pos + e.yxy).x +
|
||||
e.xxx*map(pos + e.xxx).x);
|
||||
}
|
||||
|
||||
@ -160,7 +160,7 @@ float calcAO(in vec3 pos, in vec3 nor)
|
||||
sca *= 0.95;
|
||||
if (occ>0.35) break;
|
||||
}
|
||||
|
||||
|
||||
return clamp(1.0 - 3.0*occ, 0.0, 1.0)*(0.5+0.5*nor.y);
|
||||
}
|
||||
|
||||
@ -172,15 +172,15 @@ float checkersGradBox(in vec2 p)
|
||||
// analytical integral (box filter)
|
||||
vec2 i = 2.0*(abs(fract((p - 0.5*w)*0.5)-0.5) - abs(fract((p + 0.5*w)*0.5) - 0.5))/w;
|
||||
// xor pattern
|
||||
return (0.5 - 0.5*i.x*i.y);
|
||||
return (0.5 - 0.5*i.x*i.y);
|
||||
}
|
||||
|
||||
// https://www.shadertoy.com/view/tdS3DG
|
||||
vec4 render(in vec3 ro, in vec3 rd)
|
||||
{
|
||||
{
|
||||
// background
|
||||
vec3 col = vec3(0.7, 0.7, 0.9) - max(rd.y,0.0)*0.3;
|
||||
|
||||
|
||||
// raycast scene
|
||||
vec2 res = raycast(ro,rd);
|
||||
float t = res.x;
|
||||
@ -190,11 +190,11 @@ vec4 render(in vec3 ro, in vec3 rd)
|
||||
vec3 pos = ro + t*rd;
|
||||
vec3 nor = (m<1.5) ? vec3(0.0,1.0,0.0) : calcNormal(pos);
|
||||
vec3 ref = reflect(rd, nor);
|
||||
|
||||
// material
|
||||
|
||||
// material
|
||||
col = 0.2 + 0.2*sin(m*2.0 + vec3(0.0,1.0,2.0));
|
||||
float ks = 1.0;
|
||||
|
||||
|
||||
if (m < 1.5)
|
||||
{
|
||||
float f = checkersGradBox(3.0*pos.xz);
|
||||
@ -204,7 +204,7 @@ vec4 render(in vec3 ro, in vec3 rd)
|
||||
|
||||
// lighting
|
||||
float occ = calcAO(pos, nor);
|
||||
|
||||
|
||||
vec3 lin = vec3(0.0);
|
||||
|
||||
// sun
|
||||
@ -245,7 +245,7 @@ vec4 render(in vec3 ro, in vec3 rd)
|
||||
dif *= occ;
|
||||
lin += col*0.25*dif*vec3(1.00,1.00,1.00);
|
||||
}
|
||||
|
||||
|
||||
col = lin;
|
||||
|
||||
col = mix(col, vec3(0.7,0.7,0.9), 1.0-exp(-0.0001*t*t*t));
|
||||
@ -285,7 +285,7 @@ void main()
|
||||
color = res.xyz;
|
||||
depth = CalcDepth(rd,res.w);
|
||||
}
|
||||
|
||||
|
||||
finalColor = vec4(color , 1.0);
|
||||
gl_FragDepth = depth;
|
||||
}
|
||||
@ -24,7 +24,7 @@ void main()
|
||||
// to the palette index by scaling up from [0..1] to [0..255]
|
||||
int index = int(texelColor.r*255.0);
|
||||
ivec3 color = palette[index];
|
||||
|
||||
|
||||
//finalColor = texture(palette, texelColor.xy); // Alternative to ivec3
|
||||
|
||||
// Calculate final fragment color. Note that the palette color components
|
||||
|
||||
@ -84,11 +84,11 @@ vec3 ComputePBR()
|
||||
{
|
||||
vec3 albedo = texture(albedoMap,vec2(fragTexCoord.x*tiling.x + offset.x, fragTexCoord.y*tiling.y + offset.y)).rgb;
|
||||
albedo = vec3(albedoColor.x*albedo.x, albedoColor.y*albedo.y, albedoColor.z*albedo.z);
|
||||
|
||||
|
||||
float metallic = clamp(metallicValue, 0.0, 1.0);
|
||||
float roughness = clamp(roughnessValue, 0.0, 1.0);
|
||||
float ao = clamp(aoValue, 0.0, 1.0);
|
||||
|
||||
|
||||
if (useTexMRA == 1)
|
||||
{
|
||||
vec4 mra = texture(mraMap, vec2(fragTexCoord.x*tiling.x + offset.x, fragTexCoord.y*tiling.y + offset.y));
|
||||
@ -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);
|
||||
}
|
||||
@ -133,18 +133,18 @@ vec3 ComputePBR()
|
||||
vec3 F = SchlickFresnel(hDotV, baseRefl); // Fresnel proportion of specular reflectance
|
||||
|
||||
vec3 spec = (D*G*F)/(4.0*nDotV*nDotL);
|
||||
|
||||
|
||||
// Difuse and spec light can't be above 1.0
|
||||
// kD = 1.0 - kS diffuse component is equal 1.0 - spec comonent
|
||||
vec3 kD = vec3(1.0) - F;
|
||||
|
||||
|
||||
// Mult kD by the inverse of metallnes, only non-metals should have diffuse light
|
||||
kD *= 1.0 - metallic;
|
||||
lightAccum += ((kD*albedo.rgb/PI + spec)*radiance*nDotL)*lights[i].enabled; // Angle of light has impact on result
|
||||
}
|
||||
|
||||
|
||||
vec3 ambientFinal = (ambientColor + albedo)*ambient*0.5;
|
||||
|
||||
|
||||
return (ambientFinal + lightAccum*ao + emissive);
|
||||
}
|
||||
|
||||
@ -154,7 +154,7 @@ void main()
|
||||
|
||||
// HDR tonemapping
|
||||
color = pow(color, color + vec3(1.0));
|
||||
|
||||
|
||||
// Gamma correction
|
||||
color = pow(color, vec3(1.0/2.2));
|
||||
|
||||
|
||||
@ -11,7 +11,7 @@ uniform mat4 mvp;
|
||||
uniform mat4 matModel;
|
||||
uniform mat4 matNormal;
|
||||
|
||||
uniform float time;
|
||||
uniform float time;
|
||||
|
||||
uniform sampler2D perlinNoiseMap;
|
||||
|
||||
|
||||
@ -69,7 +69,7 @@ int main(void)
|
||||
DrawText("USING DEFAULT SHADER", 20, 40, 10, RED);
|
||||
|
||||
DrawCircle(80, 120, 35, DARKBLUE);
|
||||
DrawCircleGradient(80, 220, 60, GREEN, SKYBLUE);
|
||||
DrawCircleGradient((Vector2){ 80.0f, 220.0f }, 60, GREEN, SKYBLUE);
|
||||
DrawCircleLines(80, 340, 80, DARKBLUE);
|
||||
|
||||
|
||||
|
||||
@ -56,6 +56,7 @@ int main(void)
|
||||
// Set the texture tiling using a shader
|
||||
float tiling[2] = { 3.0f, 3.0f };
|
||||
Shader shader = LoadShader(0, TextFormat("resources/shaders/glsl%i/tiling.fs", GLSL_VERSION));
|
||||
SetTextureWrap(texture, TEXTURE_WRAP_REPEAT);
|
||||
SetShaderValue(shader, GetShaderLocation(shader, "tiling"), tiling, SHADER_UNIFORM_VEC2);
|
||||
model.materials[0].shader = shader;
|
||||
|
||||
|
||||
@ -17,6 +17,8 @@
|
||||
|
||||
#include "raylib.h"
|
||||
|
||||
#include "raymath.h"
|
||||
|
||||
#include <stdlib.h> // Required for: malloc(), free()
|
||||
#include <math.h> // Required for: hypot()
|
||||
|
||||
@ -68,6 +70,8 @@ int main(void)
|
||||
Vector2 pressOffset = { 0 }; // Mouse press offset relative to the ball that grabbedd
|
||||
|
||||
float gravity = 100; // World gravity
|
||||
|
||||
Vector2 windowPosition = GetWindowPosition();
|
||||
|
||||
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
||||
//---------------------------------------------------------------------------------------
|
||||
@ -128,6 +132,17 @@ int main(void)
|
||||
}
|
||||
}
|
||||
|
||||
// Get window position change for shaking
|
||||
Vector2 windowPositionDelta = Vector2Subtract(windowPosition, GetWindowPosition());
|
||||
|
||||
if (Vector2Length(windowPositionDelta) > 5.0f)
|
||||
{
|
||||
for (int i = 0; i < ballCount; i++)
|
||||
{
|
||||
if (!balls[i].grabbed) balls[i].speed = Vector2Add(balls[i].speed, Vector2Scale(windowPositionDelta, 10.0f));
|
||||
}
|
||||
}
|
||||
|
||||
// Shake balls
|
||||
if (IsMouseButtonPressed(MOUSE_BUTTON_MIDDLE))
|
||||
{
|
||||
@ -194,6 +209,8 @@ int main(void)
|
||||
ball->prevPosition = ball->position;
|
||||
}
|
||||
}
|
||||
|
||||
windowPosition = GetWindowPosition();
|
||||
//----------------------------------------------------------------------------------
|
||||
|
||||
// Draw
|
||||
@ -222,8 +239,9 @@ int main(void)
|
||||
// De-Initialization
|
||||
//--------------------------------------------------------------------------------------
|
||||
RL_FREE(balls);
|
||||
|
||||
CloseWindow(); // Close window and OpenGL context
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -50,7 +50,7 @@ int main(void)
|
||||
|
||||
// Circle shapes and lines
|
||||
DrawCircle(screenWidth/5, 120, 35, DARKBLUE);
|
||||
DrawCircleGradient(screenWidth/5, 220, 60, GREEN, SKYBLUE);
|
||||
DrawCircleGradient((Vector2){ screenWidth/5.0f, 220.0f }, 60, GREEN, SKYBLUE);
|
||||
DrawCircleLines(screenWidth/5, 340, 80, DARKBLUE);
|
||||
DrawEllipse(screenWidth/5, 120, 25, 20, YELLOW);
|
||||
DrawEllipseLines(screenWidth/5, 120, 30, 25, YELLOW);
|
||||
|
||||
133
examples/shapes/shapes_ellipse_collision.c
Normal file
133
examples/shapes/shapes_ellipse_collision.c
Normal file
@ -0,0 +1,133 @@
|
||||
/*******************************************************************************************
|
||||
*
|
||||
* raylib [shapes] example - ellipse collision
|
||||
*
|
||||
* Example complexity rating: [★★☆☆] 2/4
|
||||
*
|
||||
* Example originally created with raylib 5.5, last time updated with raylib 5.5
|
||||
*
|
||||
* Example contributed by Ziya (@Monjaris)
|
||||
*
|
||||
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||
* BSD-like license that allows static linking with closed source software
|
||||
*
|
||||
* Copyright (c) 2025 Ziya (@Monjaris)
|
||||
*
|
||||
********************************************************************************************/
|
||||
|
||||
#include "raylib.h"
|
||||
#include <math.h>
|
||||
|
||||
// Check if point is inside ellipse
|
||||
static bool CheckCollisionPointEllipse(Vector2 point, Vector2 center, float rx, float ry)
|
||||
{
|
||||
float dx = (point.x - center.x)/rx;
|
||||
float dy = (point.y - center.y)/ry;
|
||||
return (dx*dx + dy*dy) <= 1.0f;
|
||||
}
|
||||
|
||||
// Check if two ellipses collide
|
||||
// Uses radial boundary distance in the direction between centers — scales correctly with radii
|
||||
static bool CheckCollisionEllipses(Vector2 c1, float rx1, float ry1, Vector2 c2, float rx2, float ry2)
|
||||
{
|
||||
float dx = c2.x - c1.x;
|
||||
float dy = c2.y - c1.y;
|
||||
float dist = sqrtf(dx*dx + dy*dy);
|
||||
|
||||
// Ellipses are on top of each other
|
||||
if (dist == 0.0f) return true;
|
||||
|
||||
float theta = atan2f(dy, dx);
|
||||
float cosT = cosf(theta);
|
||||
float sinT = sinf(theta);
|
||||
|
||||
// Radial distance from center to ellipse boundary in direction theta
|
||||
// r(theta) = (rx * ry) / sqrt((ry*cos)^2 + (rx*sin)^2)
|
||||
float r1 = (rx1*ry1)/sqrtf((ry1*cosT)*(ry1*cosT) + (rx1*sinT)*(rx1*sinT));
|
||||
float r2 = (rx2*ry2)/sqrtf((ry2*cosT)*(ry2*cosT) + (rx2*sinT)*(rx2*sinT));
|
||||
|
||||
return dist <= (r1 + r2);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
// Program main entry point
|
||||
//------------------------------------------------------------------------------------
|
||||
int main(void)
|
||||
{
|
||||
// Initialization
|
||||
//--------------------------------------------------------------------------------------
|
||||
const int screenWidth = 800;
|
||||
const int screenHeight = 450;
|
||||
|
||||
InitWindow(screenWidth, screenHeight, "raylib [shapes] example - collision ellipses");
|
||||
SetTargetFPS(60);
|
||||
|
||||
Vector2 ellipseACenter = { (float)screenWidth/4, (float)screenHeight/2 };
|
||||
float ellipseARx = 120.0f;
|
||||
float ellipseARy = 70.0f;
|
||||
|
||||
Vector2 ellipseBCenter = { (float)screenWidth*3/4, (float)screenHeight/2 };
|
||||
float ellipseBRx = 90.0f;
|
||||
float ellipseBRy = 140.0f;
|
||||
|
||||
// 0 = controlling A, 1 = controlling B
|
||||
int controlled = 0;
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
// Main game loop
|
||||
while (!WindowShouldClose()) // Detect window close button or ESC key
|
||||
{
|
||||
// Update
|
||||
//----------------------------------------------------------------------------------
|
||||
if (IsKeyPressed(KEY_A)) controlled = 0;
|
||||
if (IsKeyPressed(KEY_B)) controlled = 1;
|
||||
|
||||
if (controlled == 0) ellipseACenter = GetMousePosition();
|
||||
else ellipseBCenter = GetMousePosition();
|
||||
|
||||
bool ellipsesCollide = CheckCollisionEllipses(
|
||||
ellipseACenter, ellipseARx, ellipseARy,
|
||||
ellipseBCenter, ellipseBRx, ellipseBRy
|
||||
);
|
||||
|
||||
bool mouseInA = CheckCollisionPointEllipse(GetMousePosition(), ellipseACenter, ellipseARx, ellipseARy);
|
||||
bool mouseInB = CheckCollisionPointEllipse(GetMousePosition(), ellipseBCenter, ellipseBRx, ellipseBRy);
|
||||
//----------------------------------------------------------------------------------
|
||||
|
||||
// Draw
|
||||
//----------------------------------------------------------------------------------
|
||||
BeginDrawing();
|
||||
|
||||
ClearBackground(RAYWHITE);
|
||||
|
||||
DrawEllipse((int)ellipseACenter.x, (int)ellipseACenter.y, ellipseARx, ellipseARy, ellipsesCollide ? RED : BLUE);
|
||||
|
||||
DrawEllipse((int)ellipseBCenter.x, (int)ellipseBCenter.y, ellipseBRx, ellipseBRy, ellipsesCollide ? RED : GREEN);
|
||||
|
||||
DrawEllipseLines((int)ellipseACenter.x, (int)ellipseACenter.y, ellipseARx, ellipseARy, WHITE);
|
||||
|
||||
DrawEllipseLines((int)ellipseBCenter.x, (int)ellipseBCenter.y, ellipseBRx, ellipseBRy, WHITE);
|
||||
|
||||
DrawCircleV(ellipseACenter, 4, WHITE);
|
||||
DrawCircleV(ellipseBCenter, 4, WHITE);
|
||||
|
||||
if (ellipsesCollide) DrawText("ELLIPSES COLLIDE", screenWidth/2 - 120, 40, 28, RED);
|
||||
else DrawText("NO COLLISION", screenWidth/2 - 80, 40, 28, DARKGRAY);
|
||||
|
||||
DrawText(controlled == 0 ? "Controlling: A" : "Controlling: B", 20, screenHeight - 40, 20, YELLOW);
|
||||
|
||||
if (mouseInA && controlled != 0) DrawText("Mouse inside ellipse A", 20, screenHeight - 70, 20, BLUE);
|
||||
if (mouseInB && controlled != 1) DrawText("Mouse inside ellipse B", 20, screenHeight - 70, 20, GREEN);
|
||||
|
||||
DrawText("Press [A] or [B] to switch control", 20, 20, 20, GRAY);
|
||||
|
||||
EndDrawing();
|
||||
//----------------------------------------------------------------------------------
|
||||
}
|
||||
|
||||
// De-Initialization
|
||||
CloseWindow();
|
||||
|
||||
return 0;
|
||||
}
|
||||
BIN
examples/shapes/shapes_ellipse_collision.png
Normal file
BIN
examples/shapes/shapes_ellipse_collision.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 17 KiB |
@ -341,7 +341,7 @@ static void DrawLightMask(int slot)
|
||||
rlSetBlendMode(BLEND_CUSTOM);
|
||||
|
||||
// If we are valid, then draw the light radius to the alpha mask
|
||||
if (lights[slot].valid) DrawCircleGradient((int)lights[slot].position.x, (int)lights[slot].position.y, lights[slot].outerRadius, ColorAlpha(WHITE, 0), WHITE);
|
||||
if (lights[slot].valid) DrawCircleGradient(lights[slot].position, lights[slot].outerRadius, ColorAlpha(WHITE, 0), WHITE);
|
||||
|
||||
rlDrawRenderBatchActive();
|
||||
|
||||
|
||||
@ -38,12 +38,12 @@ int main(void)
|
||||
|
||||
// Define characters to draw
|
||||
// NOTE: raylib supports UTF-8 encoding, following list is actually codified as UTF8 internally
|
||||
const char msg[256] = "!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHI\nJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmn\nopqrstuvwxyz{|}~¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓ\nÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷\nøùúûüýþÿ";
|
||||
const char msg[256] = "!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHI\nJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmn\nopqrstuvwxyz{|}~¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓ\nÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷\nøùúûüýþÿ";
|
||||
|
||||
// NOTE: Textures/Fonts MUST be loaded after Window initialization (OpenGL context is required)
|
||||
|
||||
// BMFont (AngelCode) : Font data and image atlas have been generated using external program
|
||||
Font fontBm = LoadFont("resources/pixantiqua.fnt");
|
||||
Font fontBm = LoadFont("resources/pixantiqua.fnt"); // Requires "resources/pixantiqua.png"
|
||||
|
||||
// TTF font : Font data and atlas are generated directly from TTF
|
||||
// NOTE: We define a font base size of 32 pixels tall and up-to 250 characters
|
||||
|
||||
@ -39,7 +39,8 @@ int main(void)
|
||||
Image parrots = LoadImage("resources/parrots.png"); // Load image in CPU memory (RAM)
|
||||
|
||||
// Draw one image over the other with a scaling of 1.5f
|
||||
ImageDraw(&parrots, cat, (Rectangle){ 0, 0, (float)cat.width, (float)cat.height }, (Rectangle){ 30, 40, cat.width*1.5f, cat.height*1.5f }, WHITE);
|
||||
ImageDrawImagePro(&parrots, cat, (Rectangle){ 0, 0, (float)cat.width, (float)cat.height },
|
||||
(Rectangle){ 30, 40, cat.width*1.5f, cat.height*1.5f }, (Vector2){ 0 }, 0.0f, WHITE);
|
||||
ImageCrop(&parrots, (Rectangle){ 0, 50, (float)parrots.width, (float)parrots.height - 100 }); // Crop resulting image
|
||||
|
||||
// Draw on the image with a few image draw methods
|
||||
|
||||
@ -34,7 +34,7 @@ int main()
|
||||
DrawFPS(10, 10);
|
||||
EndDrawing();
|
||||
}
|
||||
|
||||
|
||||
CloseWindow();
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -5,7 +5,7 @@ project(example)
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||
|
||||
# Dependencies
|
||||
set(RAYLIB_VERSION 5.5)
|
||||
set(RAYLIB_VERSION 6.0)
|
||||
find_package(raylib ${RAYLIB_VERSION} QUIET) # QUIET or REQUIRED
|
||||
if (NOT raylib_FOUND) # If there's none, fetch and build raylib
|
||||
include(FetchContent)
|
||||
|
||||
@ -19,7 +19,7 @@ int main()
|
||||
int screenHeight = 450;
|
||||
|
||||
InitWindow(screenWidth, screenHeight, "raylib [core] example - basic window");
|
||||
|
||||
|
||||
SetTargetFPS(60);
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
@ -44,7 +44,7 @@ int main()
|
||||
}
|
||||
|
||||
// De-Initialization
|
||||
//--------------------------------------------------------------------------------------
|
||||
//--------------------------------------------------------------------------------------
|
||||
CloseWindow(); // Close window and OpenGL context
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@ -191,7 +191,7 @@
|
||||
<Overload retVal="const char" descr="Get clipboard text content"></Overload>
|
||||
</KeyWord>
|
||||
<KeyWord name="GetClipboardImage" func="yes">
|
||||
<Overload retVal="Image" descr="Get clipboard image"></Overload>
|
||||
<Overload retVal="Image" descr="Get clipboard image content"></Overload>
|
||||
</KeyWord>
|
||||
<KeyWord name="EnableEventWaiting" func="yes">
|
||||
<Overload retVal="void" descr="Enable waiting for events on EndDrawing(), no automatic event polling"></Overload>
|
||||
@ -360,7 +360,7 @@
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
<KeyWord name="SetShaderValueTexture" func="yes">
|
||||
<Overload retVal="void" descr="Set shader uniform value for texture (sampler2d)">
|
||||
<Overload retVal="void" descr="Set shader uniform value and bind the texture (sampler2d)">
|
||||
<Param name="Shader shader" />
|
||||
<Param name="int locIndex" />
|
||||
<Param name="Texture2D texture" />
|
||||
@ -498,8 +498,12 @@
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
|
||||
<!-- NOTE: Following functions implemented in module [utils] -->
|
||||
<!-------------------------------------------------------------------- -->
|
||||
<!-- Logging system -->
|
||||
<KeyWord name="SetTraceLogLevel" func="yes">
|
||||
<Overload retVal="void" descr="Set the current threshold (minimum) log level">
|
||||
<Param name="int logLevel" />
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
<KeyWord name="TraceLog" func="yes">
|
||||
<Overload retVal="void" descr="Show trace log messages (LOG_DEBUG, LOG_INFO, LOG_WARNING, LOG_ERROR...)">
|
||||
<Param name="int logLevel" />
|
||||
@ -507,11 +511,13 @@
|
||||
<Param name="..." />
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
<KeyWord name="SetTraceLogLevel" func="yes">
|
||||
<Overload retVal="void" descr="Set the current threshold (minimum) log level">
|
||||
<Param name="int logLevel" />
|
||||
<KeyWord name="SetTraceLogCallback" func="yes">
|
||||
<Overload retVal="void" descr="Set custom trace log">
|
||||
<Param name="TraceLogCallback callback" />
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
|
||||
<!-- Memory management, using internal allocators -->
|
||||
<KeyWord name="MemAlloc" func="yes">
|
||||
<Overload retVal="void" descr="Internal memory allocator">
|
||||
<Param name="unsigned int size" />
|
||||
@ -524,35 +530,7 @@
|
||||
<Overload retVal="void" descr="Internal memory free"></Overload>
|
||||
</KeyWord>
|
||||
|
||||
<!-- Set custom callbacks -->
|
||||
<!-- WARNING: Callbacks setup is intended for advanced users -->
|
||||
<KeyWord name="SetTraceLogCallback" func="yes">
|
||||
<Overload retVal="void" descr="Set custom trace log">
|
||||
<Param name="TraceLogCallback callback" />
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
<KeyWord name="SetLoadFileDataCallback" func="yes">
|
||||
<Overload retVal="void" descr="Set custom file binary data loader">
|
||||
<Param name="LoadFileDataCallback callback" />
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
<KeyWord name="SetSaveFileDataCallback" func="yes">
|
||||
<Overload retVal="void" descr="Set custom file binary data saver">
|
||||
<Param name="SaveFileDataCallback callback" />
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
<KeyWord name="SetLoadFileTextCallback" func="yes">
|
||||
<Overload retVal="void" descr="Set custom file text data loader">
|
||||
<Param name="LoadFileTextCallback callback" />
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
<KeyWord name="SetSaveFileTextCallback" func="yes">
|
||||
<Overload retVal="void" descr="Set custom file text data saver">
|
||||
<Param name="SaveFileTextCallback callback" />
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
|
||||
<!-- Files management functions -->
|
||||
<!-- File system management functions -->
|
||||
<KeyWord name="char *LoadFileData" func="yes">
|
||||
<Overload retVal="unsigned" descr="Load file data as byte array (read)">
|
||||
<Param name="const char *fileName" />
|
||||
@ -588,12 +566,69 @@
|
||||
<KeyWord name="SaveFileText" func="yes">
|
||||
<Overload retVal="bool" descr="Save text data to file (write), string must be '\0' terminated, returns true on success">
|
||||
<Param name="const char *fileName" />
|
||||
<Param name="char *text" />
|
||||
<Param name="const char *text" />
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
<!-------------------------------------------------------------------- -->
|
||||
|
||||
<!-- File system functions -->
|
||||
<!-- File access custom callbacks -->
|
||||
<!-- WARNING: Callbacks setup is intended for advanced users -->
|
||||
<KeyWord name="SetLoadFileDataCallback" func="yes">
|
||||
<Overload retVal="void" descr="Set custom file binary data loader">
|
||||
<Param name="LoadFileDataCallback callback" />
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
<KeyWord name="SetSaveFileDataCallback" func="yes">
|
||||
<Overload retVal="void" descr="Set custom file binary data saver">
|
||||
<Param name="SaveFileDataCallback callback" />
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
<KeyWord name="SetLoadFileTextCallback" func="yes">
|
||||
<Overload retVal="void" descr="Set custom file text data loader">
|
||||
<Param name="LoadFileTextCallback callback" />
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
<KeyWord name="SetSaveFileTextCallback" func="yes">
|
||||
<Overload retVal="void" descr="Set custom file text data saver">
|
||||
<Param name="SaveFileTextCallback callback" />
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
|
||||
<KeyWord name="FileRename" func="yes">
|
||||
<Overload retVal="int" descr="Rename file (if exists)">
|
||||
<Param name="const char *fileName" />
|
||||
<Param name="const char *fileRename" />
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
<KeyWord name="FileRemove" func="yes">
|
||||
<Overload retVal="int" descr="Remove file (if exists)">
|
||||
<Param name="const char *fileName" />
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
<KeyWord name="FileCopy" func="yes">
|
||||
<Overload retVal="int" descr="Copy file from one path to another, dstPath created if it doesn't exist">
|
||||
<Param name="const char *srcPath" />
|
||||
<Param name="const char *dstPath" />
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
<KeyWord name="FileMove" func="yes">
|
||||
<Overload retVal="int" descr="Move file from one directory to another, dstPath created if it doesn't exist">
|
||||
<Param name="const char *srcPath" />
|
||||
<Param name="const char *dstPath" />
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
<KeyWord name="FileTextReplace" func="yes">
|
||||
<Overload retVal="int" descr="Replace text in an existing file">
|
||||
<Param name="const char *fileName" />
|
||||
<Param name="const char *search" />
|
||||
<Param name="const char *replacement" />
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
<KeyWord name="FileTextFindIndex" func="yes">
|
||||
<Overload retVal="int" descr="Find text in existing file">
|
||||
<Param name="const char *fileName" />
|
||||
<Param name="const char *search" />
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
<KeyWord name="FileExists" func="yes">
|
||||
<Overload retVal="bool" descr="Check if file exists">
|
||||
<Param name="const char *fileName" />
|
||||
@ -605,7 +640,7 @@
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
<KeyWord name="IsFileExtension" func="yes">
|
||||
<Overload retVal="bool" descr="Check file extension (including point: .png, .wav)">
|
||||
<Overload retVal="bool" descr="Check file extension (recommended include point: .png, .wav)">
|
||||
<Param name="const char *fileName" />
|
||||
<Param name="const char *ext" />
|
||||
</Overload>
|
||||
@ -615,6 +650,11 @@
|
||||
<Param name="const char *fileName" />
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
<KeyWord name="GetFileModTime" func="yes">
|
||||
<Overload retVal="long" descr="Get file modification time (last write time)">
|
||||
<Param name="const char *fileName" />
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
<KeyWord name="GetFileExtension" func="yes">
|
||||
<Overload retVal="const char" descr="Get pointer to extension for a filename string (includes dot: '.png')">
|
||||
<Param name="const char *fileName" />
|
||||
@ -653,7 +693,7 @@
|
||||
</KeyWord>
|
||||
<KeyWord name="ChangeDirectory" func="yes">
|
||||
<Overload retVal="bool" descr="Change working directory, return true on success">
|
||||
<Param name="const char *dir" />
|
||||
<Param name="const char *dirPath" />
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
<KeyWord name="IsPathFile" func="yes">
|
||||
@ -667,12 +707,12 @@
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
<KeyWord name="LoadDirectoryFiles" func="yes">
|
||||
<Overload retVal="FilePathList" descr="Load directory filepaths">
|
||||
<Overload retVal="FilePathList" descr="Load directory filepaths, files and directories, no subdirs scan">
|
||||
<Param name="const char *dirPath" />
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
<KeyWord name="LoadDirectoryFilesEx" func="yes">
|
||||
<Overload retVal="FilePathList" descr="Load directory filepaths with extension filtering and recursive directory scan. Use 'DIR' in the filter string to include directories in the result">
|
||||
<Overload retVal="FilePathList" descr="Load directory filepaths with extension filtering and subdir scan; some filters available: "*.*", "FILES*", "DIRS*"">
|
||||
<Param name="const char *basePath" />
|
||||
<Param name="const char *filter" />
|
||||
<Param name="bool scanSubdirs" />
|
||||
@ -694,9 +734,16 @@
|
||||
<Param name="FilePathList files" />
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
<KeyWord name="GetFileModTime" func="yes">
|
||||
<Overload retVal="long" descr="Get file modification time (last write time)">
|
||||
<Param name="const char *fileName" />
|
||||
<KeyWord name="int GetDirectoryFileCount" func="yes">
|
||||
<Overload retVal="unsigned" descr="Get the file count in a directory">
|
||||
<Param name="const char *dirPath" />
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
<KeyWord name="int GetDirectoryFileCountEx" func="yes">
|
||||
<Overload retVal="unsigned" descr="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 name="const char *basePath" />
|
||||
<Param name="const char *filter" />
|
||||
<Param name="bool scanSubdirs" />
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
|
||||
@ -716,15 +763,15 @@
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
<KeyWord name="EncodeDataBase64" func="yes">
|
||||
<Overload retVal="char" descr="Encode data to Base64 string, memory must be MemFree()">
|
||||
<Overload retVal="char" descr="Encode data to Base64 string (includes NULL terminator), memory must be MemFree()">
|
||||
<Param name="const unsigned char" />
|
||||
<Param name="int dataSize" />
|
||||
<Param name="int *outputSize" />
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
<KeyWord name="char *DecodeDataBase64" func="yes">
|
||||
<Overload retVal="unsigned" descr="Decode Base64 string data, memory must be MemFree()">
|
||||
<Param name="const unsigned char" />
|
||||
<Overload retVal="unsigned" descr="Decode Base64 string (expected NULL terminated), memory must be MemFree()">
|
||||
<Param name="const char *text" />
|
||||
<Param name="int *outputSize" />
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
@ -746,7 +793,12 @@
|
||||
<Param name="int dataSize" />
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
|
||||
<KeyWord name="int *ComputeSHA256" func="yes">
|
||||
<Overload retVal="unsigned" descr="Compute SHA256 hash code, returns static int[8] (32 bytes)">
|
||||
<Param name="unsigned char *data" />
|
||||
<Param name="int dataSize" />
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
|
||||
<!-- Automation events functionality -->
|
||||
<KeyWord name="LoadAutomationEventList" func="yes">
|
||||
@ -823,6 +875,11 @@
|
||||
<KeyWord name="GetCharPressed" func="yes">
|
||||
<Overload retVal="int" descr="Get char pressed (unicode), call it multiple times for chars queued, returns 0 when the queue is empty"></Overload>
|
||||
</KeyWord>
|
||||
<KeyWord name="GetKeyName" func="yes">
|
||||
<Overload retVal="const char" descr="Get name of a QWERTY key on the current keyboard layout (eg returns string 'q' for KEY_A on an AZERTY keyboard)">
|
||||
<Param name="int key" />
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
<KeyWord name="SetExitKey" func="yes">
|
||||
<Overload retVal="void" descr="Set a custom key to exit program (default is ESC)">
|
||||
<Param name="int key" />
|
||||
@ -868,12 +925,12 @@
|
||||
<Overload retVal="int" descr="Get the last gamepad button pressed"></Overload>
|
||||
</KeyWord>
|
||||
<KeyWord name="GetGamepadAxisCount" func="yes">
|
||||
<Overload retVal="int" descr="Get gamepad axis count for a gamepad">
|
||||
<Overload retVal="int" descr="Get axis count for a gamepad">
|
||||
<Param name="int gamepad" />
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
<KeyWord name="GetGamepadAxisMovement" func="yes">
|
||||
<Overload retVal="float" descr="Get axis movement value for a gamepad axis">
|
||||
<Overload retVal="float" descr="Get movement value for a gamepad axis">
|
||||
<Param name="int gamepad" />
|
||||
<Param name="int axis" />
|
||||
</Overload>
|
||||
@ -1098,6 +1155,15 @@
|
||||
<Param name="Color color" />
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
<KeyWord name="DrawLineDashed" func="yes">
|
||||
<Overload retVal="void" descr="Draw a dashed line">
|
||||
<Param name="Vector2 startPos" />
|
||||
<Param name="Vector2 endPos" />
|
||||
<Param name="int dashSize" />
|
||||
<Param name="int spaceSize" />
|
||||
<Param name="Color color" />
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
<KeyWord name="DrawCircle" func="yes">
|
||||
<Overload retVal="void" descr="Draw a color-filled circle">
|
||||
<Param name="int centerX" />
|
||||
@ -1106,6 +1172,21 @@
|
||||
<Param name="Color color" />
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
<KeyWord name="DrawCircleV" func="yes">
|
||||
<Overload retVal="void" descr="Draw a color-filled circle (Vector version)">
|
||||
<Param name="Vector2 center" />
|
||||
<Param name="float radius" />
|
||||
<Param name="Color color" />
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
<KeyWord name="DrawCircleGradient" func="yes">
|
||||
<Overload retVal="void" descr="Draw a gradient-filled circle">
|
||||
<Param name="Vector2 center" />
|
||||
<Param name="float radius" />
|
||||
<Param name="Color inner" />
|
||||
<Param name="Color outer" />
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
<KeyWord name="DrawCircleSector" func="yes">
|
||||
<Overload retVal="void" descr="Draw a piece of a circle">
|
||||
<Param name="Vector2 center" />
|
||||
@ -1126,22 +1207,6 @@
|
||||
<Param name="Color color" />
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
<KeyWord name="DrawCircleGradient" func="yes">
|
||||
<Overload retVal="void" descr="Draw a gradient-filled circle">
|
||||
<Param name="int centerX" />
|
||||
<Param name="int centerY" />
|
||||
<Param name="float radius" />
|
||||
<Param name="Color inner" />
|
||||
<Param name="Color outer" />
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
<KeyWord name="DrawCircleV" func="yes">
|
||||
<Overload retVal="void" descr="Draw a color-filled circle (Vector version)">
|
||||
<Param name="Vector2 center" />
|
||||
<Param name="float radius" />
|
||||
<Param name="Color color" />
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
<KeyWord name="DrawCircleLines" func="yes">
|
||||
<Overload retVal="void" descr="Draw circle outline">
|
||||
<Param name="int centerX" />
|
||||
@ -1166,6 +1231,14 @@
|
||||
<Param name="Color color" />
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
<KeyWord name="DrawEllipseV" func="yes">
|
||||
<Overload retVal="void" descr="Draw ellipse (Vector version)">
|
||||
<Param name="Vector2 center" />
|
||||
<Param name="float radiusH" />
|
||||
<Param name="float radiusV" />
|
||||
<Param name="Color color" />
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
<KeyWord name="DrawEllipseLines" func="yes">
|
||||
<Overload retVal="void" descr="Draw ellipse outline">
|
||||
<Param name="int centerX" />
|
||||
@ -1175,6 +1248,14 @@
|
||||
<Param name="Color color" />
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
<KeyWord name="DrawEllipseLinesV" func="yes">
|
||||
<Overload retVal="void" descr="Draw ellipse outline (Vector version)">
|
||||
<Param name="Vector2 center" />
|
||||
<Param name="float radiusH" />
|
||||
<Param name="float radiusV" />
|
||||
<Param name="Color color" />
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
<KeyWord name="DrawRing" func="yes">
|
||||
<Overload retVal="void" descr="Draw ring">
|
||||
<Param name="Vector2 center" />
|
||||
@ -1252,8 +1333,8 @@
|
||||
<Param name="Rectangle rec" />
|
||||
<Param name="Color topLeft" />
|
||||
<Param name="Color bottomLeft" />
|
||||
<Param name="Color topRight" />
|
||||
<Param name="Color bottomRight" />
|
||||
<Param name="Color topRight" />
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
<KeyWord name="DrawRectangleLines" func="yes">
|
||||
@ -1637,7 +1718,7 @@
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
<KeyWord name="char *ExportImageToMemory" func="yes">
|
||||
<Overload retVal="unsigned" descr="Export image to memory buffer">
|
||||
<Overload retVal="unsigned" descr="Export image to memory buffer, memory must be MemFree()">
|
||||
<Param name="Image image" />
|
||||
<Param name="const char *fileType" />
|
||||
<Param name="int *fileSize" />
|
||||
@ -2099,7 +2180,7 @@
|
||||
<KeyWord name="ImageDrawTriangleFan" func="yes">
|
||||
<Overload retVal="void" descr="Draw a triangle fan defined by points within an image (first vertex is the center)">
|
||||
<Param name="Image *dst" />
|
||||
<Param name="Vector2 *points" />
|
||||
<Param name="const Vector2 *points" />
|
||||
<Param name="int pointCount" />
|
||||
<Param name="Color color" />
|
||||
</Overload>
|
||||
@ -2107,7 +2188,7 @@
|
||||
<KeyWord name="ImageDrawTriangleStrip" func="yes">
|
||||
<Overload retVal="void" descr="Draw a triangle strip defined by points within an image">
|
||||
<Param name="Image *dst" />
|
||||
<Param name="Vector2 *points" />
|
||||
<Param name="const Vector2 *points" />
|
||||
<Param name="int pointCount" />
|
||||
<Param name="Color color" />
|
||||
</Overload>
|
||||
@ -2188,13 +2269,13 @@
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
<KeyWord name="UpdateTexture" func="yes">
|
||||
<Overload retVal="void" descr="Update GPU texture with new data">
|
||||
<Overload retVal="void" descr="Update GPU texture with new data (pixels should be able to fill texture)">
|
||||
<Param name="Texture2D texture" />
|
||||
<Param name="const void *pixels" />
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
<KeyWord name="UpdateTextureRec" func="yes">
|
||||
<Overload retVal="void" descr="Update GPU texture rectangle with new data">
|
||||
<Overload retVal="void" descr="Update GPU texture rectangle with new data (pixels and rec should fit in texture)">
|
||||
<Param name="Texture2D texture" />
|
||||
<Param name="Rectangle rec" />
|
||||
<Param name="const void *pixels" />
|
||||
@ -2388,7 +2469,7 @@
|
||||
<Overload retVal="Font" descr="Load font from file with extended parameters, use NULL for codepoints and 0 for codepointCount to load the default character set, font size is provided in pixels height">
|
||||
<Param name="const char *fileName" />
|
||||
<Param name="int fontSize" />
|
||||
<Param name="int *codepoints" />
|
||||
<Param name="const int *codepoints" />
|
||||
<Param name="int codepointCount" />
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
@ -2405,7 +2486,7 @@
|
||||
<Param name="const unsigned char" />
|
||||
<Param name="int dataSize" />
|
||||
<Param name="int fontSize" />
|
||||
<Param name="int *codepoints" />
|
||||
<Param name="const int *codepoints" />
|
||||
<Param name="int codepointCount" />
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
@ -2419,9 +2500,10 @@
|
||||
<Param name="const unsigned char" />
|
||||
<Param name="int dataSize" />
|
||||
<Param name="int fontSize" />
|
||||
<Param name="int *codepoints" />
|
||||
<Param name="const int *codepoints" />
|
||||
<Param name="int codepointCount" />
|
||||
<Param name="int type" />
|
||||
<Param name="int *glyphCount" />
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
<KeyWord name="GenImageFontAtlas" func="yes">
|
||||
@ -2531,6 +2613,15 @@
|
||||
<Param name="float spacing" />
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
<KeyWord name="MeasureTextCodepoints" func="yes">
|
||||
<Overload retVal="Vector2" descr="Measure string size for an existing array of codepoints for Font">
|
||||
<Param name="Font font" />
|
||||
<Param name="const int *codepoints" />
|
||||
<Param name="int length" />
|
||||
<Param name="float fontSize" />
|
||||
<Param name="float spacing" />
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
<KeyWord name="GetGlyphIndex" func="yes">
|
||||
<Overload retVal="int" descr="Get glyph index position in font for a codepoint (unicode character), fallback to '?' if not found">
|
||||
<Param name="Font font" />
|
||||
@ -2604,7 +2695,20 @@
|
||||
</KeyWord>
|
||||
|
||||
<!-- Text strings management functions (no UTF-8 strings, only byte chars) -->
|
||||
<!-- NOTE: Some strings allocate memory internally for returned strings, just be careful! -->
|
||||
<!-- WARNING 1: Most of these functions use internal static buffers[], it's recommended to store returned data on user-side for re-use -->
|
||||
<!-- WARNING 2: Some functions allocate memory internally for the returned strings, those strings must be freed by user using MemFree() -->
|
||||
<KeyWord name="LoadTextLines" func="yes">
|
||||
<Overload retVal="char" descr="Load text as separate lines ('\n')">
|
||||
<Param name="const char *text" />
|
||||
<Param name="int *count" />
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
<KeyWord name="UnloadTextLines" func="yes">
|
||||
<Overload retVal="void" descr="Unload text lines">
|
||||
<Param name="char **text" />
|
||||
<Param name="int lineCount" />
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
<KeyWord name="TextCopy" func="yes">
|
||||
<Overload retVal="int" descr="Copy one string to another, returns bytes copied">
|
||||
<Param name="char *dst" />
|
||||
@ -2635,80 +2739,121 @@
|
||||
<Param name="int length" />
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
<KeyWord name="TextReplace" func="yes">
|
||||
<Overload retVal="char" descr="Replace text string (WARNING: memory must be freed!)">
|
||||
<KeyWord name="TextRemoveSpaces" func="yes">
|
||||
<Overload retVal="const char" descr="Remove text spaces, concat words">
|
||||
<Param name="const char *text" />
|
||||
<Param name="const char *replace" />
|
||||
<Param name="const char *by" />
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
<KeyWord name="GetTextBetween" func="yes">
|
||||
<Overload retVal="char" descr="Get text between two strings">
|
||||
<Param name="const char *text" />
|
||||
<Param name="const char *begin" />
|
||||
<Param name="const char *end" />
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
<KeyWord name="TextReplace" func="yes">
|
||||
<Overload retVal="char" descr="Replace text string with new string">
|
||||
<Param name="const char *text" />
|
||||
<Param name="const char *search" />
|
||||
<Param name="const char *replacement" />
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
<KeyWord name="TextReplaceAlloc" func="yes">
|
||||
<Overload retVal="char" descr="Replace text string with new string, memory must be MemFree()">
|
||||
<Param name="const char *text" />
|
||||
<Param name="const char *search" />
|
||||
<Param name="const char *replacement" />
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
<KeyWord name="TextReplaceBetween" func="yes">
|
||||
<Overload retVal="char" descr="Replace text between two specific strings">
|
||||
<Param name="const char *text" />
|
||||
<Param name="const char *begin" />
|
||||
<Param name="const char *end" />
|
||||
<Param name="const char *replacement" />
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
<KeyWord name="TextReplaceBetweenAlloc" func="yes">
|
||||
<Overload retVal="char" descr="Replace text between two specific strings, memory must be MemFree()">
|
||||
<Param name="const char *text" />
|
||||
<Param name="const char *begin" />
|
||||
<Param name="const char *end" />
|
||||
<Param name="const char *replacement" />
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
<KeyWord name="TextInsert" func="yes">
|
||||
<Overload retVal="char" descr="Insert text in a position (WARNING: memory must be freed!)">
|
||||
<Overload retVal="char" descr="Insert text in a defined byte position">
|
||||
<Param name="const char *text" />
|
||||
<Param name="const char *insert" />
|
||||
<Param name="int position" />
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
<KeyWord name="TextInsertAlloc" func="yes">
|
||||
<Overload retVal="char" descr="Insert text in a defined byte position, memory must be MemFree()">
|
||||
<Param name="const char *text" />
|
||||
<Param name="const char *insert" />
|
||||
<Param name="int position" />
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
<KeyWord name="TextJoin" func="yes">
|
||||
<Overload retVal="const char" descr="Join text strings with delimiter">
|
||||
<Param name="const char **textList" />
|
||||
<Overload retVal="char" descr="Join text strings with delimiter">
|
||||
<Param name="char **textList" />
|
||||
<Param name="int count" />
|
||||
<Param name="const char *delimiter" />
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
<KeyWord name="TextSplit" func="yes">
|
||||
<Overload retVal="const char" descr="Split text into multiple strings">
|
||||
<Overload retVal="char" descr="Split text into multiple strings, using MAX_TEXTSPLIT_COUNT static strings">
|
||||
<Param name="const char *text" />
|
||||
<Param name="char delimiter" />
|
||||
<Param name="int *count" />
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
<KeyWord name="TextAppend" func="yes">
|
||||
<Overload retVal="void" descr="Append text at specific position and move cursor!">
|
||||
<Overload retVal="void" descr="Append text at specific position and move cursor">
|
||||
<Param name="char *text" />
|
||||
<Param name="const char *append" />
|
||||
<Param name="int *position" />
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
<KeyWord name="TextFindIndex" func="yes">
|
||||
<Overload retVal="int" descr="Find first text occurrence within a string">
|
||||
<Overload retVal="int" descr="Find first text occurrence within a string, -1 if not found">
|
||||
<Param name="const char *text" />
|
||||
<Param name="const char *find" />
|
||||
<Param name="const char *search" />
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
<KeyWord name="TextToUpper" func="yes">
|
||||
<Overload retVal="const char" descr="Get upper case version of provided string">
|
||||
<Overload retVal="char" descr="Get upper case version of provided string">
|
||||
<Param name="const char *text" />
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
<KeyWord name="TextToLower" func="yes">
|
||||
<Overload retVal="const char" descr="Get lower case version of provided string">
|
||||
<Overload retVal="char" descr="Get lower case version of provided string">
|
||||
<Param name="const char *text" />
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
<KeyWord name="TextToPascal" func="yes">
|
||||
<Overload retVal="const char" descr="Get Pascal case notation version of provided string">
|
||||
<Overload retVal="char" descr="Get Pascal case notation version of provided string">
|
||||
<Param name="const char *text" />
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
<KeyWord name="TextToSnake" func="yes">
|
||||
<Overload retVal="const char" descr="Get Snake case notation version of provided string">
|
||||
<Overload retVal="char" descr="Get Snake case notation version of provided string">
|
||||
<Param name="const char *text" />
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
<KeyWord name="TextToCamel" func="yes">
|
||||
<Overload retVal="const char" descr="Get Camel case notation version of provided string">
|
||||
<Overload retVal="char" descr="Get Camel case notation version of provided string">
|
||||
<Param name="const char *text" />
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
|
||||
<KeyWord name="TextToInteger" func="yes">
|
||||
<Overload retVal="int" descr="Get integer value from text (negative values not supported)">
|
||||
<Overload retVal="int" descr="Get integer value from text">
|
||||
<Param name="const char *text" />
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
<KeyWord name="TextToFloat" func="yes">
|
||||
<Overload retVal="float" descr="Get float value from text (negative values not supported)">
|
||||
<Overload retVal="float" descr="Get float value from text">
|
||||
<Param name="const char *text" />
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
@ -2995,7 +3140,7 @@
|
||||
<Param name="Vector2 size" />
|
||||
<Param name="Vector2 origin" />
|
||||
<Param name="float rotation" />
|
||||
<Param name="<EFBFBD><EFBFBD>_)% " />
|
||||
<Param name="Color tint" />
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
|
||||
@ -3180,22 +3325,20 @@
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
<KeyWord name="UpdateModelAnimation" func="yes">
|
||||
<Overload retVal="void" descr="Update model animation pose (CPU)">
|
||||
<Overload retVal="void" descr="Update model animation pose (vertex buffers and bone matrices)">
|
||||
<Param name="Model model" />
|
||||
<Param name="ModelAnimation anim" />
|
||||
<Param name="int frame" />
|
||||
<Param name="float frame" />
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
<KeyWord name="UpdateModelAnimationBones" func="yes">
|
||||
<Overload retVal="void" descr="Update model animation mesh bone matrices (GPU skinning)">
|
||||
<KeyWord name="UpdateModelAnimationEx" func="yes">
|
||||
<Overload retVal="void" descr="Update model animation pose, blending two animations">
|
||||
<Param name="Model model" />
|
||||
<Param name="ModelAnimation anim" />
|
||||
<Param name="int frame" />
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
<KeyWord name="UnloadModelAnimation" func="yes">
|
||||
<Overload retVal="void" descr="Unload animation data">
|
||||
<Param name="ModelAnimation anim" />
|
||||
<Param name="ModelAnimation animA" />
|
||||
<Param name="float frameA" />
|
||||
<Param name="ModelAnimation animB" />
|
||||
<Param name="float frameB" />
|
||||
<Param name="float blend" />
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
<KeyWord name="UnloadModelAnimations" func="yes">
|
||||
@ -3333,7 +3476,7 @@
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
<KeyWord name="UpdateSound" func="yes">
|
||||
<Overload retVal="void" descr="Update sound buffer with new data">
|
||||
<Overload retVal="void" descr="Update sound buffer with new data (default data format: 32 bit float, stereo)">
|
||||
<Param name="Sound sound" />
|
||||
<Param name="const void *data" />
|
||||
<Param name="int sampleCount" />
|
||||
@ -3406,7 +3549,7 @@
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
<KeyWord name="SetSoundPan" func="yes">
|
||||
<Overload retVal="void" descr="Set pan for a sound (0.5 is center)">
|
||||
<Overload retVal="void" descr="Set pan for a sound (-1.0 left, 0.0 center, 1.0 right)">
|
||||
<Param name="Sound sound" />
|
||||
<Param name="float pan" />
|
||||
</Overload>
|
||||
@ -3514,7 +3657,7 @@
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
<KeyWord name="SetMusicPan" func="yes">
|
||||
<Overload retVal="void" descr="Set pan for a music (0.5 is center)">
|
||||
<Overload retVal="void" descr="Set pan for a music (-1.0 left, 0.0 center, 1.0 right)">
|
||||
<Param name="Music music" />
|
||||
<Param name="float pan" />
|
||||
</Overload>
|
||||
@ -3598,7 +3741,7 @@
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
<KeyWord name="SetAudioStreamPan" func="yes">
|
||||
<Overload retVal="void" descr="Set pan for audio stream (0.5 is centered)">
|
||||
<Overload retVal="void" descr="Set pan for audio stream (-1.0 to 1.0 range, 0.0 is centered)">
|
||||
<Param name="AudioStream stream" />
|
||||
<Param name="float pan" />
|
||||
</Overload>
|
||||
@ -3638,5 +3781,3 @@
|
||||
<Param name="AudioCallback processor" />
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
|
||||
|
||||
|
||||
@ -15,9 +15,9 @@
|
||||
<Param name="float alpha" />
|
||||
</Overload>
|
||||
</KeyWord>
|
||||
|
||||
|
||||
NOTE: Generated XML text should be copied inside raylib\Notepad++\plugins\APIs\c.xml
|
||||
|
||||
|
||||
WARNING: Be careful with functions that split parameters into several lines, it breaks the process!
|
||||
|
||||
LICENSE: zlib/libpng
|
||||
@ -42,13 +42,13 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
FILE *rFile = fopen(argv[1], "rt");
|
||||
FILE *rxmlFile = fopen("raylib_npp.xml", "wt");
|
||||
|
||||
|
||||
if ((rFile == NULL) || (rxmlFile == NULL))
|
||||
{
|
||||
printf("File could not be opened.\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
char *buffer = (char *)calloc(MAX_BUFFER_SIZE, 1);
|
||||
int count = 0;
|
||||
|
||||
@ -56,7 +56,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
// Read one full line
|
||||
fgets(buffer, MAX_BUFFER_SIZE, rFile);
|
||||
|
||||
|
||||
if (buffer[0] == '/') fprintf(rxmlFile, " <!--%.*s -->\n", strlen(buffer) - 3, buffer + 2);
|
||||
else if (buffer[0] == '\n') fprintf(rxmlFile, "%s", buffer); // Direct copy of code comments
|
||||
else if (strncmp(buffer, "RLAPI", 5) == 0) // raylib function declaration
|
||||
@ -65,33 +65,33 @@ int main(int argc, char *argv[])
|
||||
char funcTypeAux[64];
|
||||
char funcName[64];
|
||||
char funcDesc[256];
|
||||
|
||||
|
||||
char params[128];
|
||||
char paramType[16][16];
|
||||
char paramName[16][32];
|
||||
|
||||
|
||||
int index = 0;
|
||||
char *ptr = NULL;
|
||||
|
||||
|
||||
sscanf(buffer, "RLAPI %s %[^(]s", funcType, funcName);
|
||||
|
||||
|
||||
if (strcmp(funcType, "const") == 0)
|
||||
{
|
||||
{
|
||||
sscanf(buffer, "RLAPI %s %s %[^(]s", funcType, funcTypeAux, funcName);
|
||||
strcat(funcType, " ");
|
||||
strcat(funcType, funcTypeAux);
|
||||
}
|
||||
|
||||
|
||||
ptr = strchr(buffer, '/');
|
||||
index = (int)(ptr - buffer);
|
||||
|
||||
|
||||
sscanf(buffer + index, "%[^\n]s", funcDesc); // Read function comment after declaration
|
||||
|
||||
|
||||
ptr = strchr(buffer, '(');
|
||||
|
||||
|
||||
if (ptr != NULL) index = (int)(ptr - buffer);
|
||||
else printf("Character not found!\n");
|
||||
|
||||
|
||||
sscanf(buffer + (index + 1), "%[^)]s", params); // Read what's inside '(' and ')'
|
||||
|
||||
// Scan params string for number of func params, type and name
|
||||
@ -102,23 +102,23 @@ int main(int argc, char *argv[])
|
||||
if ((funcName[0] == '*') && (funcName[1] == '*')) fprintf(rxmlFile, " <KeyWord name=\"%s\" func=\"yes\">\n", funcName + 2);
|
||||
else if (funcName[0] == '*') fprintf(rxmlFile, " <KeyWord name=\"%s\" func=\"yes\">\n", funcName + 1);
|
||||
else fprintf(rxmlFile, " <KeyWord name=\"%s\" func=\"yes\">\n", funcName);
|
||||
|
||||
|
||||
fprintf(rxmlFile, " <Overload retVal=\"%s\" descr=\"%s\">", funcType, funcDesc + 3);
|
||||
|
||||
|
||||
bool paramsVoid = false;
|
||||
|
||||
|
||||
char paramConst[8][16];
|
||||
|
||||
while (paramPtr[paramsCount] != NULL)
|
||||
{
|
||||
sscanf(paramPtr[paramsCount], "%s %s\n", paramType[paramsCount], paramName[paramsCount]);
|
||||
|
||||
|
||||
if (strcmp(paramType[paramsCount], "void") == 0)
|
||||
{
|
||||
paramsVoid = true;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if ((strcmp(paramType[paramsCount], "const") == 0) || (strcmp(paramType[paramsCount], "unsigned") == 0))
|
||||
{
|
||||
sscanf(paramPtr[paramsCount], "%s %s %s\n", paramConst[paramsCount], paramType[paramsCount], paramName[paramsCount]);
|
||||
@ -130,17 +130,17 @@ int main(int argc, char *argv[])
|
||||
paramsCount++;
|
||||
paramPtr[paramsCount] = strtok(NULL, ",");
|
||||
}
|
||||
|
||||
|
||||
fprintf(rxmlFile, "%s</Overload>\n", paramsVoid ? "" : "\n ");
|
||||
fprintf(rxmlFile, " </KeyWord>\n");
|
||||
|
||||
count++;
|
||||
printf("Function processed %02i: %s\n", count, funcName);
|
||||
|
||||
|
||||
memset(buffer, 0, MAX_BUFFER_SIZE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
free(buffer);
|
||||
fclose(rFile);
|
||||
fclose(rxmlFile);
|
||||
|
||||
@ -49,7 +49,7 @@ RLAPI Vector2 GetWindowScaleDPI(void); // Get window
|
||||
RLAPI const char *GetMonitorName(int monitor); // Get the human-readable, UTF-8 encoded name of the specified monitor
|
||||
RLAPI void SetClipboardText(const char *text); // Set clipboard text content
|
||||
RLAPI const char *GetClipboardText(void); // Get clipboard text content
|
||||
RLAPI Image GetClipboardImage(void); // Get clipboard image
|
||||
RLAPI Image GetClipboardImage(void); // Get clipboard image content
|
||||
RLAPI void EnableEventWaiting(void); // Enable waiting for events on EndDrawing(), no automatic event polling
|
||||
RLAPI void DisableEventWaiting(void); // Disable waiting for events on EndDrawing(), automatic events polling
|
||||
|
||||
@ -91,10 +91,10 @@ RLAPI Shader LoadShaderFromMemory(const char *vsCode, const char *fsCode); // Lo
|
||||
RLAPI bool IsShaderValid(Shader shader); // Check if a shader is valid (loaded on GPU)
|
||||
RLAPI int GetShaderLocation(Shader shader, const char *uniformName); // Get shader uniform location
|
||||
RLAPI int GetShaderLocationAttrib(Shader shader, const char *attribName); // Get shader attribute location
|
||||
RLAPI void SetShaderValue(Shader shader, int locIndex, const void *value, int uniformType); // Set shader uniform value
|
||||
RLAPI void SetShaderValueV(Shader shader, int locIndex, const void *value, int uniformType, int count); // Set shader uniform value vector
|
||||
RLAPI void SetShaderValueMatrix(Shader shader, int locIndex, Matrix mat); // Set shader uniform value (matrix 4x4)
|
||||
RLAPI void SetShaderValueTexture(Shader shader, int locIndex, Texture2D texture); // Set shader uniform value for texture (sampler2d)
|
||||
RLAPI void SetShaderValue(Shader shader, int locIndex, const void *value, int uniformType); // Set shader uniform value
|
||||
RLAPI void SetShaderValueV(Shader shader, int locIndex, const void *value, int uniformType, int count); // Set shader uniform value vector
|
||||
RLAPI void SetShaderValueMatrix(Shader shader, int locIndex, Matrix mat); // Set shader uniform value (matrix 4x4)
|
||||
RLAPI void SetShaderValueTexture(Shader shader, int locIndex, Texture2D texture); // Set shader uniform value and bind the texture (sampler2d)
|
||||
RLAPI void UnloadShader(Shader shader); // Unload shader from GPU memory (VRAM)
|
||||
|
||||
// Screen-space-related functions
|
||||
@ -109,99 +109,106 @@ RLAPI Matrix GetCameraMatrix(Camera camera); // Get c
|
||||
RLAPI Matrix GetCameraMatrix2D(Camera2D camera); // Get camera 2d transform matrix
|
||||
|
||||
// Timing-related functions
|
||||
RLAPI void SetTargetFPS(int fps); // Set target FPS (maximum)
|
||||
RLAPI float GetFrameTime(void); // Get time in seconds for last frame drawn (delta time)
|
||||
RLAPI double GetTime(void); // Get elapsed time in seconds since InitWindow()
|
||||
RLAPI int GetFPS(void); // Get current FPS
|
||||
RLAPI void SetTargetFPS(int fps); // Set target FPS (maximum)
|
||||
RLAPI float GetFrameTime(void); // Get time in seconds for last frame drawn (delta time)
|
||||
RLAPI double GetTime(void); // Get elapsed time in seconds since InitWindow()
|
||||
RLAPI int GetFPS(void); // Get current FPS
|
||||
|
||||
// Custom frame control functions
|
||||
// NOTE: Those functions are intended for advanced users that want full control over the frame processing
|
||||
// By default EndDrawing() does this job: draws everything + SwapScreenBuffer() + manage frame timing + PollInputEvents()
|
||||
// To avoid that behaviour and control frame processes manually, enable in config.h: SUPPORT_CUSTOM_FRAME_CONTROL
|
||||
RLAPI void SwapScreenBuffer(void); // Swap back buffer with front buffer (screen drawing)
|
||||
RLAPI void PollInputEvents(void); // Register all input events
|
||||
RLAPI void WaitTime(double seconds); // Wait for some time (halt program execution)
|
||||
RLAPI void SwapScreenBuffer(void); // Swap back buffer with front buffer (screen drawing)
|
||||
RLAPI void PollInputEvents(void); // Register all input events
|
||||
RLAPI void WaitTime(double seconds); // Wait for some time (halt program execution)
|
||||
|
||||
// Random values generation functions
|
||||
RLAPI void SetRandomSeed(unsigned int seed); // Set the seed for the random number generator
|
||||
RLAPI int GetRandomValue(int min, int max); // Get a random value between min and max (both included)
|
||||
RLAPI void SetRandomSeed(unsigned int seed); // Set the seed for the random number generator
|
||||
RLAPI int GetRandomValue(int min, int max); // Get a random value between min and max (both included)
|
||||
RLAPI int *LoadRandomSequence(unsigned int count, int min, int max); // Load random values sequence, no values repeated
|
||||
RLAPI void UnloadRandomSequence(int *sequence); // Unload random values sequence
|
||||
RLAPI void UnloadRandomSequence(int *sequence); // Unload random values sequence
|
||||
|
||||
// Misc. functions
|
||||
RLAPI void TakeScreenshot(const char *fileName); // Takes a screenshot of current screen (filename extension defines format)
|
||||
RLAPI void SetConfigFlags(unsigned int flags); // Setup init configuration flags (view FLAGS)
|
||||
RLAPI void OpenURL(const char *url); // Open URL with default system browser (if available)
|
||||
RLAPI void TakeScreenshot(const char *fileName); // Takes a screenshot of current screen (filename extension defines format)
|
||||
RLAPI void SetConfigFlags(unsigned int flags); // Setup init configuration flags (view FLAGS)
|
||||
RLAPI void OpenURL(const char *url); // Open URL with default system browser (if available)
|
||||
|
||||
// NOTE: Following functions implemented in module [utils]
|
||||
//------------------------------------------------------------------
|
||||
RLAPI void TraceLog(int logLevel, const char *text, ...); // Show trace log messages (LOG_DEBUG, LOG_INFO, LOG_WARNING, LOG_ERROR...)
|
||||
RLAPI void SetTraceLogLevel(int logLevel); // Set the current threshold (minimum) log level
|
||||
RLAPI void *MemAlloc(unsigned int size); // Internal memory allocator
|
||||
RLAPI void *MemRealloc(void *ptr, unsigned int size); // Internal memory reallocator
|
||||
RLAPI void MemFree(void *ptr); // Internal memory free
|
||||
// Logging system
|
||||
RLAPI void SetTraceLogLevel(int logLevel); // Set the current threshold (minimum) log level
|
||||
RLAPI void TraceLog(int logLevel, const char *text, ...); // Show trace log messages (LOG_DEBUG, LOG_INFO, LOG_WARNING, LOG_ERROR...)
|
||||
RLAPI void SetTraceLogCallback(TraceLogCallback callback); // Set custom trace log
|
||||
|
||||
// Set custom callbacks
|
||||
// WARNING: Callbacks setup is intended for advanced users
|
||||
RLAPI void SetTraceLogCallback(TraceLogCallback callback); // Set custom trace log
|
||||
RLAPI void SetLoadFileDataCallback(LoadFileDataCallback callback); // Set custom file binary data loader
|
||||
RLAPI void SetSaveFileDataCallback(SaveFileDataCallback callback); // Set custom file binary data saver
|
||||
RLAPI void SetLoadFileTextCallback(LoadFileTextCallback callback); // Set custom file text data loader
|
||||
RLAPI void SetSaveFileTextCallback(SaveFileTextCallback callback); // Set custom file text data saver
|
||||
// Memory management, using internal allocators
|
||||
RLAPI void *MemAlloc(unsigned int size); // Internal memory allocator
|
||||
RLAPI void *MemRealloc(void *ptr, unsigned int size); // Internal memory reallocator
|
||||
RLAPI void MemFree(void *ptr); // Internal memory free
|
||||
|
||||
// Files management functions
|
||||
// File system management functions
|
||||
RLAPI unsigned char *LoadFileData(const char *fileName, int *dataSize); // Load file data as byte array (read)
|
||||
RLAPI void UnloadFileData(unsigned char *data); // Unload file data allocated by LoadFileData()
|
||||
RLAPI void UnloadFileData(unsigned char *data); // Unload file data allocated by LoadFileData()
|
||||
RLAPI bool SaveFileData(const char *fileName, void *data, int dataSize); // Save data to file from byte array (write), returns true on success
|
||||
RLAPI bool ExportDataAsCode(const unsigned char *data, int dataSize, const char *fileName); // Export data to code (.h), returns true on success
|
||||
RLAPI char *LoadFileText(const char *fileName); // Load text data from file (read), returns a '\0' terminated string
|
||||
RLAPI void UnloadFileText(char *text); // Unload file text data allocated by LoadFileText()
|
||||
RLAPI bool SaveFileText(const char *fileName, char *text); // Save text data to file (write), string must be '\0' terminated, returns true on success
|
||||
//------------------------------------------------------------------
|
||||
RLAPI char *LoadFileText(const char *fileName); // Load text data from file (read), returns a '\0' terminated string
|
||||
RLAPI void UnloadFileText(char *text); // Unload file text data allocated by LoadFileText()
|
||||
RLAPI bool SaveFileText(const char *fileName, const char *text); // Save text data to file (write), string must be '\0' terminated, returns true on success
|
||||
|
||||
// File system functions
|
||||
RLAPI bool FileExists(const char *fileName); // Check if file exists
|
||||
RLAPI bool DirectoryExists(const char *dirPath); // Check if a directory path exists
|
||||
RLAPI bool IsFileExtension(const char *fileName, const char *ext); // Check file extension (including point: .png, .wav)
|
||||
RLAPI int GetFileLength(const char *fileName); // Get file length in bytes (NOTE: GetFileSize() conflicts with windows.h)
|
||||
RLAPI const char *GetFileExtension(const char *fileName); // Get pointer to extension for a filename string (includes dot: '.png')
|
||||
RLAPI const char *GetFileName(const char *filePath); // Get pointer to filename for a path string
|
||||
RLAPI const char *GetFileNameWithoutExt(const char *filePath); // Get filename string without extension (uses static string)
|
||||
RLAPI const char *GetDirectoryPath(const char *filePath); // Get full path for a given fileName with path (uses static string)
|
||||
RLAPI const char *GetPrevDirectoryPath(const char *dirPath); // Get previous directory path for a given path (uses static string)
|
||||
RLAPI const char *GetWorkingDirectory(void); // Get current working directory (uses static string)
|
||||
RLAPI const char *GetApplicationDirectory(void); // Get the directory of the running application (uses static string)
|
||||
RLAPI int MakeDirectory(const char *dirPath); // Create directories (including full path requested), returns 0 on success
|
||||
RLAPI bool ChangeDirectory(const char *dir); // Change working directory, return true on success
|
||||
RLAPI bool IsPathFile(const char *path); // Check if a given path is a file or a directory
|
||||
RLAPI bool IsFileNameValid(const char *fileName); // Check if fileName is valid for the platform/OS
|
||||
RLAPI FilePathList LoadDirectoryFiles(const char *dirPath); // Load directory filepaths
|
||||
RLAPI FilePathList LoadDirectoryFilesEx(const char *basePath, const char *filter, bool scanSubdirs); // Load directory filepaths with extension filtering and recursive directory scan. Use 'DIR' in the filter string to include directories in the result
|
||||
RLAPI void UnloadDirectoryFiles(FilePathList files); // Unload filepaths
|
||||
RLAPI bool IsFileDropped(void); // Check if a file has been dropped into window
|
||||
RLAPI FilePathList LoadDroppedFiles(void); // Load dropped filepaths
|
||||
RLAPI void UnloadDroppedFiles(FilePathList files); // Unload dropped filepaths
|
||||
RLAPI long GetFileModTime(const char *fileName); // Get file modification time (last write time)
|
||||
// File access custom callbacks
|
||||
// WARNING: Callbacks setup is intended for advanced users
|
||||
RLAPI void SetLoadFileDataCallback(LoadFileDataCallback callback); // Set custom file binary data loader
|
||||
RLAPI void SetSaveFileDataCallback(SaveFileDataCallback callback); // Set custom file binary data saver
|
||||
RLAPI void SetLoadFileTextCallback(LoadFileTextCallback callback); // Set custom file text data loader
|
||||
RLAPI void SetSaveFileTextCallback(SaveFileTextCallback callback); // Set custom file text data saver
|
||||
|
||||
RLAPI int FileRename(const char *fileName, const char *fileRename); // Rename file (if exists)
|
||||
RLAPI int FileRemove(const char *fileName); // Remove file (if exists)
|
||||
RLAPI int FileCopy(const char *srcPath, const char *dstPath); // Copy file from one path to another, dstPath created if it doesn't exist
|
||||
RLAPI int FileMove(const char *srcPath, const char *dstPath); // Move file from one directory to another, dstPath created if it doesn't exist
|
||||
RLAPI int FileTextReplace(const char *fileName, const char *search, const char *replacement); // Replace text in an existing file
|
||||
RLAPI int FileTextFindIndex(const char *fileName, const char *search); // Find text in existing file
|
||||
RLAPI bool FileExists(const char *fileName); // Check if file exists
|
||||
RLAPI bool DirectoryExists(const char *dirPath); // Check if a directory path exists
|
||||
RLAPI bool IsFileExtension(const char *fileName, const char *ext); // Check file extension (recommended include point: .png, .wav)
|
||||
RLAPI int GetFileLength(const char *fileName); // Get file length in bytes (NOTE: GetFileSize() conflicts with windows.h)
|
||||
RLAPI long GetFileModTime(const char *fileName); // Get file modification time (last write time)
|
||||
RLAPI const char *GetFileExtension(const char *fileName); // Get pointer to extension for a filename string (includes dot: '.png')
|
||||
RLAPI const char *GetFileName(const char *filePath); // Get pointer to filename for a path string
|
||||
RLAPI const char *GetFileNameWithoutExt(const char *filePath); // Get filename string without extension (uses static string)
|
||||
RLAPI const char *GetDirectoryPath(const char *filePath); // Get full path for a given fileName with path (uses static string)
|
||||
RLAPI const char *GetPrevDirectoryPath(const char *dirPath); // Get previous directory path for a given path (uses static string)
|
||||
RLAPI const char *GetWorkingDirectory(void); // Get current working directory (uses static string)
|
||||
RLAPI const char *GetApplicationDirectory(void); // Get the directory of the running application (uses static string)
|
||||
RLAPI int MakeDirectory(const char *dirPath); // Create directories (including full path requested), returns 0 on success
|
||||
RLAPI bool ChangeDirectory(const char *dirPath); // Change working directory, return true on success
|
||||
RLAPI bool IsPathFile(const char *path); // Check if a given path is a file or a directory
|
||||
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*"
|
||||
RLAPI void UnloadDirectoryFiles(FilePathList files); // Unload filepaths
|
||||
RLAPI bool IsFileDropped(void); // Check if a file has been dropped into window
|
||||
RLAPI FilePathList LoadDroppedFiles(void); // Load dropped filepaths
|
||||
RLAPI void UnloadDroppedFiles(FilePathList files); // Unload dropped filepaths
|
||||
RLAPI unsigned int GetDirectoryFileCount(const char *dirPath); // Get the file count in a directory
|
||||
RLAPI unsigned int GetDirectoryFileCountEx(const char *basePath, const char *filter, bool scanSubdirs); // 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
|
||||
|
||||
// Compression/Encoding functionality
|
||||
RLAPI unsigned char *CompressData(const unsigned char *data, int dataSize, int *compDataSize); // Compress data (DEFLATE algorithm), memory must be MemFree()
|
||||
RLAPI unsigned char *DecompressData(const unsigned char *compData, int compDataSize, int *dataSize); // Decompress data (DEFLATE algorithm), memory must be MemFree()
|
||||
RLAPI char *EncodeDataBase64(const unsigned char *data, int dataSize, int *outputSize); // Encode data to Base64 string, memory must be MemFree()
|
||||
RLAPI unsigned char *DecodeDataBase64(const unsigned char *data, int *outputSize); // Decode Base64 string data, memory must be MemFree()
|
||||
RLAPI unsigned int ComputeCRC32(unsigned char *data, int dataSize); // Compute CRC32 hash code
|
||||
RLAPI unsigned int *ComputeMD5(unsigned char *data, int dataSize); // Compute MD5 hash code, returns static int[4] (16 bytes)
|
||||
RLAPI unsigned int *ComputeSHA1(unsigned char *data, int dataSize); // Compute SHA1 hash code, returns static int[5] (20 bytes)
|
||||
|
||||
RLAPI char *EncodeDataBase64(const unsigned char *data, int dataSize, int *outputSize); // Encode data to Base64 string (includes NULL terminator), memory must be MemFree()
|
||||
RLAPI unsigned char *DecodeDataBase64(const char *text, int *outputSize); // Decode Base64 string (expected NULL terminated), memory must be MemFree()
|
||||
RLAPI unsigned int ComputeCRC32(unsigned char *data, int dataSize); // Compute CRC32 hash code
|
||||
RLAPI unsigned int *ComputeMD5(unsigned char *data, int dataSize); // Compute MD5 hash code, returns static int[4] (16 bytes)
|
||||
RLAPI unsigned int *ComputeSHA1(unsigned char *data, int dataSize); // Compute SHA1 hash code, returns static int[5] (20 bytes)
|
||||
RLAPI unsigned int *ComputeSHA256(unsigned char *data, int dataSize); // Compute SHA256 hash code, returns static int[8] (32 bytes)
|
||||
|
||||
// Automation events functionality
|
||||
RLAPI AutomationEventList LoadAutomationEventList(const char *fileName); // Load automation events list from file, NULL for empty list, capacity = MAX_AUTOMATION_EVENTS
|
||||
RLAPI void UnloadAutomationEventList(AutomationEventList list); // Unload automation events list from file
|
||||
RLAPI bool ExportAutomationEventList(AutomationEventList list, const char *fileName); // Export automation events list as text file
|
||||
RLAPI void SetAutomationEventList(AutomationEventList *list); // Set automation event list to record to
|
||||
RLAPI void SetAutomationEventBaseFrame(int frame); // Set automation event internal base frame to start recording
|
||||
RLAPI void StartAutomationEventRecording(void); // Start recording automation events (AutomationEventList must be set)
|
||||
RLAPI void StopAutomationEventRecording(void); // Stop recording automation events
|
||||
RLAPI void PlayAutomationEvent(AutomationEvent event); // Play a recorded automation event
|
||||
RLAPI AutomationEventList LoadAutomationEventList(const char *fileName); // Load automation events list from file, NULL for empty list, capacity = MAX_AUTOMATION_EVENTS
|
||||
RLAPI void UnloadAutomationEventList(AutomationEventList list); // Unload automation events list from file
|
||||
RLAPI bool ExportAutomationEventList(AutomationEventList list, const char *fileName); // Export automation events list as text file
|
||||
RLAPI void SetAutomationEventList(AutomationEventList *list); // Set automation event list to record to
|
||||
RLAPI void SetAutomationEventBaseFrame(int frame); // Set automation event internal base frame to start recording
|
||||
RLAPI void StartAutomationEventRecording(void); // Start recording automation events (AutomationEventList must be set)
|
||||
RLAPI void StopAutomationEventRecording(void); // Stop recording automation events
|
||||
RLAPI void PlayAutomationEvent(AutomationEvent event); // Play a recorded automation event
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
// Input Handling Functions (Module: core)
|
||||
@ -215,20 +222,20 @@ RLAPI bool IsKeyReleased(int key); // Check if a key
|
||||
RLAPI bool IsKeyUp(int key); // Check if a key is NOT being pressed
|
||||
RLAPI int GetKeyPressed(void); // Get key pressed (keycode), call it multiple times for keys queued, returns 0 when the queue is empty
|
||||
RLAPI int GetCharPressed(void); // Get char pressed (unicode), call it multiple times for chars queued, returns 0 when the queue is empty
|
||||
RLAPI const char *GetKeyName(int key); // Get name of a QWERTY key on the current keyboard layout (eg returns string 'q' for KEY_A on an AZERTY keyboard)
|
||||
RLAPI void SetExitKey(int key); // Set a custom key to exit program (default is ESC)
|
||||
RLAPI const char *GetKeyName(int key); // Get name of a QWERTY key on the current keyboard layout (eg returns string "q" for KEY_A on an AZERTY keyboard)
|
||||
|
||||
// Input-related functions: gamepads
|
||||
RLAPI bool IsGamepadAvailable(int gamepad); // Check if a gamepad is available
|
||||
RLAPI const char *GetGamepadName(int gamepad); // Get gamepad internal name id
|
||||
RLAPI bool IsGamepadButtonPressed(int gamepad, int button); // Check if a gamepad button has been pressed once
|
||||
RLAPI bool IsGamepadButtonDown(int gamepad, int button); // Check if a gamepad button is being pressed
|
||||
RLAPI bool IsGamepadButtonReleased(int gamepad, int button); // Check if a gamepad button has been released once
|
||||
RLAPI bool IsGamepadButtonUp(int gamepad, int button); // Check if a gamepad button is NOT being pressed
|
||||
RLAPI int GetGamepadButtonPressed(void); // Get the last gamepad button pressed
|
||||
RLAPI int GetGamepadAxisCount(int gamepad); // Get gamepad axis count for a gamepad
|
||||
RLAPI float GetGamepadAxisMovement(int gamepad, int axis); // Get axis movement value for a gamepad axis
|
||||
RLAPI int SetGamepadMappings(const char *mappings); // Set internal gamepad mappings (SDL_GameControllerDB)
|
||||
RLAPI bool IsGamepadAvailable(int gamepad); // Check if a gamepad is available
|
||||
RLAPI const char *GetGamepadName(int gamepad); // Get gamepad internal name id
|
||||
RLAPI bool IsGamepadButtonPressed(int gamepad, int button); // Check if a gamepad button has been pressed once
|
||||
RLAPI bool IsGamepadButtonDown(int gamepad, int button); // Check if a gamepad button is being pressed
|
||||
RLAPI bool IsGamepadButtonReleased(int gamepad, int button); // Check if a gamepad button has been released once
|
||||
RLAPI bool IsGamepadButtonUp(int gamepad, int button); // Check if a gamepad button is NOT being pressed
|
||||
RLAPI int GetGamepadButtonPressed(void); // Get the last gamepad button pressed
|
||||
RLAPI int GetGamepadAxisCount(int gamepad); // Get axis count for a gamepad
|
||||
RLAPI float GetGamepadAxisMovement(int gamepad, int axis); // Get movement value for a gamepad axis
|
||||
RLAPI int SetGamepadMappings(const char *mappings); // Set internal gamepad mappings (SDL_GameControllerDB)
|
||||
RLAPI void SetGamepadVibration(int gamepad, float leftMotor, float rightMotor, float duration); // Set gamepad vibration for both motors (duration in seconds)
|
||||
|
||||
// Input-related functions: mouse
|
||||
@ -257,19 +264,19 @@ RLAPI int GetTouchPointCount(void); // Get number of t
|
||||
//------------------------------------------------------------------------------------
|
||||
// Gestures and Touch Handling Functions (Module: rgestures)
|
||||
//------------------------------------------------------------------------------------
|
||||
RLAPI void SetGesturesEnabled(unsigned int flags); // Enable a set of gestures using flags
|
||||
RLAPI bool IsGestureDetected(unsigned int gesture); // Check if a gesture have been detected
|
||||
RLAPI int GetGestureDetected(void); // Get latest detected gesture
|
||||
RLAPI float GetGestureHoldDuration(void); // Get gesture hold time in seconds
|
||||
RLAPI Vector2 GetGestureDragVector(void); // Get gesture drag vector
|
||||
RLAPI float GetGestureDragAngle(void); // Get gesture drag angle
|
||||
RLAPI Vector2 GetGesturePinchVector(void); // Get gesture pinch delta
|
||||
RLAPI float GetGesturePinchAngle(void); // Get gesture pinch angle
|
||||
RLAPI void SetGesturesEnabled(unsigned int flags); // Enable a set of gestures using flags
|
||||
RLAPI bool IsGestureDetected(unsigned int gesture); // Check if a gesture have been detected
|
||||
RLAPI int GetGestureDetected(void); // Get latest detected gesture
|
||||
RLAPI float GetGestureHoldDuration(void); // Get gesture hold time in seconds
|
||||
RLAPI Vector2 GetGestureDragVector(void); // Get gesture drag vector
|
||||
RLAPI float GetGestureDragAngle(void); // Get gesture drag angle
|
||||
RLAPI Vector2 GetGesturePinchVector(void); // Get gesture pinch delta
|
||||
RLAPI float GetGesturePinchAngle(void); // Get gesture pinch angle
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
// Camera System Functions (Module: rcamera)
|
||||
//------------------------------------------------------------------------------------
|
||||
RLAPI void UpdateCamera(Camera *camera, int mode); // Update camera position for selected mode
|
||||
RLAPI void UpdateCamera(Camera *camera, int mode); // Update camera position for selected mode
|
||||
RLAPI void UpdateCameraPro(Camera *camera, Vector3 movement, Vector3 rotation, float zoom); // Update camera movement/rotation
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
@ -278,9 +285,9 @@ RLAPI void UpdateCameraPro(Camera *camera, Vector3 movement, Vector3 rotation, f
|
||||
// Set texture and rectangle to be used on shapes drawing
|
||||
// NOTE: It can be useful when using basic shapes and one single font,
|
||||
// defining a font char white rectangle would allow drawing everything in a single draw call
|
||||
RLAPI void SetShapesTexture(Texture2D texture, Rectangle source); // Set texture and rectangle to be used on shapes drawing
|
||||
RLAPI Texture2D GetShapesTexture(void); // Get texture that is used for shapes drawing
|
||||
RLAPI Rectangle GetShapesTextureRectangle(void); // Get texture source rectangle that is used for shapes drawing
|
||||
RLAPI void SetShapesTexture(Texture2D texture, Rectangle source); // Set texture and rectangle to be used on shapes drawing
|
||||
RLAPI Texture2D GetShapesTexture(void); // Get texture that is used for shapes drawing
|
||||
RLAPI Rectangle GetShapesTextureRectangle(void); // Get texture source rectangle that is used for shapes drawing
|
||||
|
||||
// Basic shapes drawing functions
|
||||
RLAPI void DrawPixel(int posX, int posY, Color color); // Draw a pixel using geometry [Can be slow, use with care]
|
||||
@ -290,24 +297,27 @@ RLAPI void DrawLineV(Vector2 startPos, Vector2 endPos, Color color);
|
||||
RLAPI void DrawLineEx(Vector2 startPos, Vector2 endPos, float thick, Color color); // Draw a line (using triangles/quads)
|
||||
RLAPI void DrawLineStrip(const Vector2 *points, int pointCount, Color color); // Draw lines sequence (using gl lines)
|
||||
RLAPI void DrawLineBezier(Vector2 startPos, Vector2 endPos, float thick, Color color); // Draw line segment cubic-bezier in-out interpolation
|
||||
RLAPI void DrawLineDashed(Vector2 startPos, Vector2 endPos, int dashSize, int spaceSize, Color color); // Draw a dashed line
|
||||
RLAPI void DrawCircle(int centerX, int centerY, float radius, Color color); // Draw a color-filled circle
|
||||
RLAPI void DrawCircleSector(Vector2 center, float radius, float startAngle, float endAngle, int segments, Color color); // Draw a piece of a circle
|
||||
RLAPI void DrawCircleSectorLines(Vector2 center, float radius, float startAngle, float endAngle, int segments, Color color); // Draw circle sector outline
|
||||
RLAPI void DrawCircleGradient(int centerX, int centerY, float radius, Color inner, Color outer); // Draw a gradient-filled circle
|
||||
RLAPI void DrawCircleV(Vector2 center, float radius, Color color); // Draw a color-filled circle (Vector version)
|
||||
RLAPI void DrawCircleGradient(Vector2 center, float radius, Color inner, Color outer); // Draw a gradient-filled circle
|
||||
RLAPI void DrawCircleSector(Vector2 center, float radius, float startAngle, float endAngle, int segments, Color color); // Draw a piece of a circle
|
||||
RLAPI void DrawCircleSectorLines(Vector2 center, float radius, float startAngle, float endAngle, int segments, Color color); // Draw circle sector outline
|
||||
RLAPI void DrawCircleLines(int centerX, int centerY, float radius, Color color); // Draw circle outline
|
||||
RLAPI void DrawCircleLinesV(Vector2 center, float radius, Color color); // Draw circle outline (Vector version)
|
||||
RLAPI void DrawEllipse(int centerX, int centerY, float radiusH, float radiusV, Color color); // Draw ellipse
|
||||
RLAPI void DrawEllipseV(Vector2 center, float radiusH, float radiusV, Color color); // Draw ellipse (Vector version)
|
||||
RLAPI void DrawEllipseLines(int centerX, int centerY, float radiusH, float radiusV, Color color); // Draw ellipse outline
|
||||
RLAPI void DrawEllipseLinesV(Vector2 center, float radiusH, float radiusV, Color color); // Draw ellipse outline (Vector version)
|
||||
RLAPI void DrawRing(Vector2 center, float innerRadius, float outerRadius, float startAngle, float endAngle, int segments, Color color); // Draw ring
|
||||
RLAPI void DrawRingLines(Vector2 center, float innerRadius, float outerRadius, float startAngle, float endAngle, int segments, Color color); // Draw ring outline
|
||||
RLAPI void DrawRingLines(Vector2 center, float innerRadius, float outerRadius, float startAngle, float endAngle, int segments, Color color); // Draw ring outline
|
||||
RLAPI void DrawRectangle(int posX, int posY, int width, int height, Color color); // Draw a color-filled rectangle
|
||||
RLAPI void DrawRectangleV(Vector2 position, Vector2 size, Color color); // Draw a color-filled rectangle (Vector version)
|
||||
RLAPI void DrawRectangleRec(Rectangle rec, Color color); // Draw a color-filled rectangle
|
||||
RLAPI void DrawRectanglePro(Rectangle rec, Vector2 origin, float rotation, Color color); // Draw a color-filled rectangle with pro parameters
|
||||
RLAPI void DrawRectangleGradientV(int posX, int posY, int width, int height, Color top, Color bottom); // Draw a vertical-gradient-filled rectangle
|
||||
RLAPI void DrawRectangleGradientH(int posX, int posY, int width, int height, Color left, Color right); // Draw a horizontal-gradient-filled rectangle
|
||||
RLAPI void DrawRectangleGradientEx(Rectangle rec, Color topLeft, Color bottomLeft, Color topRight, Color bottomRight); // Draw a gradient-filled rectangle with custom vertex colors
|
||||
RLAPI void DrawRectangleGradientEx(Rectangle rec, Color topLeft, Color bottomLeft, Color bottomRight, Color topRight); // Draw a gradient-filled rectangle with custom vertex colors
|
||||
RLAPI void DrawRectangleLines(int posX, int posY, int width, int height, Color color); // Draw rectangle outline
|
||||
RLAPI void DrawRectangleLinesEx(Rectangle rec, float lineThick, Color color); // Draw rectangle outline with extended parameters
|
||||
RLAPI void DrawRectangleRounded(Rectangle rec, float roundness, int segments, Color color); // Draw rectangle with rounded edges
|
||||
@ -322,11 +332,11 @@ RLAPI void DrawPolyLines(Vector2 center, int sides, float radius, float rotation
|
||||
RLAPI void DrawPolyLinesEx(Vector2 center, int sides, float radius, float rotation, float lineThick, Color color); // Draw a polygon outline of n sides with extended parameters
|
||||
|
||||
// Splines drawing functions
|
||||
RLAPI void DrawSplineLinear(const Vector2 *points, int pointCount, float thick, Color color); // Draw spline: Linear, minimum 2 points
|
||||
RLAPI void DrawSplineBasis(const Vector2 *points, int pointCount, float thick, Color color); // Draw spline: B-Spline, minimum 4 points
|
||||
RLAPI void DrawSplineCatmullRom(const Vector2 *points, int pointCount, float thick, Color color); // Draw spline: Catmull-Rom, minimum 4 points
|
||||
RLAPI void DrawSplineBezierQuadratic(const Vector2 *points, int pointCount, float thick, Color color); // Draw spline: Quadratic Bezier, minimum 3 points (1 control point): [p1, c2, p3, c4...]
|
||||
RLAPI void DrawSplineBezierCubic(const Vector2 *points, int pointCount, float thick, Color color); // Draw spline: Cubic Bezier, minimum 4 points (2 control points): [p1, c2, c3, p4, c5, c6...]
|
||||
RLAPI void DrawSplineLinear(const Vector2 *points, int pointCount, float thick, Color color); // Draw spline: Linear, minimum 2 points
|
||||
RLAPI void DrawSplineBasis(const Vector2 *points, int pointCount, float thick, Color color); // Draw spline: B-Spline, minimum 4 points
|
||||
RLAPI void DrawSplineCatmullRom(const Vector2 *points, int pointCount, float thick, Color color); // Draw spline: Catmull-Rom, minimum 4 points
|
||||
RLAPI void DrawSplineBezierQuadratic(const Vector2 *points, int pointCount, float thick, Color color); // Draw spline: Quadratic Bezier, minimum 3 points (1 control point): [p1, c2, p3, c4...]
|
||||
RLAPI void DrawSplineBezierCubic(const Vector2 *points, int pointCount, float thick, Color color); // Draw spline: Cubic Bezier, minimum 4 points (2 control points): [p1, c2, c3, p4, c5, c6...]
|
||||
RLAPI void DrawSplineSegmentLinear(Vector2 p1, Vector2 p2, float thick, Color color); // Draw spline segment: Linear, 2 points
|
||||
RLAPI void DrawSplineSegmentBasis(Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, float thick, Color color); // Draw spline segment: B-Spline, 4 points
|
||||
RLAPI void DrawSplineSegmentCatmullRom(Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, float thick, Color color); // Draw spline segment: Catmull-Rom, 4 points
|
||||
@ -369,7 +379,7 @@ RLAPI Image LoadImageFromScreen(void);
|
||||
RLAPI bool IsImageValid(Image image); // Check if an image is valid (data and parameters)
|
||||
RLAPI void UnloadImage(Image image); // Unload image from CPU memory (RAM)
|
||||
RLAPI bool ExportImage(Image image, const char *fileName); // Export image data to file, returns true on success
|
||||
RLAPI unsigned char *ExportImageToMemory(Image image, const char *fileType, int *fileSize); // Export image to memory buffer
|
||||
RLAPI unsigned char *ExportImageToMemory(Image image, const char *fileType, int *fileSize); // Export image to memory buffer, memory must be MemFree()
|
||||
RLAPI bool ExportImageAsCode(Image image, const char *fileName); // Export image as code file defining an array of bytes, returns true on success
|
||||
|
||||
// Image generation functions
|
||||
@ -399,7 +409,7 @@ RLAPI void ImageAlphaPremultiply(Image *image);
|
||||
RLAPI void ImageBlurGaussian(Image *image, int blurSize); // Apply Gaussian blur using a box blur approximation
|
||||
RLAPI void ImageKernelConvolution(Image *image, const float *kernel, int kernelSize); // Apply custom square convolution kernel to image
|
||||
RLAPI void ImageResize(Image *image, int newWidth, int newHeight); // Resize image (Bicubic scaling algorithm)
|
||||
RLAPI void ImageResizeNN(Image *image, int newWidth,int newHeight); // Resize image (Nearest-Neighbor scaling algorithm)
|
||||
RLAPI void ImageResizeNN(Image *image, int newWidth, int newHeight); // Resize image (Nearest-Neighbor scaling algorithm)
|
||||
RLAPI void ImageResizeCanvas(Image *image, int newWidth, int newHeight, int offsetX, int offsetY, Color fill); // Resize canvas and fill with color
|
||||
RLAPI void ImageMipmaps(Image *image); // Compute all mipmap levels for a provided image
|
||||
RLAPI void ImageDither(Image *image, int rBpp, int gBpp, int bBpp, int aBpp); // Dither image data to 16bpp or lower (Floyd-Steinberg dithering)
|
||||
@ -440,8 +450,8 @@ RLAPI void ImageDrawRectangleLines(Image *dst, Rectangle rec, int thick, Color c
|
||||
RLAPI void ImageDrawTriangle(Image *dst, Vector2 v1, Vector2 v2, Vector2 v3, Color color); // Draw triangle within an image
|
||||
RLAPI void ImageDrawTriangleEx(Image *dst, Vector2 v1, Vector2 v2, Vector2 v3, Color c1, Color c2, Color c3); // Draw triangle with interpolated colors within an image
|
||||
RLAPI void ImageDrawTriangleLines(Image *dst, Vector2 v1, Vector2 v2, Vector2 v3, Color color); // Draw triangle outline within an image
|
||||
RLAPI void ImageDrawTriangleFan(Image *dst, const Vector2 *points, int pointCount, Color color); // Draw a triangle fan defined by points within an image (first vertex is the center)
|
||||
RLAPI void ImageDrawTriangleStrip(Image *dst, const Vector2 *points, int pointCount, Color color); // Draw a triangle strip defined by points within an image
|
||||
RLAPI void ImageDrawTriangleFan(Image *dst, const Vector2 *points, int pointCount, Color color); // Draw a triangle fan defined by points within an image (first vertex is the center)
|
||||
RLAPI void ImageDrawTriangleStrip(Image *dst, const Vector2 *points, int pointCount, Color color); // Draw a triangle strip defined by points within an image
|
||||
RLAPI void ImageDraw(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec, Color tint); // Draw a source image within a destination image (tint applied to source)
|
||||
RLAPI void ImageDrawText(Image *dst, const char *text, int posX, int posY, int fontSize, Color color); // Draw text (using default font) within an image (destination)
|
||||
RLAPI void ImageDrawTextEx(Image *dst, Font font, const char *text, Vector2 position, float fontSize, float spacing, Color tint); // Draw text (custom sprite font) within an image (destination)
|
||||
@ -456,8 +466,8 @@ RLAPI bool IsTextureValid(Texture2D texture);
|
||||
RLAPI void UnloadTexture(Texture2D texture); // Unload texture from GPU memory (VRAM)
|
||||
RLAPI bool IsRenderTextureValid(RenderTexture2D target); // Check if a render texture is valid (loaded in GPU)
|
||||
RLAPI void UnloadRenderTexture(RenderTexture2D target); // Unload render texture from GPU memory (VRAM)
|
||||
RLAPI void UpdateTexture(Texture2D texture, const void *pixels); // Update GPU texture with new data
|
||||
RLAPI void UpdateTextureRec(Texture2D texture, Rectangle rec, const void *pixels); // Update GPU texture rectangle with new data
|
||||
RLAPI void UpdateTexture(Texture2D texture, const void *pixels); // Update GPU texture with new data (pixels should be able to fill texture)
|
||||
RLAPI void UpdateTextureRec(Texture2D texture, Rectangle rec, const void *pixels); // Update GPU texture rectangle with new data (pixels and rec should fit in texture)
|
||||
|
||||
// Texture configuration functions
|
||||
RLAPI void GenTextureMipmaps(Texture2D *texture); // Generate GPU mipmaps for a texture
|
||||
@ -498,11 +508,11 @@ RLAPI int GetPixelDataSize(int width, int height, int format); // G
|
||||
// Font loading/unloading functions
|
||||
RLAPI Font GetFontDefault(void); // Get the default Font
|
||||
RLAPI Font LoadFont(const char *fileName); // Load font from file into GPU memory (VRAM)
|
||||
RLAPI Font LoadFontEx(const char *fileName, int fontSize, int *codepoints, int codepointCount); // Load font from file with extended parameters, use NULL for codepoints and 0 for codepointCount to load the default character set, font size is provided in pixels height
|
||||
RLAPI Font LoadFontEx(const char *fileName, int fontSize, const int *codepoints, int codepointCount); // Load font from file with extended parameters, use NULL for codepoints and 0 for codepointCount to load the default character set, font size is provided in pixels height
|
||||
RLAPI Font LoadFontFromImage(Image image, Color key, int firstChar); // Load font from Image (XNA style)
|
||||
RLAPI Font LoadFontFromMemory(const char *fileType, const unsigned char *fileData, int dataSize, int fontSize, int *codepoints, int codepointCount); // Load font from memory buffer, fileType refers to extension: i.e. '.ttf'
|
||||
RLAPI Font LoadFontFromMemory(const char *fileType, const unsigned char *fileData, int dataSize, int fontSize, const int *codepoints, int codepointCount); // Load font from memory buffer, fileType refers to extension: i.e. '.ttf'
|
||||
RLAPI bool IsFontValid(Font font); // Check if a font is valid (font data loaded, WARNING: GPU texture not checked)
|
||||
RLAPI GlyphInfo *LoadFontData(const unsigned char *fileData, int dataSize, int fontSize, int *codepoints, int codepointCount, int type); // Load font data for further use
|
||||
RLAPI GlyphInfo *LoadFontData(const unsigned char *fileData, int dataSize, int fontSize, const int *codepoints, int codepointCount, int type, int *glyphCount); // Load font data for further use
|
||||
RLAPI Image GenImageFontAtlas(const GlyphInfo *glyphs, Rectangle **glyphRecs, int glyphCount, int fontSize, int padding, int packMethod); // Generate image font atlas using chars info
|
||||
RLAPI void UnloadFontData(GlyphInfo *glyphs, int glyphCount); // Unload font chars info data (RAM)
|
||||
RLAPI void UnloadFont(Font font); // Unload font from GPU memory (VRAM)
|
||||
@ -520,42 +530,51 @@ RLAPI void DrawTextCodepoints(Font font, const int *codepoints, int codepointCou
|
||||
RLAPI void SetTextLineSpacing(int spacing); // Set vertical line spacing when drawing with line-breaks
|
||||
RLAPI int MeasureText(const char *text, int fontSize); // Measure string width for default font
|
||||
RLAPI Vector2 MeasureTextEx(Font font, const char *text, float fontSize, float spacing); // Measure string size for Font
|
||||
RLAPI Vector2 MeasureTextCodepoints(Font font, const int *codepoints, int length, float fontSize, float spacing); // Measure string size for an existing array of codepoints for Font
|
||||
RLAPI int GetGlyphIndex(Font font, int codepoint); // Get glyph index position in font for a codepoint (unicode character), fallback to '?' if not found
|
||||
RLAPI GlyphInfo GetGlyphInfo(Font font, int codepoint); // Get glyph font info data for a codepoint (unicode character), fallback to '?' if not found
|
||||
RLAPI Rectangle GetGlyphAtlasRec(Font font, int codepoint); // Get glyph rectangle in font atlas for a codepoint (unicode character), fallback to '?' if not found
|
||||
|
||||
// Text codepoints management functions (unicode characters)
|
||||
RLAPI char *LoadUTF8(const int *codepoints, int length); // Load UTF-8 text encoded from codepoints array
|
||||
RLAPI void UnloadUTF8(char *text); // Unload UTF-8 text encoded from codepoints array
|
||||
RLAPI int *LoadCodepoints(const char *text, int *count); // Load all codepoints from a UTF-8 text string, codepoints count returned by parameter
|
||||
RLAPI void UnloadCodepoints(int *codepoints); // Unload codepoints data from memory
|
||||
RLAPI int GetCodepointCount(const char *text); // Get total number of codepoints in a UTF-8 encoded string
|
||||
RLAPI int GetCodepoint(const char *text, int *codepointSize); // Get next codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure
|
||||
RLAPI int GetCodepointNext(const char *text, int *codepointSize); // Get next codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure
|
||||
RLAPI int GetCodepointPrevious(const char *text, int *codepointSize); // Get previous codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure
|
||||
RLAPI const char *CodepointToUTF8(int codepoint, int *utf8Size); // Encode one codepoint into UTF-8 byte array (array length returned as parameter)
|
||||
RLAPI char *LoadUTF8(const int *codepoints, int length); // Load UTF-8 text encoded from codepoints array
|
||||
RLAPI void UnloadUTF8(char *text); // Unload UTF-8 text encoded from codepoints array
|
||||
RLAPI int *LoadCodepoints(const char *text, int *count); // Load all codepoints from a UTF-8 text string, codepoints count returned by parameter
|
||||
RLAPI void UnloadCodepoints(int *codepoints); // Unload codepoints data from memory
|
||||
RLAPI int GetCodepointCount(const char *text); // Get total number of codepoints in a UTF-8 encoded string
|
||||
RLAPI int GetCodepoint(const char *text, int *codepointSize); // Get next codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure
|
||||
RLAPI int GetCodepointNext(const char *text, int *codepointSize); // Get next codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure
|
||||
RLAPI int GetCodepointPrevious(const char *text, int *codepointSize); // Get previous codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure
|
||||
RLAPI const char *CodepointToUTF8(int codepoint, int *utf8Size); // Encode one codepoint into UTF-8 byte array (array length returned as parameter)
|
||||
|
||||
// Text strings management functions (no UTF-8 strings, only byte chars)
|
||||
// NOTE: Some strings allocate memory internally for returned strings, just be careful!
|
||||
// WARNING 1: Most of these functions use internal static buffers[], it's recommended to store returned data on user-side for re-use
|
||||
// WARNING 2: Some functions allocate memory internally for the returned strings, those strings must be freed by user using MemFree()
|
||||
RLAPI char **LoadTextLines(const char *text, int *count); // Load text as separate lines ('\n')
|
||||
RLAPI void UnloadTextLines(char **text, int lineCount); // Unload text lines
|
||||
RLAPI int TextCopy(char *dst, const char *src); // Copy one string to another, returns bytes copied
|
||||
RLAPI bool TextIsEqual(const char *text1, const char *text2); // Check if two text string are equal
|
||||
RLAPI unsigned int TextLength(const char *text); // Get text length, checks for '\0' ending
|
||||
RLAPI const char *TextFormat(const char *text, ...); // Text formatting with variables (sprintf() style)
|
||||
RLAPI const char *TextSubtext(const char *text, int position, int length); // Get a piece of a text string
|
||||
RLAPI char *TextReplace(const char *text, const char *replace, const char *by); // Replace text string (WARNING: memory must be freed!)
|
||||
RLAPI char *TextInsert(const char *text, const char *insert, int position); // Insert text in a position (WARNING: memory must be freed!)
|
||||
RLAPI const char *TextJoin(const char **textList, int count, const char *delimiter); // Join text strings with delimiter
|
||||
RLAPI const char **TextSplit(const char *text, char delimiter, int *count); // Split text into multiple strings
|
||||
RLAPI void TextAppend(char *text, const char *append, int *position); // Append text at specific position and move cursor!
|
||||
RLAPI int TextFindIndex(const char *text, const char *find); // Find first text occurrence within a string
|
||||
RLAPI const char *TextToUpper(const char *text); // Get upper case version of provided string
|
||||
RLAPI const char *TextToLower(const char *text); // Get lower case version of provided string
|
||||
RLAPI const char *TextToPascal(const char *text); // Get Pascal case notation version of provided string
|
||||
RLAPI const char *TextToSnake(const char *text); // Get Snake case notation version of provided string
|
||||
RLAPI const char *TextToCamel(const char *text); // Get Camel case notation version of provided string
|
||||
|
||||
RLAPI int TextToInteger(const char *text); // Get integer value from text (negative values not supported)
|
||||
RLAPI float TextToFloat(const char *text); // Get float value from text (negative values not supported)
|
||||
RLAPI const char *TextRemoveSpaces(const char *text); // Remove text spaces, concat words
|
||||
RLAPI char *GetTextBetween(const char *text, const char *begin, const char *end); // Get text between two strings
|
||||
RLAPI char *TextReplace(const char *text, const char *search, const char *replacement); // Replace text string with new string
|
||||
RLAPI char *TextReplaceAlloc(const char *text, const char *search, const char *replacement); // Replace text string with new string, memory must be MemFree()
|
||||
RLAPI char *TextReplaceBetween(const char *text, const char *begin, const char *end, const char *replacement); // Replace text between two specific strings
|
||||
RLAPI char *TextReplaceBetweenAlloc(const char *text, const char *begin, const char *end, const char *replacement); // Replace text between two specific strings, memory must be MemFree()
|
||||
RLAPI char *TextInsert(const char *text, const char *insert, int position); // Insert text in a defined byte position
|
||||
RLAPI char *TextInsertAlloc(const char *text, const char *insert, int position); // Insert text in a defined byte position, memory must be MemFree()
|
||||
RLAPI char *TextJoin(char **textList, int count, const char *delimiter); // Join text strings with delimiter
|
||||
RLAPI char **TextSplit(const char *text, char delimiter, int *count); // Split text into multiple strings, using MAX_TEXTSPLIT_COUNT static strings
|
||||
RLAPI void TextAppend(char *text, const char *append, int *position); // Append text at specific position and move cursor
|
||||
RLAPI int TextFindIndex(const char *text, const char *search); // Find first text occurrence within a string, -1 if not found
|
||||
RLAPI char *TextToUpper(const char *text); // Get upper case version of provided string
|
||||
RLAPI char *TextToLower(const char *text); // Get lower case version of provided string
|
||||
RLAPI char *TextToPascal(const char *text); // Get Pascal case notation version of provided string
|
||||
RLAPI char *TextToSnake(const char *text); // Get Snake case notation version of provided string
|
||||
RLAPI char *TextToCamel(const char *text); // Get Camel case notation version of provided string
|
||||
RLAPI int TextToInteger(const char *text); // Get integer value from text
|
||||
RLAPI float TextToFloat(const char *text); // Get float value from text
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
// Basic 3d Shapes Drawing Functions (Module: models)
|
||||
@ -601,7 +620,7 @@ RLAPI void DrawModelEx(Model model, Vector3 position, Vector3 rotationAxis, floa
|
||||
RLAPI void DrawModelWires(Model model, Vector3 position, float scale, Color tint); // Draw a model wires (with texture if set)
|
||||
RLAPI void DrawModelWiresEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); // Draw a model wires (with texture if set) with extended parameters
|
||||
RLAPI void DrawBoundingBox(BoundingBox box, Color color); // Draw bounding box (wires)
|
||||
RLAPI void DrawBillboard(Camera camera, Texture2D texture, Vector3 position, float scale, Color tint); // Draw a billboard texture
|
||||
RLAPI void DrawBillboard(Camera camera, Texture2D texture, Vector3 position, float scale, Color tint); // Draw a billboard texture
|
||||
RLAPI void DrawBillboardRec(Camera camera, Texture2D texture, Rectangle source, Vector3 position, Vector2 size, Color tint); // Draw a billboard texture defined by source
|
||||
RLAPI void DrawBillboardPro(Camera camera, Texture2D texture, Rectangle source, Vector3 position, Vector3 up, Vector2 size, Vector2 origin, float rotation, Color tint); // Draw a billboard texture defined by source and rotation
|
||||
|
||||
@ -639,21 +658,20 @@ RLAPI void SetModelMeshMaterial(Model *model, int meshId, int materialId);
|
||||
|
||||
// Model animations loading/unloading functions
|
||||
RLAPI ModelAnimation *LoadModelAnimations(const char *fileName, int *animCount); // Load model animations from file
|
||||
RLAPI void UpdateModelAnimation(Model model, ModelAnimation anim, int frame); // Update model animation pose (CPU)
|
||||
RLAPI void UpdateModelAnimationBones(Model model, ModelAnimation anim, int frame); // Update model animation mesh bone matrices (GPU skinning)
|
||||
RLAPI void UnloadModelAnimation(ModelAnimation anim); // Unload animation data
|
||||
RLAPI void UpdateModelAnimation(Model model, ModelAnimation anim, float frame); // Update model animation pose (vertex buffers and bone matrices)
|
||||
RLAPI void UpdateModelAnimationEx(Model model, ModelAnimation animA, float frameA, ModelAnimation animB, float frameB, float blend); // Update model animation pose, blending two animations
|
||||
RLAPI void UnloadModelAnimations(ModelAnimation *animations, int animCount); // Unload animation array data
|
||||
RLAPI bool IsModelAnimationValid(Model model, ModelAnimation anim); // Check model animation skeleton match
|
||||
|
||||
// Collision detection functions
|
||||
RLAPI bool CheckCollisionSpheres(Vector3 center1, float radius1, Vector3 center2, float radius2); // Check collision between two spheres
|
||||
RLAPI bool CheckCollisionBoxes(BoundingBox box1, BoundingBox box2); // Check collision between two bounding boxes
|
||||
RLAPI bool CheckCollisionBoxSphere(BoundingBox box, Vector3 center, float radius); // Check collision between box and sphere
|
||||
RLAPI RayCollision GetRayCollisionSphere(Ray ray, Vector3 center, float radius); // Get collision info between ray and sphere
|
||||
RLAPI RayCollision GetRayCollisionBox(Ray ray, BoundingBox box); // Get collision info between ray and box
|
||||
RLAPI RayCollision GetRayCollisionMesh(Ray ray, Mesh mesh, Matrix transform); // Get collision info between ray and mesh
|
||||
RLAPI RayCollision GetRayCollisionTriangle(Ray ray, Vector3 p1, Vector3 p2, Vector3 p3); // Get collision info between ray and triangle
|
||||
RLAPI RayCollision GetRayCollisionQuad(Ray ray, Vector3 p1, Vector3 p2, Vector3 p3, Vector3 p4); // Get collision info between ray and quad
|
||||
RLAPI bool CheckCollisionSpheres(Vector3 center1, float radius1, Vector3 center2, float radius2); // Check collision between two spheres
|
||||
RLAPI bool CheckCollisionBoxes(BoundingBox box1, BoundingBox box2); // Check collision between two bounding boxes
|
||||
RLAPI bool CheckCollisionBoxSphere(BoundingBox box, Vector3 center, float radius); // Check collision between box and sphere
|
||||
RLAPI RayCollision GetRayCollisionSphere(Ray ray, Vector3 center, float radius); // Get collision info between ray and sphere
|
||||
RLAPI RayCollision GetRayCollisionBox(Ray ray, BoundingBox box); // Get collision info between ray and box
|
||||
RLAPI RayCollision GetRayCollisionMesh(Ray ray, Mesh mesh, Matrix transform); // Get collision info between ray and mesh
|
||||
RLAPI RayCollision GetRayCollisionTriangle(Ray ray, Vector3 p1, Vector3 p2, Vector3 p3); // Get collision info between ray and triangle
|
||||
RLAPI RayCollision GetRayCollisionQuad(Ray ray, Vector3 p1, Vector3 p2, Vector3 p3, Vector3 p4); // Get collision info between ray and quad
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
// Audio Loading and Playing Functions (Module: audio)
|
||||
@ -675,7 +693,7 @@ RLAPI Sound LoadSound(const char *fileName); // Load so
|
||||
RLAPI Sound LoadSoundFromWave(Wave wave); // Load sound from wave data
|
||||
RLAPI Sound LoadSoundAlias(Sound source); // Create a new sound that shares the same sample data as the source sound, does not own the sound data
|
||||
RLAPI bool IsSoundValid(Sound sound); // Checks if a sound is valid (data loaded and buffers initialized)
|
||||
RLAPI void UpdateSound(Sound sound, const void *data, int sampleCount); // Update sound buffer with new data
|
||||
RLAPI void UpdateSound(Sound sound, const void *data, int sampleCount); // Update sound buffer with new data (default data format: 32 bit float, stereo)
|
||||
RLAPI void UnloadWave(Wave wave); // Unload wave data
|
||||
RLAPI void UnloadSound(Sound sound); // Unload sound
|
||||
RLAPI void UnloadSoundAlias(Sound alias); // Unload a sound alias (does not deallocate sample data)
|
||||
@ -690,7 +708,7 @@ RLAPI void ResumeSound(Sound sound); // Resume
|
||||
RLAPI bool IsSoundPlaying(Sound sound); // Check if a sound is currently playing
|
||||
RLAPI void SetSoundVolume(Sound sound, float volume); // Set volume for a sound (1.0 is max level)
|
||||
RLAPI void SetSoundPitch(Sound sound, float pitch); // Set pitch for a sound (1.0 is base level)
|
||||
RLAPI void SetSoundPan(Sound sound, float pan); // Set pan for a sound (0.5 is center)
|
||||
RLAPI void SetSoundPan(Sound sound, float pan); // Set pan for a sound (-1.0 left, 0.0 center, 1.0 right)
|
||||
RLAPI Wave WaveCopy(Wave wave); // Copy a wave to a new wave
|
||||
RLAPI void WaveCrop(Wave *wave, int initFrame, int finalFrame); // Crop a wave to defined frames range
|
||||
RLAPI void WaveFormat(Wave *wave, int sampleRate, int sampleSize, int channels); // Convert wave data to desired format
|
||||
@ -711,7 +729,7 @@ RLAPI void ResumeMusicStream(Music music); // Resume
|
||||
RLAPI void SeekMusicStream(Music music, float position); // Seek music to a position (in seconds)
|
||||
RLAPI void SetMusicVolume(Music music, float volume); // Set volume for music (1.0 is max level)
|
||||
RLAPI void SetMusicPitch(Music music, float pitch); // Set pitch for a music (1.0 is base level)
|
||||
RLAPI void SetMusicPan(Music music, float pan); // Set pan for a music (0.5 is center)
|
||||
RLAPI void SetMusicPan(Music music, float pan); // Set pan for a music (-1.0 left, 0.0 center, 1.0 right)
|
||||
RLAPI float GetMusicTimeLength(Music music); // Get music time length (in seconds)
|
||||
RLAPI float GetMusicTimePlayed(Music music); // Get current music time played (in seconds)
|
||||
|
||||
@ -728,7 +746,7 @@ RLAPI bool IsAudioStreamPlaying(AudioStream stream); // Check i
|
||||
RLAPI void StopAudioStream(AudioStream stream); // Stop audio stream
|
||||
RLAPI void SetAudioStreamVolume(AudioStream stream, float volume); // Set volume for audio stream (1.0 is max level)
|
||||
RLAPI void SetAudioStreamPitch(AudioStream stream, float pitch); // Set pitch for audio stream (1.0 is base level)
|
||||
RLAPI void SetAudioStreamPan(AudioStream stream, float pan); // Set pan for audio stream (0.5 is centered)
|
||||
RLAPI void SetAudioStreamPan(AudioStream stream, float pan); // Set pan for audio stream (-1.0 to 1.0 range, 0.0 is centered)
|
||||
RLAPI void SetAudioStreamBufferSizeDefault(int size); // Default size for new audio streams
|
||||
RLAPI void SetAudioStreamCallback(AudioStream stream, AudioCallback callback); // Audio thread callback to request new data
|
||||
|
||||
@ -737,4 +755,3 @@ RLAPI void DetachAudioStreamProcessor(AudioStream stream, AudioCallback processo
|
||||
|
||||
RLAPI void AttachAudioMixedProcessor(AudioCallback processor); // Attach audio stream processor to the entire audio pipeline, receives frames x 2 samples as 'float' (stereo)
|
||||
RLAPI void DetachAudioMixedProcessor(AudioCallback processor); // Detach audio stream processor from the entire audio pipeline
|
||||
|
||||
|
||||
@ -9,10 +9,11 @@ IDE | Platform(s) | Source | Example(s)
|
||||
[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 | ✔️ | ✔️
|
||||
|
||||
*New IDEs config files are welcome!*
|
||||
|
||||
@ -1,569 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug.DLL|ARM64">
|
||||
<Configuration>Debug.DLL</Configuration>
|
||||
<Platform>ARM64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug.DLL|Win32">
|
||||
<Configuration>Debug.DLL</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug.DLL|x64">
|
||||
<Configuration>Debug.DLL</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|ARM64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>ARM64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release.DLL|ARM64">
|
||||
<Configuration>Release.DLL</Configuration>
|
||||
<Platform>ARM64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release.DLL|Win32">
|
||||
<Configuration>Release.DLL</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release.DLL|x64">
|
||||
<Configuration>Release.DLL</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|ARM64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>ARM64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{A9C422E7-0F03-4DBC-AC93-5C3EF4942DEC}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>web_basic_window</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
<ProjectName>web_basic_window</ProjectName>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug.DLL|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug.DLL|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug.DLL|ARM64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release.DLL|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release.DLL|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release.DLL|ARM64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug.DLL|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug.DLL|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug.DLL|ARM64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release.DLL|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release.DLL|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release.DLL|ARM64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<OutDir>$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir>$(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<OutDir>$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir>$(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<OutDir>$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir>$(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug.DLL|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<OutDir>$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir>$(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug.DLL|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<OutDir>$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir>$(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug.DLL|ARM64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<OutDir>$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir>$(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<OutDir>$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir>$(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<OutDir>$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir>$(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<OutDir>$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir>$(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release.DLL|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<OutDir>$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir>$(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release.DLL|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<OutDir>$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir>$(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release.DLL|ARM64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<OutDir>$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir>$(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug.DLL|Win32'">
|
||||
<LocalDebuggerWorkingDirectory>$(SolutionDir)..\..\examples\others</LocalDebuggerWorkingDirectory>
|
||||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug.DLL|x64'">
|
||||
<LocalDebuggerWorkingDirectory>$(SolutionDir)..\..\examples\others</LocalDebuggerWorkingDirectory>
|
||||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug.DLL|ARM64'">
|
||||
<LocalDebuggerWorkingDirectory>$(SolutionDir)..\..\examples\others</LocalDebuggerWorkingDirectory>
|
||||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LocalDebuggerWorkingDirectory>$(SolutionDir)..\..\examples\others</LocalDebuggerWorkingDirectory>
|
||||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LocalDebuggerWorkingDirectory>$(SolutionDir)..\..\examples\others</LocalDebuggerWorkingDirectory>
|
||||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release.DLL|Win32'">
|
||||
<LocalDebuggerWorkingDirectory>$(SolutionDir)..\..\examples\others</LocalDebuggerWorkingDirectory>
|
||||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LocalDebuggerWorkingDirectory>$(SolutionDir)..\..\examples\others</LocalDebuggerWorkingDirectory>
|
||||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
|
||||
<LocalDebuggerWorkingDirectory>$(SolutionDir)..\..\examples\others</LocalDebuggerWorkingDirectory>
|
||||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LocalDebuggerWorkingDirectory>$(SolutionDir)..\..\examples\others</LocalDebuggerWorkingDirectory>
|
||||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
|
||||
<LocalDebuggerWorkingDirectory>$(SolutionDir)..\..\examples\others</LocalDebuggerWorkingDirectory>
|
||||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release.DLL|x64'">
|
||||
<LocalDebuggerWorkingDirectory>$(SolutionDir)..\..\examples\others</LocalDebuggerWorkingDirectory>
|
||||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release.DLL|ARM64'">
|
||||
<LocalDebuggerWorkingDirectory>$(SolutionDir)..\..\examples\others</LocalDebuggerWorkingDirectory>
|
||||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<CompileAs>CompileAsC</CompileAs>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalLibraryDirectories>$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<CompileAs>CompileAsC</CompileAs>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalOptions>/FS %(AdditionalOptions)</AdditionalOptions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalLibraryDirectories>$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>raylib.lib;opengl32.lib;kernel32.lib;user32.lib;shcore.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<CompileAs>CompileAsC</CompileAs>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalOptions>/FS %(AdditionalOptions)</AdditionalOptions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalLibraryDirectories>$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug.DLL|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<CompileAs>CompileAsC</CompileAs>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalLibraryDirectories>$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)"</Command>
|
||||
<Message>Copy Debug DLL to output directory</Message>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug.DLL|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<CompileAs>CompileAsC</CompileAs>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalLibraryDirectories>$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)"</Command>
|
||||
<Message>Copy Debug DLL to output directory</Message>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug.DLL|ARM64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<CompileAs>CompileAsC</CompileAs>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalLibraryDirectories>$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)"</Command>
|
||||
<Message>Copy Debug DLL to output directory</Message>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<CompileAs>CompileAsC</CompileAs>
|
||||
<RemoveUnreferencedCodeData>true</RemoveUnreferencedCodeData>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalDependencies>raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<CompileAs>CompileAsC</CompileAs>
|
||||
<RemoveUnreferencedCodeData>true</RemoveUnreferencedCodeData>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalDependencies>raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<CompileAs>CompileAsC</CompileAs>
|
||||
<RemoveUnreferencedCodeData>true</RemoveUnreferencedCodeData>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalDependencies>raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release.DLL|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<CompileAs>CompileAsC</CompileAs>
|
||||
<RemoveUnreferencedCodeData>true</RemoveUnreferencedCodeData>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalDependencies>raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)"</Command>
|
||||
</PostBuildEvent>
|
||||
<PostBuildEvent>
|
||||
<Message>Copy Release DLL to output directory</Message>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release.DLL|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<CompileAs>CompileAsC</CompileAs>
|
||||
<RemoveUnreferencedCodeData>true</RemoveUnreferencedCodeData>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalDependencies>raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)"</Command>
|
||||
</PostBuildEvent>
|
||||
<PostBuildEvent>
|
||||
<Message>Copy Release DLL to output directory</Message>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release.DLL|ARM64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<CompileAs>CompileAsC</CompileAs>
|
||||
<RemoveUnreferencedCodeData>true</RemoveUnreferencedCodeData>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalDependencies>raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)"</Command>
|
||||
</PostBuildEvent>
|
||||
<PostBuildEvent>
|
||||
<Message>Copy Release DLL to output directory</Message>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\..\examples\others\web_basic_window.c" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="..\..\..\examples\examples.rc" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\raylib\raylib.vcxproj">
|
||||
<Project>{e89d61ac-55de-4482-afd4-df7242ebc859}</Project>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
84
projects/Zig/README.md
Normal file
84
projects/Zig/README.md
Normal file
@ -0,0 +1,84 @@
|
||||
# Starting your raylib project with Zig (0.16.0)
|
||||
|
||||
## How to compile and run it
|
||||
|
||||
To compile the project:
|
||||
|
||||
```sh
|
||||
zig build
|
||||
```
|
||||
|
||||
To run the project:
|
||||
|
||||
```sh
|
||||
zig build run
|
||||
```
|
||||
|
||||
## Compile with different optimization
|
||||
|
||||
To change from debug to release build you can do it with the `-Doptimze=` flag.
|
||||
|
||||
```
|
||||
Debug
|
||||
ReleaseSafe
|
||||
ReleaseFast
|
||||
ReleaseSmall
|
||||
```
|
||||
|
||||
## Choose a different platform
|
||||
|
||||
To compile with a different platform you can use the `-Dplatform=` flag.
|
||||
Here all the options:
|
||||
|
||||
```
|
||||
glfw
|
||||
rgfw
|
||||
sdl
|
||||
sdl2
|
||||
sdl3
|
||||
memory
|
||||
win32
|
||||
drm
|
||||
android
|
||||
```
|
||||
|
||||
In this example the platform `sdl` and `sdl2` are not supported
|
||||
|
||||
Important for the android platform you also have to compile for the right target
|
||||
|
||||
## Compile for a different target
|
||||
|
||||
To compile for a different [target](https://ziglang.org/download/0.16.0/release-notes.html#Support-Table) you can use the `-Dtarget=` flag.
|
||||
Not all targets are supported
|
||||
|
||||
## Example: Compile for web and run it
|
||||
|
||||
To compile for the web we use emscripten and you run it like that:
|
||||
|
||||
```sh
|
||||
zig build -Dtarget=wasm32-emscripten
|
||||
```
|
||||
|
||||
To run it we do:
|
||||
|
||||
```sh
|
||||
zig build run -Dtarget=wasm32-emscripten
|
||||
```
|
||||
|
||||
And to make a relase build we do:
|
||||
|
||||
```sh
|
||||
zig build -Dtarget=wasm32-emscripten -Doptimize=ReleaseFast
|
||||
```
|
||||
|
||||
If we want to use rgfw for the web build we could do:
|
||||
|
||||
```sh
|
||||
zig build -Dplatform=rgfw -Dtarget=wasm32-emscripten -Doptimize=ReleaseFast
|
||||
```
|
||||
|
||||
## Compiling the Zig code? Just add `-Dzig` and try out zig ;)
|
||||
|
||||
## More Resources
|
||||
|
||||
See [Zig Build System](https://ziglang.org/learn/build-system/)
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user